Skip to content

Commit b5f9797

Browse files
authored
Merge pull request microsoft#8 from denniseik/feature/201-fitandfinish
Add compute, private link dependencies and updated readme's for publication
2 parents ae58331 + bcd263e commit b5f9797

File tree

6 files changed

+98
-9
lines changed

6 files changed

+98
-9
lines changed

.gitignore

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
quickstart/101-machine-learning/.terraform.lock.hcl
2-
quickstart/101-machine-learning/.terraform/providers/registry.terraform.io/hashicorp/azurerm/2.76.0/windows_amd64/terraform-provider-azurerm_v2.76.0_x5.exe
3-
quickstart/101-machine-learning/terraform.tfstate
4-
quickstart/101-machine-learning/demo.tfplan
1+
*.terraform.lock.hcl
2+
*.exe
3+
*.tfstate
4+
*.tfplan
5+
*.tfplan

quickstart/101-machine-learning/compute.tf

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,17 @@
1-
# Compute Instance
1+
# Generate random string for unique compute instance name
2+
resource "random_string" "ci_prefix" {
3+
length = 8
4+
upper = false
5+
special = false
6+
number = false
7+
}
8+
9+
# Compute instance
210
resource "azurerm_machine_learning_compute_instance" "compute_instance" {
3-
name = "default-instance"
11+
name = "${random_string.ci_prefix.result}instance"
412
location = azurerm_resource_group.default.location
513
machine_learning_workspace_id = azurerm_machine_learning_workspace.default.id
6-
virtual_machine_size = "STANDARD_DS2_V2"
14+
virtual_machine_size = "STANDARD_DS2_V2"
715
}
816

917
# Compute Cluster
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Generate random string for unique compute instance name
2+
resource "random_string" "ci_prefix" {
3+
length = 8
4+
upper = false
5+
special = false
6+
number = false
7+
}
8+
9+
# Compute instance
10+
resource "azurerm_machine_learning_compute_instance" "compute_instance" {
11+
name = "${random_string.ci_prefix.result}instance"
12+
location = azurerm_resource_group.default.location
13+
machine_learning_workspace_id = azurerm_machine_learning_workspace.default.id
14+
virtual_machine_size = "STANDARD_DS2_V2"
15+
subnet_resource_id = azurerm_subnet.snet-training.id
16+
17+
depends_on = [
18+
azurerm_private_endpoint.mlw_ple
19+
]
20+
}
21+
22+
# Compute cluster
23+
resource "azurerm_machine_learning_compute_cluster" "compute" {
24+
name = "cpu-cluster"
25+
location = azurerm_resource_group.default.location
26+
machine_learning_workspace_id = azurerm_machine_learning_workspace.default.id
27+
vm_priority = "Dedicated"
28+
vm_size = "STANDARD_DS2_V2"
29+
subnet_resource_id = azurerm_subnet.snet-training.id
30+
31+
identity {
32+
type = "SystemAssigned"
33+
}
34+
35+
scale_settings {
36+
min_node_count = 0
37+
max_node_count = 3
38+
scale_down_nodes_after_idle_duration = "PT15M" # 15 minutes
39+
}
40+
41+
}

quickstart/201-machine-learning-moderately-secure/readme.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ This configuration describes the minimal set of resources you require to get sta
4343
## Usage
4444

4545
```bash
46+
terraform init
47+
4648
terraform plan -var name=azureml567 -out demo.tfplan
4749

4850
terraform apply "demo.tfplan"
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# Generate random string for unique compute instance name
2+
resource "random_string" "ci_prefix" {
3+
length = 8
4+
upper = false
5+
special = false
6+
number = false
7+
}
8+
9+
# Compute instance
10+
resource "azurerm_machine_learning_compute_instance" "compute_instance" {
11+
name = "${random_string.ci_prefix.result}instance"
12+
location = azurerm_resource_group.default.location
13+
machine_learning_workspace_id = azurerm_machine_learning_workspace.default.id
14+
virtual_machine_size = "STANDARD_DS2_V2"
15+
subnet_resource_id = var.training_subnet_resource_id
16+
}
17+
18+
# Compute cluster
19+
resource "azurerm_machine_learning_compute_cluster" "compute" {
20+
name = "cpu-cluster"
21+
location = azurerm_resource_group.default.location
22+
machine_learning_workspace_id = azurerm_machine_learning_workspace.default.id
23+
vm_priority = "Dedicated"
24+
vm_size = "STANDARD_DS2_V2"
25+
subnet_resource_id = var.training_subnet_resource_id
26+
27+
identity {
28+
type = "SystemAssigned"
29+
}
30+
31+
scale_settings {
32+
min_node_count = 0
33+
max_node_count = 3
34+
scale_down_nodes_after_idle_duration = "PT15M" # 15 minutes
35+
}
36+
37+
}

quickstart/202-machine-learning-moderately-secure-existing-VNet/readme.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ for private network connectivity using [Azure Private Link](https://docs.microso
88

99
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.
1010

11+
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.
12+
1113
## Resources
1214

1315
| Terraform Resource Type | Description |
@@ -20,8 +22,6 @@ This configuration describes the minimal set of resources you require to get sta
2022
| `azurerm_machine_learning_workspace` | An Azure Machine Learning workspace instance |
2123
| `azurerm_virtual_network` | An Azure Machine Learning workspace instance |
2224
| `azurerm_subnet` | An Azure Machine Learning workspace instance |
23-
| `azurerm_private_dns_zone` | Private DNS Zones for FQDNs required for Azure Machine Learning and associated resources |
24-
| `azurerm_private_dns_zone_virtual_network_link` | Virtual network links of the Private DNS Zones to the virtual network resource |
2525
| `azurerm_private_endpoint` | Private Endpoints for the Azure Machine Learning workspace and associated resources |
2626
| `azurerm_machine_learning_compute_instance` | An Azure Machine Learning compute instance a single-node managed compute. |
2727
| `azurerm_machine_learning_compute_cluster` | An Azure Machine Learning compute cluster as multi-node shared and managed compute. |

0 commit comments

Comments
 (0)