Submit a job requiring limits
You apply a limit by specifying it as a host requirement for the job or job step. If you don't specify a limit in a step and that step uses an associated resource, the step's usage isn't counted against the limit when jobs are scheduled..
Some Deadline Cloud submitters enable you to set a host requirement. You can specify the limit's amount requirement name in the submitter to apply the limit.
If your submitter doesn't support adding host requirements, you can also apply a limit by editing the job template for the job.
To apply a limit to a job step in the job bundle
-
Open the job template for the job using a text editor. The job template is located in the job bundle directory for the job. For more information, see Job bundles in the Deadline Cloud Developer Guide.
-
Find the step definition for the step to apply the limit to.
-
Add the following to the step definition. Replace
amount.namewith the amount requirement name of your limit. For typical use, you should set theminvalue to 1.You can add multiple limits to a job step as follows. Replace
amount.name_1andamount.name_2with the amount requirement names of your limits. -
Save the changes to the job template.
Automate limits with submission hooks
If you want to enforce limits across all job submissions without requiring artists to
manually edit job templates, you can use a pre-submission hook
A pre-submission hook is a script that runs before the job is submitted. The hook can
modify the job bundle's template.yaml to add the
hostRequirements amounts entry for your limit. This approach ensures that
every job submitted through the Deadline Cloud CLI or DCC submitters declares its need for
the limited resource.
For a complete working example, see the license limits submission hook sample
End-to-end example: Enforce V-Ray license limits
This example shows how to set up a limit for 5 V-Ray floating licenses and verify that the scheduler enforces it.
To set up and test a V-Ray license limit
-
Create the limit on your farm:
aws deadline create-limit \ --farm-idfarm-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\ --display-name "VRay License" \ --amount-requirement-name "amount.vray" \ --max-count 5 -
Associate the limit with your queue:
aws deadline create-queue-limit-association \ --farm-idfarm-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\ --queue-idqueue-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\ --limit-idlimit-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX -
Add the host requirement to your job template:
specificationVersion: jobtemplate-2023-09 name: My VRay Render steps: - name: Render hostRequirements: amounts: - name: amount.vray min: 1 script: actions: onRun: command: vray args: ["-scene", "{{Param.SceneFile}}"] -
Submit the job. The scheduler allows at most 5 tasks with
amount.vrayto run concurrently across all jobs in the queue. Additional tasks remain in theREADYstate until a slot becomes available.
To verify the limit is working, temporarily set maxCount to 1 and submit
two jobs. The first job runs while the second remains in the READY state
until the first completes.