Skip to content

Commit cd229a1

Browse files
authored
Merge pull request #4 from dlepow/update
Update to latest Batch and Storage SDKs
2 parents 9e66959 + 25a2043 commit cd229a1

File tree

2 files changed

+11
-8
lines changed

2 files changed

+11
-8
lines changed

src/batch_python_tutorial_ffmpeg.py

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,7 @@ def create_pool(batch_service_client, pool_id):
210210
elevation_level=batchmodels.ElevationLevel.admin)),
211211
)
212212
)
213+
213214
batch_service_client.pool.add(new_pool)
214215

215216
def create_job(batch_service_client, job_id, pool_id):
@@ -224,8 +225,8 @@ def create_job(batch_service_client, job_id, pool_id):
224225
print('Creating job [{}]...'.format(job_id))
225226

226227
job = batch.models.JobAddParameter(
227-
job_id,
228-
batch.models.PoolInformation(pool_id=pool_id))
228+
id=job_id,
229+
pool_info=batch.models.PoolInformation(pool_id=pool_id))
229230

230231
batch_service_client.job.add(job)
231232

@@ -254,11 +255,13 @@ def add_tasks(batch_service_client, job_id, input_files, output_container_sas_ur
254255
id='Task{}'.format(idx),
255256
command_line=command,
256257
resource_files=[input_file],
257-
output_files=[batchmodels.OutputFile(output_file_path,
258+
output_files=[batchmodels.OutputFile(
259+
file_pattern=output_file_path,
258260
destination=batchmodels.OutputFileDestination(
259-
container=batchmodels.OutputFileBlobContainerDestination(output_container_sas_url)),
261+
container=batchmodels.OutputFileBlobContainerDestination(
262+
container_url=output_container_sas_url)),
260263
upload_options=batchmodels.OutputFileUploadOptions(
261-
batchmodels.OutputFileUploadCondition.task_success))]
264+
upload_condition=batchmodels.OutputFileUploadCondition.task_success))]
262265
)
263266
)
264267
batch_service_client.task.add_collection(job_id, tasks)
@@ -327,7 +330,7 @@ def wait_for_tasks_to_complete(batch_service_client, job_id, timeout):
327330
# Create a list of all MP4 files in the InputFiles directory.
328331
input_file_paths = []
329332

330-
for folder, subs, files in os.walk('./InputFiles/'):
333+
for folder, subs, files in os.walk(os.path.join(sys.path[0],'InputFiles')):
331334
for filename in files:
332335
if filename.endswith(".mp4"):
333336
input_file_paths.append(os.path.abspath(os.path.join(folder, filename)))
@@ -374,7 +377,7 @@ def wait_for_tasks_to_complete(batch_service_client, job_id, timeout):
374377
print(" Success! All tasks reached the 'Completed' state within the "
375378
"specified timeout period.")
376379

377-
except batchmodels.batch_error.BatchErrorException as err:
380+
except batchmodels.BatchErrorException as err:
378381
print_batch_exception(err)
379382
raise
380383

src/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
azure-batch==4.0.0
2-
azure-storage==0.36.0
2+
azure-storage-blob==1.3.1

0 commit comments

Comments
 (0)