Skip to content

Turn On Exec Jobs

Exec jobs for one task, with every switch on the way to a worker turned on.

Requirements:

1. Check the Switches

Exec jobs need three switches. A repository alone can never start code on a worker.

Switch Default Where
Instance on services.gradient.exec.enable
Task off Task Settings -> Run exec jobs, or exec_enabled in the state
Worker off services.gradient.worker.capabilities.exec and enable_exec on the worker registration

Build requests check the project setting Allow Exec Jobs in Build-Requests in place of the task switch.

2. Turn On Task and Worker

Open the task Settings, tick Run exec jobs and save. Members who can edit the task can change the task switch.

services.gradient.state = {
  tasks.apps.exec_enabled = true;
  workers.gpu-box.enable_exec = true;
};

3. Read Refusals

Exec apps fail with a message on the task page while the instance or task switch is off.

Message Cause
exec jobs are disabled on this instance exec.enable is off
exec jobs are disabled for this task The task switch is off
Exec jobs don't run in build requests for this project. Enable "Allow Exec Jobs in Build-Requests" in project settings. A build request without the project setting, see Run a Program from the CLI

A finished job can start again with runExecJob from the API reference once every switch is on. An app refused during evaluation has no job and needs a new evaluation.

Verify Deployment

  • Start an evaluation of the task. Exec jobs appear with a status in the Exec Jobs section of the evaluation.
  • Waiting jobs name the missing requirement, for example a device without a connected worker.

Next Steps