This commit is contained in:
Dennis Eikelenboom 2021-09-21 17:11:52 -07:00
commit a2957c998d
5 changed files with 93 additions and 5 deletions

View File

@ -1,9 +1,17 @@
# Compute Instance
# Generate random string for unique compute instance name
resource "random_string" "ci_prefix" {
length = 8
upper = false
special = false
number = false
}
# Compute instance
resource "azurerm_machine_learning_compute_instance" "compute_instance" {
name = "default-instance"
name = "${random_string.ci_prefix.result}instance"
location = azurerm_resource_group.default.location
machine_learning_workspace_id = azurerm_machine_learning_workspace.default.id
virtual_machine_size = "STANDARD_DS2_V2"
virtual_machine_size = "STANDARD_DS2_V2"
}
# Compute Cluster

View File

@ -0,0 +1,41 @@
# Generate random string for unique compute instance name
resource "random_string" "ci_prefix" {
length = 8
upper = false
special = false
number = false
}
# Compute instance
resource "azurerm_machine_learning_compute_instance" "compute_instance" {
name = "${random_string.ci_prefix.result}instance"
location = azurerm_resource_group.default.location
machine_learning_workspace_id = azurerm_machine_learning_workspace.default.id
virtual_machine_size = "STANDARD_DS2_V2"
subnet_resource_id = azurerm_subnet.snet-training.id
depends_on = [
azurerm_private_endpoint.mlw_ple
]
}
# Compute cluster
resource "azurerm_machine_learning_compute_cluster" "compute" {
name = "cpu-cluster"
location = azurerm_resource_group.default.location
machine_learning_workspace_id = azurerm_machine_learning_workspace.default.id
vm_priority = "Dedicated"
vm_size = "STANDARD_DS2_V2"
subnet_resource_id = azurerm_subnet.snet-training.id
identity {
type = "SystemAssigned"
}
scale_settings {
min_node_count = 0
max_node_count = 3
scale_down_nodes_after_idle_duration = "PT15M" # 15 minutes
}
}

View File

@ -43,6 +43,8 @@ This configuration describes the minimal set of resources you require to get sta
## Usage
```bash
terraform init
terraform plan -var name=azureml567 -out demo.tfplan
terraform apply "demo.tfplan"

View File

@ -0,0 +1,37 @@
# Generate random string for unique compute instance name
resource "random_string" "ci_prefix" {
length = 8
upper = false
special = false
number = false
}
# Compute instance
resource "azurerm_machine_learning_compute_instance" "compute_instance" {
name = "${random_string.ci_prefix.result}instance"
location = azurerm_resource_group.default.location
machine_learning_workspace_id = azurerm_machine_learning_workspace.default.id
virtual_machine_size = "STANDARD_DS2_V2"
subnet_resource_id = var.training_subnet_resource_id
}
# Compute cluster
resource "azurerm_machine_learning_compute_cluster" "compute" {
name = "cpu-cluster"
location = azurerm_resource_group.default.location
machine_learning_workspace_id = azurerm_machine_learning_workspace.default.id
vm_priority = "Dedicated"
vm_size = "STANDARD_DS2_V2"
subnet_resource_id = var.training_subnet_resource_id
identity {
type = "SystemAssigned"
}
scale_settings {
min_node_count = 0
max_node_count = 3
scale_down_nodes_after_idle_duration = "PT15M" # 15 minutes
}
}

View File

@ -8,6 +8,8 @@ for private network connectivity using [Azure Private Link](https://docs.microso
This configuration describes the minimal set of resources you require to get started with Azure Machine Learning in a network-isolated set-up. This configurations assumes that you have existing network components to reuse. The [201 example](../201-machine-learning-moderately-secure/readme.md), alternatively creates new network components.
Please note that this template does not create Azure Private DNS zones. The assumption is that you have already configured Azure private DNS zones that are linked to your virtual network resources.
## Resources
| Terraform Resource Type | Description |
@ -20,8 +22,6 @@ This configuration describes the minimal set of resources you require to get sta
| `azurerm_machine_learning_workspace` | An Azure Machine Learning workspace instance |
| `azurerm_virtual_network` | An Azure Machine Learning workspace instance |
| `azurerm_subnet` | An Azure Machine Learning workspace instance |
| `azurerm_private_dns_zone` | Private DNS Zones for FQDNs required for Azure Machine Learning and associated resources |
| `azurerm_private_dns_zone_virtual_network_link` | Virtual network links of the Private DNS Zones to the virtual network resource |
| `azurerm_private_endpoint` | Private Endpoints for the Azure Machine Learning workspace and associated resources |
| `azurerm_machine_learning_compute_instance` | An Azure Machine Learning compute instance a single-node managed compute. |
| `azurerm_machine_learning_compute_cluster` | An Azure Machine Learning compute cluster as multi-node shared and managed compute. |