# DSLab Runner

The **DSL** (**Data Science Lab**) Runner is utilized to manage and execute data science experiments that have been created within the DS Lab module and imported into the pipeline.

All component configurations are classified broadly into 3 section:

* ​[​Basic Information​](../component-base-configuration)​
* Meta Information
* [Resource Configuration​](../resource-configuration)

## Using a DS Lab Runner Component in the Pipeline Workflow

* Drag the DS Lab Runner component to the Pipeline Workflow canvas.

<figure><img src="https://content.gitbook.com/content/vmyGSlDvDj86v7eh3RHM/blobs/55Ri32sjmZdNQT4Xezey/MicrosoftTeams-image%20(110).png" alt=""><figcaption><p>Dragging the DS Lab Runner to the Pipeline canvas</p></figcaption></figure>

* The DS Lab Model runner requires input data from an Event and sends the processed data to another Event. So, create two events and drag them onto the Workspace.
* Connect the input and output events with the DS Lab Runner component as displayed below.

<figure><img src="https://content.gitbook.com/content/vmyGSlDvDj86v7eh3RHM/blobs/SNpJJkl0CavOSwGB5GZH/MicrosoftTeams-image%20(111).png" alt=""><figcaption></figcaption></figure>

* The data in the input event can come from any Ingestion, readers, any script from DS Lab Module or shared events.
* Click the DS Lab Model runner component to get the component properties tabs below.

<figure><img src="https://content.gitbook.com/content/vmyGSlDvDj86v7eh3RHM/blobs/ZJcZJw5ptHaYo5Gvr0Sh/image.png" alt=""><figcaption></figcaption></figure>

## **Basic Information**

* It is the default tab to open for the component.         &#x20;
* Select an Invocation type from the drop-down menu to confirm the running mode of the reader component. Select the _**Real-Time**_ or _**Batch**_ option from the drop-down menu.                                                                                                       &#x20;

{% hint style="info" %}
_<mark style="color:green;">Please Note:</mark> If the selected Invocation Type option is Batch, then Grace Period (in sec)\* field appears to provide the grace period for component to go down gracefully after that time._
{% endhint %}

* **Deployment Type:** It displays the deployment type for the component. This field comes pre-selected.
* **Batch Size** (min 10): Provide the maximum number of records to be processed in one execution cycle (Min limit for this field is 10).&#x20;
* **Failover Event:** Select a failover Event from the drop-down menu.
* **Container Image Version:** It displays the image version for the docker container. This field comes pre-selected.
* **Description:** Description of the component. It is optional.

{% hint style="info" %}
_<mark style="color:green;">Please Note</mark>: The DS Lab Runner contains two execution types in its Meta Information tab._
{% endhint %}

<details>

<summary>DS Lab Runner as Model Runner</summary>

It allows to run a model that you have created on DS Lab Module by simply registering the model to use it in pipeline.

</details>

<details>

<summary>DS Lab Runner as Script Runner</summary>

It allows to run a script that you have exported from DS Lab Module to pipeline.

</details>

{% hint style="success" %}
_Please follow the demonstration to use the DS Lab Runner as **Model Runner.**_
{% endhint %}

{% embed url="https://files.gitbook.com/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fuq3RSHHup7fjHYaspk7y%2Fuploads%2FkawGCkdu7nj1hh8ewgpT%2Fdslab_model_runeer_AdobeExpress.mp4?alt=media&token=5c3d857d-c539-4a42-8cff-a9adcee83736" %}
Configuring the 'Model Runner​' as execution type in DSLab Runner
{% endembed %}

## Meta Information Tab (as Model Runner)

### Model Runner as Execution Type

Please follow the below steps to configure the Meta Information when the **Model Runner** is selected as execution type:

* **Project Name:** Name of the project where you have created your model in DS Lab Module.
* **Model Name:** Name of the saved model in Project under the DS Lab module.&#x20;

<figure><img src="https://content.gitbook.com/content/vmyGSlDvDj86v7eh3RHM/blobs/K0zVCzEicwZxYJz97G1h/image.png" alt=""><figcaption><p>Configuring the Model Runner​ as an execution type in the Meta Information</p></figcaption></figure>

{% hint style="success" %}
_Please follow the demonstration to configure the component for Execution Type as **Script Runner** as **Execution Type**._
{% endhint %}

{% embed url="https://files.gitbook.com/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fc39ZvXI46qjXzpN3rYAg%2Fuploads%2FBelY7i6O47FYh435V4nK%2F2023-10-12-18-02-05%20(online-video-cutter.com)%20(1).mp4?alt=media&token=d0fbdaf0-7169-4ba7-b467-9485c55897d9" %}
Configuring the Script Runner​ as an execution type in DS Lab Runner
{% endembed %}

### Script Runner as Execution Type

Please follow the below-given steps to configure the Meta Information when the **Script Runner** is selected as _**Execution Type**_:

* **Function Input Type:** Select the input type from the drop down. There are two option in this field:
  1. Data Frame&#x20;
  2. List
* **Project Name:** Name of the project where you have created your model in DS Lab Module.
* **Script Name:** Select the script which has been exported from notebook in DS Lab module. The script written in DS Lab module should be inside a function.
* **External Library:** If any external libraries used in the script we can mention here. We can mention multiple libraries by giving comma(,) in between the names.
* **Start Function:** Select the function name in which the script has been written.
* **Script:** The Exported script appears under this space.
* **Input Data:** If any parameter has been given in the function, then the name of the parameter is provided as **Key** and value of the parameters has to be provided as **value** in this field.

<figure><img src="https://content.gitbook.com/content/vmyGSlDvDj86v7eh3RHM/blobs/AMOFpwfiSJIydkqxvIGO/image.png" alt=""><figcaption><p>Configuring the Script Runner​ as an execution type in the Meta Information</p></figcaption></figure>

## **Saving the DS Lab Runner Component**

* Click the _**Save Component in Storage**_![](https://content.gitbook.com/content/vmyGSlDvDj86v7eh3RHM/blobs/HQgmiA1NLPOsz6qW4VwB/image.png) icon.
* A success notification message appears when the component gets saved.
* The DS Lab Runner component reads the data coming to the input event, runs the model and gives the output data with predicted columns to the output event.
