Create a Shell task

更新时间:
复制 MD 格式

Create a Shell offline computing task in Dataphin to run custom scripts on a schedule or on demand.

Limitations

  • You can add a dataset only after you enable the unstructured data feature.

  • Only Shell tasks in a Basic project support referencing datasets.

Permissions

The following project roles can use all datasets within the project in the task's Dataset properties:

  • Dev and Basic projects: project administrator, developer, and analyst.

  • Prod projects: project administrator and operator.

  • Custom project roles with the Dataset - Use permission.

Procedure

  1. In the top navigation bar of the Dataphin homepage, choose Development > Data Development.

  2. On the Development page, select a Project. In Dev-Prod mode, also select an environment.

  3. In the navigation pane on the left, choose Data Processing > Compute Task. In the Compute Task list, click the image icon and select Shell.

  4. In the Create Shell Task dialog box, configure the following parameters.

    Parameter

    Description

    Task name

    Enter the task name.

    Maximum 256 characters. The following characters are not allowed: | / \ : ? <> * "

    Scheduling type

    Select a scheduling type. Options:

    • Periodic Task: Runs automatically on a schedule.

    • Manual Task: Runs only when triggered manually.

    Select directory

    Select the folder to store the task.

    To create a new folder:

    1. Above the task list, click the image icon to open the Create Folder dialog box.

    2. In the Create Folder dialog box, enter a Name and optionally select a directory.

    3. Click OK.

    Use template

    Turn on Use Template to apply a code template, then select a template and template version.

    Template code is read-only — configure only the parameters. Create an offline computing template.

    Python third-party package

    Select Python third-party packages. Install a Python module.

    Note

    After adding a module, declare it in the task before importing it in your code. Configure referenced modules in the task's Python third-party package properties.

    Description

    Enter a task description. Maximum 1,000 characters.

  5. Click OK.

  6. In the code editor, write your Shell script. Click Run in the toolbar to execute it.

  7. In the right-side pane, click Properties. In the Properties panel, configure General, Runtime resources, Python third-party package, Dataset, Runtime parameters, Scheduling properties, Scheduling dependencies, Runtime configurations, and Resource configurations.

  8. On the Shell task tab, save and submit the task.

    1. In the toolbar, click the image icon to save.

    2. Click the image icon to submit.

  9. On the Submission Details page, review the Content to Submit and pre-check results, then enter any remarks. Submission instructions for offline compute tasks.

  10. Click OK and Submit.

Next steps