Containers¶
The pipeline uses two images from the GitHub Container Registry (ghcr.io):
| Image | Contents | Pin | Pin location |
|---|---|---|---|
ghcr.io/boulardlab/3t-seq |
All conda envs of the pipeline | :env-<hash> |
containerized: line in workflow/Snakefile |
ghcr.io/boulardlab/3t-seq/salmonte |
SalmonTE | :X.Y.Z (release version) |
container: lines in workflow/rules/salmonTE.smk |
All pins must use a fixed tag. Do not use :latest and do not omit the tag.
The check job in container-check.yml enforces this rule.
3t-seq image¶
How the pin works¶
pixi run containerizerunssnakemake --containerize. The command writes theDockerfile.- The
Dockerfilecontains the labelio.github.snakemake.conda_env_hash. Its value is the env hash. container_pin.py updatewrites the tagenv-<hash>into thecontainerized:line ofworkflow/Snakefile.build-3t-seq.ymlbuilds the image from theDockerfileand tags itenv-<hash>.
Why the pin must match¶
Snakemake finds each conda env inside the image by its content hash. When you change a conda env, its hash changes. If the pinned image does not contain the new env, Snakemake stops with an error similar to this one:
The text of the error can be different in other Snakemake versions.
The env-<hash> tag changes when any conda env changes.
Thus, each commit pins an image that contains exactly its conda envs.
Procedure: change a conda env¶
- Edit the file in
workflow/env/. - Run
pixi run containerize. - Make sure that
git diffshows changes inDockerfileandworkflow/Snakefile. - Commit the env file,
Dockerfileandworkflow/Snakefilein the same commit. - Push the branch and open a PR from a branch in this repository.
- Wait for
build-3t-seq.ymlto buildenv-<hash>. Thecheckjob waits for this build.
Do not edit the Dockerfile or the containerized: line by hand.
The dockerfile-sync job regenerates both files and fails on a difference.
Make sure that conda can solve each env for linux/amd64 and linux/arm64.
build-3t-seq.yml builds both platforms.
SalmonTE image¶
The SalmonTE image has its own Dockerfile in assets/docker/salmonTE/.
It does not use the conda envs, so its tag is the release version.
- Release-please updates the version in
workflow/rules/salmonTE.smk. The lines have the marker# x-release-please-version. build-salmonte.ymlbuilds:X.Y.Zfrom the release PR, before the PR merges.- After the git tag
vX.Y.Zexists, the workflow does not overwrite:X.Y.Z.
A change to assets/docker/salmonTE/Dockerfile does not change the pin.
PRs and the e2e job use the old :X.Y.Z image until the next release PR.
To test a new SalmonTE image earlier, do these steps:
- Run
gh workflow run build-salmonte.yml --ref <branch>. Do not give aversioninput. - Find the
<branch>-<short-sha>tag in the build log. The workflow replaces/in the branch name with-. - Pin that tag in
workflow/rules/salmonTE.smkon your branch, and run the tests. - Put back the
X.Y.Zpin before the PR merges.
When CI builds images¶
| Event | 3t-seq image | SalmonTE image |
|---|---|---|
PR to dev or main that changes Dockerfile or the workflow file (branch in this repo) |
Builds env-<hash> if it does not exist. Otherwise, retags the existing image. |
No |
Release PR to main |
Only if Dockerfile changed |
Builds :X.Y.Z |
Push to dev or main |
Builds or retags, only when Dockerfile or the workflow file changes |
Builds, only when assets/docker/salmonTE/Dockerfile or the workflow file changes |
Push of git tag vX.Y.Z |
Adds tag :X.Y.Z to env-<hash> |
Builds :X.Y.Z only if it is missing |
Manual run (workflow_dispatch) |
Builds or retags for the selected ref | Builds the selected ref, or :<version> |
| Fork PR | No | No |
When env-<hash> already exists, build-3t-seq.yml does not build again.
It points the other tags at the existing image.
Tags¶
| Tag | Image | Set by | Can it change? |
|---|---|---|---|
env-<hash> |
3t-seq | The first build of that env hash | No. CI never overwrites it. |
X.Y.Z |
3t-seq | Push of git tag vX.Y.Z |
No. CI skips it when it exists. |
X.Y.Z |
SalmonTE | Release PR or manual run | Yes, until git tag vX.Y.Z exists. Then no. |
<branch>, <branch>-<short-sha> |
Both | Push or manual run on a branch. PR builds do not set these tags. | Yes. It follows the branch. |
sha-<sha> |
Both | Each build or retag | No in practice. One commit gives one tag. |
latest |
Both | Push or manual run on main |
Yes. |
Pipeline code must pin env-<hash> or X.Y.Z. The other tags are for people, not for pins.
latest¶
- Only a workflow run on
mainmoveslatest. build-3t-seq.ymlruns on a push tomainonly when theDockerfilechanges. Thus,latestcan stay on an older image after a release.- To move
latestto the currentmain, rungh workflow run build-3t-seq.yml --ref main.