All Products
Search
Document Center

Container Service for Kubernetes:Create an ASIC-accelerated cluster

Last Updated:Oct 10, 2023

Application-Specific Integrated Circuits (ASICs) are integrated circuits custom-designed based on specific algorithms to meet computing power and computing efficiency requirements. ASICs are small and power efficient. ASICs can ensure the reliability and confidentiality of your workloads and improve the computing efficiency. This topic describes how to create an ASIC-accelerated cluster in the Container Service for Kubernetes (ACK) console and how to use ASIC devices.

Prerequisites

An ACK Pro cluster or an ACK dedicated cluster is created.

Create an ASIC node pool

Select an ASIC-accelerated instance type when you create an ASIC node pool. For example, you can select the ecs.video-trans.26xhevc instance type. For more information about how to create a node pool, see Create a node pool. For more information about instance types, see Overview of instance families.

Note

If no ASIC-accelerated instance type is available, change the vSwitch of the node pool and try again.

View the ASIC devices mounted to a node

After you create a cluster, you can view the ASIC devices mounted to the nodes in the cluster.

  1. Log on to the ACK console. In the left-side navigation pane, click Clusters.

  2. On the Clusters page, click the name of the cluster that you want to manage and choose Nodes > Nodes in the left-side navigation pane.

  3. Find a worker node and choose More > Details in the Actions column to view the ASIC devices that are mounted to the worker node.

Use ASIC devices

You can use base images provided by NETINT on Docker Hub to build container images. For more information about the base images provided by NETINT, see netint/ni_xcoder_release. The following section describes how to submit a job that requests NETINT ASIC devices.

  1. Use kubectl to connect to the ACK cluster. For more information, see Obtain the kubeconfig file of a cluster and use kubectl to connect to the cluster.

  2. Run the following command to view the total number of NETINT ASIC devices that are mounted to a node in the cluster. The extended resource names of NETINT ASIC devices are netint.ca/ASIC.

    kubectl get nodes <NODE_NAME> -o yaml

    Expected output:

    netint.ca/ASIC: "12"

    The output indicates that the node is mounted with 12 NETINT ASIC devices.

  3. Submit a job that requests NETINT ASIC devices.

    1. Use the following YAML template to create a file named test-asic.yaml.

      apiVersion: batch/v1
      kind: Job
      metadata:
        name: test-asic
      spec:
        parallelism: 1
        template:
          metadata:
            labels:
              app: test-asic
          spec:
            containers:
            - name: test-asic
              image: registry.cn-beijing.aliyuncs.com/ai-samples/asic_258:asic
              command:
              - sleep
              - "500"
              resources:
                limits:
                  netint.ca/ASIC: 2 #Request two NETINT ASIC devices. 
            restartPolicy: Never
    2. Run the following command to submit the job:

      kubectl create -f test-asic.yaml
  4. Run the following command to check whether the pod is in the Running state:

    kubectl get po -l app=test-asic
  5. Run the following command to log on to the pod:

    kubectl exec -ti test-asic-zt6ck -- bash
  6. Run the following command in the pod to initialize the NETINT ASIC devices:

    ni_rsrc_mon
  7. Run the following command to check whether the NETINT ASIC devices are ready for use:

    bash run_ffmpeg.sh