Repository navigation
Add dat bypass, build-cluster-db CLI, and incremental improvements #10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
2995518
797a3ef
2fb34ef
caf9b26
3116dcc
ffc337c
cc175b5
d6a9112
a2fa10a
3229e22
4628df8
d74e4b6
3442870
63d793b
8dcaf3e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,9 +2,9 @@ name: pyspectrafuse Containers Build and Sync | |
|
|
||
| on: | ||
| push: | ||
| branches: [ "master" ] | ||
| branches: [master, main] | ||
| pull_request: | ||
| branches: [ "master" ] | ||
| branches: [master, main] | ||
| paths: | ||
| - 'Dockerfile' | ||
| - '.github/workflows/**' | ||
|
|
@@ -17,11 +17,6 @@ on: | |
| required: false | ||
| default: true | ||
| type: 'boolean' | ||
| push_release: | ||
| description: 'Push as release version' | ||
| required: false | ||
| default: false | ||
| type: boolean | ||
|
|
||
| jobs: | ||
| build-pyspectrafuse: | ||
|
|
@@ -32,8 +27,6 @@ jobs: | |
| packages: write | ||
|
|
||
| env: | ||
| RETRY_TIMES: 3 | ||
| RETRY_DELAY: 30 | ||
| SINGULARITY_TMPDIR: /tmp/singularity-tmp | ||
| SINGULARITY_CACHEDIR: /tmp/singularity-cache | ||
| SINGULARITY_LIBRARYDIR: /tmp/singularity-lib | ||
|
|
@@ -50,10 +43,10 @@ jobs: | |
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Set up Docker Buildx | ||
| uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f | ||
| uses: docker/setup-buildx-action@v3 | ||
|
|
||
| - name: Log in to GitHub Container Registry | ||
| uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef | ||
| uses: docker/login-action@v3 | ||
| with: | ||
| registry: ghcr.io | ||
| username: ${{ github.actor }} | ||
|
|
@@ -65,18 +58,13 @@ jobs: | |
| VERSION=$(grep '^version = ' pyproject.toml | cut -d'"' -f2) | ||
| echo "VERSION=$VERSION" >> $GITHUB_OUTPUT | ||
| echo "Extracted version: $VERSION" | ||
| # Extract major and minor version | ||
| MAJOR=$(echo $VERSION | cut -d'.' -f1) | ||
| MINOR=$(echo $VERSION | cut -d'.' -f2) | ||
| echo "MAJOR=$MAJOR" >> $GITHUB_OUTPUT | ||
| echo "MINOR=$MINOR" >> $GITHUB_OUTPUT | ||
| echo "Major.Minor: $MAJOR.$MINOR" | ||
|
|
||
| - name: Build and Push pyspectrafuse image | ||
| uses: docker/build-push-action@ca052bb54ab0790a636c9b5f226502c73d547a25 | ||
| uses: docker/build-push-action@v6 | ||
| with: | ||
| context: . | ||
| push: ${{ (github.event.inputs.push_images == true || github.event.inputs.push_images == '') && (github.event_name != 'pull_request') }} | ||
| load: ${{ github.event_name == 'pull_request' }} | ||
| tags: | | ||
| ghcr.io/bigbio/pyspectrafuse:latest | ||
| ghcr.io/bigbio/pyspectrafuse:${{ steps.version.outputs.VERSION }} | ||
|
|
@@ -85,31 +73,26 @@ jobs: | |
| build-args: | | ||
| BUILDKIT_INLINE_CACHE=1 | ||
| provenance: false | ||
| # Note: Only building for linux/amd64 | ||
| platforms: linux/amd64 | ||
|
|
||
| - name: Test container functionality | ||
| run: | | ||
| echo "Testing container import and CLI..." | ||
| docker run --rm ghcr.io/bigbio/pyspectrafuse:${{ steps.version.outputs.VERSION }} --help || docker run --rm ghcr.io/bigbio/pyspectrafuse:latest --help | ||
| echo "Testing CLI..." | ||
| docker run --rm ghcr.io/bigbio/pyspectrafuse:${{ steps.version.outputs.VERSION }} --help | ||
| echo "Testing Python imports..." | ||
| docker run --rm --entrypoint python ghcr.io/bigbio/pyspectrafuse:${{ steps.version.outputs.VERSION }} -c "from pyspectrafuse.pyspectrafuse import main; print('CLI import successful')" || docker run --rm --entrypoint python ghcr.io/bigbio/pyspectrafuse:latest -c "from pyspectrafuse.pyspectrafuse import main; print('CLI import successful')" | ||
| echo "Testing consensus strategy imports..." | ||
| docker run --rm --entrypoint python ghcr.io/bigbio/pyspectrafuse:${{ steps.version.outputs.VERSION }} -c "from pyspectrafuse.consensus_strategy.best_spetrum_strategy import BestSpectrumStrategy; print('BestSpectrumStrategy import successful')" || docker run --rm --entrypoint python ghcr.io/bigbio/pyspectrafuse:latest -c "from pyspectrafuse.consensus_strategy.best_spetrum_strategy import BestSpectrumStrategy; print('BestSpectrumStrategy import successful')" | ||
| echo "Testing spectrum_utils import (numba caching test)..." | ||
| docker run --rm --entrypoint python ghcr.io/bigbio/pyspectrafuse:${{ steps.version.outputs.VERSION }} -c "import spectrum_utils.spectrum as sus; print('spectrum_utils import successful')" || docker run --rm --entrypoint python ghcr.io/bigbio/pyspectrafuse:latest -c "import spectrum_utils.spectrum as sus; print('spectrum_utils import successful')" | ||
| docker run --rm --entrypoint python ghcr.io/bigbio/pyspectrafuse:${{ steps.version.outputs.VERSION }} -c "from pyspectrafuse.pyspectrafuse import main; print('CLI import OK')" | ||
| echo "Testing dat conversion import..." | ||
| docker run --rm --entrypoint python ghcr.io/bigbio/pyspectrafuse:${{ steps.version.outputs.VERSION }} -c "from pyspectrafuse.maracluster_dat import parquet_to_dat; print('dat conversion import OK')" | ||
| echo "All container tests passed!" | ||
|
Comment on lines
+80
to
86
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🌐 Web query:
💡 Result: To load the built image into the local Docker daemon when using docker/build-push-action v6 with push: false, set the load input to true. This corresponds to the Buildx --output=type=docker option, which exports the image to the Docker image store, making it available for commands like docker run. Example workflow step: - name: Build image uses: docker/build-push-action@v6 with: context: . push: false load: true tags: myimage:latest After this step, the image with the specified tags will be listed in docker images and usable locally. Note that load: true works for single-platform builds; for multi-platform, it loads only the current node platform's image. This behavior is consistent across v6 releases (up to v6.19.0 as of 2026-02) and is recommended in official Docker docs for testing before push workflows. Citations:
🏁 Script executed: cat .github/workflows/pyspectrafuse-containers.ymlRepository: bigbio/pyspectrafuse Length of output: 4512 Add The workflow will fail the "Test container functionality" step on pull_request events because the image is never loaded into the local Docker daemon. The Fix: Add load parameter - name: Build and Push pyspectrafuse image
uses: docker/build-push-action@v6
with:
context: .
push: ${{ (github.event.inputs.push_images == true || github.event.inputs.push_images == '') && (github.event_name != 'pull_request') }}
load: ${{ github.event_name == 'pull_request' }}
tags: |
ghcr.io/bigbio/pyspectrafuse:latest
ghcr.io/bigbio/pyspectrafuse:${{ steps.version.outputs.VERSION }}
cache-from: type=gha
cache-to: type=gha,mode=min
build-args: |
BUILDKIT_INLINE_CACHE=1
provenance: false
platforms: linux/amd64🤖 Prompt for AI Agents |
||
|
|
||
| - name: Free up disk space after build | ||
| run: | | ||
| docker image rm ghcr.io/bigbio/pyspectrafuse:latest || true | ||
| docker system prune -af || true | ||
| sudo apt-get clean | ||
| sudo rm -rf /var/lib/apt/lists/* | ||
|
|
||
| - name: Set up Singularity | ||
| if: ${{ (github.event.inputs.push_images == true || github.event.inputs.push_images == '') && (github.event_name != 'pull_request') }} | ||
| uses: eWaterCycle/setup-singularity@931d4e31109e875b13309ae1d07c70ca8fbc8537 | ||
| uses: eWaterCycle/setup-singularity@v7 | ||
| with: | ||
| singularity-version: 3.8.7 | ||
|
Comment on lines
+95
to
97
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🌐 Web query:
💡 Result: The latest version of the eWaterCycle/setup-singularity GitHub Action is v7, released on 2021-10-20. The repository explicitly recommends using the companion eWaterCycle/setup-apptainer action instead, as it supports newer versions of the open-source fork of Singularity (Apptainer). The setup-apptainer action's latest release is v2.0.0 (2022-10-25), with its last code push on 2025-01-07. For eWaterCycle workflows in 2026, official documentation prefers Apptainer over Singularity. Use uses: eWaterCycle/setup-apptainer@v2 with apptainer-version input (e.g., 1.3.6 or latest compatible). Example: - uses: eWaterCycle/setup-apptainer@v2 with: apptainer-version: 1.3.6 Apptainer is backward-compatible with Singularity images. Citations:
Migrate from The 🤖 Prompt for AI Agents |
||
|
|
||
|
|
@@ -125,23 +108,9 @@ jobs: | |
|
|
||
| - name: Login and Deploy Container | ||
| if: (github.event_name != 'pull_request') | ||
| env: | ||
| IS_RELEASE: ${{ github.event_name == 'release' }} | ||
| IS_MASTER: ${{ github.ref == 'refs/heads/master' && github.event_name == 'push' }} | ||
| run: | | ||
| echo ${{ secrets.GHCR_TOKEN }} | singularity remote login -u ${{ secrets.GHCR_USERNAME }} --password-stdin oras://ghcr.io | ||
| singularity push pyspectrafuse.sif oras://ghcr.io/bigbio/pyspectrafuse-sif:${{ steps.version.outputs.VERSION }} | ||
| if [[ "${{ env.IS_RELEASE }}" == "true" || "${{ env.IS_MASTER }}" == "true" ]]; then | ||
| if [[ "${{ github.event_name }}" == "release" || "${{ github.ref }}" == "refs/heads/master" ]]; then | ||
| singularity push pyspectrafuse.sif oras://ghcr.io/bigbio/pyspectrafuse-sif:latest | ||
| fi | ||
|
|
||
| - name: Notify on success | ||
| if: success() | ||
| run: | | ||
| echo "::notice::Successfully built and pushed pyspectrafuse Docker and Singularity images to ghcr.io/bigbio" | ||
|
|
||
| - name: Notify on failure | ||
| if: failure() | ||
| run: | | ||
| echo "::error::Failed to build or push pyspectrafuse images. Check the logs for details." | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,8 +5,8 @@ FROM python:3.10-slim | |
| LABEL base_image="python:3.10-slim" | ||
| LABEL version="1" | ||
| LABEL software="pyspectrafuse" | ||
| LABEL software.version="0.0.2" | ||
| LABEL about.summary="pyspectrafuse - Command-line utilities for spectrum clustering and conversion" | ||
| LABEL software.version="0.0.4" | ||
| LABEL about.summary="pyspectrafuse - CLI for spectral clustering and consensus library generation" | ||
| LABEL about.home="https://github.com/bigbio/pyspectrafuse" | ||
| LABEL about.documentation="https://github.com/bigbio/pyspectrafuse" | ||
| LABEL about.license_file="https://github.com/bigbio/pyspectrafuse/blob/master/LICENSE" | ||
|
|
@@ -21,7 +21,6 @@ MAINTAINER Yasset Perez-Riverol <ypriverol@gmail.com> | |
| ENV DEBIAN_FRONTEND=noninteractive | ||
|
|
||
| # Disable numba caching to avoid issues in containerized environments | ||
| # Numba caching fails in containers because it can't locate source files in site-packages | ||
| ENV NUMBA_DISABLE_CACHING=1 | ||
|
|
||
| ## Update and install packages | ||
|
|
@@ -31,20 +30,20 @@ RUN apt-get update -y && \ | |
| procps \ | ||
| && rm -rf /var/lib/apt/lists/* | ||
|
|
||
| ## Install uv | ||
| COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/ | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🌐 Web query:
💡 Result: The recommended secure Docker pattern for ghcr.io/astral-sh/uv is to pin to an explicit version tag and further pin by SHA256 digest for reproducibility and security against tag movement. Official uv documentation provides this example in a multi-stage Dockerfile: FROM python:3.12-slim-trixie COPY --from=ghcr.io/astral-sh/uv:0.11.6 /uv /uvx /bin/ For maximum security, replace the tag with Citations:
Pin the The Proposed change-COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/
+COPY --from=ghcr.io/astral-sh/uv:<pinned-version>@sha256:<pinned-digest> /uv /uvx /bin/Consult the official uv Docker integration guide for available version tags and instructions to retrieve the corresponding digest using 🤖 Prompt for AI Agents |
||
|
|
||
| ## Set working directory | ||
| WORKDIR /data/ | ||
|
|
||
| ## Copy requirements first for better caching | ||
| COPY requirements.txt . | ||
|
|
||
| ## Install Python dependencies | ||
| RUN pip install --no-cache-dir --upgrade pip && \ | ||
| pip install --no-cache-dir -r requirements.txt | ||
|
|
||
| ## Copy project files | ||
| COPY pyproject.toml . | ||
| COPY README.md . | ||
| COPY pyspectrafuse/ ./pyspectrafuse/ | ||
|
|
||
| ## Install the package | ||
| RUN pip install --no-cache-dir -e . | ||
| ## Install the package with uv | ||
| RUN uv pip install --system --no-cache . | ||
|
coderabbitai[bot] marked this conversation as resolved.
Resolved
|
||
|
|
||
| ## No ENTRYPOINT — Nextflow runs commands via /bin/bash | ||
| ## Use `pyspectrafuse` as the CLI command in scripts | ||
| CMD ["pyspectrafuse", "--help"] | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🌐 Web query:
Latest stable major versions of docker/setup-buildx-action, docker/login-action, and docker/build-push-action in 2026💡 Result:
Latest stable major versions as of 2026-04-17: - docker/setup-buildx-action: v4 (released 2026-03-05) - docker/login-action: v4 (released 2026-04-02) - docker/build-push-action: v7 (released 2026-03-05)
Citations:
Update Docker action versions to latest stable releases. The current versions are outdated:
docker/setup-buildx-action@v4,docker/login-action@v4, anddocker/build-push-action@v7are available as of April 2026.🤖 Prompt for AI Agents