Skip to content

use libnvidia-container fork #11

use libnvidia-container fork

use libnvidia-container fork #11

Workflow file for this run

# Copyright 2024 NVIDIA CORPORATION
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# Run this workflow on pull requests
name: image
on:
push:
branches:
- main
- release-*
jobs:
packages:
strategy:
matrix:
target:
- runner: ubuntu-24.04
arch: amd64
- runner: ubuntu-24.04-arm
arch: arm64
runs-on: ${{ matrix.target.runner }}
steps:
- uses: actions/checkout@v4
name: Check out code
with:
submodules: recursive
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: libnvidia-container
run: |
REVISION=$(git -C third_party/libnvidia-container rev-parse HEAD)
BUILDX_TAG=nvidia/libnvidia-container/ubuntu20.04-${{ matrix.target.arch }}
DIST=./dist/ubuntu20.04/${{ matrix.target.arch }}
mkdir -p $DIST
docker buildx build \
--platform=linux/${{ matrix.target.arch }} \
--progress=plain \
--build-arg BASEIMAGE="ubuntu:20.04" \
--build-arg OS_VERSION="20.04" \
--build-arg OS_ARCH="${{ matrix.target.arch }}" \
--build-arg GOLANG_VERSION="1.17.1" \
--build-arg WITH_NVCGO="yes" \
--build-arg WITH_LIBELF="no" \
--build-arg WITH_TIRPC="no" \
--build-arg WITH_SECCOMP="yes" \
--build-arg CFLAGS="" \
--build-arg LDLIBS="" \
--build-arg REVISION="$REVISION" \
--build-arg LIB_VERSION="1.17.4" \
--build-arg LIB_TAG="" \
--build-arg LIB_BUILD="" \
--load \
--tag $BUILDX_TAG \
--file third_party/libnvidia-container/mk/Dockerfile.ubuntu third_party/libnvidia-container/
docker run --rm --platform linux/${{ matrix.target.arch }} -v $DIST:/dist $BUILDX_TAG:latest
- name: toolkit
run: |
BUILDX_TAG=nvidia/nvidia-container-toolkit/ubuntu20.04-${{ matrix.target.arch }}
DIST=./dist/ubuntu20.04/${{ matrix.target.arch }}
mkdir -p $DIST
docker build \
--platform=linux/${{ matrix.target.arch }} \
--progress=plain \
--build-arg BASEIMAGE="ubuntu:20.04" \
--build-arg GOLANG_VERSION="1.23.4" \
--build-arg PKG_NAME="nvidia-container-toolkit" \
--build-arg PKG_VERS="1.17.4" \
--build-arg PKG_REV="1" \
--build-arg LIBNVIDIA_CONTAINER_TOOLS_VERSION="1.17.4-1" \
--build-arg GIT_COMMIT="${{ github.sha }}" \
--tag $BUILDX_TAG \
--file docker/Dockerfile.ubuntu .
docker run --rm --platform linux/${{ matrix.target.arch }} -v $DIST:/dist $BUILDX_TAG:latest
- name: 'Upload Artifacts'
uses: actions/upload-artifact@v4
with:
name: nvidia-container-toolkit-ubuntu20.04-${{ matrix.target.arch }}-${{ github.run_id }}
path: dist/*
compression-level: 0
image:
runs-on: ubuntu-24.04
needs: packages
steps:
- uses: actions/checkout@v4
name: Check out code
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Download packages
uses: actions/download-artifact@v4
with:
path: dist/
pattern: nvidia-container-toolkit-ubuntu20.04-*-${{ github.run_id }}
merge-multiple: true
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build image
run: |
make -f deployments/container/Makefile build-ubuntu20.04 \
BUILD_MULTI_ARCH_IMAGES="true" \
IMAGE_NAME=ghcr.io/${{ github.actor }}/container-toolkit \
PACKAGE_DIST=ubuntu20.04 \
PUSH_ON_BUILD="true"