forked from NVIDIA/JAX-Toolbox
-
Notifications
You must be signed in to change notification settings - Fork 0
78 lines (68 loc) · 2.1 KB
/
_build_base.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
name: ~build CUDA+Python base container
on:
workflow_call:
inputs:
BASE_IMAGE:
type: string
description: 'Base CUDA image:'
required: false
default: nvidia/cuda:12.1.0-devel-ubuntu22.04
BUILD_DATE:
type: string
description: "Build date in YYYY-MM-DD format"
required: false
default: 'NOT SPECIFIED'
outputs:
DOCKER_TAGS:
description: "Tags of the image built"
value: ${{ jobs.build.outputs.DOCKER_TAGS }}
env:
UPLD_IMAGE: ghcr.io/nvidia/jax-toolbox-internal
permissions:
contents: read # to fetch code
actions: write # to cancel previous workflows
packages: write # to upload container
jobs:
build:
outputs:
DOCKER_TAGS: ${{ steps.meta.outputs.tags }}
runs-on: ubuntu-22.04
steps:
- name: Print environment variables
run: env
- name: Check out the repository under ${GITHUB_WORKSPACE}
uses: actions/checkout@v3
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set docker metadata
id: meta
uses: docker/metadata-action@v4
with:
images: |
${{ env.UPLD_IMAGE }}
flavor: |
latest=false
tags: |
type=raw,value=${{ github.run_id }}-base
labels:
org.opencontainers.image.created=${{ inputs.BUILD_DATE }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
with:
driver-opts: |
image=moby/buildkit:v0.10.6
- name: Build docker images
uses: docker/build-push-action@v4
with:
context: .github/container
push: true
file: .github/container/Dockerfile.base
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: |
BASE_IMAGE=${{ inputs.BASE_IMAGE }}
BUILD_DATE=${{ inputs.BUILD_DATE }}