Skip to content

Build funannotate2 Docker image (pixi + GitHub Actions)#51

Merged
nextgenusfs merged 6 commits intomainfrom
build-funannotate2-docker-image
Apr 21, 2026
Merged

Build funannotate2 Docker image (pixi + GitHub Actions)#51
nextgenusfs merged 6 commits intomainfrom
build-funannotate2-docker-image

Conversation

@nextgenusfs
Copy link
Copy Markdown
Owner

Summary

Adds a fully-functional nextgenusfs/funannotate2 Docker image assembled with pixi, plus a GitHub Actions workflow that builds and publishes it to GHCR (and Docker Hub once DOCKERHUB_USERNAME/DOCKERHUB_TOKEN secrets are set).

See the spec for full design rationale and verification notes.

Files added

  • pixi.toml / pixi.lock — pixi workspace with bioconda tooling (augustus, minimap2, miniprot, snap, glimmerhmm, diamond, trnascan-se, table2asn, pytantan, …), python deps (gfftk, gapmm2, buscolite, pyhmmer, pyfastx, tensorflow 2.10–2.15), and PyPI packages (funannotate2 source, funannotate2-addons, helixerlite, annorefine).
  • Dockerfile — three-stage build:
    1. build — pixi resolves the locked environment, then rebuilds pytantan from source with -DHAVE_AVX2:BOOL=OFF so it runs on any x86_64 host (incl. Rosetta 2 on Apple Silicon).
    2. dbs — runs funannotate2 install -d all into /opt/funannotate2_db on a dedicated layer (~3 GB; BUSCO lineages download at runtime).
    3. final — slim ubuntu:22.04 with the pixi env, databases, and captured activation script via tini.
  • .dockerignore — keeps the build context slim.
  • .github/workflows/docker.yml — builds on tag push v*, workflow_dispatch, and paths-filtered PRs (Dockerfile / pixi.* / docker.yml). PRs build-only; tag and dispatch push to GHCR (+ Docker Hub if secret is present).

Notable design choices

  • linux/amd64 only — bioconda coverage on arm is incomplete; target is HPC Linux x86_64. Apple Silicon users run under Rosetta.
  • pytantan rebuilt SSE4-only — PyPI/bioconda wheels ship AVX2 code that SIGILLs under Rosetta. SSE4.2 is the x86_64-v2 baseline (universal since ~2011), so the rebuild loses no practical compatibility. Draft upstream issue in the workspace.
  • BUSCO lineages intentionally not baked in — ~90 GB uncompressed, well past Docker Hub's 10 GB ceiling. predict/annotate fetch on demand; docs will describe mounting a host cache dir.
  • GeneMark not included — license-restricted.

Local verification (Docker Desktop on Apple Silicon, Rosetta 2)

  • docker build --target build succeeds (~3 min; pixi resolves lockfile, pytantan SSE4 rebuild ~23 s)
  • funannotate2 --help, funannotate2 install -s, f2a --help, helixerlite --help all exit 0
  • pytantan + RepeatFinder(default_scoring_matrix()) instantiates cleanly
  • Full end-to-end (dbs stage with funannotate2 install -d all) will be validated by this PR's CI run on native x86_64.

Follow-ups (after this merges and the image is verified)

  • Add DOCKERHUB_USERNAME + DOCKERHUB_TOKEN repo secrets to enable Docker Hub publishing.
  • Update docs/installation.rst and README.md with pixi and Docker install instructions.
  • File upstream issue at althonos/pytantan about the AVX2-only wheels (draft ready in workspace notes).

Pull Request opened by Augment Code with guidance from the PR author

Jon Palmer added 6 commits April 20, 2026 08:22
Agent-Id: agent-001dbe11-1134-451f-9706-c99fb75eb238
- Dockerfile (linux/amd64, 3 stages: pixi build -> dbs install -> minimal final)
- pixi.lock (linux-64, generated in prefix-dev/pixi container)
- .github/workflows/docker.yml (workflow_dispatch + v* tag; GHCR + Docker Hub with secret guard)

Agent-Id: agent-001dbe11-1134-451f-9706-c99fb75eb238
- Multi-stage Dockerfile (build -> dbs -> final) targeting linux/amd64
- pixi.lock generated in ghcr.io/prefix-dev/pixi container (linux-64 only)

Agent-Id: agent-001dbe11-1134-451f-9706-c99fb75eb238
Agent-Id: agent-001dbe11-1134-451f-9706-c99fb75eb238
Adds a pull_request trigger to docker.yml scoped to Dockerfile, pixi
config, and the workflow file itself, so image builds are validated
on PRs touching container-relevant files without running on every
commit. PRs build-only (no registry push); pushes happen only on
tag push or workflow_dispatch.
- README: promote Docker to primary install path; add pixi install recipe; relabel the bioconda section as Linux (conda).
- docs/installation.rst: new 'Using the Docker image' and 'Installing with pixi' sections at the top; keep existing conda and pip instructions intact.

Agent-Id: agent-001dbe11-1134-451f-9706-c99fb75eb238
@nextgenusfs nextgenusfs marked this pull request as ready for review April 21, 2026 01:21
@nextgenusfs nextgenusfs merged commit 1a7e335 into main Apr 21, 2026
6 of 7 checks passed
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.

1 participant