Skip to content

Commit ad6a212

Browse files
committed
fix: move Imagenette precompute to runtime, increase health start-period
LanceDB stored in Docker overlay filesystem layers is extremely slow to reopen on free-tier CPUs, causing a 2h+ delay at container startup and a 30-minute health check timeout. Move dataset/embedding/layout computation to runtime (same approach as Jaguar Space) and increase HEALTHCHECK --start-period to 600s.
1 parent 3db18ba commit ad6a212

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

spaces/imagenette-clip-hycoclip/Dockerfile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,12 @@ COPY --chown=user demo.py ./demo.py
3333
ENV HYPERVIEW_DATASETS_DIR=/home/user/app/demo_data/datasets \
3434
HYPERVIEW_MEDIA_DIR=/home/user/app/demo_data/media
3535

36-
# Precompute at build time so the Space starts fast.
37-
RUN python -c "from demo import build_dataset; build_dataset()"
38-
3936
EXPOSE 7860
4037

41-
HEALTHCHECK --interval=30s --timeout=10s --start-period=120s --retries=3 \
38+
HEALTHCHECK --interval=30s --timeout=10s --start-period=600s --retries=3 \
4239
CMD curl -f http://localhost:7860/__hyperview__/health || exit 1
4340

41+
# Dataset is built at first startup (model download + embedding computation).
42+
# Precomputing at Docker build time causes LanceDB to be stored in overlay
43+
# filesystem layers, which are extremely slow to reopen on free-tier CPUs.
4444
CMD ["python", "demo.py"]

spaces/imagenette-clip-hycoclip/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ This example runs HyperView with:
1919
- CLIP embeddings (`openai/clip-vit-base-patch32`) for Euclidean layout
2020
- HyCoCLIP embeddings (`hycoclip-vit-s`) for Poincaré layout
2121

22-
The Docker image installs released HyperView packages from PyPI and precomputes
23-
the dataset, embeddings, and layouts during build for fast runtime startup.
22+
The Docker image installs released HyperView packages from PyPI. The dataset,
23+
embeddings, and layouts are computed at first startup.
2424

2525
## Reuse This Template
2626

0 commit comments

Comments
 (0)