Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/matcha_ml/config/matcha_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ def read_matcha_config() -> MatchaConfig:

@staticmethod
def config_file_exists() -> bool:
"""A convencience function which checks for the existence of the matcha.config.json file.
"""A convenience function which checks for the existence of the matcha.config.json file.

Returns:
True if the matcha.config.json file exists, False otherwise.
Expand Down
92 changes: 48 additions & 44 deletions src/matcha_ml/infrastructure/default/.terraform.lock.hcl

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions src/matcha_ml/infrastructure/default/aks/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ resource "azurerm_kubernetes_cluster" "main" {
name = "default"
vm_size = "Standard_DS3_v2"

enable_auto_scaling = true
max_count = 3
min_count = 1
max_count = 3
min_count = 1
auto_scaling_enabled = true
}

identity {
Expand Down
22 changes: 11 additions & 11 deletions src/matcha_ml/infrastructure/default/aks/output.tf
Original file line number Diff line number Diff line change
@@ -1,46 +1,46 @@
output "kube_config" {
description = "Raw Kubernetes configuration for the created cluster"
value = azurerm_kubernetes_cluster.main.kube_config_raw
sensitive = true
value = azurerm_kubernetes_cluster.main.kube_config_raw
sensitive = true
}

output "client_key" {
description = "Client key for accessing the Kubernetes cluster"
value = azurerm_kubernetes_cluster.main.kube_config.0.client_key
value = azurerm_kubernetes_cluster.main.kube_config.0.client_key
}

output "client_certificate" {
description = "Client certificate for accessing the Kubernetes cluster"
value = azurerm_kubernetes_cluster.main.kube_config.0.client_certificate
sensitive = true
value = azurerm_kubernetes_cluster.main.kube_config.0.client_certificate
sensitive = true
}

output "cluster_ca_certificate" {
description = "Cluster CA certificate for the Kubernetes cluster"
value = azurerm_kubernetes_cluster.main.kube_config.0.cluster_ca_certificate
value = azurerm_kubernetes_cluster.main.kube_config.0.cluster_ca_certificate
}

output "host" {
description = "Host address for the Kubernetes cluster"
value = azurerm_kubernetes_cluster.main.kube_config.0.host
value = azurerm_kubernetes_cluster.main.kube_config.0.host
}

output "aks_cluster_id" {
description = "ID of the created Kubernetes cluster"
value = azurerm_kubernetes_cluster.main.id
value = azurerm_kubernetes_cluster.main.id
}

output "aks_cluster_name" {
description = "Name of the created Kubernetes cluster"
value = azurerm_kubernetes_cluster.main.name
value = azurerm_kubernetes_cluster.main.name
}

output "aks_principal_id" {
description = "Principal ID for the Kubernetes cluster"
value = azurerm_kubernetes_cluster.main.identity[0].principal_id
value = azurerm_kubernetes_cluster.main.identity[0].principal_id
}

output "aks_object_id" {
description = "Object ID for the Kubernetes cluster"
value = azurerm_kubernetes_cluster.main.kubelet_identity[0].object_id
value = azurerm_kubernetes_cluster.main.kubelet_identity[0].object_id
}
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# output for container registry
output "container_registry_url" {
description = "The URL used to log into the container registry"
value = azurerm_container_registry.main.login_server
value = azurerm_container_registry.main.login_server
}

output "container_registry_name" {
description = "The name of the container registry"
value = azurerm_container_registry.main.name
value = azurerm_container_registry.main.name
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,13 @@ resource "azurerm_storage_account" "storageaccount" {
account_tier = "Standard"
account_kind = "StorageV2"
account_replication_type = "LRS"
enable_https_traffic_only = true
access_tier = "Hot"
allow_nested_items_to_be_public = true
}

# create a storage container inside created storage account
resource "azurerm_storage_container" "storagecontainer" {
name = "${var.prefix}dvcstore"
storage_account_name = azurerm_storage_account.storageaccount.name
storage_account_id = azurerm_storage_account.storageaccount.id
container_access_type = "container"
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
output "storage_container_name" {
description = "The name of the Azure Storage Container."
value = azurerm_storage_container.storagecontainer.name
value = azurerm_storage_container.storagecontainer.name
}

output "storage_account_name" {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ terraform {
required_providers {
azurerm = {
source = "hashicorp/azurerm"
version = "3.48.0"
version = "4.38.0"
}
}
}
2 changes: 1 addition & 1 deletion src/matcha_ml/infrastructure/default/helm.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
provider "helm" {
kubernetes {
kubernetes = {
host = module.aks.host

client_certificate = base64decode(module.aks.client_certificate)
Expand Down
2 changes: 1 addition & 1 deletion src/matcha_ml/infrastructure/default/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ provider "azurerm" {
module "resource_group" {
source = "./resource_group"

prefix = var.prefix
prefix = var.prefix
}

module "storage" {
Expand Down
68 changes: 35 additions & 33 deletions src/matcha_ml/infrastructure/default/mlflow_module/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -5,40 +5,42 @@ resource "helm_release" "mlflow_tracking" {
name = "mlflow-tracking"
repository = "https://community-charts.github.io/helm-charts"
chart = "mlflow"
version = "1.3.2"

# Change type from "ClusterIP" to "LoadBalancer"
set {
name = "service.type"
value = "LoadBalancer"
}
# set proxied access to artifact storage
set {
name = "artifactRoot.proxiedArtifactStorage"
value = var.artifact_proxied_access
type = "auto"
}

# Derived from ZenML's stack recipes; source: https://github.com/zenml-io/mlops-stacks/blob/8eb06596bf836d3a3dd2634fbc7f2b5687421811/aws-minimal/mlflow-module/mlflow.tf#L39
# set values for Azure Blob Storage
set {
name = "artifactRoot.azureBlob.enabled"
value = var.artifact_azure
type = "auto"
}
set {
name = "artifactRoot.azureBlob.storageAccount"
value = var.storage_account_name
type = "string"
}
set {
name = "artifactRoot.azureBlob.container"
value = var.storage_container_name
type = "string"
}
set_sensitive {
name = "artifactRoot.azureBlob.accessKey"
value = var.artifact_azure_access_key
type = "string"
}
set = [
{
name = "service.type"
value = "LoadBalancer"
},
# set proxied access to artifact storage
{
name = "artifactRoot.proxiedArtifactStorage"
value = var.artifact_proxied_access
type = "auto"
},

# Derived from ZenML's stack recipes; source: https://github.com/zenml-io/mlops-stacks/blob/8eb06596bf836d3a3dd2634fbc7f2b5687421811/aws-minimal/mlflow-module/mlflow.tf#L39
# set values for Azure Blob Storage
{
name = "artifactRoot.azureBlob.enabled"
value = var.artifact_azure
type = "auto"
},
{
name = "artifactRoot.azureBlob.storageAccount"
value = var.storage_account_name
type = "string"
},
{
name = "artifactRoot.azureBlob.container"
value = var.storage_container_name
type = "string"
},
{
name = "artifactRoot.azureBlob.accessKey"
value = var.artifact_azure_access_key
type = "string"
},
]
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
output "mlflow_tracking_url" {
description = "The tracking URL for MLFlow dashboard"
value = "http://${data.kubernetes_service.mlflow_tracking.status.0.load_balancer.0.ingress.0.ip}:${data.kubernetes_service.mlflow_tracking.spec.0.port.0.port}"
value = "http://${data.kubernetes_service.mlflow_tracking.status.0.load_balancer.0.ingress.0.ip}:${data.kubernetes_service.mlflow_tracking.spec.0.port.0.port}"
}
Loading
Loading