From b1ebe8734343e0427528d9de311b00251b11104b Mon Sep 17 00:00:00 2001 From: Bishoy Hanna Date: Mon, 27 Apr 2026 16:12:01 +0000 Subject: [PATCH 1/2] Harden CI workflow and standardize Docker Hub docs for genmap --- .github/workflows/build-publish.yml | 34 +++++++++++++++++++++++------ README.md | 18 ++++++++++++--- 2 files changed, 42 insertions(+), 10 deletions(-) diff --git a/.github/workflows/build-publish.yml b/.github/workflows/build-publish.yml index 9170884..ddd09cc 100644 --- a/.github/workflows/build-publish.yml +++ b/.github/workflows/build-publish.yml @@ -1,34 +1,54 @@ name: Build and Publish genmap on: + pull_request: push: branches: - main - tags: - - 'v*' jobs: - build-publish: + test: runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v5 + + - name: Build smoke-test image + uses: docker/build-push-action@v7 + with: + context: . + file: ./Dockerfile + load: true + tags: picotainers-local/genmap:smoke + - name: Smoke test + run: | + set -euo pipefail + docker run --rm picotainers-local/genmap:smoke --help > help.txt + grep -Eiq 'genmap|usage|version|options' help.txt + + publish: + needs: test + if: github.event_name == 'push' && github.ref == 'refs/heads/main' + runs-on: ubuntu-latest steps: - name: Checkout code - uses: actions/checkout@v4 + uses: actions/checkout@v5 - name: Login to DockerHub - uses: docker/login-action@v3 + uses: docker/login-action@v4 with: username: ${{ secrets.DOCKER_HUB_USERNAME }} password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} - name: Build and push id: docker_build - uses: docker/build-push-action@v6 + uses: docker/build-push-action@v7 with: context: . file: ./Dockerfile push: true - tags: picotainers/genmap:latest + tags: docker.io/picotainers/genmap:latest - name: Image digest run: echo ${{ steps.docker_build.outputs.digest }} diff --git a/README.md b/README.md index 7deace5..f4e0233 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,19 @@ # genmap -Small compatibility-focused container for `genmap`. +Minimal container for +auto-generated wrapper around the upstream genmap tool. -## how to use +## Quick Usage ```bash -docker run --rm -v "$(pwd):/data" picotainers/genmap:latest --help +docker run --rm docker.io/picotainers/genmap:latest --help +``` + +## Usage +```bash +# Run in current directory +docker run --rm -v "$(pwd):/data" -w /data docker.io/picotainers/genmap:latest --help +``` + +## Building +```bash +docker build -t docker.io/picotainers/genmap:latest . ``` From 8dceebb2944fbe696db20a99f719cce57d3f6ad0 Mon Sep 17 00:00:00 2001 From: Bishoy Hanna Date: Fri, 7 Aug 2026 16:19:08 +0000 Subject: [PATCH 2/2] Switch genmap image to upstream source build --- Dockerfile | 74 +++++++++++++++++++++++++++++++----------------------- README.md | 3 +-- 2 files changed, 43 insertions(+), 34 deletions(-) diff --git a/Dockerfile b/Dockerfile index 40d0b22..2050c45 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,34 +1,44 @@ # syntax=docker/dockerfile:1 -# Compatibility-first template for genmap. -# Installs package from Bioconda and copies the full conda runtime to avoid missing libs/interpreters. - -FROM mambaorg/micromamba:2.0.5-debian12-slim AS builder - -RUN micromamba install -y -n base -c conda-forge -c bioconda \ - genmap \ - && micromamba clean --all --yes - -# Resolve a runnable command for this package. -# Prefer exact match, then underscore variant, then prefix match. -RUN set -eux; \ - BIN=""; \ - if [ -x "/opt/conda/bin/genmap" ]; then BIN="/opt/conda/bin/genmap"; fi; \ - if [ -z "$BIN" ]; then CAND="/opt/conda/bin/$(echo genmap | tr '-' '_')"; [ -x "$CAND" ] && BIN="$CAND" || true; fi; \ - if [ -z "$BIN" ]; then BIN="$(find /opt/conda/bin -maxdepth 1 -type f -perm -111 -name 'genmap*' | head -n1 || true)"; fi; \ - test -n "$BIN"; \ - printf '%s\n' "$BIN" > /tmp/tool-entry-path - -FROM mambaorg/micromamba:2.0.5-debian12-slim - -COPY --from=builder /opt/conda /opt/conda -COPY --from=builder /tmp/tool-entry-path /tmp/tool-entry-path - -USER root -ENV PATH="/opt/conda/bin:${PATH}" -ENV LD_LIBRARY_PATH="/opt/conda/lib:/opt/conda/lib64" -RUN set -eux; \ - BIN="$(cat /tmp/tool-entry-path)"; \ - printf '#!/usr/bin/env bash\nexec "%s" "$@"\n' "$BIN" > /usr/local/bin/genmap -RUN chmod +x /usr/local/bin/genmap && rm -f /tmp/tool-entry-path + +FROM ubuntu:22.04 AS builder + +ENV DEBIAN_FRONTEND=noninteractive + +ARG GENMAP_REPO=https://github.com/cpockrandt/genmap.git +ARG GENMAP_REF=genmap-v1.3.0 + +RUN apt-get update && \ + apt-get install -y --no-install-recommends \ + build-essential \ + ca-certificates \ + cmake \ + git \ + zlib1g-dev && \ + rm -rf /var/lib/apt/lists/* + +WORKDIR /src +RUN git clone --depth 1 --branch "${GENMAP_REF}" "${GENMAP_REPO}" /src/genmap && \ + cd /src/genmap && \ + git -c url."https://github.com/".insteadOf=git://github.com/ submodule update --init --recursive --depth 1 + +WORKDIR /src/genmap +RUN cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DGENMAP_NATIVE_BUILD=OFF && \ + cmake --build build --target genmap -j"$(nproc)" && \ + cmake --install build --prefix /opt/genmap + +FROM ubuntu:22.04 + +ENV DEBIAN_FRONTEND=noninteractive + +RUN apt-get update && \ + apt-get install -y --no-install-recommends \ + ca-certificates \ + libgomp1 \ + libstdc++6 && \ + rm -rf /var/lib/apt/lists/* + +COPY --from=builder /opt/genmap /opt/genmap +ENV PATH="/opt/genmap/bin:${PATH}" + WORKDIR /data -ENTRYPOINT ["/usr/local/bin/genmap"] +ENTRYPOINT ["genmap"] diff --git a/README.md b/README.md index f4e0233..f77220b 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,5 @@ # genmap -Minimal container for -auto-generated wrapper around the upstream genmap tool. +Container image for `genmap` built from upstream source. ## Quick Usage ```bash