-
Notifications
You must be signed in to change notification settings - Fork 471
54 lines (45 loc) · 1.78 KB
/
Copy pathtest-nvcr-pull.yml
File metadata and controls
54 lines (45 loc) · 1.78 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
# nvcr.io image pull + size — single-job smoke test.
#
# Pulls a specific nvcr.io image and reports its on-disk size. Does
# not include `docker login` — relies on whatever credentials the
# runner is configured with (the Packer-baked NGC pull-secret on
# nv-gha-runners, if present). A failure with an auth error is
# itself useful signal that the runner is not pre-configured for
# the target namespace.
#
# Triggers: same as `secret-scan.yml` — copy-pr-bot mirror branches
# (`pull-request/[0-9]+`) on NVIDIA/cccl + workflow_dispatch.
name: nvcr image pull + size
run-name: nvcr pull — ${{ github.ref_name }}
on:
push:
branches:
- "pull-request/[0-9]+"
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-on-${{ github.event_name }}-from-${{ github.ref_name }}
cancel-in-progress: true
permissions:
contents: read
jobs:
pull-and-size:
name: docker pull + size
# NV self-hosted CPU runner on NVIDIA/cccl; GitHub-hosted fallback
# on contributor forks where nv-gha-runners labels do not resolve.
runs-on: ${{ github.repository == 'NVIDIA/cccl' && 'linux-amd64-cpu4' || 'ubuntu-latest' }}
env:
NVCR_IMAGE: nvcr.io/nvidian/prodsec/pulse-trufflehog:1.33
steps:
- name: docker pull
run: docker pull "${NVCR_IMAGE}"
- name: Report size
run: |
set -euo pipefail
bytes=$(docker image inspect "${NVCR_IMAGE}" --format '{{.Size}}')
mib=$(awk -v b="${bytes}" 'BEGIN { printf "%.1f", b/1024/1024 }')
gib=$(awk -v b="${bytes}" 'BEGIN { printf "%.2f", b/1024/1024/1024 }')
echo "Image: ${NVCR_IMAGE}"
echo "Size: ${bytes} bytes (${mib} MiB / ${gib} GiB)"
- name: Cleanup
if: always()
run: docker rmi "${NVCR_IMAGE}" >/dev/null 2>&1 || true