> For the complete documentation index, see [llms.txt](https://docs.bdb.ai/data-pipeline-4/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.bdb.ai/data-pipeline-4/getting-started/homepage/create/register-as-job.md).

# Register as Job

The **Register** Feature enables users to directly create jobs from DsLab notebook. Using this feature, users can create the following types of jobs:

* [**Python Job**](/data-pipeline-4/getting-started/homepage/create/creating-a-new-job/python-job.md)
* [**Python Job (On demand)**](/data-pipeline-4/getting-started/homepage/create/creating-a-new-job/python-job-on-demand.md)
* [**PySpark Job**](/data-pipeline-4/getting-started/homepage/create/creating-a-new-job/pyspark-job.md)

## Creating a Python Job or Python Job (On demand) using register feature.

Follow the below-given steps to create a Python Job using the register feature:

1. Create a project in the DSLab module under the Python environment. Refer to the below given image for guidance.

<figure><img src="https://3157314867-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvmyGSlDvDj86v7eh3RHM%2Fuploads%2FTCWw2ieXITUZu3IzwSX2%2Fimage.png?alt=media&amp;token=5ee720aa-6456-44d7-a1d3-d947eb6fb76d" alt=""><figcaption><p><em><strong>Creating a project under python environment</strong></em></p></figcaption></figure>

2. Once the project is created, create a Notebook and write the scripts. It supports scripts running through multiple code cells.
3. After writing the script, select the ***Register*** option from the Notebook options. Refer to the following image for reference.

<figure><img src="https://3157314867-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvmyGSlDvDj86v7eh3RHM%2Fuploads%2FZy0sCIsmc3CmN6vHd9rs%2Fimage.png?alt=media&amp;token=74bcc5c1-1fc6-4c0e-8d3e-677d203f8485" alt=""><figcaption><p><em><strong>Register option in the DSLab Notebook</strong></em></p></figcaption></figure>

4. The ***Register as Job*** panel will open on the right side of the window with two options:
   * **Register as New:** This will create a new Job.
   * **Re-Register:** If the Job is already created and the user wants to make changes to the scripts, it will update the existing Job with the latest changes.

<figure><img src="https://3157314867-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvmyGSlDvDj86v7eh3RHM%2Fuploads%2F8IdKzvlGcixOJnrYYbb3%2Fimage.png?alt=media&amp;token=06b39bee-9fb8-413a-b058-60af7a3c7f49" alt=""><figcaption><p><em><strong>Register as Job</strong></em></p></figcaption></figure>

## Register as New:

{% hint style="success" %}
&#x20;*Please go through the walkthrough below to register as a new Job.*
{% endhint %}

{% embed url="<https://files.gitbook.com/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvmyGSlDvDj86v7eh3RHM%2Fuploads%2FYCQMjvYia0C7r8LyXvC4%2F2024-02-08-17-16-04%20(online-video-cutter.com).mp4?alt=media&token=04eba57c-d103-445e-8c67-512f521eb45f>" %}
*Register as New*
{% endembed %}

1. After clicking on the ***Register*** option and selecting the ***Register as New** optio&#x6E;**,*** the user needs to choose the desired notebook cell that should be executed with the Job. The user can select multiple cells from the notebook according to requirement and then click on the ***Next*** option.

<figure><img src="https://3157314867-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvmyGSlDvDj86v7eh3RHM%2Fuploads%2FC1hwyZsdZzPkuzYDqoFH%2Fimage.png?alt=media&amp;token=1a3a3a2e-b5db-4b3a-b843-349d2918fe66" alt=""><figcaption><p><em><strong>Register as New</strong></em></p></figcaption></figure>

2. Now, the user needs to validate the script of the selected cell by clicking on the **Validate** option. Additionally, the user can select the **External Libraries** used in the project by clicking on the **External Libraries** option next to the **Validate** option. The Next option won't be enabled until the user validates the script. After validating the script, click on the ***Next*** option.

<figure><img src="https://3157314867-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvmyGSlDvDj86v7eh3RHM%2Fuploads%2Frp6br5WtIG0oad6HovXB%2Fimage.png?alt=media&amp;token=b1f7e366-0905-457a-aaa4-aa659b5306e2" alt=""><figcaption><p><em><strong>Validating the selected script</strong></em></p></figcaption></figure>

3. **Enter scheduler name:** Name of the job. (It will create a scheduled job if the user is creating a Python Job).
4. **Scheduler description:** Description of the job.
5. **Start function:** Select the start function from the validated script to start the job from the given start function.
6. **Job baseinfo:** Python (This field will be pre-selected if the DSLab project is created under the Python environment.)
7. **Docker config:** Select the desired configuration for the job and provide the resources (CPU & Memory) for executing the job.
8. Provide the resources required to run the Python Job in the Limit and Request section.
   * **Limit:** Enter the max CPU and Memory required for the Python Job.
   * **Request:** Enter the CPU and Memory required for the job at the start.
   * **Instances:** Enter the number of instances for the Python Job.
9. **On demand:** Check-in this option if Python Job (On demand) has to be created. In this scenario, the Job will not be scheduled.
10. **Payload:** This option will appear if the On demand option is checked in. Enter the payload in the form of a list of dictionaries. For more details about the Python Job (On demand), refer to this link: [***Python Job(On demand)***](/data-pipeline-4/getting-started/homepage/create/creating-a-new-job/python-job-on-demand.md)
11. **Concurrency Policy:** Select the desired concurrency policy. For more details about the Concurrency Policy, check this link: [***Concurrency Policy***](/data-pipeline-4/getting-started/homepage/create/creating-a-new-job.md)
12. **Alert:** This feature in the Job allows the users to send an alert message to the specified channel (Teams or Slack) in the event of either the success or failure of the configured Job. Users can also choose both success and failure options to send an alert for the configured Job. Check the following link to configure the Alert: [***Job Alerts***](/data-pipeline-4/getting-started/homepage/create/creating-a-new-job/job-alerts.md)
13. Click on the ***Save*** option to create a job.

## Re-Register:

This feature allows the user to update an existing job with the latest changes. Select the ***Re-register*** option if the Job is already created and the user wants to make changes to the scripts.

1. After selecting the **Re-Register** option, the system will display all previous versions of registered Jobs from the chosen notebook.

<figure><img src="https://3157314867-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvmyGSlDvDj86v7eh3RHM%2Fuploads%2FZYhbpxgydTApmWMtm1Bm%2Fimage.png?alt=media&amp;token=4e6ed130-f005-4fcc-903e-26de3fa73c6a" alt=""><figcaption><p><em><strong>Re-Register</strong></em> </p></figcaption></figure>

2. The user must choose the Job to be Re-Registered with the latest changes and proceed by clicking Next.
3. Validate the script of the selected cell by clicking on the ***Validate*** option. Additionally, the user can choose ***External Libraries*** by clicking on the option next to Validate. The ***Next*** option remains disabled until the script is validated.
4. After script validation, proceed by clicking ***Next***.
5. Now, the user needs to provide all the required information for Re-registering the job, following the same steps outlined in the ***Register as New*** feature.
6. Finally, click on the ***Save*** option to complete the Re-Registration of the job.<br>

{% hint style="info" %}
*<mark style="color:green;">Please Note:</mark>* *The user can Register as New or Re-Register a PySpark Job in the same way as Python Job as mentioned above. The only difference is that the user needs to create the project under PySpark environment in the DSLab module.*
{% endhint %}
