feat: Add caching support for container mode builds

オープン
#18 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
25/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
github-actions, python

調査の方向性

setup-environment/action.yml:62-66、77、122-127 と、setup-environment/README.md:126-127 および #100 harness から始めてください。コンテナモードの差分インストールパスとキャッシュの動作を検証し、リポジトリが環境更新ファイルを採用してそのコストが測定された後にのみ、再度見直してください。どのような実装でも、記載されている restore とイメージ環境に関する懸念を解決する必要があります。

索引モデルが issue の本文から書いたものです。

説明

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.

主要言語
Shell
スター
0
フォーク
1
平均マージ
18時間 51分
マージ済み PR(30日)
58

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

QuantEcon/actions のほかの issue

QuantEcon/actions の issue をすべて見る

似ている issue

Shell/Bash の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。