Connect to a DLC task node for debugging

Updated at:

When a DLC training job fails, you often have nothing to work with except logs and guesswork. An environment connection lets you enter a specific node (Pod) of the DLC job from your DSW instance, inspect training processes and logs in the terminal, or have Agentic PAI Code run diagnostics on that node.

Prerequisites

  • A running DSW instance with Environment connection shown in the upper-right corner of the development environment.

  • Access to the target DLC job in the same region as the DSW instance, and a target Pod that is running.

Connect to a node through environment connection

Select the target node

  1. Log on to the PAI console, select the target region and workspace, and choose Model Development and Training > Interactive Modeling (DSW). In the Actions column of the target instance, click Open.

  2. In the upper-right corner of the development environment, click Environment connection, and then click New connection.

    • Workspace: The current workspace is searched by default. If the target job is in another workspace, select All workspaces in the same region.

    • DLC job: In the drop-down list, search by job name or job ID and select the target job.

    • Node (Pod): Select the node to debug. For a distributed job with multiple nodes, verify the Pod name.

Establish a connection to the node

Environment connection offers two modes: standard connection and enhanced connection. They differ in whether an Agent takes part and whether the connection has a time limit.

Connection mode

Scenario

Requirements and duration

Standard connection

Interactive debugging in a Terminal, such as viewing logs or checking processes.

Any available Pod works. No connection duration is required.

Enhanced connection

An Agent runs commands on the target Pod, or you re-enter the node from a Terminal while the connection is still valid.

The DSW instance and the DLC job must use the same Virtual Private Cloud (VPC). The connection duration starts when pairing succeeds.

The following table compares the two modes in detail:

Compare standard and enhanced connections

Item

Standard connection

Enhanced connection

Scenario

Temporarily enter a DLC task node to manually view logs, check processes, or run debugging commands.

Use Agentic PAI Code to run diagnostic tasks continuously on the target node, or enter the same node several times over a period.

Network requirements

The DSW instance and the DLC job don't need to share a Virtual Private Cloud (VPC).

The DSW instance and the DLC job must use the same VPC. Jobs that support enhanced connection show Enhanced available in the list.

Connection method

After you select a job and a node (Pod), the system opens a Terminal where you interact directly with the target node's shell.

After you select a job and a node, set the connection duration, and then follow the Terminal prompts to complete pairing. After pairing succeeds, both the Agent and the interactive terminal can use the connection.

Agent support

Manual operation is recommended. Parsing interactive terminal commands and output is error-prone for an Agent.

Recommended for Agent automation. An Agent can run commands one after another on a specific Pod and get each result through the same connection.

Connection validity

No connection duration is required. When debugging is done, enter exit or press Ctrl+D to leave the remote shell.

The connection duration starts when pairing succeeds. The default is 12 hours, and the maximum for the first setting is 24 hours. Before expiry, click Extend connection to add up to 24 hours per extension, for a total of up to 7 days.

Re-enter the node

After the connection closes, click Reconnect in the connection record.

While the connection is valid, click Terminal in the connection record to enter the same Pod again. After the connection closes or expires, click Reconnect.

Important

Both modes run commands with the permissions of the target identity. Writing files or stopping processes affects the target training environment. After you disconnect, your changes persist and background processes may keep running.

Establish a standard connection

  1. Select Standard connection and click Establish connection. In the confirmation dialog box, verify the job name and Pod ID, read the production environment notice, and then click Establish connection again.

  2. The system opens a Terminal. On first use, complete the confirmation as prompted in the Terminal. When the following message appears, you're in the target Pod and can run debugging commands.

    # connected to <Pod name> (Ctrl-D or 'exit' to quit)
  3. When debugging is done, enter exit or press Ctrl+D to leave the remote shell.

Establish an enhanced connection

  1. In the job list, select a job marked Enhanced available, select the target Pod, and then select Enhanced connection. In Management duration, enter the connection duration in hours. The default is 12 hours and the maximum is 24 hours.

  2. Click Establish connection. Verify the job name, Pod ID, and connection duration, read the notice, and then click Establish connection again and follow the Terminal prompts to complete pairing.

  3. Return to the environment connection list. After the target record shows In progress and an expiry time, click Terminal in that row to enter the same Pod again.

Connect to a node with Agentic PAI Code

  1. Open Agentic PAI Code from the DSW launcher and enter the following example instruction in the dialog box.

    /pai-dsw-connect Connect to the running DLC job that was started most recently in the current workspace and supports enhanced connection. If there are multiple Pods, list them first so I can choose.
  2. Confirm the target as prompted. After the connection succeeds, verify the job ID and Pod name in the response. In the same session, you can continue with an instruction such as "List the 5 processes using the most memory on the Pod you just connected to."

Important

Commands from the terminal and from the Agent both run with the permissions of the target identity. Operations such as writing files or stopping processes affect the running training job.

Manage connections

In the upper-right corner of the development environment, click Environment connection. You can search records by job ID, connection ID, or Pod ID, and filter them by start time, connection mode, or status.

Operation

Applicable records

Description

Open terminal

In-progress enhanced connections

Click Terminal to enter the target Pod through the existing connection.

Extend connection

In-progress enhanced connections

Click Extend connection, verify the current expiry time, enter the extension duration, and confirm. Each extension can add up to 24 hours, and the total validity from successful pairing is up to 7 days.

Disconnect

In-progress connections

Click Disconnect, verify the Pod ID and connection ID, and confirm. Changes that have been made persist and background processes may keep running.

Reconnect

Closed, expired, or failed connections

Verify that the target Pod is still running, click Reconnect, and follow the on-screen prompts.

Delete record

Closed, expired, or failed connections

Click Delete record, or select multiple deletable records and click Batch delete.

FAQ

Q: What do I do if I can't find the target job or Pod?

Check the workspace scope and region, search again by job ID, and click Refresh in the job or Pod list. If the job has ended and the Pod has been released, view the historical logs on the DLC job details page. To open a terminal, select a Pod that is still running.

Q: Why can't I select enhanced connection?

Select the DLC job and node first, then check whether the job is marked Enhanced available. Verify that the DSW instance and the DLC job use the same VPC ID. If you only need to debug manually in a terminal, use the standard connection offered on the page.

Q: How do I troubleshoot a failed connection?

Click the status icon next to Failed in the connection list to view the failure reason. Verify the job and node status, resolve the issue as prompted, and click Reconnect. The same record also lets you re-establish an expired enhanced connection.