Configure the Arena client

更新时间:
复制 MD 格式

Arena is a lightweight Kubernetes-based machine learning solution that supports the full lifecycle from data preparation through model development, training, and prediction. It integrates deeply with Alibaba Cloud services such as GPU sharing and CPFS. This topic explains how to configure the Arena client.

Prerequisites

Ensure you have the following resources ready:

Step 1: Connect to the cluster

Connection method depends on your cluster type.

ACK managed clusters

ACK managed clusters have no master nodes. Install Arena on your local machine (e.g., macOS) and connect via kubeconfig.

ACK dedicated clusters

Log in to a master node via SSH, then run Arena commands directly.

Run kubectl get nodes to verify your kubeconfig.

Step 2: Install the Arena client

Select the package for your OS and architecture.

Linux/amd64

# Download the Arena installation package.
wget https://aliacs-k8s-cn-hangzhou.oss-cn-hangzhou.aliyuncs.com/arena/arena-installer-0.12.0-linux-amd64.tar.gz

# Extract the package.
tar -zxvf arena-installer-0.12.0-linux-amd64.tar.gz

# Install Arena.
cd arena-installer-0.12.0-linux-amd64
bash install.sh --only-binary

Linux/arm64

# Download the Arena installation package.
wget https://aliacs-k8s-cn-hangzhou.oss-cn-hangzhou.aliyuncs.com/arena/arena-installer-0.12.0-linux-arm64.tar.gz

# Extract the package.
tar -zxvf arena-installer-0.12.0-linux-arm64.tar.gz

# Install Arena.
cd arena-installer-0.12.0-linux-arm64
bash install.sh --only-binary

macOS/amd64

# Download the Arena installation package.
wget https://aliacs-k8s-cn-hangzhou.oss-cn-hangzhou.aliyuncs.com/arena/arena-installer-0.12.0-darwin-amd64.tar.gz

# Extract the package.
tar -zxvf arena-installer-0.12.0-darwin-amd64.tar.gz

# Install Arena.
cd arena-installer-0.12.0-darwin-amd64
bash install.sh --only-binary

macOS/arm64

# Download the Arena installation package.
wget https://aliacs-k8s-cn-hangzhou.oss-cn-hangzhou.aliyuncs.com/arena/arena-installer-0.12.0-darwin-arm64.tar.gz

# Extract the package.
tar -zxvf arena-installer-0.12.0-darwin-arm64.tar.gz

# Install Arena.
cd arena-installer-0.12.0-darwin-arm64
bash install.sh --only-binary

Step 3: (Optional) Enable shell auto-completion

Press Tab to complete partially typed Arena commands.

Install the completion package

CentOS or Linux

sudo yum install bash-completion -y

Debian or Ubuntu

sudo apt-get install bash-completion

macOS

brew install bash-completion@2

Enable auto-completion in your shell profile

bash (Linux)

echo "source <(arena completion bash)" >> ~/.bashrc
chmod u+x ~/.bashrc

bash (macOS)

echo "source $(brew --prefix)/etc/profile.d/bash_completion.sh" >> ~/.bashrc

Step 4: Verify the installation

Confirm Arena is working.

  1. Check available GPU resources in the cluster:

    arena top node

    Expected output:

    NAME                        IPADDRESS      ROLE    STATUS  GPU(Total)  GPU(Allocated)
    cn-huhehaote.192.168.X.XXX  192.168.0.117  <none>  ready   8           0
    cn-huhehaote.192.168.X.XXX  192.168.0.118  <none>  ready   8           0
    cn-huhehaote.192.168.X.XXX  192.168.0.119  <none>  ready   8           0
    cn-huhehaote.192.169.X.XXX  192.168.0.120  <none>  ready   8           0
    -----------------------------------------------------------------------------------------
    Allocated/Total GPUs In Cluster:
    0/32 (0%)
  2. Submit a test training job:

    arena submit tf \
          --name=firstjob \
          --gpus=1 \
          --image=registry.cn-hangzhou.aliyuncs.com/tensorflow-samples/tf-mnist-standalone:gpu \
          "python /app/main.py"

    Expected output:

    configmap/firstjob-tfjob created
    configmap/firstjob-tfjob labeled
    tfjob.kubeflow.org/firstjob created
    INFO[0001] The Job firstjob has been submitted successfully
    INFO[0001] You can run `arena get firstjob --type tfjob` to check the job status
  3. List all jobs:

    arena list

    Expected output:

    NAME      STATUS   TRAINER  AGE  NODE
    firstjob  RUNNING  TFJOB    5s   192.168.X.XXX
  4. Check the job status:

    arena get firstjob

    Expected output:

    STATUS: SUCCEEDED
    NAMESPACE: default
    PRIORITY: N/A
    TRAINING DURATION: 52s
    NAME      STATUS     TRAINER  AGE  INSTANCE          NODE
    firstjob  SUCCEEDED  TFJOB    14m  firstjob-chief-0  192.168.X.XXX
  5. View the job logs:

    arena logs --tail=10 firstjob

    Expected output:

    Accuracy at step 910: 0.9694
    Accuracy at step 920: 0.9687
    Accuracy at step 930: 0.9676
    Accuracy at step 940: 0.9678
    Accuracy at step 950: 0.9704
    Accuracy at step 960: 0.9692
    Accuracy at step 970: 0.9721
    Accuracy at step 980: 0.9696
    Accuracy at step 990: 0.9675
    Adding run metadata for 999

    The job completed successfully.

Related video

Watch how to install Arena and submit a Gang Scheduling job.

Next steps