azure-batch-maya/azure_batch_maya/templates/containers/vray-2017-linux.json

198 строки
5.7 KiB
JSON

{
"templateMetadata": {
"description": "Application template for working with Maya and VRay on CentOS."
},
"parameters": {
"sceneFile": {
"type": "string",
"metadata": {
"description": "The Maya scene file to be rendered"
}
},
"renderer": {
"type": "string",
"defaultValue": "vray",
"metadata": {
"description": "The Maya renderer to be used for the render"
},
"allowedValues": [
"vray"
]
},
"projectData": {
"type": "string",
"metadata": {
"description": "The file group where the input data is stored"
}
},
"assetScript": {
"type": "string",
"metadata": {
"description": "The SAS URL to a pre-render asset path redirection script"
}
},
"thumbScript": {
"type": "string",
"metadata": {
"description": "The SAS URL to the thumbnail generation script"
}
},
"frameStart": {
"type": "int",
"metadata": {
"description": "Index of the first frame to render"
}
},
"workspace": {
"type": "string",
"metadata": {
"description": "The SAS URL to the project workspace"
}
},
"frameStep": {
"type": "int",
"metadata": {
"description": "Incremental step in frame sequeunce"
}
},
"frameEnd": {
"type": "int",
"metadata": {
"description": "Index of the last frame to render"
}
},
"outputs": {
"type": "string",
"metadata": {
"description": "The file group where outputs will be stored"
}
},
"storageURL": {
"type": "string",
"metadata": {
"description": "SAS URL for input file group with read and list permissions"
}
},
"taskContainerImageName": {
"type": "string",
"metadata": {
"description": "The Container image name to execute each task within"
}
}
},
"jobPreparationTask": {
"userIdentity": {
"autoUser": {
"elevationLevel": "admin"
}
},
"resourceFiles": [
{
"blobSource": "[parameters('assetScript')]",
"filePath": "scripts/renderPrep.mel"
},
{
"blobSource": "[parameters('thumbScript')]",
"filePath": "thumbnail.py"
},
{
"blobSource": "[parameters('workspace')]",
"filePath": "workspace.mel"
}
],
"commandLine": "/bin/bash -c \"yum install -y libunwind libicu && curl -sSL -o dotnet.tar.gz https://download.microsoft.com/download/7/3/A/73A3E4DC-F019-47D1-9951-0453676E059B/dotnet-sdk-2.0.2-linux-x64.tar.gz && mkdir -p /opt/dotnet && tar zxf dotnet.tar.gz -C /opt/dotnet && ln -nsf /opt/dotnet/dotnet /usr/local/bin && wget -O azcopy.tar.gz https://aka.ms/downloadazcopyprlinux && tar -xf azcopy.tar.gz && ./install.sh && azcopy --source \\\"[parameters('storageURL')]\\\" --destination $AZ_BATCH_JOB_PREP_WORKING_DIR/assets --recursive\""
},
"taskFactory": {
"type": "parametricSweep",
"parameterSets": [
{
"start": "[parameters('frameStart')]",
"end": "[parameters('frameEnd')]",
"step": "[parameters('frameStep')]"
}
],
"repeatTask": {
"displayName": "Frame {0}",
"userIdentity": {
"autoUser": {
"scope": "task",
"elevationLevel": "admin"
}
},
"commandLine": "sudo mkdir -m a=rwx -p \"/X\";sudo mount --rbind $AZ_BATCH_JOB_PREP_WORKING_DIR/assets /X;maya2017.sh -renderer [parameters('renderer')] -proj \"$AZ_BATCH_JOB_PREP_WORKING_DIR\" -verb -preRender renderPrep -rd \"$AZ_BATCH_TASK_WORKING_DIR/images\" -s {0} -e {0} \"[parameters('sceneFile')]\";err=$?;python /mnt/resource/batch/tasks/workitems/[parameters('outputs')]/job-1/jobpreparation/wd/thumbnail.py $err;sudo umount \"/X\";exit $err",
"environmentSettings": [
{
"name": "MAYA_SCRIPT_PATH",
"value": "/mnt/resource/batch/tasks/workitems/[parameters('outputs')]/job-1/jobpreparation/wd/scripts"
},
{
"name": "LANG",
"value": "en_US.iso88591"
},
{
"name": "FLEXLM_TIMEOUT",
"value": "5000000"
},
{
"name": "VRAY_AUTH_CLIENT_FILE_PATH",
"value": "/etc/vray"
}
],
"outputFiles": [
{
"filePattern": "images/**/*",
"destination": {
"autoStorage": {
"fileGroup": "[parameters('outputs')]"
}
},
"uploadOptions": {
"uploadCondition": "taskSuccess"
}
},
{
"filePattern": "thumbs/*.png",
"destination": {
"autoStorage": {
"fileGroup": "[parameters('outputs')]",
"path": "thumbs"
}
},
"uploadOptions": {
"uploadCondition": "taskSuccess"
}
},
{
"filePattern": "../stdout.txt",
"destination": {
"autoStorage": {
"fileGroup": "[parameters('outputs')]",
"path": "logs/frame_{0}.log"
}
},
"uploadOptions": {
"uploadCondition": "taskCompletion"
}
},
{
"filePattern": "../stderr.txt",
"destination": {
"autoStorage": {
"fileGroup": "[parameters('outputs')]",
"path": "logs/frame_{0}_error.log"
}
},
"uploadOptions": {
"uploadCondition": "taskCompletion"
}
}
],
"containerSettings": {
"imageName": "[parameters('taskContainerImageName')]",
"containerRunOptions": "--privileged"
}
}
},
"onAllTasksComplete": "terminateJob"
}