diff --git a/.github/workflows/build-and-push.yaml b/.github/workflows/build-and-push.yaml index c6f9595..174c9b9 100644 --- a/.github/workflows/build-and-push.yaml +++ b/.github/workflows/build-and-push.yaml @@ -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 @@ -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: | @@ -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 @@ -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: | @@ -110,7 +76,6 @@ jobs: fi echo "tags=$TAGS" >> $GITHUB_OUTPUT - - name: Build Docker image uses: docker/build-push-action@v5 with: @@ -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 @@ -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 }} diff --git a/filtertabular/Dockerfile b/filtertabular/Dockerfile index 95a428e..22c8abf 100644 --- a/filtertabular/Dockerfile +++ b/filtertabular/Dockerfile @@ -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 @@ -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 diff --git a/package-information.json b/package-information.json index cd182ac..84784c6 100644 --- a/package-information.json +++ b/package-information.json @@ -1,5 +1,5 @@ { - "urgap": "3.2.18", + "urgap": "3.3.5", "packages": [ { "name": "plink", @@ -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 } diff --git a/plink/Dockerfile b/plink/Dockerfile index 3a8b929..ac53345 100644 --- a/plink/Dockerfile +++ b/plink/Dockerfile @@ -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 @@ -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"