Job Definition
A Job Definition is a reusable template that tells Daestro exactly how to run a specific task. Think of it as a detailed recipe for your job . It includes everything Daestro needs to know, such as what code to run, what software to use, and how long the task is allowed to take.
Once you create a Job Definition, you can use it over and over again to run jobs without having to re-enter the same settings every time.
Daestro supports two types of Job Definitions:
- Docker: For running jobs using a specific Docker container image.
- Bash Script: For running simple jobs using a standard Linux shell script.
How to Create a Job Definition
- Go to the Job Definition page in the Daestro Console.
- Click on Create Job Definition and choose either Docker or Bash Script.
For a Docker Job
This is the most common type and gives you the most flexibility.
- Name: A unique name for your definition (e.g.,
process-daily-reports). - Docker Image: The name of the Docker image to use (e.g.,
ubuntu:24.04ormy-app:latest). - Container Registry Auth (Optional): If you are using a private Docker image, select the credentials you saved earlier.
- Execution Timeout (in seconds): The maximum time the job is allowed to run before it is automatically stopped. Use
0for no time limit. - Command (Optional): The specific command to run inside the Docker container. You can use placeholders like
Param::<key>to pass in custom values when the job runs. - Command Parameters (Optional): Define default values for the placeholders you used in the Command. These can be overridden when you submit a job.
- Environment Variables (Optional): Add any secret keys or configuration values your application needs. For security, these are always encrypted.
- CPU Quota Percentage (Optional): Percentage of CPU core to use. 100% means it will use 1 full core, likewise 50% = 0.5 core, 400% = 4 core. Minimum value can be 10%, leave it blank to use full system capability.
- Memory Quota (Optional): Puts a constraint on Memory usage for your container. Jobs can be killed due to OOM if value is set lesser than your container needs. Set it after proper testing.
- Privileged (Checkbox): Grants the container extra permissions on the host machine. Only use this if you are sure you need it.
For a Bash Script Job
This is a simpler option for running shell commands without needing a custom Docker image.
- Name: A unique name for your definition.
- Bash Script: Write or paste the shell script you want to run. Daestro will execute it inside a default
ubuntu:24.04container. - Execution Timeout (in seconds): The maximum time the job is allowed to run.
- Environment Variables (Optional): Add any secret keys or configuration values your script needs.
- CPU Quota Percentage (Optional): Percentage of CPU core to use. 100% means it will use 1 full core, likewise 50% = 0.5 core, 400% = 4 core. Minimum value can be 10%, leave it blank to use full system capability.
- Memory Quota (Optional): Puts a constraint on Memory usage for your container. Jobs can be killed due to OOM if value is set lesser than your container needs. Set it after proper testing.
- Privileged (Checkbox): Grants the container extra permissions on the host machine. Only use this if you are sure you need it.
How to Update a Job Definition (Revisions)
For safety and consistency, you cannot directly edit a Job Definition after it has been created. Instead, you create a revision.
A revision is a new version of the Job Definition. It copies all the settings from the original, allowing you to make changes and save it as a new version (e.g., process-daily-reports:2). This is a great way to update your jobs without breaking any tasks that are currently running with the old version.
How to Delete a Job Definition
You can delete a Job Definition if it is no longer needed, but only if it meets these conditions: