Skip to content

Commit

Permalink
Add GHA for cuda devpack
Browse files Browse the repository at this point in the history
  • Loading branch information
zifeitong committed Jul 19, 2024
1 parent 87817ca commit b565bf6
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
18 changes: 12 additions & 6 deletions .github/workflows/build-and-push-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,20 @@ name: Create and push a continer image

on:
push:
branches: ['latest']
branches: ["latest"]

env:
REGISTRY: ghcr.io
IMAGE_NAME: zifeitong/ubuntu-devpack
USER_NAME: zifeitong

jobs:
build-and-push-image:
strategy:
matrix:
image: [ubuntu-devpack, cuda-devpack]
fail-fast: true
max-parallel: 1

runs-on: ubuntu-latest

permissions:
Expand All @@ -33,7 +39,7 @@ jobs:
id: meta
uses: docker/[email protected]
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
images: ${{ env.REGISTRY }}/${{ env.USER_NAME }}/${{ matrix.image }}

- name: Set up Docker Buildx
uses: docker/[email protected]
Expand All @@ -43,16 +49,16 @@ jobs:
uses: docker/[email protected]
with:
context: .
file: ./Containerfile.ubuntu-devpack
file: ${{ matrix.image }}.Containerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max

- name: Generate artifact attestation
uses: actions/[email protected]
with:
subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME}}
subject-name: ${{ env.REGISTRY }}/${{ env.USER_NAME }}/${{ matrix.image }}
subject-digest: ${{ steps.push.outputs.digest }}
push-to-registry: true
3 changes: 2 additions & 1 deletion cuda.Containerfile → cuda-devpack.Containerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ RUN [ "${TARGETARCH}" = "amd64" ]

ARG CUDA_KEYRING_URL=https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2404/x86_64/cuda-keyring_1.1-1_all.deb

RUN wget CUDA_KEYRING_URL && \
RUN --mount=type=cache,sharing=locked,target=/var/lib/dpkg wget ${CUDA_KEYRING_URL} && \
lsof /var/lib/dpkg/lock-frontend && \
dpkg -i cuda-keyring_1.1-1_all.deb && \
apt-get update & \
DEBIAN_FRONTEND=noninteractive apt-get -y install cuda-toolkit cudnn9-cuda-12 && \
Expand Down

0 comments on commit b565bf6

Please sign in to comment.