Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Only pixi.toml, pixi.lock, pyproject.toml, README.md, src/ and db/ go into the image.
*
!pixi.toml
!pixi.lock
!pyproject.toml
!README.md
!src/
!db/
**/__pycache__
db/*.duckdb
db/candidates/
83 changes: 83 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
name: docker

# Release images: ghcr.io/stajichlab/matpredict:<version> and :latest.
# A v* tag or a published release builds and pushes; a pull request that touches
# the image inputs builds and smoke-tests without pushing; workflow_dispatch
# builds and pushes on demand.
on:
push:
tags: ["v*"]
release:
types: [published]
workflow_dispatch:
pull_request:
paths:
- Dockerfile
- .dockerignore
- pixi.toml
- pixi.lock
- pyproject.toml
- .github/workflows/docker.yml

permissions:
contents: read
packages: write

env:
IMAGE: ghcr.io/${{ github.repository_owner }}/matpredict

jobs:
image:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Image tags
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.IMAGE }}
tags: |
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=raw,value=latest,enable=${{ startsWith(github.ref, 'refs/tags/v') || github.event_name == 'release' }}
type=ref,event=pr
type=sha,format=short

- uses: docker/setup-buildx-action@v3

- name: Build (load locally for the smoke test)
uses: docker/build-push-action@v6
with:
context: .
load: true
tags: matpredict:test
build-args: VERSION=${{ steps.meta.outputs.version }}
cache-from: type=gha
cache-to: type=gha,mode=max

- name: Smoke test
run: |
docker run --rm matpredict:test --version
docker run --rm matpredict:test detect --help > /dev/null
docker run --rm --entrypoint /bin/bash matpredict:test /shell-hook.sh \
bash -c 'for t in tblastn diamond miniprot exonerate mafft augustus taxonkit; do command -v $t > /dev/null || { echo "missing $t"; exit 1; }; done; python -c "import pyhmmer, MATPredict"'

- name: Log in to GHCR
if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Push
if: github.event_name != 'pull_request'
uses: docker/build-push-action@v6
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: VERSION=${{ steps.meta.outputs.version }}
cache-from: type=gha
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
.matpredict_cache/
__pycache__/
*.pyc
pixi.lock
.pytest_cache/
.pixi/
db/*.duckdb
31 changes: 31 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,37 @@ All notable changes to MATPredict. Versions follow [semantic versioning](https:/
release tags may carry a clade suffix naming the lineage whose infrastructure that
release completed.

## [Unreleased]

### Changed
- No default NCBI e-mail. The address comes from `$MATPREDICT_NCBI_EMAIL` or the
`[ncbi]` table of `~/.config/matpredict/config.toml` (`$MATPREDICT_CONFIG`,
`$XDG_CONFIG_HOME`). Without one, requests carry no e-mail and one warning is
logged. Requests now send `tool=MATPredict`.
- The NCBI response cache key leaves out `email`, `api_key` and `tool`. Entries
cached under the old full-URL key are still found and copied forward.
- README rewritten: goals, workflow, curation process, quickstart, usage,
validation, citation.

### Added
- `pixi.lock` is now committed, so environments and images are reproducible.
- `environment.yml` for conda/mamba users (exported from `pixi.toml`).
- `Dockerfile` (pixi build stage, Ubuntu 24.04 runtime with the environment,
the package and `db/`).
- `.github/workflows/docker.yml`: builds and smoke-tests the image on pull
requests that touch the image inputs; on a `v*` tag, a published release or a
manual run it also pushes `ghcr.io/stajichlab/matpredict:<version>` and
`:latest`.

## [0.6.0] — 2026-10-03 — `v0.6.0`

Post-#9 work merged as PR #10: confidence and tier rules, the V3 polish cap,
the flank-carried rule, `not_searched` routing, the MAT-gene gate, the P1
paralog class, deterministic classifier builds, scope-only families,
`idiomorph_class`, the regression check, new curated records, and held-out
validation (LCG 536/621, Jena 61/64, Zygo 23/23). See the `v0.6.0` tag message
and `analysis/INDEX.md`.

## [0.5.0] — 2026-09-20 — `v0.5.0-mucoromycota`

Mucoromycota detection becomes usable end to end: idiomorph calling works, the
Expand Down
34 changes: 34 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# MATPredict container image.
# Build stage: solve nothing, install the locked pixi environment (pixi.lock).
# Runtime stage: the environment, the package source and the curated database.
#
# docker build -t matpredict .
# docker run --rm -v "$PWD":/data -e MATPREDICT_NCBI_EMAIL=you@example.org \
# matpredict detect --genome /data/genome.fna --taxid 4837 --out-dir /data/out

FROM ghcr.io/prefix-dev/pixi:0.71.3-noble AS build
WORKDIR /app
COPY pixi.toml pixi.lock pyproject.toml README.md ./
COPY src ./src
RUN pixi install --locked -e default \
&& pixi shell-hook -e default -s bash > /shell-hook.sh \
&& echo 'exec "$@"' >> /shell-hook.sh

FROM ubuntu:24.04 AS runtime
ARG VERSION=dev
LABEL org.opencontainers.image.title="MATPredict" \
org.opencontainers.image.description="Find and type fungal mating-type (MAT) loci in genome assemblies" \
org.opencontainers.image.source="https://github.com/stajichlab/MATPredict" \
org.opencontainers.image.version="${VERSION}"
# The environment keeps its build path (/app/.pixi/envs/default): conda
# packages and the editable MATPredict install record absolute paths.
COPY --from=build /app/.pixi/envs/default /app/.pixi/envs/default
COPY --from=build /shell-hook.sh /shell-hook.sh
COPY --from=build /app/src /app/src
COPY pyproject.toml README.md /app/
COPY db /app/db
ENV MATPREDICT_DB_ROOT=/app/db \
MATPREDICT_CACHE_DIR=/data/.matpredict_cache
WORKDIR /data
ENTRYPOINT ["/bin/bash", "/shell-hook.sh", "matpredict"]
CMD ["--help"]
Loading
Loading