Skip to content

Build Docker and Create Release #48

Build Docker and Create Release

Build Docker and Create Release #48

Workflow file for this run

name: Build Docker and Create Release
on:
workflow_dispatch:
permissions:
contents: read
jobs:
build:
permissions:
contents: write # for softprops/action-gh-release to create GitHub release
runs-on: self-hosted
strategy:
fail-fast: false
matrix:
slurm:
- version: 24.05.4
image:
- context: .
push: false
platforms: linux/amd64
load: true
ubuntu_version: focal
pmix_version: 5.0.2
cuda_version: 12.2.2
build_args:
BASE_IMAGE=nvidia/cuda:12.2.2-cudnn8-devel-ubuntu20.04
- context: .
push: false
platforms: linux/amd64
load: true
ubuntu_version: jammy
pmix_version: 5.0.3
cuda_version: 12.2.2
build_args:
BASE_IMAGE=nvidia/cuda:12.2.2-cudnn8-devel-ubuntu22.04
steps:
- name: Harden Runner
uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2
with:
egress-policy: audit
- name: Checkout repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@6524bf65af31da8d45b59e8c27de4bd072b392f5 # v3.8.0
- name: Build docker images
uses: docker/build-push-action@48aba3b46d1b1fec4febb7c5d0c644b249a11355 # v6.10.0
with:
context: ${{ matrix.image.context }}
push: ${{ matrix.image.push }}
tags: slurm_builder:${{ matrix.image.cuda_version }}-${{ matrix.image.ubuntu_version }}-slurm${{ matrix.slurm.version }}
platforms: ${{ matrix.image.platforms }}
load: ${{ matrix.image.load }}
build-args: |
${{ matrix.image.build_args }}
SLURM_VERSION=${{ matrix.slurm.version }}
PMIX_VERSION=${{ matrix.image.pmix_version }}
cache-from: type=local,src=.buildx-cache
cache-to: type=local,dest=.buildx-cache,mode=max
- name: Create slurm_build_output directory
run: mkdir -p slurm_build_output
- name: Run Docker container and copy files
run: |
container_id=$(docker create slurm_builder:${{ matrix.image.cuda_version }}-${{ matrix.image.ubuntu_version }}-slurm${{ matrix.slurm.version }})
docker start $container_id
docker cp $container_id:/usr/src/debs/ ./slurm_build_output/
docker cp $container_id:/usr/src/nccl-tests/build/nccl-tests-perf.tar.gz ./slurm_build_output/
docker rm $container_id
- name: Create GitHub Release and Upload DEB packages
uses: softprops/action-gh-release@7b4da11513bf3f43f9999e90eabced41ab8bb048 # v2.2.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ matrix.image.cuda_version }}-${{ matrix.image.ubuntu_version }}-slurm${{ matrix.slurm.version }}
name: Cuda ${{ matrix.image.cuda_version }}, Ubuntu ${{ matrix.image.ubuntu_version }}, Slurm ${{ matrix.slurm.version }}
body: "Release based on Ubuntu ${{ matrix.image.ubuntu_version }} for Slurm ${{ matrix.slurm.version }} with cuda ${{ matrix.image.cuda_version }}, PMIx ${{ matrix.image.pmix_version }} and libnccl"
draft: false
prerelease: false
files: |
slurm_build_output/debs/*.deb
slurm_build_output/nccl-tests-perf.tar.gz
- name: Cleanup
run: rm -rf slurm_build_output/*.deb