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
43 changes: 4 additions & 39 deletions .github/workflows/build-and-push.yaml
Original file line number Diff line number Diff line change
@@ -1,27 +1,17 @@
name: Build and Push Docker Images

on:
push:
pull_request:
branches:
- main
#pull_request:
# branches:
# - main
workflow_dispatch:
inputs:
package:
description: 'Package name to build (leave empty for all)'
required: false
default: ''
urgap_wheel_url:
description: 'URL to urgap wheel (for pre-release testing)'
required: false
default: ''

env:
REGISTRY: ghcr.io
IMAGE_PREFIX: ghcr.io/urgap

jobs:
build-matrix:
name: Generate Build Matrix
Expand All @@ -32,12 +22,10 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'

- name: Generate matrix
id: set-matrix
run: |
Expand All @@ -55,7 +43,6 @@ jobs:
else
echo "has_packages=false" >> $GITHUB_OUTPUT
fi

build-test-push:
name: Build ${{ matrix.name }}:${{ matrix.version }}
needs: build-matrix
Expand All @@ -70,35 +57,14 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Download urgap wheel from PyPI
id: download-wheel
run: |
mkdir -p ${{ matrix.name }}/wheel

if [ -n "${{ github.event.inputs.urgap_wheel_url }}" ]; then
# Use provided wheel URL
curl -L -o ${{ matrix.name }}/wheel/urgap.whl "${{ github.event.inputs.urgap_wheel_url }}"
else
# Download from PyPI
pip download urgap==${{ matrix.urgap_version }} --no-deps -d ${{ matrix.name }}/wheel/ || \
pip download urgap --no-deps -d ${{ matrix.name }}/wheel/
fi

WHEEL_FILE=$(ls ${{ matrix.name }}/wheel/*.whl | head -1)
WHEEL_NAME=$(basename "$WHEEL_FILE")
echo "wheel_name=$WHEEL_NAME" >> $GITHUB_OUTPUT

- name: Prepare Docker tags
id: tags
run: |
Expand All @@ -110,7 +76,6 @@ jobs:
fi

echo "tags=$TAGS" >> $GITHUB_OUTPUT

- name: Build Docker image
uses: docker/build-push-action@v5
with:
Expand All @@ -124,12 +89,14 @@ jobs:
URGAP=wheel/${{ steps.download-wheel.outputs.wheel_name }}
cache-from: type=gha
cache-to: type=gha,mode=max

- name: Run tests
run: |
IMAGE_TAG="${{ env.IMAGE_PREFIX }}/${{ matrix.name }}:${{ matrix.version }}"
CONTAINER_NAME="${{ matrix.name }}-test-$$"

# Start container
docker run -d --name "$CONTAINER_NAME" "$IMAGE_TAG"

# Copy tests into container
docker cp ${{ matrix.name }}/tests "$CONTAINER_NAME":/home/nonroot/tests

Expand All @@ -145,9 +112,7 @@ jobs:
# Cleanup
docker stop "$CONTAINER_NAME"
docker rm "$CONTAINER_NAME"

- name: Push Docker image
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
uses: docker/build-push-action@v5
with:
context: ${{ matrix.name }}
Expand Down
6 changes: 1 addition & 5 deletions filtertabular/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,12 @@ ARG BASEIMAGE

FROM ${BASEIMAGE}

ARG URGAP

RUN addgroup --system nonroot && \
adduser --system \
--ingroup nonroot \
--home /home/nonroot \
nonroot

COPY ${URGAP} /home/nonroot

ENV HOME=/home/nonroot
ENV VENV_PATH=$HOME/venv
ENV PATH=$VENV_PATH/bin:$PATH
Expand All @@ -20,7 +16,7 @@ USER nonroot
RUN python -m venv "$VENV_PATH" --system-site-packages

RUN pip install uv
RUN uv pip install /home/nonroot/${URGAP}["all"]
RUN uv pip install urgap["all"]

WORKDIR $HOME

Expand Down
4 changes: 2 additions & 2 deletions package-information.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"urgap": "3.2.18",
"urgap": "3.3.5",
"packages": [
{
"name": "plink",
Expand All @@ -11,7 +11,7 @@
{
"name": "filtertabular",
"versions": ["1.0.0"],
"base_image": "python:3.10",
"base_image": "python:3.13-slim-trixie",
"gh_url": "urgap/urgap.git",
"separate_venv": false
}
Expand Down
13 changes: 3 additions & 10 deletions plink/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ RUN cp $(which plink2 || which plink) /tmp/plink2
# Stage 2: Build final image with Python 3.11 + plink
FROM python:3.11-slim

ARG URGAP

# Copy plink binary from base image
COPY --from=plink-source /tmp/plink2 /usr/local/bin/plink2

Expand All @@ -18,14 +16,9 @@ RUN useradd -m -s /bin/bash nonroot
USER nonroot
WORKDIR /home/nonroot

RUN python -m venv /home/nonroot/venv

# Copy and install urgap wheel into venv
COPY --chown=nonroot:nonroot ${URGAP} /tmp/
RUN /home/nonroot/venv/bin/pip install --upgrade pip && \
WHEEL=$(ls /tmp/*.whl) && \
/home/nonroot/venv/bin/pip install "${WHEEL}[all]" && \
rm /tmp/*.whl
RUN python -m venv /home/nonroot/venv && \
/home/nonroot/venv/bin/pip install --upgrade pip && \
/home/nonroot/venv/bin/pip install urgap["all"]

# Add venv to PATH
ENV PATH="/home/nonroot/venv/bin:$PATH"
Expand Down