Install MaxFrame in a DataWorks runtime image

Updated at:

This topic describes how to use a custom runtime image in DataWorks Image Management to install MaxFrame and develop applications. This approach helps you quickly build a development environment and avoid version conflicts with other environments.

Prerequisites

Procedure

Step 1: Create a custom runtime image

  1. Log on to the DataWorks console. In the left-side navigation pane, click Image Management.

  2. On the Custom Images tab, click Create Image. In the dialog box that appears, configure the following key parameters:

    Parameter

    Description

    Image Name

    The name of the custom runtime image.

    Image Description

    The description of the custom runtime image.

    Reference Data Type

    Select DataWorks Official Image.

    Image Namespace

    This parameter is fixed to DataWorks Default.

    Image Repository

    This parameter is fixed to DataWorks Default.

    Image Name/ID

    From the drop-down list, select an official runtime image provided by DataWorks. For this topic, select dataworks_pyodps_task_pod:prod_20251201 (System_pyodps_20251201).

    Visible Scope

    Sets the visibility of the custom image. The options are Visible Only to Creator and Visible to all.

    Module

    Currently, custom images can be used only in DataStudio.

    Supported Task Type

    • DataWorks official runtime image for Shell nodes: supports the Shell node type.

    • DataWorks official runtime image for PyODPS nodes: supports PyODPS 2 and PyODPS 3 node types. For this topic, select PyODPS 3.

    • DataWorks official runtime image for EMR DataLake Insight V5.15.1: supports EMR Spark, EMR Spark SQL, and EMR SHELL node types.

    Installation Package

    Add third-party packages as needed. The following methods are supported:

    • Quick Install: From the Installation Package drop-down list, select Python2, Python3, or Yum to directly select the environment or resource that you want to install.

      If the required third-party package is not in the drop-down list, switch to Script mode to manually install it.
    • Manual Input: From the Installation Package drop-down list, select Script. Enter installation commands in the script box. You can use the following example commands to download third-party packages.

      • pip example command: pip install xx. This command is for Python 2.

      • pip3 example command: /home/tops/bin/pip3 install 'urllib3<2.0' . This command is for Python 3.

      • yum example command: yum install -y git.

      • wget example command: wget git.

        For more information about installation commands, see Appendix: Installation command reference.
    • For this topic, select Script. In the script command box, enter the command to install MaxFrame. If MaxFrame is already installed, this command upgrades it to the latest version. The code is as follows.

      /home/tops/bin/pip3 install --upgrade maxframe
    Important

    If you need to install third-party packages or their dependencies from the internet, the VPC bound to the serverless resource group must have public internet access.

    For more information, see Create a custom image.

Step 2: Publish the runtime image

On the Image Management > Custom Images tab of the DataWorks console, Publish the target image. You can only publish images that have passed the test. If the test fails, you can click image > Modify in the Operation column of the target custom image to modify its configuration.

Perform the following steps:

  1. On the Image Management > Custom Images tab, click Publish in the Operation column of the target image to open the Publish Image dialog box.

  2. Configure the test parameters and click Test.

    Parameter

    Description

    Test Resource Group

    Select the serverless resource group to be used for the test.

    Test CU

    The compute resources to allocate for the test. Default: 0.5 CU. Minimum: 0.25 CU. If the image is large or the test takes a long time to pass, you can increase the CU value and retry.

  3. View the Test Result and Test Log.

    • After the test starts, the Test Result shows Testing. You can click Refresh to view the latest status, or click Cancel Test to end the current test. After canceling the test, you can select a different resource group or CU allocation and test again.

    • The Test Log section streams the command-line logs of the image build process in real time and provides the following operations: Maximize (view long logs in full screen), Copy (copy the full log to the clipboard with one click), Download (download as image-test-log-<imageID>.log), and Collapse/Expand.

    • If the test fails, the Test Result shows Test Failed, and an AI diagnosis panel automatically appears. The system provides a failure analysis and recommended solutions based on test logs and image layer information. Adjust the image configuration or installation commands based on the diagnosis and click Test Again.

    • After the test is successful, the Test Result shows Test Successful. If you need to change the test conditions and verify again, click Test Again.

  4. After the test passes, click Publish at the bottom of the dialog box. Published images can be used by DataWorks task nodes.

    Note

    The Publish button is enabled only when the Test result is Test Successful or Publish Failed. The button is disabled in other states, such as Testing, Test Failed, and Published.

Note the following when you test and publish an image:

  • When you test a custom image, select a serverless resource group.

  • If you create an image based on an Alibaba Cloud Container Registry image or create an image from a personal development environment, ensure that the VPC bound to the serverless resource group for testing is the same as the VPC bound to the ACR image instance.

  • If the custom image you configured retrieves third-party packages from the internet and the test does not pass for a long time, check whether the VPC bound to the Test Resource Group has public internet access.

  • If a build failure occurs during image testing or publishing (for example, the publish status shows Published (build failed)), the console may only display Build Failed without providing detailed reasons, which makes self-service troubleshooting difficult. A common scenario is insufficient disk space in the build environment. The disk space required during the build phase may be slightly higher than during the test phase. As a result, the test may pass, but the process fails when the image artifacts are published or generated. Try increasing the Calculate CU (for example, by 0.5 CU) and retrying. If the issue persists, submit a ticket to contact Alibaba Cloud Technical Support for assistance.

Step 3: Change the workspace of the runtime image

  1. On the Image Management > Custom Images tab of the DataWorks console, find the Published custom image.

  2. In the Operation column of the target image, click image > Change Workspace to bind the custom image to a workspace.

Step 4: Use the runtime image

Use an image in legacy DataStudio

  1. Go to DataStudio: Log on to the DataWorks console, switch to the target region, and click Data Development and O&M > DataStudio in the left-side navigation pane. Select the desired workspace from the drop-down list and click Data Analytics.

  2. Configure the image: In DataStudio, find the task node for which you want to test the custom image, click Scheduling Settings on the right side, and then configure resource properties in the Scheduling Settings section.

    • Resource Group for Scheduling: Select a serverless resource group.

      If the target resource group is not displayed, check whether it is bound to the current workspace. You can go to the Resource Groups page, find the target resource group, and then click Associate Workspace in the Operation column to complete the binding.
      Important

      To ensure that task nodes run as expected, make sure that the Resource Group for Scheduling is the same as the Test Resource Group that you selected when you Publish Image.

    • Image: Select a published custom image.

      If you switch images, you must republish the node for the change to take effect.
  3. Debug the node: In the top toolbar, click Run with Parameters (image). In the dialog box that appears, configure Resource Group Name, CUs for Node Running, and Image, and then click Run.

  4. Publish the node: In the top toolbar, click Save and Commit to publish the node to the production environment.

Use an image in the new DataStudio

  1. Go to DataStudio: Go to the DataWorks Workspaces page, switch to the target region at the top, find the target workspace, and then click Shortcuts > DataStudio in the Operation column.

  2. Configure the image: In DataStudio, find the task node for which you want to test the custom image, click Scheduling Settings on the right side, and then configure resource properties.

    • Resource Group: Select a serverless resource group.

      If the target resource group is not displayed, check whether it is bound to the current workspace. You can go to the Resource Groups page, find the target resource group, and then click Associate Workspace in the Operation column to complete the binding.
      Important

      To ensure that task nodes run as expected, make sure that the Resource Group is the same as the Test Resource Group that you selected when Publish Image.

    • Image: Select a published custom image.

      If you switch images, you must republish the node for the change to take effect.

      In the Scheduling configurations > Scheduling properties panel, configure Resource group and compute CU (for example, 0.5), and select an image from the Image drop-down list.

  3. Debug the node: In the Run Configuration panel on the right side of the node, configure Computing Resources, Resource Group, Calculate CU, Image, and Script Parameters, and then click Run in the top toolbar.

  4. Publish the node: In the top toolbar, click Publish to publish the node to the production environment.

For more information about DataWorks custom runtime images, see Custom image.