Blobfuseintegration: Mounting blob container. (#15)
Render vray scene with mounting blob container.
This commit is contained in:
Родитель
bfe813ff28
Коммит
5d76b1e373
|
@ -8,5 +8,10 @@
|
|||
"id": "render-linux",
|
||||
"name": "Render V-Ray scene on CentOS",
|
||||
"description": "Render a standalone V-Ray scene on CentOS"
|
||||
},
|
||||
{
|
||||
"id": "render-linux-with-blobfuse-mount",
|
||||
"name": "Render V-Ray scene on CentOS with Blobfuse",
|
||||
"description": "Render a standalone V-Ray scene on CentOS with Blobfuse"
|
||||
}
|
||||
]
|
||||
|
|
|
@ -0,0 +1,49 @@
|
|||
#!/bin/bash
|
||||
if [ "$EUID" -ne 0 ]
|
||||
then echo "Please run as root"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
set -e
|
||||
|
||||
BLOBFUSE_CONFIG_FILE="$AZ_BATCH_JOB_PREP_WORKING_DIR/connection.cfg"
|
||||
MOUNT_POINT_PATH="$AZ_BATCH_JOB_PREP_WORKING_DIR/$INPUT_FILEGROUP_NAME"
|
||||
TMP_CACHE_PATH="$AZ_BATCH_JOB_PREP_WORKING_DIR/blobfusetmp"
|
||||
# Get the account name from the SAS URL
|
||||
SAS_STRING=$(echo $INPUT_FILEGROUP_SAS | rev | cut -d '?' -f 1 | rev)
|
||||
ACCOUNT_NAME="$(echo $INPUT_FILEGROUP_SAS | cut -d'/' -f3 | cut -d'.' -f1)"
|
||||
echo "accountName $ACCOUNT_NAME" > $BLOBFUSE_CONFIG_FILE
|
||||
echo "sasToken ?$SAS_STRING" >> $BLOBFUSE_CONFIG_FILE
|
||||
echo "containerName $INPUT_FILEGROUP_NAME" >> $BLOBFUSE_CONFIG_FILE
|
||||
|
||||
# Configure the apt repository for Microsoft products following:
|
||||
# Install repository configuration
|
||||
curl https://packages.microsoft.com/config/rhel/7/prod.repo > ./microsoft-prod.repo
|
||||
cp ./microsoft-prod.repo /etc/yum.repos.d/
|
||||
|
||||
# Install Microsoft's GPG public key
|
||||
curl https://packages.microsoft.com/keys/microsoft.asc > ./microsoft.asc
|
||||
rpm --import ./microsoft.asc
|
||||
|
||||
# Install blobfuse
|
||||
yum install blobfuse fuse -y --nogpgcheck
|
||||
|
||||
# Configuring and Running.
|
||||
if [[ ! -d $TMP_CACHE_PATH ]]; then
|
||||
mkdir $TMP_CACHE_PATH
|
||||
else
|
||||
echo "$TMP_CACHE_PATH already exists."
|
||||
fi
|
||||
|
||||
# This is folder naming with the filegroup name.
|
||||
if [[ ! -d $MOUNT_POINT_PATH ]]; then
|
||||
mkdir $MOUNT_POINT_PATH
|
||||
else
|
||||
echo "$MOUNT_POINT_PATH already exists."
|
||||
fi
|
||||
|
||||
# Below is the config file approach
|
||||
blobfuse "$MOUNT_POINT_PATH" --tmp-path=$TMP_CACHE_PATH -o attr_timeout=240 -o entry_timeout=240 -o negative_timeout=120 --config-file="$BLOBFUSE_CONFIG_FILE"
|
||||
|
||||
ls "$MOUNT_POINT_PATH"
|
||||
sleep 30s
|
|
@ -0,0 +1,129 @@
|
|||
{
|
||||
"templateMetadata": {
|
||||
"description": "Application template for working with V-Ray standalone renderer on CentOS."
|
||||
},
|
||||
"parameters": {
|
||||
"poolId": {
|
||||
"type": "string",
|
||||
"defaultValue": "vray-pool-centos",
|
||||
"metadata": {
|
||||
"description": "The ID of the pool on which to run the job."
|
||||
}
|
||||
},
|
||||
"jobName": {
|
||||
"type": "string",
|
||||
"defaultValue": "render-vray",
|
||||
"metadata": {
|
||||
"description": "The unique name of the job."
|
||||
}
|
||||
},
|
||||
"inputFilegroupName": {
|
||||
"type": "string",
|
||||
"metadata": {
|
||||
"description": "The file group where the data is stored",
|
||||
"advancedType": "file-group"
|
||||
}
|
||||
},
|
||||
"sceneFile": {
|
||||
"type": "string",
|
||||
"metadata": {
|
||||
"description": "The V-Ray scene file to be rendered (.vrscene)",
|
||||
"advancedType": "file-in-file-group",
|
||||
"dependsOn": "inputFilegroupName"
|
||||
}
|
||||
},
|
||||
"inputFilegroupSas": {
|
||||
"type": "string",
|
||||
"metadata": {
|
||||
"description": "SAS URL for reading the data from the selected file group",
|
||||
"advancedType": "file-group-write-sas",
|
||||
"dependsOn": "inputFilegroupName"
|
||||
}
|
||||
},
|
||||
"frameStart": {
|
||||
"type": "int",
|
||||
"defaultValue": 1,
|
||||
"metadata": {
|
||||
"description": "Index of the first frame to render"
|
||||
}
|
||||
},
|
||||
"frameEnd": {
|
||||
"type": "int",
|
||||
"defaultValue": 1,
|
||||
"metadata": {
|
||||
"description": "Index of the last frame to render"
|
||||
}
|
||||
},
|
||||
"outputs": {
|
||||
"type": "string",
|
||||
"metadata": {
|
||||
"description": "The file group where outputs test will be stored",
|
||||
"advancedType": "file-group"
|
||||
}
|
||||
}
|
||||
},
|
||||
"job": {
|
||||
"type": "Microsoft.Batch/batchAccounts/jobs",
|
||||
"properties": {
|
||||
"id": "[parameters('jobName')]",
|
||||
"poolInfo": {
|
||||
"poolId": "[parameters('poolId')]"
|
||||
},
|
||||
"jobPreparationTask": {
|
||||
"resourceFiles":[
|
||||
{
|
||||
"blobSource":"https://raw.githubusercontent.com/Azure/BatchLabs-data/blobfuseintegration/ncj/vray/render-linux-with-blobfuse-mount/installblobfuse.sh",
|
||||
"filePath":"installblobfuse.sh"
|
||||
}
|
||||
],
|
||||
"environmentSettings":[
|
||||
{
|
||||
"name":"INPUT_FILEGROUP_NAME",
|
||||
"value":"fgrp-[parameters('inputFilegroupName')]"
|
||||
},
|
||||
{
|
||||
"name":"INPUT_FILEGROUP_SAS",
|
||||
"value":"[parameters('inputFilegroupSas')]"
|
||||
}
|
||||
],
|
||||
"commandLine": "/bin/bash -c installblobfuse.sh",
|
||||
"userIdentity": {
|
||||
"autoUser": {
|
||||
"elevationLevel": "admin",
|
||||
"scope": "pool"
|
||||
}
|
||||
}
|
||||
},
|
||||
"jobReleaseTask": {
|
||||
"commandLine": "/bin/bash -c \"fusermount -u $AZ_BATCH_JOB_PREP_WORKING_DIR/fgrp-[parameters('inputFilegroupName')]\"",
|
||||
"userIdentity": {
|
||||
"autoUser": {
|
||||
"elevationLevel": "admin",
|
||||
"scope": "pool"
|
||||
}
|
||||
}
|
||||
},
|
||||
"taskFactory": {
|
||||
"type": "parametricSweep",
|
||||
"parameterSets": [
|
||||
{
|
||||
"start": "[parameters('frameStart')]",
|
||||
"end": "[parameters('frameEnd')]",
|
||||
"step": 1
|
||||
}
|
||||
],
|
||||
"repeatTask": {
|
||||
"displayName": "Frame {0}",
|
||||
"userIdentity": {
|
||||
"autoUser": {
|
||||
"scope": "task",
|
||||
"elevationLevel": "admin"
|
||||
}
|
||||
},
|
||||
"commandLine": "source /etc/profile.d/chaos.sh;vray2017.sh -sceneFile=\"$AZ_BATCH_JOB_PREP_WORKING_DIR/fgrp-[parameters('inputFilegroupName')]/[parameters('sceneFile')]\" -frames={0} -imgfile=\"$AZ_BATCH_JOB_PREP_WORKING_DIR/fgrp-[parameters('inputFilegroupName')]/image{0}.png\" -display=0;err=$?;exit $err"
|
||||
}
|
||||
},
|
||||
"onAllTasksComplete": "terminateJob"
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,109 @@
|
|||
{
|
||||
"parameters": {
|
||||
"poolName": {
|
||||
"type": "string",
|
||||
"defaultValue": "vray-pool-centos",
|
||||
"metadata": {
|
||||
"description": "Id of the pool"
|
||||
}
|
||||
},
|
||||
"vmCount": {
|
||||
"type": "int",
|
||||
"defaultValue": 1,
|
||||
"metadata": {
|
||||
"description": "The number of virtual machines in the Azure Batch pool where the job will run"
|
||||
}
|
||||
},
|
||||
"vmSize": {
|
||||
"type": "string",
|
||||
"metadata": {
|
||||
"description": "The size of the virtual machines that run the application"
|
||||
},
|
||||
"defaultValue": "Standard_D2_v2",
|
||||
"allowedValues": [
|
||||
"Standard_A8",
|
||||
"Standard_A9",
|
||||
"Standard_A10",
|
||||
"Standard_A11",
|
||||
"Standard_A1_v2",
|
||||
"Standard_A2_v2",
|
||||
"Standard_A4_v2",
|
||||
"Standard_A8_v2",
|
||||
"Standard_A2m_v2",
|
||||
"Standard_A4m_v2",
|
||||
"Standard_A8m_v2",
|
||||
"Standard_D1",
|
||||
"Standard_D2",
|
||||
"Standard_D3",
|
||||
"Standard_D4",
|
||||
"Standard_D11",
|
||||
"Standard_D12",
|
||||
"Standard_D13",
|
||||
"Standard_D14",
|
||||
"Standard_D11",
|
||||
"Standard_D12",
|
||||
"Standard_D13",
|
||||
"Standard_D14",
|
||||
"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_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_L4",
|
||||
"Standard_L8",
|
||||
"Standard_L16",
|
||||
"Standard_L32",
|
||||
"Standard_M64s",
|
||||
"Standard_M64ms",
|
||||
"Standard_M128s"
|
||||
]
|
||||
}
|
||||
},
|
||||
"variables": {
|
||||
"osType": {
|
||||
"imageReference": {
|
||||
"publisher": "batch",
|
||||
"offer": "rendering-centos73",
|
||||
"sku": "rendering",
|
||||
"version": "latest"
|
||||
},
|
||||
"nodeAgentSKUId": "batch.node.centos 7"
|
||||
}
|
||||
},
|
||||
"pool": {
|
||||
"id": "[parameters('poolName')]",
|
||||
"displayName": "V-Ray CentOS rendering pool",
|
||||
"vmSize": "[parameters('vmSize')]",
|
||||
"virtualMachineConfiguration": "[variables('osType')]",
|
||||
"targetDedicatedNodes": "[parameters('vmCount')]",
|
||||
"enableAutoScale": false,
|
||||
"applicationLicenses": [
|
||||
"vray"
|
||||
]
|
||||
}
|
||||
}
|
Загрузка…
Ссылка в новой задаче