Skip to content

Commit 53dccd0

Browse files
authored
Update python mpi sample with latest SDK. (#260)
1 parent 39605bb commit 53dccd0

File tree

3 files changed

+17
-2
lines changed

3 files changed

+17
-2
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
azure-batch==5.0.0
1+
azure-batch==6.0.0
22
azure-storage-blob==1.3.1

Python/Batch/common/helpers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -412,7 +412,7 @@ def upload_file_to_container(
412412
block_blob_client, container_name, blob_name, file_path, expiry=None,
413413
timeout=timeout)
414414
return batchmodels.ResourceFile(
415-
file_path=blob_name, blob_source=sas_url)
415+
file_path=blob_name, http_url=sas_url)
416416

417417

418418
def download_blob_from_container(

Python/Batch/sample3_encrypted_resourcefiles.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,21 @@ def create_pool_and_wait_for_node(
201201
)
202202
common.helpers.create_pool_if_not_exist(batch_client, pool)
203203

204+
# because we want all nodes to be available before any tasks are assigned
205+
# to the pool, here we will wait for all compute nodes to reach idle
206+
nodes = common.helpers.wait_for_all_nodes_state(
207+
batch_client, pool,
208+
frozenset(
209+
(batchmodels.ComputeNodeState.start_task_failed,
210+
batchmodels.ComputeNodeState.unusable,
211+
batchmodels.ComputeNodeState.idle)
212+
)
213+
)
214+
# ensure all node are idle
215+
if any(node.state != batchmodels.ComputeNodeState.idle for node in nodes):
216+
raise RuntimeError('node(s) of pool {} not in idle state'.format(
217+
pool_id))
218+
204219

205220
def submit_job_and_add_task(
206221
batch_client, block_blob_client, storage_account_name,

0 commit comments

Comments
 (0)