---
title: Custom jobs in the Model Registry
description: Create custom jobs in the Model Registry to define tests for your models and deployments.
section_name: MLOps
maturity: public-preview

---

# Custom jobs in the Model Registry

!!! info "Availability information"
    Custom jobs are off by default. Contact your DataRobot representative or administrator for information on enabling this feature.

    <b>Feature flag:</b> Enable Custom Jobs

Now available as a public preview feature, you can create custom jobs in the Model Registry to implement automation (for example, custom tests) for your models and deployments. Each job serves as an automated workload, and the exit code determines if it passed or failed. You can run the custom jobs you create for one or more models or deployments. The automated workloads you define through custom jobs can make prediction requests, fetch inputs, and store outputs using DataRobot's Public API.

## Register and assemble a new job {: #register-and-assemble-a-new-job }

When you register a custom job, you must assemble the required execution environment and files before running the job. Only the execution environment and an *entry point* file (typically `run.sh`) are required; however, you can designate any file you add as the entry point. If you add other files to create your job, the entry point file should reference those files. In addition, to configure runtime parameters, you should create or upload a `metadata.yaml` file containing the runtime parameter configuration for your job.

To register and assemble a new custom job in the Model Registry:

1. Click **Model Registry > Custom Jobs**, and then click **Register new job**.

    ![](images/custom-jobs-register.png)

2. In the **Register new job** dialog box, enter a **Job name** and **Description (optional)** and then click **Create new job**.
    
    The custom job opens in the **Workshop** tab.

3. In the **Custom Job Workshop** for the new job, under **Environment and Description**, select an **Execution Environment** for the job and (optionally) edit the **Description**.

4. In the **Content** section, assemble your custom job. You can use the options in this section to create or upload the files required to assemble a custom job:

    ![](images/custom-jobs-content.png)

    Option      | Description
    ------------|------------
    Add files   | Upload existing custom job files (`run.sh`, `metadata.yaml`, etc.).
    Create file | Create a blank file and add contents in DataRobot. <br> The default file name for a file created this way is `run.sh`; however, you can edit that name before saving the file. If you've already added a `run.sh` file and you create another file without changing the default name, the new file overwrites the previously created or uploaded `run.sh` file.

5. In the **Settings** section, define the **Entry point** file. If you've only added one file (usually `run.sh`), that file is the entry point.

6. (Optional) In the **Settings** section, if you uploaded a `metadata.yaml` file, configure the **Runtime Parameters**.

## Run and schedule jobs {: #run-and-schedule-jobs }

After you register and assemble a custom job with the required environment and files, you can run the job, schedule a run, or both. In the **Model Registry**, on the **Custom Jobs > Workshop** tab, locate the run options next to the **Custom Jobs Workshop** header:

![](images/custom-jobs-run-options1.png)

Option       | Description
-------------|------------
Run          | Starts a custom job run immediately and opens the run on the **Runs** tab, where you can [view custom job run information](#view-and-manage-job-runs).
Schedule run | Opens the **Schedule run (UTC)** section, where you can select a frequency and enter a time (in UTC) to run your custom job. You can also click Use advanced scheduler to provide a more precise run schedule. Once you've configured a schedule, click **Set schedule**.

## View and edit jobs info {: #view-and-edit-jobs-info }

After you register a custom job, you can view and edit the registration info. In the **Model Registry**, on the **Custom Jobs > Info** tab, locate the **Custom Job Info**. You can view the custom job ID, and the created, updated, and last run information. You can also edit the **Name** and **Description** of the custom job. To edit those fields, click the edit icon (![](images/icon-pencil.png)) next to the field contents:

![](images/custom-jobs-info.png)

## View and manage job runs {: #view-and-manage-job-runs }

When you run a custom job (or a scheduled run completes), the run information is recorded, allowing you to review the run information and view and manage run logs. This is helpful for diagnosing issues when a run fails. In the **Model Registry**, on the **Custom Jobs > Runs** tab, locate and click the run you want to view from the list and review the **Custom job run info**:

!!! warning
    Do not log sensitive information in your custom job code. The logs for a custom job run contain any information logged in that job's code. If you log sensitive information, you should delete your logs.

![](images/custom-jobs-run-info.png)

Field           | Description
----------------|------------
Job results     | The **Status** and **Duration** of the selected job run.
Description     | A description of the job run. To edit the description, click the edit icon (![](images/icon-pencil.png)) next to the field contents.
Logs of the run | Provides the following log controls: <ul><li>**View full logs:** Open the **Console Logs** window in DataRobot where you can **Search**, **Download**, and **Refresh** the log contents. You can view logs while the run is still in progress, clicking **Refresh** to keep them up to date. </li><li>**Download logs:** Download the logs as a `.txt` file.</li><li>**Delete logs:** Permanently delete the logs for a run, typically if you accidentally logged sensitive information.</li></ul>

If you uploaded a `metadata.yaml` file and configured **Runtime Parameters** during the custom jobs assembly process, you can view them in the **Runtime Parameters** table for a run:

![](images/custom-jobs-run-parameters.png)

You can also initiate or schedule runs from the **Runs** tab: 

![](images/custom-jobs-run-options2.png)


## Delete a custom job {: #delete-a-custom-job }

To delete a custom job and all of its contents, in the **Model Registry**, on the **Custom Jobs** tab, locate the row for the custom job you want to delete, click the action menu (![](images/icon-menu.png)), and click **Delete**. Then, in the **Delete Custom Job** dialog box, click **Delete** again.

![](images/custom-jobs-delete.png)