This commit is contained in:
Andrew Scobie 2018-07-18 14:48:57 +12:00
Родитель 9f02821791
Коммит 0f8f12a1fe
3 изменённых файлов: 28 добавлений и 13 удалений

Просмотреть файл

@ -5,14 +5,14 @@
"parameters": {
"poolId": {
"type": "string",
"defaultValue": "blender-ubuntu-dr",
"defaultValue": "blender-windows-dr",
"metadata": {
"description": "The ID of the pool on which to run the job."
}
},
"jobName": {
"type": "string",
"defaultValue": "blender-tile",
"defaultValue": "blender-tile-windows",
"metadata": {
"description": "The name of the Azure Batch job, also used to prefix rendered outputs",
"advancedType": "job-id"
@ -20,6 +20,7 @@
},
"inputData": {
"type": "string",
"defaultValue": "fgrp-blender-monster",
"metadata": {
"description": "The file group where the input data is stored",
"advancedType": "file-group"
@ -35,6 +36,7 @@
},
"blendFile": {
"type": "string",
"defaultValue": "monster.blend",
"metadata": {
"description": "The Blender scene file to be rendered",
"advancedType": "file-in-file-group",
@ -57,7 +59,7 @@
"metadata": {
"description": "The number of tiles on the X axis to split the frame into"
},
"defaultValue": "6",
"defaultValue": "2",
"allowedValues": [
"2",
"4",
@ -70,7 +72,7 @@
"metadata": {
"description": "The number of tiles on the Y axis to split the frame into"
},
"defaultValue": "6",
"defaultValue": "2",
"allowedValues": [
"2",
"4",
@ -112,6 +114,7 @@
},
"outputs": {
"type": "string",
"defaultValue": "fgrp-outputs",
"metadata": {
"description": "The file group where outputs will be stored",
"advancedType": "file-group"
@ -140,19 +143,19 @@
"userIdentity": {
"autoUser": {
"scope": "pool",
"elevationLevel": "admin"
"elevationLevel": "nonAdmin"
}
},
"commandLine": "/bin/bash -c 'azcopy --source \"[parameters('inputDataSas')]\" --destination \"$AZ_BATCH_JOB_PREP_WORKING_DIR\" --recursive'"
"commandLine": "cmd.exe /c azcopy /source:\"[parameters('inputDataSas')]\" /dest:\"%AZ_BATCH_JOB_PREP_WORKING_DIR%\" /S || exit /b %errorlevel%"
},
"jobReleaseTask": {
"userIdentity": {
"autoUser": {
"scope": "pool",
"elevationLevel": "admin"
"elevationLevel": "nonAdmin"
}
},
"commandLine": "/bin/bash -c \"sudo rm -rfv $AZ_BATCH_JOB_PREP_WORKING_DIR/*\""
"commandLine":"cmd.exe /c DEL /S /Q \"%AZ_BATCH_JOB_PREP_WORKING_DIR%\" & exit /b 0"
},
"jobManagerTask":{
"id": "_manager",
@ -160,7 +163,7 @@
"allowLowPriorityNode" : true,
"runExclusive": true,
"environmentSettings": [
{ "name": "TEMPLATE_OS", "value": "Linux" },
{ "name": "TEMPLATE_OS", "value": "Windows" },
{ "name": "CROP_TO_BORDER", "value": "[parameters('cropToBorder')]" },
{ "name": "OUTPUT_FORMAT", "value": "[parameters('outputFormat')]" },
{ "name": "BLEND_FILE", "value": "[parameters('blendFile')]" },
@ -178,10 +181,10 @@
"userIdentity": {
"autoUser": {
"scope": "pool",
"elevationLevel": "admin"
"elevationLevel": "nonAdmin"
}
},
"commandLine": "/bin/bash -c 'env;python $AZ_BATCH_TASK_WORKING_DIR/scripts/python-frame-splitter.py'",
"commandLine": "cmd.exe /c \"python %AZ_BATCH_TASK_WORKING_DIR%/scripts/python-frame-splitter.py\"",
"killJobOnCompletion": false,
"resourceFiles": [
{

Просмотреть файл

@ -133,7 +133,8 @@ def create_task(frame, task_id, job_id, tile_num, current_x, current_y):
optionalParams = os.environ["OPTIONAL_PARAMS"]
# generate the blender command line
command_line = "blender -b \"{}/{}\" -P \"{}/scripts/python-task-manager.py\" -y -t 0 {}".format(
command_line = "{} -b \"{}/{}\" -P \"{}/scripts/python-task-manager.py\" -y -t 0 {}".format(
blender_exe(),
os_env("AZ_BATCH_JOB_PREP_WORKING_DIR"),
blend_file,
os_env("AZ_BATCH_TASK_WORKING_DIR"),
@ -309,6 +310,17 @@ def create_merge_task(frame, task_id, job_id, depend_start, depend_end):
])
def blender_exe():
"""
Gets the operating specific blender exe.
"""
current_os = os.environ["TEMPLATE_OS"]
if current_os.lower() == "linux":
return "blender"
else:
return "\"%BLENDER_2018_EXEC%\""
def os_env(env_var_name):
"""
Gets the operating specific environment variable format string.

Просмотреть файл

@ -1,5 +1,5 @@
echo # installing choco ...
echo # installing python ...
choco install python -y
echo # installing azure-batch sdk for python ...
pip install azure-batch