From e29ca7af47d89b90c4deca684494bc809e3bc8e7 Mon Sep 17 00:00:00 2001 From: farchaab Date: Thu, 14 Nov 2024 09:35:24 +0100 Subject: [PATCH 1/3] adde env.yaml --- env.yaml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 env.yaml diff --git a/env.yaml b/env.yaml new file mode 100644 index 0000000..6dcff28 --- /dev/null +++ b/env.yaml @@ -0,0 +1,16 @@ +channels: + - conda-forge + - bioconda +dependencies: + - apptainer =1.3.2 + - python =3.12 + - pip + - Click =8.1.3 + - metasnek =0.0.8 + - snaketool-utils =0.0.5 + - snakemake-minimal =8.24 + - snakemake-executor-plugin-slurm =0.11.2 + - attrmap =0.0.7 + - biopython =1.83 + - pandas =2.2.1 + From 04553dfd7b61a890fc93ab1c9de6aa5e35546669 Mon Sep 17 00:00:00 2001 From: farchaab Date: Thu, 14 Nov 2024 09:35:34 +0100 Subject: [PATCH 2/3] added docker file --- Dockerfile | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..328faaf --- /dev/null +++ b/Dockerfile @@ -0,0 +1,22 @@ +FROM mambaorg/micromamba +LABEL org.opencontainers.image.source=https://github.com/metagenlab/zAMP +LABEL org.opencontainers.image.description="Snakemake pipeline for convenient amplicon metagenomics anlysis" +LABEL org.opencontainers.image.licenses=MIT +ENV LANG=C.UTF-8 +ENV SHELL=/bin/bash + +USER root +ENV APT_PKGS="procps ca-certificates" +RUN apt-get update \ + && apt-get install -y --no-install-recommends ${APT_PKGS} \ + && apt-get clean \ + && rm -rf /var/lib/apt /var/lib/dpkg /var/lib/cache /var/lib/log +USER $MAMBA_USER + +COPY --chown=$MAMBA_USER:$MAMBA_USER . /pkg +RUN micromamba config set extract_threads 1 && \ + micromamba install -n base -y -f /pkg/env.yaml && \ + micromamba clean -afy +ARG MAMBA_DOCKERFILE_ACTIVATE=1 +RUN pip install /pkg --no-deps --no-build-isolation --no-cache-dir -vvv +ENV PATH="/opt/conda/bin:$PATH" XDG_CACHE_HOME=/tmp From 040cedcb03dee9b4d37c36b5b8cea1a1c1e8bf42 Mon Sep 17 00:00:00 2001 From: farchaab Date: Thu, 14 Nov 2024 09:36:10 +0100 Subject: [PATCH 3/3] added docker publish workflow --- .github/workflows/docker-publish.yml | 78 ++++++++++++++++++++++++++++ 1 file changed, 78 insertions(+) create mode 100644 .github/workflows/docker-publish.yml diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml new file mode 100644 index 0000000..4d41ed4 --- /dev/null +++ b/.github/workflows/docker-publish.yml @@ -0,0 +1,78 @@ +name: Publish Docker image + +on: + pull_request: + paths: + - "Dockerfile" + - "env.yaml" + - ".github/workflows/docker-publish.yml" + - "zamp/**" + - "setup.py" + - "!docs/**" + - "!*.md" + - "!LICENSE" + push: + branches: [main] + paths: + - "Dockerfile" + - "env.yaml" + - ".github/workflows/docker-publish.yml" + - "zamp/**" + - "setup.py" + - "!docs/**" + - "!*.md" + - "!LICENSE" + + release: + types: [published] + +jobs: + push_to_registry: + if: github.repository == 'metagenlab/zAMP' + name: Build + Push Docker image + runs-on: ubuntu-latest + steps: + - name: Check out the repo + uses: actions/checkout@v4 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@v3 + + - name: Login to Docker Hub + uses: docker/login-action@v3 + with: + username: ${{ vars.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Login to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Push dev image + uses: docker/build-push-action@v6 + if: github.event_name == 'push' + with: + platforms: linux/amd64,linux/arm64 + push: true + tags: | + ghcr.io/metagenlab/zamp:dev + metagenlab/zamp:dev + + - name: Push release image + uses: docker/build-push-action@v6 + if: github.event_name == 'release' + with: + platforms: linux/amd64,linux/arm64 + push: true + tags: | + ghcr.io/metagenlab/zamp:${{ github.event.release.tag_name }} + ghcr.io/metagenlab/zamp:latest + metagenlab/zamp:${{ github.event.release.tag_name }} + metagenlab/zamp:latest