-
Notifications
You must be signed in to change notification settings - Fork 16
78 lines (76 loc) · 2.17 KB
/
build-image.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 and push image variant
on:
workflow_call:
inputs:
ARCHES:
required: true
type: string
CUDA_VER:
required: true
type: string
LINUX_VER:
required: true
type: string
PYTHON_VER:
required: true
type: string
IMAGE_REPO:
required: true
type: string
IMAGE_NAME:
required: true
type: string
DOCKERFILE:
required: true
type: string
DOCKER_TARGET:
required: false
type: string
jobs:
run:
name: build (${{ matrix.CUDA_VER }}, ${{ matrix.PYTHON_VER }}, ${{ matrix.LINUX_VER }}, ${{ matrix.ARCH }})
strategy:
max-parallel: 50
matrix:
ARCH: ${{ fromJSON(inputs.ARCHES) }}
CUDA_VER: ["${{ inputs.CUDA_VER }}"]
LINUX_VER: ["${{ inputs.LINUX_VER }}"]
PYTHON_VER: ["${{ inputs.PYTHON_VER }}"]
fail-fast: false
runs-on: linux-${{ matrix.ARCH }}-cpu4
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.GPUCIBOT_DOCKERHUB_USER }}
password: ${{ secrets.GPUCIBOT_DOCKERHUB_TOKEN }}
- name: Set up Docker Context for Buildx
run: |
docker context create builders
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
driver: docker
endpoint: builders
- name: Generate Build Args
id: generate-build-args
run: ci/compute-build-args.sh
env:
CUDA_VER: ${{ inputs.CUDA_VER }}
LINUX_VER: ${{ inputs.LINUX_VER }}
PYTHON_VER: ${{ inputs.PYTHON_VER }}
ARCH: ${{ matrix.ARCH }}
IMAGE_REPO: ${{ inputs.IMAGE_REPO }}
- name: Build image
uses: docker/build-push-action@v6
with:
context: context
file: ${{ inputs.DOCKERFILE }}
push: true
pull: true
build-args: |
${{ steps.generate-build-args.outputs.ARGS }}
target: ${{ inputs.DOCKER_TARGET }}
tags: ${{ inputs.IMAGE_NAME }}-${{ matrix.ARCH }}