How to Manage Jobs in App Platform

Jobs can consist of any application code you would like to run at a specific time. Currently, App Platform only supports scheduling code to run at pre-deploy time, or after deploy time. If scheduling your job to run after deploy time, you can further select whether to run a job after a successful deployment or whether the job should be run if the app fails to deploy.

Like workers, jobs are not “routable,” meaning they run in the background and cannot accept HTTP/S requests.

Create Jobs

  1. Visit the Apps page and either click Create App if starting from scratch, or click an existing app to add your container image to your solution.
    • If adding an image to an existing solution, click the Components tab, then click Service, Worker, or Job.
  2. Select Container as the source for your code, and choose the image you would like to use from the Repository drop-down.
  3. On the next page, give your new component a name, and select the tag of the image you would like to deploy.
  4. Configure any details such as HTTP routes, environment variables, the run command, or the HTTP port.
  5. Select the instance size you would like to use when a container is created from the image.

When updating the source image tag, a new deployment will be triggered. If the actual tag name has not changed, it is not guaranteed to pull down a fresh copy of the image due to caching. The recommended approach is to use unique tag names for all image updates.

Edit Jobs

Go to https://cloud.digitalocean.com/apps, click on your app, and click on the Components tab. Click the Job you’d like to edit.

You can use the configuration settings you see here to change the Job’s scaling behavior, modify environment variables, edit commands, and more.

You can also change when your job runs by modifying the Job Trigger value.

Job trigger drop-down

Destroy Jobs

Go to https://cloud.digitalocean.com/apps, click on your app, and click on the Components tab. Click on the Job you’d like to destroy.

You can destroy the Job by clicking the Destroy Component button on the bottom of the page and entering its name to confirm your selection.

Job
In App Platform, a job is a type of component that is not expected to run continuously and is suitable for running one-off operations.