You need to enable JavaScript to run this app.
Lake AI Service

Lake AI Service

Copy page
Download PDF
Resources and data processing
Overview of data processing tasks
Copy page
Download PDF
Overview of data processing tasks

The core resource for LAS data processing is the queue: it provides all the CPU, GPU, and memory required for running operators and scripts. The development machine, task management, and workflow are all built on the queue, each addressing the challenges of debugging, batch execution, and complex scheduling in their respective phases. This article introduces the dependencies and collaboration methods among the four core modules of LAS data processing—queue, development machine, task management, and workflow.

Key features

The core modules of LAS data processing (development machine / task management / workflow) rely on the underlying queue and read scripts, container images, data, and operator templates from external resources.
Image
The division of responsibilities and dependencies among the four modules is as follows:

Module

Problems solved

Relationship with other modules

Queue

Provides CPU / GPU computing resources

Shared among DevBox, tasks, and workflows; divided into dedicated queues (EMR Serverless) and compute queues (LAS queues), with dedicated queues officially recommended

DevBox

Interactive debugging of operator code

Runs on the specified queue, reads TOS / image repository / dataset; after debugging the code, migrate it to task management for batch execution

Task management

Submit batch or periodic tasks

Select a queue to consume resources; supports three task types: Daft, Python, and Spark; operator templates and environment variable lists can be obtained from the operator marketplace

Workflow

Multi-task DAG orchestration and scheduling

Organize multiple tasks into a DAG with dependencies, and submit task instances to the queue sequentially upon triggering

Data processing workflow

General workflow

The complete workflow from creating a queue to viewing results, including debugging and scheduling branches (Daft / Python / Spark), typically consists of the following six steps:
Image
Main workflow: Create a queue → Create a development machine → Upload code to TOS → Create a task → Submit to the queue for execution → View task instances. The upper branches represent three trigger methods, and the lower dashed line indicates the parameter iteration loop.

  • Main workflow: Create a queue → Debug on the development machine → Upload code to TOS → Create a task → Submit to the queue for execution → View instance logs and results.
  • Trigger methods: After a task is created, it can be triggered in three ways: manual execution / periodic scheduling / workflow orchestration. If the execution result does not meet expectations, return to the "Create task" step to adjust the script, environment variables, or resource parameters for iteration.

Operation example

Taking the offline operator "Video Key Frame Extraction" provided by the LAS Operator Plaza as an example, this section brings together all the modules mentioned above and demonstrates how to run an operator on the queue.

Prerequisites

  • A compute queue has already been created in the LAS console (it is recommended to use a dedicated queue), and permission to submit tasks has been granted. For details on the queue creation process, see Queue management.
  • A TOS bucket in the same region as LAS has been enabled for storing operator scripts and input/output data.
  • The "Video Key Frame Extraction" operator has been located in the LAS Operator Marketplace, and its environment variable list and entry command template have been recorded.

warning

When custom images are selected, tasks currently do not support running on dedicated queues (EMR Serverless queues); in this case, switch to LAS compute queues.

Step 1: Prepare the operator code and upload it to TOS

  1. Refer to the sample code for "Video Key Frame Extraction" in the Operator Marketplace, save the script as test.py, with a structure as shown below (refer to the Operator Marketplace for the actual structure):

    # test.py —— Example of an offline operator for video keyframe extraction
    import os
    import daft
    
    # 1. Read parameters specified by the operator marketplace from environment variables
    input_uri  = os.getenv("INPUT_URI")        # Input video directory, for example tos://your-bucket/videos/
    output_uri = os.getenv("OUTPUT_URI")       # Keyframe output directory
    frame_rate = float(os.getenv("FRAME_RATE", "1.0"))  # Frame extraction frequency (frames/second)
    model_path = os.getenv("MODEL_PATH", "/mnt/data/keyframe_model")
    
    # 2. Use Daft to read the video and call the keyframe extraction operator
    df = daft.read_video(input_uri)
    df = df.with_column(
        "keyframes",
        df["video"].apply_udf("keyframe_extract", fps=frame_rate, model=model_path),
    )
    
    # 3. Write the results back to TOS
    df.write_parquet(output_uri)
    
  2. Upload test.py to the TOS bucket in the same region as LAS, placing it at the designated path:

    tosutil cp ./test.py tos://test/test.py
    

    This example uses tos://test/ test.py as the script address and /test/ as the mount path within the task; for actual use, replace these with your own bucket name and directory.

Step 2: Create a task and mount the TOS directory

Go to LAS Console > Data Processing > Task Management > Create Task and fill in the basic information and environment information as follows:

Configuration items

Example values

Name

video-keyframe-extract

Task type

Daft (preferred for multimodal big data; Python can also be used for lightweight scripts)

Image

Built-in image: select the official LAS Daft image, or use a custom image recommended by the Operator Plaza

Storage path mounting

Mount type TOS, source path tos://test/, container mount path /test/

After mounting is complete, /test/ test.py inside the container at task startup will directly point to the script on TOS; any subsequent script changes only require re-uploading to TOS, without recreating the task.

Step 3: Fill in the environment variables as described in the Operator Marketplace

Open the "Video Key Frame Extraction" page in the LAS Operator Marketplace, and copy the key-value pairs listed in the "Environment Variables" section directly into the task's environment variable form. For example, in this case (refer to the Operator Marketplace for actual values):

Key

Value (example)

INPUT_URI

tos://your-bucket/videos/

OUTPUT_URI

tos://your-bucket/keyframes/

FRAME_RATE

1.0

MODEL_PATH

/mnt/data/keyframe_model

warning

The case of the environment variable Key must be exactly the same as in the Operator Plaza, so that os.getenv("...") in the script can read the value. If the Value contains spaces or special characters, it is recommended to paste it in text mode for centralized input to avoid truncation in single-line KV input.

Step 4: Submit the task to the specified queue and specify the entry command

Enter the actual execution statement in the entry command field. Since the script is already mounted at /test/ test.py, the most straightforward way to write it is:

python /test/test.py

In the Resources section on the right side of the page, select the queue prepared in Step 1 (for example, las-gpu-queue-a), and set the number of CPUs, memory, and GPUs for the Driver/Executor as needed. After confirming everything is correct, click Execute, and the task instance will immediately enter the queue for scheduling.

Step 5: View the execution results

Each time the task is triggered, a record will be generated on the "Task Instance" page. The execution status can be confirmed from three aspects:

  • Instance status: Running / Succeeded / Failed; when failed, hover the mouse to see a brief reason.
  • Log: Click "Log" to view the standard output and error stack of the Driver / Executor, which is used to locate script-level errors.
  • Daft UI: For Daft-type tasks, click "Daft UI" to jump to the Daft Web interface and view detailed metrics such as DAG, operator duration, and data volume distribution.

After the task succeeds, the extraction results will be written back to TOS according to OUTPUT_URI; use tosutil ls tos://your-bucket/keyframes/ or the object storage console to verify the output files.

Step 6: Adjust parameters and resources according to business requirements

After running the first instance successfully, it is usually necessary to make adjustments based on the scale of the business. The common directions for parameter tuning are as follows:

Adjust dimensions

Typical scenarios

Adjust position

Script parameters

Switch frame extraction algorithm and add post-processing logic

Modify test.py and re-upload to TOS; no need to change the task

Environment variables

Switch input/output buckets and adjust frame extraction frequency

Task details > Edit > Environment variables

Resource specifications

More GPUs or larger memory are required as video volume increases

When clicking "Execute", adjust the CPU/GPU/memory of the Driver/Executor in the pop-up window

Scheduling policy

Frame extraction needs to be scheduled every day at midnight

Task details > Advanced settings > Periodic scheduling, configure the effective time and interval

Multi-task orchestration

Feature extraction and database import are required after frame extraction

In "Workflow", chain multiple tasks into a DAG. For details, see Workflow

Last updated: 2026.07.03 15:29:32