Skip to content

Add Docker-based CI environment image on GHCR to eliminate repeated dependency installation - #267

Closed
ShixiangWang with Copilot wants to merge 3 commits into
mainfrom
copilot/optimize-ci-build-environment
Closed

Add Docker-based CI environment image on GHCR to eliminate repeated dependency installation#267
ShixiangWang with Copilot wants to merge 3 commits into
mainfrom
copilot/optimize-ci-build-environment

Conversation

Copilot AI commented Apr 3, 2026

Copy link
Copy Markdown
Contributor

CI runs take 1+ hours, with 30-40 min spent reinstalling 180+ R packages, Python, Julia, and Quarto from scratch every time. This adds a pre-built Docker image on GHCR so CI pulls it and only does differential dependency updates.

New files

  • Dockerfile — Based on rocker/r-ver:4. Installs all system libs, R packages via pak (CRAN/Bioconductor/GitHub Remotes), Python venv with pip deps, Julia 1.10.7 + CairoMakie/DataFrames/Statistics/QuartoNotebookRunner, Quarto latest + TinyTeX.
  • .github/workflows/build-env-image.yml — Builds and pushes ghcr.io/openbiox/bizard-env:latest. Triggers: weekly (Sunday), on dependency file changes (DESCRIPTION, requirements.txt, Julia/Project.toml, Dockerfile), manual dispatch. Uses GHA cache for Docker layers.
  • .dockerignore — Excludes _site/, _freeze/, .git/, etc.

Modified workflows

  • quarto-publish.yml / quarto-publish-update-cache.yml — Replace all setup actions (setup-r, setup-python, setup-julia, setup-r-dependencies, quarto-actions/setup) with:
container:
  image: ghcr.io/openbiox/bizard-env:latest
  credentials:
    username: ${{ github.actor }}
    password: ${{ secrets.GITHUB_TOKEN }}

Differential dep steps (pak::local_install_deps(), pip install, Pkg.instantiate()) are kept as fast no-ops when the image is current.

First-time setup

After merge, manually trigger the "Build CI Environment Image" workflow once to create the initial image. Subsequent rebuilds are automatic.

Copilot AI linked an issue Apr 3, 2026 that may be closed by this pull request
Copilot AI and others added 2 commits April 3, 2026 16:24
- Add Dockerfile with pre-installed R, Python, Julia, and Quarto dependencies
- Add .dockerignore to optimize Docker build context
- Add build-env-image.yml workflow to build/push image to GHCR weekly
- Update quarto-publish.yml to use the container image
- Update quarto-publish-update-cache.yml to use the container image

This eliminates 30-40 min of dependency installation per CI run by
pulling a pre-built image with all 180+ R packages, Python, Julia,
and Quarto already installed.

Agent-Logs-Url: https://github.com/openbiox/Bizard/sessions/01dddaf6-2291-43d5-8b63-d55977dd7136

Co-authored-by: ShixiangWang <25057508+ShixiangWang@users.noreply.github.com>
…ing, add comments

Agent-Logs-Url: https://github.com/openbiox/Bizard/sessions/01dddaf6-2291-43d5-8b63-d55977dd7136

Co-authored-by: ShixiangWang <25057508+ShixiangWang@users.noreply.github.com>
Copilot AI changed the title [WIP] Optimize CI build environment for page rendering Add Docker-based CI environment image on GHCR to eliminate repeated dependency installation Apr 3, 2026
Copilot AI requested a review from ShixiangWang April 3, 2026 16:30
@github-actions

github-actions Bot commented Apr 3, 2026

Copy link
Copy Markdown
Contributor

✅ QMD Format Check

No new QMD tutorial files to check.

Automated check by the PR Review workflow.
See contribution guidance for the expected tutorial format.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

环境准备工作优化

2 participants