Run a portable job locally and in a container
A portable job template defines the application command and arguments without selecting the
runtime. The following example requires bash. It doesn't contain Docker commands,
an image URI, or Amazon ECR authentication.
Prerequisites
Install the OpenJD CLI and the Deadline Cloud CLI. Complete Set up container support in the console and use an image that provides bash.
Run the job template
To run a portable job locally and on Deadline Cloud
-
Create a directory named
portable-container-joband save the following content astemplate.yamlin that directory.specificationVersion: jobtemplate-2023-09 name: Portable container job parameterDefinitions: - name: Message type: STRING default: Hello from a portable OpenJD job steps: - name: PrintMessage script: actions: onRun: command: bash args: - "{{Task.File.Run}}" - "{{Param.Message}}" embeddedFiles: - name: Run filename: run.sh type: TEXT data: | #!/usr/bin/env bash set -euo pipefail printf '%s\n' "$1" -
Validate the job template.
openjd check portable-container-job/template.yaml -
Run the job directly on your workstation.
openjd run portable-container-job/template.yaml \ -p Message="Local execution"Verify that the output contains
Local execution. -
Configure the Deadline Cloud CLI to use the Docker-enabled queue, and submit the unchanged job bundle.
deadline bundle submit portable-container-job \ -p Message="Container execution" -
Open the job in the Deadline Cloud monitor, select the task, and view its session log. Confirm that the log contains
Container execution.
The queue environment selects the Docker image and redirects the action into its session container. If you remove the wrapping environment, the same command runs directly on a compatible worker.