kae-driver-installer:基于 Kubernetes 的鲲鹏加速引擎驱动安装组件

用户可借助此项目在 Kubernetes 节点上自动安装、升级和维护鲲鹏加速引擎(KAE)驱动,确保硬件与内核兼容。它能检测节点信息、处理依赖、验证安装并支持回滚,采用 Job 模式运行,适配多种鲲鹏服务器型号。【此简介由AI生成】

Branch1Tags0
FilesLast commitLast update
1 year ago
1 year ago
2 years ago
2 years ago
2 years ago
5 months ago
5 months ago
2 years ago
2 years ago

KAE Driver Installer

Function

KAE Driver Installer is a containerized driver installation component designed specifically for Kunpeng Acceleration Engine (KAE), responsible for automatically installing, upgrading, and maintaining the drivers required for KAE accelerator cards on Kubernetes nodes, ensuring hardware and operating system kernel compatibility. Specifically includes:

  • Detecting node kernel version and hardware model to match corresponding driver versions.
  • Handling driver dependencies (such as kernel modules, firmware files).
  • Driver installation verification (such as confirming module loading success through modprobe).
  • Supporting driver rollback (automatically restoring to previous version when new version installation fails).

Feature Introduction

  • Belongs to the underlying driver management layer of KAE resources, directly interacting with the host machine.
  • Runs in Job mode to ensure reliable execution of one-time tasks.
  • Supports driver adaptation for multiple Kunpeng server models.

Getting Started

Prerequisites

  • Nodes must be equipped with Kunpeng processors (aarch64 architecture) and KAE accelerator hardware.
  • Nodes have joined the Kubernetes cluster and can be scheduled (no taints affecting Pod operation).
  • Node kernel version must be compatible with the target KAE driver version (refer to official compatibility matrix).
  • Cluster has deployed KAE Operator (recommended) or has Job resource creation permissions.

Automatic Invocation via KAE Operator

  1. Specify the driver version in the KAE Operator CR configuration, and the Operator will automatically trigger kae-driver-installer:

    # kae-cluster.yaml
    apiVersion: kae.example.com/v1alpha1
    kind: KAECluster
    metadata:
    name: kae-cluster
    spec:
    driver:
        version: v1.3.0  # Specify driver version
        installTimeout: 300s
    nodeSelector:
        kae: enabled  # Only install on nodes with matching labels
    
  2. After applying the configuration, view the installation progress:

    # View driver installation Job
    kubectl get jobs -n <namesapce> -l app=kae-driver-installer
    
    # View installation logs
    kubectl logs <pod-name> -n <namesapce> -f
    

Local Build

Image Build

Build Parameters

  • GOPRIVATE: Configure Go language private repository, equivalent to the GOPRIVATE environment variable.
  • COMMIT: Hash value of the current git commit.
  • VERSION: Component version.
  • SOURCE_DATE_EPOCH: Timestamp of the image rootfs.

Build Commands

  • Build and push to specified OCI repository.

    Using docker
    docker buildx build . -f <path/to/dockerfile> \
        -o type=image,name=<oci/repository>:<tag>,oci-mediatypes=true,rewrite-timestamp=true,push=true \
        --platform=linux/amd64,linux/arm64 \
        --provenance=false \
        --build-arg=GOPRIVATE=gopkg.openfuyao.cn \
        --build-arg=COMMIT=$(git rev-parse HEAD) \
        --build-arg=VERSION=0.0.0-latest \
        --build-arg=SOURCE_DATE_EPOCH=$(git log -1 --pretty=%ct)
    
    Using nerdctl
    nerdctl build . -f <path/to/dockerfile> \
        -o type=image,name=<oci/repository>:<tag>,oci-mediatypes=true,rewrite-timestamp=true,push=true \
        --platform=linux/amd64,linux/arm64 \
        --provenance=false \
        --build-arg=GOPRIVATE=gopkg.openfuyao.cn \
        --build-arg=COMMIT=$(git rev-parse HEAD) \
        --build-arg=VERSION=0.0.0-latest \
        --build-arg=SOURCE_DATE_EPOCH=$(git log -1 --pretty=%ct)
    

    Where <path/to/dockerfile> is the Dockerfile path ./build/Dockerfile, <oci/repository> is the image address, and <tag> is the image tag.

  • Build and export OCI Layout to local tarball.

    Using docker
    docker buildx build . -f <path/to/dockerfile> \
        -o type=oci,name=<oci/repository>:<tag>,dest=<path/to/oci-layout.tar>,rewrite-timestamp=true \
        --platform=linux/amd64,linux/arm64 \
        --provenance=false \
        --build-arg=GOPRIVATE=gopkg.openfuyao.cn \
        --build-arg=COMMIT=$(git rev-parse HEAD) \
        --build-arg=VERSION=0.0.0-latest \
        --build-arg=SOURCE_DATE_EPOCH=$(git log -1 --pretty=%ct)
    
    Using nerdctl
    nerdctl build . -f <path/to/dockerfile> \
        -o type=oci,name=<oci/repository>:<tag>,dest=<path/to/oci-layout.tar>,rewrite-timestamp=true \
        --platform=linux/amd64,linux/arm64 \
        --provenance=false \
        --build-arg=GOPRIVATE=gopkg.openfuyao.cn \
        --build-arg=COMMIT=$(git rev-parse HEAD) \
        --build-arg=VERSION=0.0.0-latest \
        --build-arg=SOURCE_DATE_EPOCH=$(git log -1 --pretty=%ct)
    

    Where <path/to/dockerfile> is the Dockerfile path ./build/Dockerfile, <oci/repository> is the image address, <tag> is the image tag, and path/to/oci-layout.tar is the tar package path.

  • Build and export image rootfs to local directory.

    Using docker
    docker buildx build . -f <path/to/dockerfile> \
        -o type=local,dest=<path/to/output>,platform-split=true \
        --platform=linux/amd64,linux/arm64 \
        --provenance=false \
        --build-arg=GOPRIVATE=gopkg.openfuyao.cn \
        --build-arg=COMMIT=$(git rev-parse HEAD) \
        --build-arg=VERSION=0.0.0-latest
    
    Using nerdctl
    nerdctl build . -f <path/to/dockerfile> \
        -o type=local,dest=<path/to/output>,platform-split=true \
        --platform=linux/amd64,linux/arm64 \
        --provenance=false \
        --build-arg=GOPRIVATE=gopkg.openfuyao.cn \
        --build-arg=COMMIT=$(git rev-parse HEAD) \
        --build-arg=VERSION=0.0.0-latest
    

    Where <path/to/dockerfile> is the Dockerfile path ./build/Dockerfile and path/to/output is the local directory path.

Helm Chart Build

  • Package Helm Chart.

    helm package <path/to/chart> -u \
        --version=0.0.0-latest \
        --app-version=openFuyao-v25.09
    

    Where <path/to/chart> is the Chart folder path.

  • Push Chart package to specified OCI repository.

    helm push <path/to/chart.tgz> oci://<oci/repository>:<tag>
    

    Where <path/to/chart.tgz> is the Chart package path, <oci/repository> is the Chart package push address, and <tag> is the Chart package tag.

Introduction

用户可借助此项目在 Kubernetes 节点上自动安装、升级和维护鲲鹏加速引擎(KAE)驱动,确保硬件与内核兼容。它能检测节点信息、处理依赖、验证安装并支持回滚,采用 Job 模式运行,适配多种鲲鹏服务器型号。【此简介由AI生成】

Customize your domain