Skip to content

Commit 9dafbac

Browse files
Exorustclaude
andcommitted
Fix the docker workflow and image build
The tag was built from github.repository_owner, which is "Exorust", but registry names must be lowercase, so buildx rejected ghcr.io/Exorust/torchleet before it built anything. Lowercase the owner when composing the image name. Also install torchvision from the same CPU wheel index as torch. Pulling it from the default index can produce a build compiled against a different torch, which fails at import with an obscure symbol error. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
1 parent a622d25 commit 9dafbac

2 files changed

Lines changed: 15 additions & 6 deletions

File tree

.github/workflows/docker.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,20 @@ jobs:
1414
packages: write
1515
steps:
1616
- uses: actions/checkout@v4
17+
18+
# Registry names must be lowercase, but the GitHub owner is "Exorust".
19+
- name: Compute lowercase image name
20+
id: img
21+
run: echo "name=ghcr.io/${GITHUB_REPOSITORY_OWNER,,}/torchleet" >> "$GITHUB_OUTPUT"
22+
1723
- uses: docker/login-action@v3
1824
with:
1925
registry: ghcr.io
2026
username: ${{ github.actor }}
2127
password: ${{ secrets.GITHUB_TOKEN }}
28+
2229
- uses: docker/build-push-action@v6
2330
with:
2431
context: .
2532
push: true
26-
tags: ghcr.io/${{ github.repository_owner }}/torchleet:latest
33+
tags: ${{ steps.img.outputs.name }}:latest

Dockerfile

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
1-
# Zero-install TorchLeet: notebooks + the grader, no local Python setup.
1+
# Zero-install TorchLeet: notebooks plus the grader, no local Python setup.
22
# docker run --rm -p 8888:8888 ghcr.io/exorust/torchleet
33
FROM python:3.12-slim
44

5-
# CPU-only torch keeps the image small; a GPU box can pip install a CUDA build.
6-
RUN pip install --no-cache-dir \
7-
torch --index-url https://download.pytorch.org/whl/cpu \
8-
&& pip install --no-cache-dir jupyterlab torchvision matplotlib numpy
5+
# torch AND torchvision both come from the CPU wheel index. Taking torchvision
6+
# from the default index instead risks a build compiled against a different
7+
# torch, which fails at import with an obscure symbol error.
8+
RUN pip install --no-cache-dir --index-url https://download.pytorch.org/whl/cpu \
9+
torch torchvision \
10+
&& pip install --no-cache-dir jupyterlab matplotlib numpy
911

1012
WORKDIR /torchleet
1113
COPY . /torchleet

0 commit comments

Comments
 (0)