Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ jobs:
secrets: inherit
with:
version: ${{ needs.basic.outputs.version }}
build_multi_arch_images: ${{ github.ref_name == 'main' || startsWith(github.ref_name, 'release-') }}

e2e-test:
needs:
Expand Down
42 changes: 30 additions & 12 deletions .github/workflows/image.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,26 +20,22 @@ on:
version:
required: true
type: string
build_multi_arch_images:
required: true
type: string

jobs:
build:
runs-on: linux-amd64-cpu4
strategy:
matrix:
arch:
- amd64
- arm64
runs-on: linux-${{ matrix.arch }}-cpu4
permissions:
contents: read
id-token: write
packages: write
steps:
- uses: actions/checkout@v5
name: Check out code
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
with:
image: tonistiigi/binfmt:master
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
Expand All @@ -52,10 +48,32 @@ jobs:
- name: Build image
env:
IMAGE_NAME: ghcr.io/nvidia/k8s-device-plugin
VERSION: ${{ inputs.version }}
VERSION: ${{ inputs.version }}-${{ matrix.arch }}
PUSH_ON_BUILD: true
BUILD_MULTI_ARCH_IMAGES: ${{ inputs.build_multi_arch_images }}
GOPROXY: ${{ steps.setup-go-proxy.outputs.goproxy-url }}
DOCKER_BUILD_PLATFORM_OPTIONS: "--platform=linux/${{ matrix.arch }}"
run: |
echo "${VERSION}"
make -f deployments/container/Makefile build

create-manifest:
needs: [ build ]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
name: Check out code
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build Manifest
env:
MULTIARCH_IMAGE: ghcr.io/nvidia/k8s-device-plugin:${{ inputs.version }}
run: |
docker manifest create \
${MULTIARCH_IMAGE} \
ghcr.io/nvidia/k8s-device-plugin:${{ inputs.version }}-amd64 \
ghcr.io/nvidia/k8s-device-plugin:${{ inputs.version }}-arm64
docker manifest push ${MULTIARCH_IMAGE}
7 changes: 1 addition & 6 deletions deployments/container/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,6 @@

BUILD_MULTI_ARCH_IMAGES ?= no
DOCKER ?= docker
BUILDX =
ifeq ($(BUILD_MULTI_ARCH_IMAGES),true)
BUILDX = buildx
endif
MKDIR ?= mkdir

##### Global variables #####
Expand Down Expand Up @@ -72,8 +68,7 @@ DOCKERFILE = $(CURDIR)/deployments/container/Dockerfile

# Use a generic build target to build the relevant images
$(IMAGE_TARGETS): image-%:
DOCKER_BUILDKIT=1 \
$(DOCKER) $(BUILDX) build --pull \
$(DOCKER) build --pull \
--provenance=false --sbom=false \
$(DOCKER_BUILD_OPTIONS) \
$(DOCKER_BUILD_PLATFORM_OPTIONS) \
Expand Down
2 changes: 1 addition & 1 deletion deployments/container/multi-arch.mk
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@

PUSH_ON_BUILD ?= false
DOCKER_BUILD_OPTIONS = --output=type=image,push=$(PUSH_ON_BUILD)
DOCKER_BUILD_PLATFORM_OPTIONS = --platform=linux/amd64,linux/arm64
DOCKER_BUILD_PLATFORM_OPTIONS ?= --platform=linux/amd64,linux/arm64

$(BUILD_TARGETS): build-%: image-%