From 78f7b8e6fef920a6f828954bbf29d9680a652fec Mon Sep 17 00:00:00 2001 From: hugo meiland Date: Mon, 19 Feb 2024 11:41:53 +0100 Subject: [PATCH] clean up and open script layout --- deploy/amlhpc_simple.bicep | 11 ++++++++++- deploy/amlhpc_simple.json | 14 ++++++++++++-- 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/deploy/amlhpc_simple.bicep b/deploy/amlhpc_simple.bicep index 9220b32..a70bb64 100644 --- a/deploy/amlhpc_simple.bicep +++ b/deploy/amlhpc_simple.bicep @@ -142,6 +142,14 @@ resource amlLoginVM 'Microsoft.MachineLearningServices/workspaces/computes@2023- subnet: { id: subnetClusterId } + customServices: [{ + environmentVariables: { + test_variable: { + type: 'local' + value: '12345' + } + } + }] vmSize: 'Standard_F2s_v2' setupScripts: { scripts: { @@ -149,7 +157,8 @@ resource amlLoginVM 'Microsoft.MachineLearningServices/workspaces/computes@2023- scriptSource : 'inline' scriptData: base64(''' pip install amlhpc -echo "export SUBSCRIPTION=${subscription().subscriptionId}" > /etc/profile.d/amlhpc.sh +#echo "export SUBSCRIPTION=${subscription().subscriptionId}" > /etc/profile.d/amlhpc.sh +echo "export SUBSCRIPTION=$test_variable" > /etc/profile.d/amlhpc.sh ''') } startupScript: { diff --git a/deploy/amlhpc_simple.json b/deploy/amlhpc_simple.json index 13840ca..c0e0645 100644 --- a/deploy/amlhpc_simple.json +++ b/deploy/amlhpc_simple.json @@ -5,7 +5,7 @@ "_generator": { "name": "bicep", "version": "0.24.24.22086", - "templateHash": "3905114379493833843" + "templateHash": "4455719693739351355" } }, "parameters": { @@ -175,12 +175,22 @@ "subnet": { "id": "[variables('subnetClusterId')]" }, + "customServices": [ + { + "environmentVariables": { + "test_variable": { + "type": "local", + "value": "12345" + } + } + } + ], "vmSize": "Standard_F2s_v2", "setupScripts": { "scripts": { "creationScript": { "scriptSource": "inline", - "scriptData": "[base64('pip install amlhpc \necho \"export SUBSCRIPTION=${subscription().subscriptionId}\" > /etc/profile.d/amlhpc.sh\n')]" + "scriptData": "[base64('pip install amlhpc \n#echo \"export SUBSCRIPTION=${subscription().subscriptionId}\" > /etc/profile.d/amlhpc.sh\necho \"export SUBSCRIPTION=$test_variable\" > /etc/profile.d/amlhpc.sh\n')]" }, "startupScript": { "scriptSource": "inline",