@@ -19,7 +19,7 @@ concurrency:
1919 cancel-in-progress : true
2020
2121jobs :
22- create-cuda-run-images :
22+ create-cuda-build-and- run-images :
2323 runs-on : ${{ matrix.PLATFORM == 'linux/arm64' && 'ubuntu-24.04-arm' || 'ubuntu-24.04' }}
2424 strategy :
2525 fail-fast : true
2828 - linux/amd64
2929 - linux/arm64
3030 env :
31- CONTAINER_IMAGE_NAME : ${{ github.repository }}/cuda-build-image
31+ CONTAINER_BUILD_IMAGE_NAME : ${{ github.repository }}/cuda-build-image
32+ CONTAINER_RUN_IMAGE_NAME : ${{ github.repository }}/cuda-run-image
3233 steps :
3334 - name : Checkout repository
3435 uses : actions/checkout@v5
@@ -43,16 +44,18 @@ jobs:
4344 - name : Set up Docker Buildx
4445 uses : docker/setup-buildx-action@v3
4546
46- - name : Docker meta
47- id : meta
47+ - name : Docker build-image meta
48+ id : build_meta
4849 uses : docker/metadata-action@v5
4950 env :
5051 DOCKER_METADATA_ANNOTATIONS_LEVELS : manifest,index
5152 with :
52- images : ${{ env.CONTAINER_REGISTRY }}/${{ env.CONTAINER_IMAGE_NAME }}
53+ images : ${{ env.CONTAINER_REGISTRY }}/${{ env.CONTAINER_BUILD_IMAGE_NAME }}
5354 labels : |
5455 io.buildpacks.base.distro.name=ubuntu
5556 io.buildpacks.base.distro.version=24.04
57+ org.opencontainers.image.title=renku-frontend-buildpacks/cuda-build-image
58+ org.opencontainers.image.description=The build image for CUDA-enabled buildpacks
5659 tags : |
5760 type=sha,prefix=${{ matrix.PLATFORM == 'linux/arm64' && 'arm64' || 'amd64' }}-
5861
@@ -63,19 +66,53 @@ jobs:
6366 file : ./run-image/Dockerfile
6467 platforms : ${{ matrix.PLATFORM }}
6568 build-args : base_image=nvcr.io/nvidia/cuda-dl-base:25.10-cuda13.0-devel-ubuntu24.04
66- target : run
69+ target : build
6770 push : true
68- tags : ${{ steps.meta .outputs.tags }}
69- labels : ${{ steps.meta .outputs.labels }}
70- annotations : ${{ steps.meta .outputs.annotations }}
71+ tags : ${{ steps.build_meta .outputs.tags }}
72+ labels : ${{ steps.build_meta .outputs.labels }}
73+ annotations : ${{ steps.build_meta .outputs.annotations }}
7174 cache-from : type=gha,scope=cuda-build-image-${{ matrix.PLATFORM == 'linux/arm64' && 'arm64' || 'amd64' }}
7275 cache-to : type=gha,mode=max,scope=cuda-build-image-${{ matrix.PLATFORM == 'linux/arm64' && 'arm64' || 'amd64' }}
7376
74- combine-cuda-run-images :
75- needs : [create-cuda-run-images]
77+ - name : Docker run-image meta
78+ id : run_meta
79+ uses : docker/metadata-action@v5
80+ env :
81+ DOCKER_METADATA_ANNOTATIONS_LEVELS : manifest,index
82+ with :
83+ images : ${{ env.CONTAINER_REGISTRY }}/${{ env.CONTAINER_RUN_IMAGE_NAME }}
84+ labels : |
85+ io.buildpacks.base.distro.name=ubuntu
86+ io.buildpacks.base.distro.version=24.04
87+ org.opencontainers.image.title=renku-frontend-buildpacks/cuda-run-image
88+ org.opencontainers.image.description=The run image for CUDA-enabled buildpacks
89+ tags : |
90+ type=sha,prefix=${{ matrix.PLATFORM == 'linux/arm64' && 'arm64' || 'amd64' }}-
91+
92+ - name : Build and push cuda run-image
93+ uses : docker/build-push-action@v6
94+ with :
95+ context : ./run-image
96+ file : ./run-image/Dockerfile
97+ platforms : ${{ matrix.PLATFORM }}
98+ build-args : base_image=nvcr.io/nvidia/cuda-dl-base:25.10-cuda13.0-devel-ubuntu24.04
99+ target : run
100+ push : true
101+ tags : ${{ steps.run_meta.outputs.tags }}
102+ labels : ${{ steps.run_meta.outputs.labels }}
103+ annotations : ${{ steps.run_meta.outputs.annotations }}
104+ cache-from : type=gha,scope=cuda-run-image-${{ matrix.PLATFORM == 'linux/arm64' && 'arm64' || 'amd64' }}
105+ cache-to : type=gha,mode=max,scope=cuda-run-image-${{ matrix.PLATFORM == 'linux/arm64' && 'arm64' || 'amd64' }}
106+
107+ combine-cuda-build-and-run-images :
108+ needs : [create-cuda-build-and-run-images]
76109 runs-on : ubuntu-24.04
77- env :
78- CONTAINER_IMAGE_NAME : ${{ github.repository }}/cuda-build-image
110+ strategy :
111+ fail-fast : true
112+ matrix :
113+ IMAGE_TYPE :
114+ - build
115+ - run
79116 steps :
80117 - name : Checkout repository
81118 uses : actions/checkout@v5
@@ -96,30 +133,30 @@ jobs:
96133 env :
97134 DOCKER_METADATA_ANNOTATIONS_LEVELS : index
98135 with :
99- images : ${{ env.CONTAINER_REGISTRY }}/${{ env.CONTAINER_IMAGE_NAME }}
136+ images : ${{ env.CONTAINER_REGISTRY }}/${{ github.repository }}/cuda-${{ matrix.IMAGE_TYPE }}-image
100137 labels : |
101138 io.buildpacks.base.distro.name=ubuntu
102139 io.buildpacks.base.distro.version=24.04
140+ org.opencontainers.image.title=renku-frontend-buildpacks/cuda-${{ matrix.IMAGE_TYPE }}-image
141+ org.opencontainers.image.description=The ${{ matrix.IMAGE_TYPE }} image for CUDA-enabled buildpacks
103142 tags : |
104143 type=sha,prefix=
105- # tags: |
106- # type=sha,prefix=
107- # type=raw,value=latest,enable=${{ github.ref == 'refs/heads/main' }}
108- # type=semver,pattern={{version}},event=tag
144+ type=raw,value=latest,enable=${{ github.ref == 'refs/heads/main' }}
145+ type=semver,pattern={{version}},event=tag
109146
110147 - name : Docker meta amd64
111148 id : meta_amd64
112149 uses : docker/metadata-action@v5
113150 with :
114- images : ${{ env.CONTAINER_REGISTRY }}/${{ env.CONTAINER_IMAGE_NAME }}
151+ images : ${{ env.CONTAINER_REGISTRY }}/${{ github.repository }}/cuda-${{ matrix.IMAGE_TYPE }}-image
115152 tags : |
116153 type=sha,prefix=amd64-
117154
118155 - name : Docker meta arm64
119156 id : meta_arm64
120157 uses : docker/metadata-action@v5
121158 with :
122- images : ${{ env.CONTAINER_REGISTRY }}/${{ env.CONTAINER_IMAGE_NAME }}
159+ images : ${{ env.CONTAINER_REGISTRY }}/${{ github.repository }}/cuda-${{ matrix.IMAGE_TYPE }}-image
123160 tags : |
124161 type=sha,prefix=arm64-
125162
0 commit comments