Dockerfile: point cadgenbench install at huggingface/cadgenbench
Browse filesSwitch source from MichaelRabinovich/LeForge to huggingface/cadgenbench
now that the latter has the full history (181 commits, see
space-setup/migration.md Phase C). The pinned commit (d7e0468) exists
on both remotes so this is URL-only; cadgenbench version bumps are a
separate concern handled by ARG CADGENBENCH_SHA.
The GH_PAT secret on the Space is being rotated in lockstep from a
fine-grained PAT scoped to LeForge to a classic PAT with 'repo' scope.
Classic is broader than ideal (gives the PAT read on any private repo
the issuing user can see, not just huggingface/cadgenbench) but it's
the only self-serve option: the huggingface GH org has fine-grained
PATs disabled, and the cadgenbench space-setup user isn't an admin on
the org repo so can't add a per-repo deploy key either. Tracked as
follow-up debt to swap for a deploy key once admin permissions land
(asked Leandro).
Co-authored-by: Cursor <cursoragent@cursor.com>
- Dockerfile +15 -7
|
@@ -8,11 +8,19 @@
|
|
| 8 |
# --secret id=GH_PAT,src=/tmp/gh_pat \
|
| 9 |
# -t cadgenbench-space-test .
|
| 10 |
#
|
| 11 |
-
# The GH_PAT mount is a
|
| 12 |
-
#
|
| 13 |
-
#
|
| 14 |
-
#
|
| 15 |
-
#
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 16 |
|
| 17 |
FROM python:3.12-slim-bookworm
|
| 18 |
|
|
@@ -47,14 +55,14 @@ RUN pip install --no-cache-dir -r /tmp/requirements.txt \
|
|
| 47 |
RUN pip install --no-cache-dir playwright \
|
| 48 |
&& playwright install --with-deps chromium
|
| 49 |
|
| 50 |
-
# cadgenbench from the
|
| 51 |
# mount is visible only inside this single RUN: not embedded in any layer,
|
| 52 |
# not exposed as env, not written to disk after the layer commits. Bumping
|
| 53 |
# CADGENBENCH_SHA is the one-line path to picking up a new cadgenbench.
|
| 54 |
ARG CADGENBENCH_SHA=d7e0468
|
| 55 |
RUN --mount=type=secret,id=GH_PAT,mode=0400,required=true \
|
| 56 |
pip install --no-cache-dir \
|
| 57 |
-
"cadgenbench @ git+https://$(cat /run/secrets/GH_PAT)@github.com/
|
| 58 |
|
| 59 |
# Drop privileges. HF Spaces conventionally run as uid 1000 with
|
| 60 |
# WORKDIR /home/user/app.
|
|
|
|
| 8 |
# --secret id=GH_PAT,src=/tmp/gh_pat \
|
| 9 |
# -t cadgenbench-space-test .
|
| 10 |
#
|
| 11 |
+
# The GH_PAT mount is a classic GitHub PAT with `repo` scope (because the
|
| 12 |
+
# `huggingface` GH org has fine-grained PATs disabled, and the cadgenbench
|
| 13 |
+
# space-setup user isn't an admin on huggingface/cadgenbench so can't add
|
| 14 |
+
# a per-repo deploy key either). Broader scope than ideal: this PAT could
|
| 15 |
+
# in principle read any private repo the issuing user has access to, not
|
| 16 |
+
# just huggingface/cadgenbench. Tracked as a follow-up to swap for a
|
| 17 |
+
# read-only deploy key once admin permissions land. See `space-setup/
|
| 18 |
+
# migration.md` Phase C GitHub move section.
|
| 19 |
+
#
|
| 20 |
+
# The mount itself is safe: the value is visible only inside the single
|
| 21 |
+
# `pip install cadgenbench` RUN below, never lands in an image layer,
|
| 22 |
+
# env var, or disk file in the final image. The same value lives on the
|
| 23 |
+
# Space as a Settings Secret (mirrors /tmp/gh_pat locally).
|
| 24 |
|
| 25 |
FROM python:3.12-slim-bookworm
|
| 26 |
|
|
|
|
| 55 |
RUN pip install --no-cache-dir playwright \
|
| 56 |
&& playwright install --with-deps chromium
|
| 57 |
|
| 58 |
+
# cadgenbench from the Internal GitHub repo, pinned to a commit. The PAT
|
| 59 |
# mount is visible only inside this single RUN: not embedded in any layer,
|
| 60 |
# not exposed as env, not written to disk after the layer commits. Bumping
|
| 61 |
# CADGENBENCH_SHA is the one-line path to picking up a new cadgenbench.
|
| 62 |
ARG CADGENBENCH_SHA=d7e0468
|
| 63 |
RUN --mount=type=secret,id=GH_PAT,mode=0400,required=true \
|
| 64 |
pip install --no-cache-dir \
|
| 65 |
+
"cadgenbench @ git+https://$(cat /run/secrets/GH_PAT)@github.com/huggingface/cadgenbench.git@${CADGENBENCH_SHA}"
|
| 66 |
|
| 67 |
# Drop privileges. HF Spaces conventionally run as uid 1000 with
|
| 68 |
# WORKDIR /home/user/app.
|