Jobs

last updated: 2024-05-19

Overview

Jobs are scheduled containers, which either trigger on time-basis or resource-basis.

Scheduling

All schedules have a time-based and a resource-based component. Due to the nature of various workload, the user can decide on the triggering entity.

Primarily time-based schedules

Time-based schedules are fixed schedules that require a job to run within a certain interval. Those jobs only tolerate a minimal amount of delay, so resource consumption is only a secondary decision factor for trigger a job.

God examples for time-based schedules are:

  • a CronJob that checks every 5 minutes for new records in a database
  • a CronJob that checks every 15 minutes for new registered users

Primarily resource-based schedules

Resource-based schedules are relaxed schedules that require a job to run within a certain range of an interval. Those jobs can tolerate a more flexible schedule to optimize for resource availability and consumption.

Good examples for resource-based schedules

  • a Job that check for an RSS feed, running at least once a week, at most once a day, depending on the available resource-preferences
  • a Job that check github pull-requests and runs various test suites, whenever resources are available, but at least once a day

Environment Variables from the runtime

variable settable description
DTZ_ACCESS_TOKEN yes (identity can be changed) JWT generate from the context that allows resources to be accessed within the context.
DTZ_CONTEXT_ID no DTZ context that the current application is running in