diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml new file mode 100644 index 0000000..77ba9cf --- /dev/null +++ b/.github/workflows/build-test.yml @@ -0,0 +1,70 @@ +name: Docker Build Test + +on: + pull_request: + branches: + - main + - master + paths: + - 'docker/**' + - '.github/workflows/build-test.yml' + +jobs: + build-and-test: + runs-on: ubuntu-latest + timeout-minutes: 30 + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Build Docker image + uses: docker/build-push-action@v5 + with: + context: . + file: ./docker/Dockerfile + push: false + load: true + tags: nf-artist:pr-${{ github.event.pull_request.number }} + cache-from: type=gha + cache-to: type=gha,mode=max + + - name: Smoke Test - Verify Dependencies + run: | + docker run --rm nf-artist:pr-${{ github.event.pull_request.number }} \ + python -c " +import sys +import numpy +import zarr + +print(f'Python: {sys.version}') +print(f'NumPy: {numpy.__version__}') +print(f'Zarr: {zarr.__version__}') + +# Verify NumPy 2.x is installed +assert numpy.__version__.startswith('2.'), f'Expected NumPy 2.x, got {numpy.__version__}' + +# Verify zarr v3 is installed +assert zarr.__version__.startswith('3.'), f'Expected zarr 3.x, got {zarr.__version__}' + +# Test that zarr works with NumPy 2.x (no np.PINF errors) +import numpy as np +arr = zarr.array(np.random.random((10, 10))) +print(f'✓ Successfully created zarr array with shape {arr.shape}') + +print('✓ All dependency checks passed!') +" + + - name: Import Test - Verify All Critical Packages + run: | + docker run --rm nf-artist:pr-${{ github.event.pull_request.number }} \ + python -c " +import openslide +import cv2 +import synapseclient +import ome_types +print('✓ All critical packages imported successfully!') +" diff --git a/docker/Dockerfile b/docker/Dockerfile index 837001f..e831eba 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -49,14 +49,7 @@ RUN apt-get update && apt-get install --yes --no-install-recommends \ RUN source /venv/bin/activate && \ git clone https://github.com/adamjtaylor/miniature.git -b v2 && \ git clone https://github.com/adamjtaylor/auto-minerva.git -b minerva1point5 && \ - git clone https://github.com/labsyspharm/minerva-author.git -b v1.14.0 && \ - pip install git+https://github.com/labsyspharm/minerva-lib-python@master#egg=minerva-lib && \ - pip install \ - openslide-python \ - opencv-python-headless \ - synapseclient \ - mantel \ - "ome_types>=0.4.2" + git clone https://github.com/labsyspharm/minerva-author.git -b v1.14.0 ENV VIRTUAL_ENV=/venv ENV PATH="$VIRTUAL_ENV/bin:$PATH" diff --git a/docker/environment.yml b/docker/environment.yml index 900b770..4aa640f 100644 --- a/docker/environment.yml +++ b/docker/environment.yml @@ -5,7 +5,8 @@ channels: - fastai - bioconda dependencies: - - numpy>=1.23.0,<2.0 + - numpy>=1.26.0 + - zarr>=3.0.0 - Pillow - flask - waitress @@ -16,11 +17,9 @@ dependencies: - scikit-image - pandas - pooch - - zarr - cython - pyinstaller - altair - - matplotlib - umap-learn - scikit-learn - colormath @@ -33,3 +32,10 @@ dependencies: - libvips - estimagic - pyvips + - pip: + - openslide-python + - opencv-python-headless + - synapseclient + - mantel + - "ome_types>=0.4.2" + - git+https://github.com/labsyspharm/minerva-lib-python@master#egg=minerva-lib