-
Notifications
You must be signed in to change notification settings - Fork 2
build: setup ML workspace and VM cluster provisioning via bicep scripts #43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
anujsinha3
wants to merge
4
commits into
main
Choose a base branch
from
build-bicep-provisioning
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
5cf0e32
build: setup ML workspace and VM cluster provisioning via bicep scripts
anujsinha3 ab8f23e
docs: add readme for execution of bicep scripts
anujsinha3 de29baf
build: update script for provisioning of VM cluster
anujsinha3 bc1768b
docs: update README.md for prerequisite steps
anujsinha3 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
## HOW TO DEPLOY TO AZURE USING BICEP SCRIPTS AND COMMAND LINES | ||
|
||
### STEP 0: PREREQUISITES | ||
Ignore pre-requisites if already done as part of the project setup instruction in the parent README.md | ||
[Install Azure CLI](https://learn.microsoft.com/en-us/cli/azure/install-azure-cli) | ||
|
||
Add the ML extension: | ||
``` | ||
az extension add --name ml | ||
``` | ||
|
||
Configure the CLI: | ||
|
||
``` | ||
az login | ||
az account set --subscription "<your subscription name>" | ||
az configure --defaults workspace=<aml workspace> group=<resource group> location=<location, e.g. westus3> | ||
``` | ||
|
||
Execute the following commands on your terminal(mac) | ||
|
||
#### STEP 1: SET THE REQUIRED VARIABLES | ||
``` | ||
current_date=$(date +%m-%d-%Y) | ||
``` | ||
|
||
#### STEP 2: SET THE DEPLOYMENT NAME | ||
``` | ||
deployment_name="<name_as_per_specification>""$current_date" | ||
``` | ||
|
||
example for reference: 'AutoRAML02-26-2024' | ||
|
||
#### STEP 3: TRIGGER DEPLOYMENT | ||
``` | ||
az deployment group create --name $deployment_name --resource-group <resource_group_name on azure> --template-file ./main.bicep --parameters ./azuredeploy.parameters.json --verbose --confirm-with-what-if | ||
``` | ||
|
||
#### STEP 4: CONFIRM CHANGES (y/N) | ||
|
||
#### STEP 5: TRACK THE STATUS OF YOUR DEPLOYMENT UNDER | ||
- https://portal.azure.com/#view/HubsExtension/BrowseResourceGroups | ||
- Click on your resource group | ||
- Click on the 'Deployments' tab on the left panel | ||
- Check the status of the deployment name for which your triggered deployment. | ||
|
||
Further references: | ||
https://medium.com/codex/using-bicep-to-create-workspace-resources-and-get-started-with-azure-machine-learning-bcc57fd4fd09 | ||
https://medium.com/@dmitri.mahayana/creating-virtual-assistance-using-with-llama-2-7b-chat-model-9f693c8250ee |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{ | ||
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", | ||
"contentVersion": "1.0.0.0", | ||
"parameters": { | ||
"name": { | ||
"value": "autora" | ||
}, | ||
"environment": { | ||
"value": "testenv4" | ||
}, | ||
"location": { | ||
"value": "westus" | ||
}, | ||
"clusterLocation": { | ||
"value": "westus3" | ||
} | ||
} | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,110 @@ | ||
@description('Specifies the name of the deployment.') | ||
param name string | ||
|
||
@description('Specifies the name of the environment.') | ||
param environment string | ||
|
||
@description('Specifies the region of the cluster.') | ||
param clusterLocation string | ||
|
||
@description('Specifies the location of the Azure Machine Learning workspace and dependent resources.') | ||
param location string = resourceGroup().location | ||
|
||
@description('The minimum number of nodes to use on the cluster. If not specified, defaults to 0') | ||
param minNodeCount int = 0 | ||
@description(' The maximum number of nodes to use on the cluster. If not specified, defaults to 4.') | ||
param maxNodeCount int = 1 | ||
|
||
@description('Specifies whether to reduce telemetry collection and enable additional encryption.') | ||
param hbi_workspace bool = false | ||
|
||
@description(' The size of agent VMs. More details can be found here: https://aka.ms/azureml-vm-details.') | ||
param vmSize string = 'Standard_NC6s_v3' | ||
|
||
var tenantId = subscription().tenantId | ||
var storageAccountName_var = 'st${name}${environment}' | ||
var keyVaultName_var = 'kv-${name}-${environment}' | ||
var applicationInsightsName_var = 'appi-${name}-${environment}' | ||
var containerRegistryName_var = 'cr${name}${environment}' | ||
var workspaceName_var = 'mlw${name}${environment}' | ||
var clusterName_var = 'clust${name}${environment}' | ||
var storageAccount = storageAccountName.id | ||
var keyVault = keyVaultName.id | ||
var applicationInsights = applicationInsightsName.id | ||
var containerRegistry = containerRegistryName.id | ||
|
||
resource storageAccountName 'Microsoft.Storage/storageAccounts@2023-01-01' = { | ||
name: storageAccountName_var | ||
location: location | ||
sku: { | ||
name: 'Standard_RAGRS' | ||
} | ||
kind: 'StorageV2' | ||
} | ||
|
||
resource keyVaultName 'Microsoft.KeyVault/vaults@2023-07-01' = { | ||
name: keyVaultName_var | ||
location: location | ||
properties: { | ||
sku: { | ||
family: 'A' | ||
name: 'standard' | ||
} | ||
tenantId: tenantId | ||
accessPolicies: [] | ||
enableSoftDelete: true | ||
} | ||
} | ||
|
||
resource applicationInsightsName 'Microsoft.Insights/components@2020-02-02' = { | ||
name: applicationInsightsName_var | ||
location: location | ||
kind: 'web' | ||
properties: { | ||
Application_Type: 'web' | ||
} | ||
} | ||
|
||
resource containerRegistryName 'Microsoft.ContainerRegistry/registries@2023-11-01-preview' = { | ||
name: containerRegistryName_var | ||
location: location | ||
sku: { | ||
name: 'Standard' | ||
} | ||
properties: { | ||
adminUserEnabled: true | ||
} | ||
} | ||
|
||
resource workspaceName 'Microsoft.MachineLearningServices/workspaces@2023-10-01' = { | ||
identity: { | ||
type: 'SystemAssigned' | ||
} | ||
name: workspaceName_var | ||
location: location | ||
properties: { | ||
friendlyName: workspaceName_var | ||
storageAccount: storageAccount | ||
keyVault: keyVault | ||
applicationInsights: applicationInsights | ||
containerRegistry: containerRegistry | ||
hbiWorkspace: hbi_workspace | ||
} | ||
} | ||
|
||
|
||
resource clusterName 'Microsoft.MachineLearningServices/workspaces/computes@2021-01-01' = { | ||
parent: workspaceName | ||
name: clusterName_var | ||
location: clusterLocation | ||
properties: { | ||
computeType: 'AmlCompute' | ||
properties: { | ||
vmSize: vmSize | ||
scaleSettings: { | ||
minNodeCount: minNodeCount | ||
maxNodeCount: maxNodeCount | ||
} | ||
} | ||
} | ||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The comment says zero, but the default is 1?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The cluster does get provisioned with a minimum of 0 nodes. If I remember correctly, the cluster we had also had 0 as its minimum nodes.