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

Commit

Permalink
Update Dist Tensorflow Sample to use Blob for training scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
llidev committed Feb 15, 2019
1 parent a23035f commit 2238607
Showing 1 changed file with 7 additions and 29 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -139,36 +139,14 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"### Create Azure File Share\n",
"\n",
"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",
"\n",
"**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."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"azure_file_share_name = 'batchaisample'\n",
"file_service = FileService(cfg.storage_account_name, cfg.storage_account_key)\n",
"file_service.create_share(azure_file_share_name, fail_on_exist=False)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Deploy Sample Script to Azure File Share"
"### Deploy Sample Script toAzure Blob Container"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"We will create a folder on Azure File Share containing a copy of sample script"
"We will create a folder on Azure Blob Containers containing a copy of sample script"
]
},
{
Expand All @@ -179,10 +157,10 @@
"source": [
"script_directory = 'tensorflow_samples'\n",
"script_to_deploy = 'mnist_replica.py'\n",
"file_service.create_directory(\n",
" azure_file_share_name, script_directory, fail_on_exist=False)\n",
"file_service.create_file_from_path(\n",
" azure_file_share_name, script_directory, script_to_deploy, script_to_deploy)"
"\n",
"blob_service.create_blob_from_path(azure_blob_container_name,\n",
" script_directory + '/' + script_to_deploy, \n",
" script_to_deploy)"
]
},
{
Expand Down Expand Up @@ -303,7 +281,7 @@
" input_directories=[\n",
" models.InputDirectory(\n",
" id='SCRIPT',\n",
" path='$AZ_BATCHAI_JOB_MOUNT_ROOT/{0}/{1}'.format(azure_file_share, script_directory)),\n",
" path='$AZ_BATCHAI_JOB_MOUNT_ROOT/{0}/{1}'.format(azure_blob, script_directory)),\n",
" models.InputDirectory(\n",
" id='DATASET',\n",
" path='$AZ_BATCHAI_JOB_MOUNT_ROOT/{0}/{1}'.format(azure_blob, mnist_dataset_directory))],\n",
Expand Down

0 comments on commit 2238607

Please sign in to comment.