build-devops-images #22
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: build-devops-images | |
permissions: | |
contents: write | |
pull-requests: read | |
actions: write | |
defaults: | |
run: | |
shell: bash | |
on: | |
workflow_dispatch: | |
inputs: | |
target: | |
description: 'Target' | |
required: true | |
type: choice | |
options: | |
- cann | |
- cpu | |
- cuda | |
- dtk | |
- hip | |
- musa | |
- oneapi | |
jobs: | |
cann: | |
if: ${{ inputs.target == 'cann' }} | |
runs-on: ubuntu-22.04 | |
strategy: | |
fail-fast: false | |
matrix: | |
cann_chip: | |
- '310p' | |
- '910b' | |
cann_version: | |
- '8.0.RC2.alpha003' | |
os_base: | |
- 'ubuntu' | |
os_version: | |
- '20.04' | |
steps: | |
- name: Maximize Docker Build Space | |
uses: gpustack/.github/.github/actions/maximize-docker-build-space@main | |
with: | |
root-reserve-mb: 1024 | |
temp-reserve-mb: 1024 | |
swap-size-mb: 1024 | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
repository: 'cosdt/dockerfiles' | |
ref: '99aaac257b3a98c059b0c055bc1c8d31e6c4fc99' | |
fetch-depth: 1 | |
persist-credentials: false | |
- name: Setup QEMU | |
uses: docker/setup-qemu-action@v3 | |
with: | |
image: tonistiigi/binfmt:qemu-v8.1.5 | |
platforms: "arm64" | |
- name: Setup Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Login DockerHub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.CI_DOCKERHUB_USERNAME }} | |
password: ${{ secrets.CI_DOCKERHUB_PASSWORD }} | |
- name: Prepare | |
id: prepare | |
run: | | |
curl -sL https://raw.githubusercontent.com/gpustack/.github/refs/heads/main/cann/ubuntu/Dockerfile.suffix >> ${{ github.workspace }}/cann/${{ matrix.os_base }}/Dockerfile | |
echo "cann_version_lowercase=$(echo "${{ matrix.cann_version }}" | tr '[:upper:]' '[:lower:]')" >> ${GITHUB_OUTPUT} | |
- name: Package | |
uses: docker/build-push-action@v6 | |
with: | |
push: true | |
file: ${{ github.workspace }}/cann/${{ matrix.os_base }}/Dockerfile | |
context: ${{ github.workspace }}/cann | |
platforms: 'linux/amd64,linux/arm64' | |
build-args: | | |
CANN_VERSION=${{ matrix.cann_version }} | |
CANN_CHIP=${{ matrix.cann_chip }} | |
BASE_VERSION=${{ matrix.os_version }} | |
PY_VERSION=3.9 | |
tags: 'gpustack/devel-ascendai-cann:${{ steps.prepare.outputs.cann_version_lowercase }}-${{ matrix.cann_chip }}-${{ matrix.os_base }}${{ matrix.os_version }}' | |
cache-from: | | |
type=registry,ref=gpustack/build-cache:devel-ascendai-cann-${{ steps.prepare.outputs.cann_version_lowercase }}-${{ matrix.cann_chip }}-${{ matrix.os_base }}${{ matrix.os_version }} | |
cache-to: | | |
type=registry,mode=max,oci-mediatypes=false,compression=gzip,ref=gpustack/build-cache:devel-ascendai-cann-${{ steps.prepare.outputs.cann_version_lowercase }}-${{ matrix.cann_chip }}-${{ matrix.os_base }}${{ matrix.os_version }},ignore-error=true | |
provenance: true | |
sbom: true | |
cpu: | |
if: ${{ inputs.target == 'cpu' }} | |
runs-on: ubuntu-22.04 | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- os_base: 'centos' | |
os_version: '7' | |
- os_base: 'rockylinux' | |
os_version: '8.9' | |
- os_base: 'ubuntu' | |
os_version: '18.04' | |
steps: | |
- name: Maximize Docker Build Space | |
uses: gpustack/.github/.github/actions/maximize-docker-build-space@main | |
with: | |
root-reserve-mb: 1024 | |
temp-reserve-mb: 1024 | |
swap-size-mb: 1024 | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 1 | |
persist-credentials: false | |
- name: Setup QEMU | |
uses: docker/setup-qemu-action@v3 | |
with: | |
image: tonistiigi/binfmt:qemu-v8.1.5 | |
platforms: "arm64" | |
- name: Setup Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Login DockerHub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.CI_DOCKERHUB_USERNAME }} | |
password: ${{ secrets.CI_DOCKERHUB_PASSWORD }} | |
- name: Package | |
uses: docker/build-push-action@v6 | |
with: | |
push: true | |
file: ${{ github.workspace }}/cpu/${{ matrix.os_base }}/Dockerfile | |
context: ${{ github.workspace }}/cpu | |
platforms: 'linux/amd64,linux/arm64' | |
build-args: | | |
BASE_VERSION=${{ matrix.os_version }} | |
tags: 'gpustack/devel-cpu:${{ matrix.os_base }}${{ matrix.os_version }}' | |
cache-from: | | |
type=registry,ref=gpustack/build-cache:devel-cpu-${{ matrix.os_base }}${{ matrix.os_version }} | |
cache-to: | | |
type=registry,mode=max,oci-mediatypes=false,compression=gzip,ref=gpustack/build-cache:devel-cpu-${{ matrix.os_base }}${{ matrix.os_version }},ignore-error=true | |
provenance: true | |
sbom: true | |
cuda: | |
if: ${{ inputs.target == 'cuda' }} | |
runs-on: ubuntu-22.04 | |
strategy: | |
fail-fast: false | |
matrix: | |
cuda_version: | |
- '12.4.0' | |
- '11.8.0' | |
os_base: | |
- 'centos' | |
os_version: | |
- '7' | |
steps: | |
- name: Maximize Docker Build Space | |
uses: gpustack/.github/.github/actions/maximize-docker-build-space@main | |
with: | |
root-reserve-mb: 1024 | |
temp-reserve-mb: 1024 | |
swap-size-mb: 1024 | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 1 | |
persist-credentials: false | |
- name: Setup QEMU | |
uses: docker/setup-qemu-action@v3 | |
with: | |
image: tonistiigi/binfmt:qemu-v8.1.5 | |
platforms: "arm64" | |
- name: Setup Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Login DockerHub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.CI_DOCKERHUB_USERNAME }} | |
password: ${{ secrets.CI_DOCKERHUB_PASSWORD }} | |
- name: Package | |
uses: docker/build-push-action@v6 | |
with: | |
push: true | |
file: ${{ github.workspace }}/cuda/${{ matrix.os_base }}/Dockerfile | |
context: ${{ github.workspace }}/cuda | |
platforms: 'linux/amd64' | |
build-args: | | |
CUDA_VERSION=${{ matrix.cuda_version }} | |
BASE_VERSION=${{ matrix.os_version }} | |
tags: 'gpustack/devel-nvidia-cuda:${{ matrix.cuda_version }}-${{ matrix.os_base }}${{ matrix.os_version }}' | |
cache-from: | | |
type=registry,ref=gpustack/build-cache:devel-nvidia-cuda-${{ matrix.cuda_version }}-${{ matrix.os_base }}${{ matrix.os_version }} | |
cache-to: | | |
type=registry,mode=max,oci-mediatypes=false,compression=gzip,ref=gpustack/build-cache:devel-nvidia-cuda-${{ matrix.cuda_version }}-${{ matrix.os_base }}${{ matrix.os_version }},ignore-error=true | |
provenance: true | |
sbom: true | |
dtk: | |
if: ${{ inputs.target == 'dtk' }} | |
runs-on: ubuntu-22.04 | |
strategy: | |
fail-fast: false | |
matrix: | |
dtk_version: | |
- '24.04.3' | |
os_base: | |
- 'ubuntu' | |
os_version: | |
- '20.04' | |
steps: | |
- name: Maximize Docker Build Space | |
uses: gpustack/.github/.github/actions/maximize-docker-build-space@main | |
with: | |
root-reserve-mb: 1024 | |
temp-reserve-mb: 1024 | |
swap-size-mb: 1024 | |
- name: Setup Docker | |
run: | | |
if [ -f /etc/docker/daemon.json ]; then | |
sudo cat /etc/docker/daemon.json | jq '. + {"allow-nondistributable-artifacts": ["image.sourcefind.cn:5000"]}' | sudo tee /etc/docker/daemon.json | |
else | |
echo '{"debug": true, "experimental": true, "allow-nondistributable-artifacts": ["image.sourcefind.cn:5000"]}' | sudo tee /etc/docker/daemon.json | |
fi | |
sudo systemctl restart docker | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 1 | |
persist-credentials: false | |
- name: Setup QEMU | |
uses: docker/setup-qemu-action@v3 | |
with: | |
image: tonistiigi/binfmt:qemu-v8.1.5 | |
platforms: "arm64" | |
- name: Setup Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Login DockerHub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.CI_DOCKERHUB_USERNAME }} | |
password: ${{ secrets.CI_DOCKERHUB_PASSWORD }} | |
- name: Package | |
uses: docker/build-push-action@v6 | |
with: | |
push: true | |
file: ${{ github.workspace }}/dtk/${{ matrix.os_base }}/Dockerfile | |
context: ${{ github.workspace }}/dtk | |
platforms: 'linux/amd64' | |
build-args: | | |
DTK_VERSION=${{ matrix.dtk_version }} | |
BASE_VERSION=${{ matrix.os_version }} | |
tags: 'gpustack/devel-hygon-dtk:${{ matrix.dtk_version }}-${{ matrix.os_base }}${{ matrix.os_version }}' | |
cache-from: | | |
type=registry,ref=gpustack/build-cache:devel-hygon-dtk-${{ matrix.dtk_version }}-${{ matrix.os_base }}${{ matrix.os_version }} | |
cache-to: | | |
type=registry,mode=max,oci-mediatypes=false,compression=gzip,ref=gpustack/build-cache:devel-hygon-dtk-${{ matrix.dtk_version }}-${{ matrix.os_base }}${{ matrix.os_version }},ignore-error=true | |
provenance: true | |
sbom: true | |
hip: | |
if: ${{ inputs.target == 'hip' }} | |
runs-on: ubuntu-22.04 | |
strategy: | |
fail-fast: false | |
matrix: | |
hip_version: | |
- '6.2.4' | |
os_base: | |
- 'centos' | |
os_version: | |
- '7' | |
steps: | |
- name: Maximize Docker Build Space | |
uses: gpustack/.github/.github/actions/maximize-docker-build-space@main | |
with: | |
root-reserve-mb: 1024 | |
temp-reserve-mb: 1024 | |
swap-size-mb: 1024 | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 1 | |
persist-credentials: false | |
- name: Setup QEMU | |
uses: docker/setup-qemu-action@v3 | |
with: | |
image: tonistiigi/binfmt:qemu-v8.1.5 | |
platforms: "arm64" | |
- name: Setup Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Login DockerHub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.CI_DOCKERHUB_USERNAME }} | |
password: ${{ secrets.CI_DOCKERHUB_PASSWORD }} | |
- name: Package | |
uses: docker/build-push-action@v6 | |
with: | |
push: true | |
file: ${{ github.workspace }}/hip/${{ matrix.os_base }}/Dockerfile | |
context: ${{ github.workspace }}/hip | |
platforms: 'linux/amd64' | |
build-args: | | |
HIP_VERSION=${{ matrix.hip_version }} | |
BASE_VERSION=${{ matrix.os_version }} | |
tags: 'gpustack/devel-rocm-hip:${{ matrix.hip_version }}-${{ matrix.os_base }}${{ matrix.os_version }}' | |
cache-from: | | |
type=registry,ref=gpustack/build-cache:devel-rocm-hip-${{ matrix.hip_version }}-${{ matrix.os_base }}${{ matrix.os_version }} | |
cache-to: | | |
type=registry,mode=max,oci-mediatypes=false,compression=gzip,ref=gpustack/build-cache:devel-rocm-hip-${{ matrix.hip_version }}-${{ matrix.os_base }}${{ matrix.os_version }},ignore-error=true | |
provenance: true | |
sbom: true | |
musa: | |
if: ${{ inputs.target == 'musa' }} | |
runs-on: ubuntu-22.04 | |
strategy: | |
fail-fast: false | |
matrix: | |
musa_version: | |
- 'rc3.1.0' | |
os_base: | |
- 'ubuntu' | |
os_version: | |
- '22.04' | |
steps: | |
- name: Maximize Docker Build Space | |
uses: gpustack/.github/.github/actions/maximize-docker-build-space@main | |
with: | |
root-reserve-mb: 1024 | |
temp-reserve-mb: 1024 | |
swap-size-mb: 1024 | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 1 | |
persist-credentials: false | |
- name: Setup QEMU | |
uses: docker/setup-qemu-action@v3 | |
with: | |
image: tonistiigi/binfmt:qemu-v8.1.5 | |
platforms: "arm64" | |
- name: Setup Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Login DockerHub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.CI_DOCKERHUB_USERNAME }} | |
password: ${{ secrets.CI_DOCKERHUB_PASSWORD }} | |
- name: Package | |
uses: docker/build-push-action@v6 | |
with: | |
push: true | |
file: ${{ github.workspace }}/musa/${{ matrix.os_base }}/Dockerfile | |
context: ${{ github.workspace }}/musa | |
platforms: 'linux/amd64' | |
build-args: | | |
MUSA_VERSION=${{ matrix.musa_version }} | |
BASE_VERSION=${{ matrix.os_version }} | |
tags: 'gpustack/devel-mthreads-musa:${{ matrix.musa_version }}-${{ matrix.os_base }}${{ matrix.os_version }}' | |
cache-from: | | |
type=registry,ref=gpustack/build-cache:devel-mthreads-musa-${{ matrix.musa_version }}-${{ matrix.os_base }}${{ matrix.os_version }} | |
cache-to: | | |
type=registry,mode=max,oci-mediatypes=false,compression=gzip,ref=gpustack/build-cache:devel-mthreads-musa-${{ matrix.musa_version }}-${{ matrix.os_base }}${{ matrix.os_version }},ignore-error=true | |
provenance: true | |
sbom: true | |
oneapi: | |
if: ${{ inputs.target == 'oneapi' }} | |
runs-on: ubuntu-22.04 | |
strategy: | |
fail-fast: false | |
matrix: | |
oneapi_version: | |
- '2025.0.0-0' | |
os_base: | |
- 'ubuntu' | |
os_version: | |
- '22.04' | |
steps: | |
- name: Maximize Docker Build Space | |
uses: gpustack/.github/.github/actions/maximize-docker-build-space@main | |
with: | |
root-reserve-mb: 1024 | |
temp-reserve-mb: 1024 | |
swap-size-mb: 1024 | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 1 | |
persist-credentials: false | |
- name: Setup QEMU | |
uses: docker/setup-qemu-action@v3 | |
with: | |
image: tonistiigi/binfmt:qemu-v8.1.5 | |
platforms: "arm64" | |
- name: Setup Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Login DockerHub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.CI_DOCKERHUB_USERNAME }} | |
password: ${{ secrets.CI_DOCKERHUB_PASSWORD }} | |
- name: Package | |
uses: docker/build-push-action@v6 | |
with: | |
push: true | |
file: ${{ github.workspace }}/oneapi/${{ matrix.os_base }}/Dockerfile | |
context: ${{ github.workspace }}/oneapi | |
platforms: 'linux/amd64' | |
build-args: | | |
ONEAPI_VERSION=${{ matrix.oneapi_version }} | |
BASE_VERSION=${{ matrix.os_version }} | |
tags: 'gpustack/devel-intel-oneapi:${{ matrix.oneapi_version }}-${{ matrix.os_base }}${{ matrix.os_version }}' | |
cache-from: | | |
type=registry,ref=gpustack/build-cache:devel-intel-oneapi-${{ matrix.oneapi_version }}-${{ matrix.os_base }}${{ matrix.os_version }} | |
cache-to: | | |
type=registry,mode=max,oci-mediatypes=false,compression=gzip,ref=gpustack/build-cache:devel-intel-oneapi-${{ matrix.oneapi_version }}-${{ matrix.os_base }}${{ matrix.os_version }},ignore-error=true | |
provenance: true | |
sbom: true |