add windows DR tiling for blender

This commit is contained in:
Andrew Scobie 2018-07-18 12:01:22 +12:00
Родитель e523bf25b6
Коммит 2915fd4c8a
3 изменённых файлов: 358 добавлений и 0 удалений

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

@ -0,0 +1,221 @@
{
"templateMetadata":{
"description":"Distributed render Blender frames over multiple nodes."
},
"parameters": {
"poolId": {
"type": "string",
"defaultValue": "blender-ubuntu-dr",
"metadata": {
"description": "The ID of the pool on which to run the job."
}
},
"jobName": {
"type": "string",
"defaultValue": "blender-tile",
"metadata": {
"description": "The name of the Azure Batch job, also used to prefix rendered outputs",
"advancedType": "job-id"
}
},
"inputData": {
"type": "string",
"metadata": {
"description": "The file group where the input data is stored",
"advancedType": "file-group"
}
},
"inputDataSas": {
"type": "string",
"metadata": {
"description": "SAS token for reading the data from the selected file group",
"advancedType": "file-group-sas",
"dependsOn": "inputData"
}
},
"blendFile": {
"type": "string",
"metadata": {
"description": "The Blender scene file to be rendered",
"advancedType": "file-in-file-group",
"dependsOn": "inputData",
"wildcards": "*.blend"
}
},
"outputFormat": {
"type": "string",
"metadata": {
"description": "The output format of the rendered image, (default to PNG only at the moment)"
},
"defaultValue": "PNG",
"allowedValues": [
"PNG"
]
},
"xTiles": {
"type": "string",
"metadata": {
"description": "The number of tiles on the X axis to split the frame into"
},
"defaultValue": "6",
"allowedValues": [
"2",
"4",
"6",
"8"
]
},
"yTiles": {
"type": "string",
"metadata": {
"description": "The number of tiles on the Y axis to split the frame into"
},
"defaultValue": "6",
"allowedValues": [
"2",
"4",
"6",
"8"
]
},
"cropToBorder": {
"type": "string",
"metadata": {
"description": "When rendering the tile the output image will be cropped to the size of the tile"
},
"defaultValue": "True",
"allowedValues": [
"True",
"False"
]
},
"optionalParameters": {
"type": "string",
"defaultValue": " ",
"metadata": {
"description": "Optional parameters to pass to blender, e.g. --scene <name>"
}
},
"frameStart": {
"type": "int",
"defaultValue": 1,
"metadata": {
"description": "The first frame to render"
}
},
"frameEnd": {
"type": "int",
"defaultValue": 1,
"metadata": {
"description": "The last frame to render"
}
},
"outputs": {
"type": "string",
"metadata": {
"description": "The file group where outputs will be stored",
"advancedType": "file-group"
}
},
"outputSas": {
"type": "string",
"metadata": {
"description": "Writable SAS token for uploading outputs to the container",
"advancedType": "file-group-write-sas",
"dependsOn": "outputs"
}
}
},
"job": {
"type": "Microsoft.Batch/batchAccounts/jobs",
"properties": {
"id": "[parameters('jobName')]",
"poolInfo": {
"poolId": "[parameters('poolId')]"
},
"displayName": "",
"onAllTasksComplete": "terminateJob",
"usesTaskDependencies": true,
"jobPreparationTask": {
"userIdentity": {
"autoUser": {
"scope": "pool",
"elevationLevel": "admin"
}
},
"commandLine": "/bin/bash -c 'azcopy --source \"[parameters('inputDataSas')]\" --destination \"$AZ_BATCH_JOB_PREP_WORKING_DIR\" --recursive'"
},
"jobReleaseTask": {
"userIdentity": {
"autoUser": {
"scope": "pool",
"elevationLevel": "admin"
}
},
"commandLine": "/bin/bash -c \"sudo rm -rfv $AZ_BATCH_JOB_PREP_WORKING_DIR/*\""
},
"jobManagerTask":{
"id": "_manager",
"displayName": "job manager task",
"allowLowPriorityNode" : true,
"runExclusive": true,
"environmentSettings": [
{ "name": "TEMPLATE_OS", "value": "Linux" },
{ "name": "CROP_TO_BORDER", "value": "[parameters('cropToBorder')]" },
{ "name": "OUTPUT_FORMAT", "value": "[parameters('outputFormat')]" },
{ "name": "BLEND_FILE", "value": "[parameters('blendFile')]" },
{ "name": "OPTIONAL_PARAMS", "value": "[parameters('optionalParameters')]" },
{ "name": "INPUT_CONTAINER_SAS", "value": "[parameters('inputDataSas')]" },
{ "name": "OUTPUT_CONTAINER_SAS", "value": "[parameters('outputSas')]" },
{ "name": "X_TILES", "value": "[parameters('xTiles')]" },
{ "name": "Y_TILES", "value": "[parameters('yTiles')]" },
{ "name": "FRAME_START", "value": "[parameters('frameStart')]" },
{ "name": "FRAME_END", "value": "[parameters('frameEnd')]" }
],
"authenticationTokenSettings":{
"access": ["job"]
},
"userIdentity": {
"autoUser": {
"scope": "pool",
"elevationLevel": "admin"
}
},
"commandLine": "/bin/bash -c 'env;python $AZ_BATCH_TASK_WORKING_DIR/scripts/python-frame-splitter.py'",
"killJobOnCompletion": false,
"resourceFiles": [
{
"blobSource": "https://raw.githubusercontent.com/Azure/BatchLabs-data/master/ncj/blender/scripts/python-frame-splitter.py",
"filePath": "scripts/python-frame-splitter.py"
}
],
"outputFiles": [
{
"filePattern": "../stdout.txt",
"destination": {
"autoStorage": {
"fileGroup": "[parameters('outputs')]",
"path": "[parameters('jobName')]/logs/manager/stdout.txt"
}
},
"uploadOptions": {
"uploadCondition": "taskCompletion"
}
},
{
"filePattern": "../stderr.txt",
"destination": {
"autoStorage": {
"fileGroup": "[parameters('outputs')]",
"path": "[parameters('jobName')]/logs/manager/stderr.txt"
}
},
"uploadOptions": {
"uploadCondition": "taskCompletion"
}
}
]
}
}
}
}

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

@ -0,0 +1,128 @@
{
"parameters": {
"poolId": {
"type": "string",
"defaultValue": "blender-ubuntu-dr",
"metadata": {
"description": "Id of the pool"
}
},
"dedicatedVmCount": {
"type": "int",
"defaultValue": 1,
"metadata": {
"description": "The number of dedicated nodes in the Azure Batch pool"
}
},
"lowPriorityVmCount": {
"type": "int",
"defaultValue": 0,
"metadata": {
"description": "The number of low priority nodes in the Azure Batch pool"
}
},
"nodeSize": {
"type": "string",
"metadata": {
"description": "The size of the nodes that run the tasks in the pool"
},
"defaultValue": "Standard_D3_v2",
"allowedValues": [
"Standard_A8",
"Standard_A9",
"Standard_A10",
"Standard_A11",
"Standard_D1_v2",
"Standard_D2_v2",
"Standard_D3_v2",
"Standard_D4_v2",
"Standard_D5_v2",
"Standard_D11_v2",
"Standard_D12_v2",
"Standard_D13_v2",
"Standard_D14_v2",
"Standard_D15_v2",
"Standard_D2_v3",
"Standard_D4_v3",
"Standard_D8_v3",
"Standard_D16_v3",
"Standard_D32_v3",
"Standard_D64_v3",
"Standard_E2_v3",
"Standard_E4_v3",
"Standard_E8_v3",
"Standard_E16_v3",
"Standard_E32_v3",
"Standard_E64_v3",
"Standard_F1",
"Standard_F2",
"Standard_F4",
"Standard_F8",
"Standard_F16",
"Standard_G1",
"Standard_G2",
"Standard_G3",
"Standard_G4",
"Standard_G5",
"Standard_H8",
"Standard_H16",
"Standard_H8m",
"Standard_H16m",
"Standard_H16r",
"Standard_H16mr",
"Standard_L4",
"Standard_L8",
"Standard_L16",
"Standard_L32",
"Standard_M64s",
"Standard_M64ms",
"Standard_M128s",
"Standard_NC6",
"Standard_NC12",
"Standard_NC24",
"Standard_NC6s_v2",
"Standard_NC12s_v2",
"Standard_NC24s_v2",
"Standard_NC6s_v3",
"Standard_NC12s_v3",
"Standard_NC24s_v3"
]
}
},
"variables": {
"osType": {
"imageReference": {
"publisher": "Canonical",
"offer": "UbuntuServer",
"sku": "16.04.0-LTS",
"version": "latest"
},
"nodeAgentSKUId": "batch.node.ubuntu 16.04"
}
},
"pool": {
"id": "[parameters('poolId')]",
"vmSize": "[parameters('nodeSize')]",
"virtualMachineConfiguration": "[variables('osType')]",
"targetDedicatedNodes": "[parameters('dedicatedVmCount')]",
"targetLowPriorityNodes": "[parameters('lowPriorityVmCount')]",
"enableAutoScale": false,
"startTask": {
"commandLine": "/bin/bash -c ./setup-linux-pool.sh",
"waitForSuccess": true,
"maxTaskRetryCount": 0,
"userIdentity": {
"autoUser": {
"scope": "pool",
"elevationLevel": "admin"
}
},
"resourceFiles": [
{
"blobSource": "https://raw.githubusercontent.com/Azure/BatchLabs-data/master/ncj/blender/scripts/setup-linux-pool.sh",
"filePath": "setup-linux-pool.sh"
}
]
}
}
}

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

@ -0,0 +1,9 @@
echo # installing choco ...
choco install python yes to all
refreshenv
echo # installing azure-batch sdk for python ...
pip install azure-batch
refreshenv
echo Exit Code is %errorlevel%
exit /b %errorlevel%