Configure a notebook node

Updated at:

In task orchestration, you can use a notebook node to periodically run .ipynb files to automate tasks such as generating reports or training AI models.

Prerequisites

Complete the following operations:

Procedure

  1. Log in to DMS 5.0.

  2. Move the pointer over the 2023-01-28_15-57-17.png icon in the upper-left corner and choose All Features > Data+AI > Data Development > Task Orchestration.

    Note

    If you use the DMS console in normal mode, choose Data+AI > Data Development > Task Orchestration in the top navigation bar.

  3. Create a task flow.

    Click Create Task Flow. In the dialog box, configure Business Scenario and Task Flow Name, and then click OK.

  4. Create a notebook node.

    From the Task Type list on the left side of the canvas, drag Notebook to a blank area on the canvas.

  5. Configure the notebook node.

    Double-click the node to open its configuration page. Configure parameters such as Workspace, Compute Resource, and Notebook file.

    The Type of a runtime parameter can be string, number, or boolean.

    Note

    The key of a runtime parameter corresponds to a variable name in the notebook file. The value can be a constant or a variable, such as the system variable ${bizdate}.

  6. Configure the scheduling cycle for the task flow.

    At the bottom of the task flow configuration page, click Task Flow Information and configure the parameters in the Scheduling Settings section. The following scheduling types are available:

  7. Test the node.

    If the last line of the run log shows status SUCCEEDED, the test run is successful. The following example shows a successful run:

    2024-09-23 17:44:02[GMT+08:00] INFO - Finishing job j_299*** at 172708464**** with status SUCCEEDED
    Note
    • DMS generates a new .ipynb file each time a notebook node runs.

    • If the test run fails (the run log shows status FAILED), check the log to find the cause, fix the configuration, and then try again.

Notebook run results

  1. In the upper-right corner of the task flow configuration page, click Go to O&M.

    Note

    Alternatively, on the task flow list page, click O&M.

  2. On the Run History tab, select a trigger type, such as a scheduled trigger or manual trigger.

  3. Click View Notebook.

    This button is in the Actions column for the sub-task on the run history page.

    The system redirects you to the generated .ipynb file.

    # Cell [1] (parameters)
    a = 1
    # Cell [2] (injected-parameters)
    # Parameters
    a = "2024-09-22"
    # Cell [3]
    print(a)
    # Output: 2024-09-22