Repository navigation
144 lines (139 loc) · 5.08 KB
/
Copy pathrealtime_prebuilt_binaries.yml
File metadata and controls
144 lines (139 loc) · 5.08 KB
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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
on:
workflow_call:
inputs:
platform:
type: string
required: false
default: linux/amd64
platform_base_image:
required: false
type: string
default: amd64/almalinux:8
description: The image to use as a base image when building the installer.
cuda_version:
required: true
type: string
description: The CUDA version used for the build (e.g. 12.3).
environment:
type: string
required: false
# Dependency sources. All blank by default, which assets.Dockerfile passes
# through as empty build args, leaving the deps_common.sh pins in effect.
doca_version:
required: false
type: string
default: ''
description: DOCA version to install. Blank uses the deps_common.sh default.
holoscan_version:
required: false
type: string
default: ''
description: Holoscan SDK version to install. Blank uses the deps_common.sh default.
hsb_repo:
required: false
type: string
default: ''
description: Holoscan Sensor Bridge repository to clone. Blank uses the deps_common.sh default. Must be clonable without credentials.
hsb_ref:
required: false
type: string
default: ''
description: Holoscan Sensor Bridge branch or tag. Blank uses the deps_common.sh default.
release_tag:
required: false
type: string
default: ''
description: Draft release tag to attach the installer to.
secrets:
DOCKERHUB_USERNAME:
required: true
DOCKERHUB_READONLY_TOKEN:
required: true
REPO_BOT_ACCESS_TOKEN:
required: false
name: Pre-built realtime binaries
jobs:
build_installer:
name: Build CUDA Quantum Realtime installers
runs-on: ${{ (contains(inputs.platform, 'arm') && 'linux-arm64-cpu32') || 'linux-amd64-cpu32' }}
permissions:
contents: read
packages: read
outputs:
image_hash: ghcr.io/nvidia/cuda-quantum-realtime-assets-${{ inputs.platform }}-cu${{ inputs.cuda_version }}
artifact_name: cuda-quantum-realtime-assets-${{ inputs.platform }}-cu${{ inputs.cuda_version }}
services:
registry:
image: registry:2
ports:
- 5000:5000
steps:
# realtime/ uses no submodules.
- name: Checkout repository
uses: actions/checkout@v6
- name: Log in to DockerHub
uses: docker/login-action@v4
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_READONLY_TOKEN }}
- name: Login to GitHub CR
uses: docker/login-action@v4
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ github.token }}
- name: Set up context for buildx
run: |
docker context create builder_context
- name: Set up buildx runner
uses: docker/setup-buildx-action@v4
with:
endpoint: builder_context
version: v0.19.0
buildkitd-config: /etc/buildkit/buildkitd.toml # hard-coded to run on our runners
driver-opts: |
network=host
image=moby/buildkit:v0.19.0
- name: Build assets
id: docker_build
uses: docker/build-push-action@v7
env:
DOCKER_BUILD_RECORD_UPLOAD: "false"
with:
context: .
file: ./realtime/docker/assets.Dockerfile
build-args: |
base_image=${{ (contains(inputs.platform, 'arm') && 'ghcr.io/nvidia/arm64v8/almalinux:8') || 'ghcr.io/nvidia/amd64/almalinux:8' }}
cuda_version=${{ inputs.cuda_version }}
DOCA_VERSION=${{ inputs.doca_version }}
HOLOSCAN_SDK_VERSION=${{ inputs.holoscan_version }}
CUDAQ_REALTIME_HSB_REPO=${{ inputs.hsb_repo }}
CUDAQ_REALTIME_HSB_REF=${{ inputs.hsb_ref }}
tags: ghcr.io/nvidia/cuda-quantum-realtime-assets-${{ inputs.platform }}-cu${{ inputs.cuda_version }}
# labels: ${{ steps.metadata.outputs.labels }}
platforms: ${{ inputs.platform }}
# TODO: set up cache
# cache-from: |
# ${{ inputs.build_cache }}
# ${{ steps.config.outputs.additional_build_caches }}
# TODO: push to the cache registry
push: false
# Output the installer
outputs: type=local,dest=/tmp/install
- name: Upload installer
uses: actions/upload-artifact@v7
with:
name: install_cuda_quantum_realtime_cu${{ inputs.cuda_version }}.${{ inputs.platform }}
path: /tmp/install
# Validation fetches these from the Deployments run; must outlive it.
retention-days: 14
if-no-files-found: error
- name: Attach installer to draft release
if: inputs.release_tag != ''
env:
GH_TOKEN: ${{ secrets.REPO_BOT_ACCESS_TOKEN }}
RELEASE_TAG: ${{ inputs.release_tag }}
run: |
retry() { for n in 1 2 3; do "$@" && return 0; [ $n -lt 3 ] && sleep $((15*n*n)); done; return 1; }
retry gh release upload "$RELEASE_TAG" /tmp/install/install_cuda_quantum_realtime* \
-R ${{ github.repository }} --clobber