Skip to main content
Version: Cloud

Job schedules

info

Job schedules only work for Deployments using the KServe deployment service

Job schedules create cronjobs on the cluster that automatically schedule jobs for you. The job will call the _request_instances:predict endpoint on your transformer. To make this endpoint available, use the Deeploy CLI to help you generate code for a custom transformer. Use the DeeployCustomInstancesTransformer class in your transformer and implement the predict method in this class to retrieve your instances. The returned instances are used to make new requests. The instances will automatically be split up into multiple requests if you choose to use the /explain endpoint or if the request body becomes too large.

The Example weather prediction repository contains an example of a custom transformer that is prepared for job schedules. The repository contains an LightGBM model and a custom transformer.

Create a job schedule

Before creating a new job schedule, make sure the Deployment for which you're creating the job schedule is ready to receive requests.

In your Workspace, navigate to the Job schedules page and click on Create schedule. Fill in a unique name for your job schedule, and select the Deployment you want to create the job schedule for. If the Deployment has an explainer, select which endpoint you want the requests to go to. Fill in a valid cron expression, which will be translated for you to readable language below the input field.

info

The cron expression is based on the UTC timezone

Click Create test request to see if your job schedule works as expected. The test request will call the /instances endpoint on your transformer and call the selected endpoint with the retrieved instances. If any of the requests fail, the encountered error will be shown to help you debug your setup.

After the test succeeds, click Save schedule. The job schedule is now scheduling requests on the interval based on your cron expression.

Deactivate job schedule

You can stop the job schedule from creating new requests by deactivating the job schedule. On the Job schedules page, locate your job schedule in the table and click on options (the three dots), then click Deactivate. The cron job will be removed from the cluster, and can be reactivated by clicking Activate in the same options menu anytime.