Repository navigation
69 lines (61 loc) · 2.2 KB
/
Copy pathrunpod-image.yml
File metadata and controls
69 lines (61 loc) · 2.2 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
name: RunPod image
# Builds hosting/runpod and pushes it to ghcr.io, tagged with the commit.
# Nothing uses the new image until an admin points the RunPod template at it:
# the run summary gives the digest-pinned reference to paste there.
on:
push:
branches: [main]
paths:
- 'hosting/runpod/**'
- '.github/workflows/runpod-image.yml'
workflow_dispatch:
permissions: {}
# Two pushes in quick succession build in order rather than racing.
concurrency:
group: runpod-image
cancel-in-progress: false
jobs:
image:
runs-on: ubuntu-latest
# The first push copies the vLLM base layers into ghcr once; later pushes
# add only our small layer.
timeout-minutes: 120
permissions:
contents: read
packages: write
env:
IMAGE: ghcr.io/apache/tooling-llmao/llmao-vllm-box
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Log in to ghcr.io
env:
GHCR_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: printf '%s' "$GHCR_TOKEN" | docker login ghcr.io --username "$GITHUB_ACTOR" --password-stdin
# The docker-container driver is what can build COPY --link layers on a
# base it never unpacks, and push straight to the registry.
- name: Build and push
run: |
docker buildx create --driver docker-container --use
docker buildx build \
--platform linux/amd64 \
--provenance=false --sbom=false \
--push \
--metadata-file "$RUNNER_TEMP/meta.json" \
--tag "$IMAGE:$GITHUB_SHA" \
hosting/runpod
- name: Report the pinned reference
run: |
digest=$(python3 -c 'import json, sys; print(json.load(open(sys.argv[1]))["containerimage.digest"])' "$RUNNER_TEMP/meta.json")
{
echo "### RunPod image"
echo
echo "Paste into the RunPod template's container image:"
echo
echo '```'
echo "$IMAGE@$digest"
echo '```'
echo
echo "Built from $GITHUB_SHA (also tagged \`$IMAGE:$GITHUB_SHA\`)."
} >> "$GITHUB_STEP_SUMMARY"