Michael Rabinovich Cursor commited on
Commit ·
3909559
1
Parent(s): 40dd166
docker: cache-bust the cadgenbench @main install
Browse filesADD the GitHub commits endpoint for the tracked ref before the pip
install so BuildKit invalidates the cached layer whenever main moves;
otherwise @main would stay pinned to the first build's HEAD. No-op when
CADGENBENCH_SHA is a fixed commit SHA.
Co-authored-by: Cursor <cursoragent@cursor.com>
- Dockerfile +6 -0
Dockerfile
CHANGED
|
@@ -42,6 +42,12 @@ RUN pip install --no-cache-dir -r /tmp/requirements.txt \
|
|
| 42 |
# to a specific commit SHA at the v1 release so published scores are
|
| 43 |
# reproducible (see space-setup/post-gt-swap.md Stage F).
|
| 44 |
ARG CADGENBENCH_SHA=main
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 45 |
RUN pip install --no-cache-dir \
|
| 46 |
"cadgenbench @ git+https://github.com/huggingface/cadgenbench.git@${CADGENBENCH_SHA}"
|
| 47 |
|
|
|
|
| 42 |
# to a specific commit SHA at the v1 release so published scores are
|
| 43 |
# reproducible (see space-setup/post-gt-swap.md Stage F).
|
| 44 |
ARG CADGENBENCH_SHA=main
|
| 45 |
+
# Cache-bust the install below whenever the tracked ref moves: the
|
| 46 |
+
# GitHub commits endpoint's response changes with each new commit on
|
| 47 |
+
# `main`, so BuildKit re-fetches and invalidates the cached pip layer.
|
| 48 |
+
# Without it, `@main` would stay pinned to whatever `main` was at first
|
| 49 |
+
# build. Stable (a no-op) when CADGENBENCH_SHA is a fixed commit SHA.
|
| 50 |
+
ADD https://api.github.com/repos/huggingface/cadgenbench/commits/${CADGENBENCH_SHA} /tmp/cadgenbench.commit
|
| 51 |
RUN pip install --no-cache-dir \
|
| 52 |
"cadgenbench @ git+https://github.com/huggingface/cadgenbench.git@${CADGENBENCH_SHA}"
|
| 53 |
|