mnist-nfs demo v2
"ws = Workspace.from_config()\n",
"\n",
"# choose a name for your Azure Arc-enabled Kubernetes compute\n",
- "amlarc_compute_name = os.environ.get(\"AML_COMPUTE_CLUSTER_NAME\", \"<AMLARC_COMPUTE_NAME>\")\n",
+ "amlarc_compute_name = os.environ.get(\"AML_COMPUTE_CLUSTER_NAME\", \"<ArcComputeName>\")\n",
"\n",
"# resource ID for your Azure Arc-enabled Kubernetes cluster\n",
"resource_id = \"/subscriptions/<subscriptionId>/resourceGroups/<resourceGroupName>/providers/Microsoft.Kubernetes/connectedClusters/<clusterName>\"\n",
" # For a more detailed view of current KubernetesCompute status, use get_status()\n",
" print(amlarc_compute.get_status().serialize())\n",
"\n",
- "print(f\"compute target id in endpoint yaml: azureml:{amlarc_compute.name}\")"
+ "print(f\"compute target id in endpoint yaml: azureml:{amlarc_compute.name}, instance type name in endpoint yaml: {amlarc_compute.default_instance_type}\")"
]
},
{
"source": [
"from azureml.core import ScriptRunConfig\n",
"\n",
- "data_folder = os.path.join(\"<MountPathOnTrainingPod>\", \"mnist\") # training data are saved to <mountPoint>/mnist\n",
+ "data_folder = \"/nfs_share\"+\"/mnist\" # training data are saved to <mountPoint>/mnist (have to use / as the path separator)\n",
"\n",
"args = ['--data-folder', data_folder, '--regularization', 0.5]\n",
"script_folder = \"mnist_script\"\n",
"metadata": {},
"outputs": [],
"source": [
- "endpoint = 'sklearn-mnist-jiadu'\n",
+ "endpoint = '<sklearn-mnist endpoint name>'\n",
"\n",
"import os\n",
"from pathlib import Path\n",
"properties = helpers.run(cmd, return_output=True, no_output=True)\n",
"\n",
"cmd = f\"az ml endpoint get-credentials -n {endpoint} -w {ws.name} -g {ws.resource_group}\"\n",
- "credentials = helpers.run(cmd, return_output=True, no_output=True)"
+ "credentials = helpers.run(cmd, return_output=True, no_output=True)\n",
+ "\n",
+ "print(f\"Got endpoint and credentials.\")"
]
},
{
],
"metadata": {
"interpreter": {
- "hash": "df0893f56f349688326838aaeea0de204df53a132722cbd565e54b24a8fec5f6"
+ "hash": "fc402497f0168b24575e2ffafe64cd34c507b9a7fab971a93b09782ae565c5c6"
},
"kernelspec": {
- "display_name": "Python 3.8.11 64-bit",
+ "display_name": "Python 3.8.3 64-bit",
"name": "python3"
},
"language_info": {
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
- "version": "3.8.11"
+ "version": "3.8.3"
}
},
"nbformat": 4,
