Skip to content
This repository was archived by the owner on Nov 16, 2023. It is now read-only.

Commit 2238607

Browse files
committed
Update Dist Tensorflow Sample to use Blob for training scripts
1 parent a23035f commit 2238607

File tree

1 file changed

+7
-29
lines changed

1 file changed

+7
-29
lines changed

recipes/TensorFlow/TensorFlow-GPU-Distributed/TensorFlow-GPU-Distributed.ipynb

Lines changed: 7 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -139,36 +139,14 @@
139139
"cell_type": "markdown",
140140
"metadata": {},
141141
"source": [
142-
"### Create Azure File Share\n",
143-
"\n",
144-
"For this example we will create a new File Share with name `batchaisample` under your storage account. This will be used to share the *training script file* and *output file*.\n",
145-
"\n",
146-
"**Note** You don't need to create new file share for every cluster. We are doing this in this sample to simplify resource management for you."
147-
]
148-
},
149-
{
150-
"cell_type": "code",
151-
"execution_count": null,
152-
"metadata": {},
153-
"outputs": [],
154-
"source": [
155-
"azure_file_share_name = 'batchaisample'\n",
156-
"file_service = FileService(cfg.storage_account_name, cfg.storage_account_key)\n",
157-
"file_service.create_share(azure_file_share_name, fail_on_exist=False)"
158-
]
159-
},
160-
{
161-
"cell_type": "markdown",
162-
"metadata": {},
163-
"source": [
164-
"### Deploy Sample Script to Azure File Share"
142+
"### Deploy Sample Script toAzure Blob Container"
165143
]
166144
},
167145
{
168146
"cell_type": "markdown",
169147
"metadata": {},
170148
"source": [
171-
"We will create a folder on Azure File Share containing a copy of sample script"
149+
"We will create a folder on Azure Blob Containers containing a copy of sample script"
172150
]
173151
},
174152
{
@@ -179,10 +157,10 @@
179157
"source": [
180158
"script_directory = 'tensorflow_samples'\n",
181159
"script_to_deploy = 'mnist_replica.py'\n",
182-
"file_service.create_directory(\n",
183-
" azure_file_share_name, script_directory, fail_on_exist=False)\n",
184-
"file_service.create_file_from_path(\n",
185-
" azure_file_share_name, script_directory, script_to_deploy, script_to_deploy)"
160+
"\n",
161+
"blob_service.create_blob_from_path(azure_blob_container_name,\n",
162+
" script_directory + '/' + script_to_deploy, \n",
163+
" script_to_deploy)"
186164
]
187165
},
188166
{
@@ -303,7 +281,7 @@
303281
" input_directories=[\n",
304282
" models.InputDirectory(\n",
305283
" id='SCRIPT',\n",
306-
" path='$AZ_BATCHAI_JOB_MOUNT_ROOT/{0}/{1}'.format(azure_file_share, script_directory)),\n",
284+
" path='$AZ_BATCHAI_JOB_MOUNT_ROOT/{0}/{1}'.format(azure_blob, script_directory)),\n",
307285
" models.InputDirectory(\n",
308286
" id='DATASET',\n",
309287
" path='$AZ_BATCHAI_JOB_MOUNT_ROOT/{0}/{1}'.format(azure_blob, mnist_dataset_directory))],\n",

0 commit comments

Comments
 (0)