feat: Add caching support for container mode builds

Aperta
#18 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
25/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
github-actions, python

Direzione di ricerca

Inizia da setup-environment/action.yml:62-66, 77 e 122-127, oltre a setup-environment/README.md:126-127 e al harness di #100. Verifica il percorso di installazione delta in modalità container e il comportamento della cache; riprendi la questione solo dopo che un repository avrà adottato un file di aggiornamento dell’ambiente e ne sarà stato misurato il costo; qualsiasi implementazione dovrebbe risolvere i problemi indicati relativi al ripristino e all’ambiente dell’immagine.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

enhancement low-priority

Speed up container-mode setup-environment by avoiding a fresh package install every run. Scope is now narrow: only the per-lecture environment-update delta install is uncached, and no consumer pays for it today.

The common stack is pre-baked on the Anaconda 2026.06 baseline (containers/quantecon/environment.yml:11; lean-image pins at containers/quantecon-build/environment.yml:20-29), reaching consumers via the image tag, not the v0.9.0 release. Undone is the literal ask: analyse packages common across the lecture repos and add them to quantecon-build. containers/quantecon-build/environment.yml:3 still routes every lecture-specific package (quantecon, wbgapi, jax) to the lecture repo's own environment file; that delta install is the whole remaining scope.

The default path is zero-cost: environment-update defaults to '' (setup-environment/action.yml:17) and container mode runs a no-op (setup-environment/action.yml:85-93), shipped in v0.5.0. No consumer passes it — QuantEcon/lecture-dp's ci.yml and cache.yml do not — and the #92 baseline below shows no delta install among the costs.

actions/cache can see /opt/conda — under container: every step runs inside the container, JS actions included — so isolation was never the obstacle. The real obstacles, hit by the #100 harness in standard mode: tar ownership/permissions on restore (setup-environment/action.yml:122-127), and restoring a cached env over the image's own. The workspace-copy workaround (into .cache/, back over site-packages) is out; the pip-download-cache and mounted-volume variants need re-deriving from these. Two shipped comments still assert the wrong rationale (Conda env outside the workspace mount, actions/cache on the host) and link back here.

Next steps

  • Pre-bake the common stack into the container images — done in #95 (v0.9.0)
  • Profile current build times to establish a baseline — done for the container path in #92: warm lecture-dp ~2.7 min, container pull 129s, HTML 22s, cache restore 3s
  • Correct that rationale (setup-environment/action.yml:62-66, setup-environment/README.md:126) and the unmeasured ~30-60s figure (setup-environment/README.md:127), regardless of later measurement; can ride #107, which fixes the missing -n in the same step (setup-environment/action.yml:77)
  • Revisit only once a repo adopts an environment-update file and there is a measured cost
  • If worth attacking, prefer baking the near-universal delta packages into the image over caching them

Keep open at low priority, per PLAN.md:115. Origin: PR #17, container-aware setup-environment. #107 (conda env update without -n, wrong env) lands before any work here; #92 has the measured preview-build baselines.

Lingua principale
Shell
Stelle
0
Fork
1
Merge medio
20h 3m
PR unite (30g)
48

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di QuantEcon/actions

Tutte le issue di QuantEcon/actions

Issue simili

Altre issue su Shell/Bash

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.