# Register as Job

## Register a Notebook as a Job

{% hint style="success" %}
*Check out the illustration on registering a Notebook script as a Job to the Data Pipeline module.*
{% endhint %}

{% embed url="<https://files.gitbook.com/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fz33KQNYQvBTgQKJBgwTz%2Fuploads%2Fuacs9gnYj69zZf7kF0HQ%2FRegister%20as%20Job.mp4?alt=media&token=cc933237-1181-4de7-8527-c950291288eb>" %}
***Resigtering a Notebook Script as Job***
{% endembed %}

The user can register a Notebook script as a Job using this functionality.&#x20;

* Select a Notebook from the Repo folder in the left side panel.
* Click the ellipsis icon.

<figure><img src="https://3817372244-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fz33KQNYQvBTgQKJBgwTz%2Fuploads%2FMlv9LxC0Q3CB7bq57TaN%2Fimage.png?alt=media&#x26;token=dd6b48b8-51d5-47a9-b79d-9a516883b1bd" alt=""><figcaption></figcaption></figure>

* A context menu opens.
* Click the ***Register*** option from the context menu.

<figure><img src="https://3817372244-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fz33KQNYQvBTgQKJBgwTz%2Fuploads%2Fq17IwpbwWZQJfUkSqWY3%2Fimage.png?alt=media&#x26;token=0b0acfe2-c13c-42e4-97a9-44a8a16816ca" alt=""><figcaption></figcaption></figure>

* The ***Register as Job*** page opens.
* Use the ***Select All*** option or select the specific script by using the given checkmark.&#x20;
* Click the ***Next*** option.

<figure><img src="https://3817372244-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fz33KQNYQvBTgQKJBgwTz%2Fuploads%2FJMsSZfHoVyy7TkWbjuhi%2Fimage.png?alt=media&#x26;token=d85c9553-a39f-4c40-a5a4-d993d1fc5215" alt=""><figcaption></figcaption></figure>

* Click the ***Valid*** icon on the next screen that appears.
* A notification appears to confirm the validation.
* Click the ***Next*** option.

<figure><img src="https://3817372244-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fz33KQNYQvBTgQKJBgwTz%2Fuploads%2FcaxdaTtOcmuMrBwY9AL4%2Fimage.png?alt=media&#x26;token=342de6c2-8a2c-41a2-aa56-0a6d6f542daf" alt=""><figcaption></figcaption></figure>

* Provide the following information:

  * Enter scheduler name
  * Scheduler description
  * Start function
  * Job basinfo
  * Docker Config
    * Choose an option out of Low, Medium, and High
    * ***Limit*** - based on the selected docker configuration option (Low/Medium/High) the CPU and Memory limit are displayed.
    * Request -It provides predefined values for  CPU, Memory, and count of instances.&#x20;

  <figure><img src="https://3817372244-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fz33KQNYQvBTgQKJBgwTz%2Fuploads%2F1ivQyMeCTpNq1Xr2CAzc%2Fimage.png?alt=media&#x26;token=ef055ddc-e91d-4c9f-aaa7-9c4bc7785f9c" alt=""><figcaption></figcaption></figure>
* **On demand:** Check this option if a Python Job (On demand) must be created. In this scenario, the Job will not be scheduled.
* **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)***](https://app.gitbook.com/s/6ZP8JhQPMmuTgMyLMcCU/getting-started/homepage/create/creating-a-new-job/python-job-on-demand)

<figure><img src="https://3817372244-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fz33KQNYQvBTgQKJBgwTz%2Fuploads%2F1V87qzhRUhbl1djOpWBS%2Fimage.png?alt=media&#x26;token=f9ca70a1-ab62-4697-a74a-010e6b945086" alt=""><figcaption></figcaption></figure>

* **Concurrency Policy:** Select the desired concurrency policy. For more details about the Concurrency Policy, check this link: [***Concurrency Policy***](https://app.gitbook.com/s/6ZP8JhQPMmuTgMyLMcCU/getting-started/homepage/create/creating-a-new-job)

<figure><img src="https://3817372244-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fz33KQNYQvBTgQKJBgwTz%2Fuploads%2FEfc7uanJxNw5IGBfAP5P%2Fimage.png?alt=media&#x26;token=668ea805-9fd1-4000-8bde-900402cfde71" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
*<mark style="color:green;">Please Note:</mark> The Concurrency policy option doesn't appear for the On-demand jobs, it displays only for the jobs wherein the scheduler is configured.*
{% endhint %}

* The concurrency policy has three options: Allow, Forbid, and Replace.

  * **Allow:** If a job is scheduled for a specific time and the first process is not completed before the next scheduled time, the next task will run in parallel with the previous task.
  * **Forbid:** If a job is scheduled for a specific time and the first process is not completed before the next scheduled time, the next task will wait until all the previous tasks are completed.
  * **Replace:** If a job is scheduled for a specific time and the first process is not completed before the next scheduled time, the previous task will be terminated and the new task will start processing.

  &#x20;      &#x20;

  <figure><img src="https://3817372244-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fz33KQNYQvBTgQKJBgwTz%2Fuploads%2FzoU1numQH8Z15lZuOusB%2Fimage.png?alt=media&#x26;token=70537622-08de-441b-9d84-16f079e14e2a" alt=""><figcaption></figcaption></figure>
* **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 success and failure options to send an alert for the configured Job. Check the following link to configure the Alert: [***Job Alerts***](https://app.gitbook.com/s/6ZP8JhQPMmuTgMyLMcCU/getting-started/homepage/create/creating-a-new-job/job-alerts)

<figure><img src="https://3817372244-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fz33KQNYQvBTgQKJBgwTz%2Fuploads%2F592kKlVeXFu7XAchjGbP%2Fimage.png?alt=media&#x26;token=fe7883d7-47de-4d77-af23-94ef621052c6" alt=""><figcaption></figcaption></figure>

* Click the ***Save*** option to register the Notebook as a Job.

<figure><img src="https://3817372244-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fz33KQNYQvBTgQKJBgwTz%2Fuploads%2FGXWQKBVrvyOICJ0TTxtX%2Fimage.png?alt=media&#x26;token=e9667515-5436-4925-a340-9d7d864a60e8" alt=""><figcaption></figcaption></figure>

* A notification appears.

<figure><img src="https://3817372244-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fz33KQNYQvBTgQKJBgwTz%2Fuploads%2FP1OvFTWdtFzraLepg014%2Fimage.png?alt=media&#x26;token=e54a8df7-a195-4b73-8ebe-8ab0df4015ca" alt=""><figcaption></figcaption></figure>

* Navigate to the ***List Jobs*** page within the ***Data Pipeline*** module.
* The recently registered DS Notebook gets listed with the same Scheduler name.

<figure><img src="https://3817372244-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fz33KQNYQvBTgQKJBgwTz%2Fuploads%2F57DRa1YlrLQ7F3B6U0mD%2Fimage.png?alt=media&#x26;token=08ad1ed3-c3db-42c7-82cd-ed0d3d2f1156" alt=""><figcaption></figcaption></figure>

## Re-Registering Notebook Script  (.ipynb file)

This option appears for a .ipynb file that has been registered before.

* Select the ***Register*** option for a .ipynb file that has been registered before.

<figure><img src="https://3817372244-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fz33KQNYQvBTgQKJBgwTz%2Fuploads%2FQcFkLxQJKSaFt2fq0b6y%2Fimage.png?alt=media&#x26;token=b73a872e-8189-4b88-bcfa-8930fd27c8d9" alt=""><figcaption></figcaption></figure>

* The  ***Register as Job*** page opens displaying the ***Re-Register*** and ***Register*** as New options.
* Select the ***Re-Register*** option by using the checkbox.
* Select a version by using a checkbox.
* Click the ***Next*** option.

<figure><img src="https://3817372244-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fz33KQNYQvBTgQKJBgwTz%2Fuploads%2FuUkVOfwAUPPKSD6e0a9b%2Fimage.png?alt=media&#x26;token=8cc973a2-efa9-445d-811a-c40e388c2c39" alt=""><figcaption></figcaption></figure>

* Select the script using the checkbox (it appears as per the pre-selection). The user can also choose the ***Select All*** option.
* Click the ***Next*** option.

<figure><img src="https://3817372244-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fz33KQNYQvBTgQKJBgwTz%2Fuploads%2FxcX0pVm6eCD6z01i8kHB%2Fimage.png?alt=media&#x26;token=32874531-5207-47a4-aa05-9decdca1d2f7" alt=""><figcaption></figcaption></figure>

* The next page opens to ***Validate*** the Script. Click the ***Validate*** icon.
* A notification message appears to ensure that the script is valid.
* Once the script gets validated, the ***Next*** option gets enabled. Click the ***Next*** option.

<figure><img src="https://3817372244-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fz33KQNYQvBTgQKJBgwTz%2Fuploads%2FNvXR6j7P3nmnsoiNvlEe%2Fimage.png?alt=media&#x26;token=8cbd5036-49c7-47bc-92ea-cf23e80c95dd" alt=""><figcaption></figcaption></figure>

* The following information appears pre-selected:
  * Enter scheduler name
  * Scheduler description
* Start function: Select a function from the drop-down menu.
* Job basinfo: Select an option from the drop-down menu.
* Docker Config

  * Choose an option for Limit out of Low, Medium, and High
  * Request - CPU and Memory limit are displayed.

  <figure><img src="https://3817372244-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fz33KQNYQvBTgQKJBgwTz%2Fuploads%2FMIs3EezMjaKnrtUy3uqI%2Fimage.png?alt=media&#x26;token=77192355-96ab-4201-9d57-0a478c6dc0c2" alt=""><figcaption></figcaption></figure>
* **On demand:** Check this option if a Python Job (On demand) must be created. In this scenario, the Job will not be scheduled.
* **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)***](https://app.gitbook.com/s/6ZP8JhQPMmuTgMyLMcCU/getting-started/homepage/create/creating-a-new-job/python-job-on-demand)

<figure><img src="https://3817372244-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fz33KQNYQvBTgQKJBgwTz%2Fuploads%2F1V87qzhRUhbl1djOpWBS%2Fimage.png?alt=media&#x26;token=f9ca70a1-ab62-4697-a74a-010e6b945086" alt=""><figcaption></figcaption></figure>

* **Concurrency Policy:** Select the desired concurrency policy. For more details about the Concurrency Policy, check this link: [***Concurrency Policy***](https://app.gitbook.com/s/6ZP8JhQPMmuTgMyLMcCU/getting-started/homepage/create/creating-a-new-job)

<figure><img src="https://3817372244-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fz33KQNYQvBTgQKJBgwTz%2Fuploads%2FEfc7uanJxNw5IGBfAP5P%2Fimage.png?alt=media&#x26;token=668ea805-9fd1-4000-8bde-900402cfde71" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
*<mark style="color:green;">Please Note:</mark> The Concurrency policy option doesn't appear for the On-demand jobs, it displays only for the jobs wherein the scheduler is configured.*
{% endhint %}

* The concurrency policy has three options: Allow, Forbid, and Replace.

  * **Allow:** If a job is scheduled for a specific time and the first process is not completed before the next scheduled time, the next task will run in parallel with the previous task.
  * **Forbid:** If a job is scheduled for a specific time and the first process is not completed before the next scheduled time, the next task will wait until all the previous tasks are completed.
  * **Replace:** If a job is scheduled for a specific time and the first process is not completed before the next scheduled time, the previous task will be terminated and the new task will start processing.

  &#x20;      &#x20;

  <figure><img src="https://3817372244-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fz33KQNYQvBTgQKJBgwTz%2Fuploads%2FzoU1numQH8Z15lZuOusB%2Fimage.png?alt=media&#x26;token=70537622-08de-441b-9d84-16f079e14e2a" alt=""><figcaption></figcaption></figure>
* **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 success and failure options to send an alert for the configured Job. Check the following link to configure the Alert: [***Job Alerts***](https://app.gitbook.com/s/6ZP8JhQPMmuTgMyLMcCU/getting-started/homepage/create/creating-a-new-job/job-alerts)

<figure><img src="https://3817372244-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fz33KQNYQvBTgQKJBgwTz%2Fuploads%2F592kKlVeXFu7XAchjGbP%2Fimage.png?alt=media&#x26;token=fe7883d7-47de-4d77-af23-94ef621052c6" alt=""><figcaption></figcaption></figure>

* Click the ***Save*** option to register the Notebook as a Job.
* A notification message appears.

<figure><img src="https://3817372244-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fz33KQNYQvBTgQKJBgwTz%2Fuploads%2FyUIB1Lfu8osf44kem2On%2Fimage.png?alt=media&#x26;token=e4184235-47ec-4260-900d-34f0b64d0425" alt=""><figcaption></figcaption></figure>

* Navigate to the ***List Jobs*** page within the Data Pipeline module.
* The recently registered DS Notebook gets listed with the same Scheduler name.

<figure><img src="https://3817372244-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fz33KQNYQvBTgQKJBgwTz%2Fuploads%2FfuibimHRRNEmNuVsIaIs%2Fimage.png?alt=media&#x26;token=c6b5d9e0-f297-4e3d-b28a-3196983b177e" alt=""><figcaption><p><em><strong>Re-registered an .ipynb file to Data Pipelline module</strong></em></p></figcaption></figure>

{% hint style="info" %}
*<mark style="color:green;">Please Note:</mark>  The user must follow all the steps from the **Register a Notebook Script** section while re-registering it with the **Register as New** option.*&#x20;
{% endhint %}
