Retile demo site #14
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Retile demo site | |
| on: | |
| workflow_dispatch: {} | |
| permissions: | |
| contents: read | |
| env: | |
| PIP_CACHE_KEY: retile-pip-${{ github.run_id }} | |
| PYTHONUNBUFFERED: 1 | |
| PYTHON_VER: "3.14t" | |
| PYTHON_DEPS: "boto3 openslide-bin openslide-python requests" | |
| jobs: | |
| setup: | |
| name: Set up tiling | |
| environment: demo-site | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check out repo | |
| uses: actions/checkout@v5 | |
| - name: Set up Python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: ${{ env.PYTHON_VER }} | |
| - name: Install dependencies | |
| run: pip install --break-system-packages ${PYTHON_DEPS} | |
| - name: Cache dependencies | |
| uses: actions/cache/save@v4 | |
| with: | |
| key: ${{ env.PIP_CACHE_KEY }} | |
| path: /home/runner/.cache/pip | |
| - name: Set up tiling | |
| id: start-tiling | |
| working-directory: demo | |
| env: | |
| AWS_ACCESS_KEY_ID: ${{ secrets.DEMO_TILER_AWS_KEY_ID }} | |
| AWS_SECRET_ACCESS_KEY: ${{ secrets.DEMO_TILER_AWS_SECRET_KEY }} | |
| run: | | |
| ./_synctiles.py start "${{ vars.DEMO_TILER_BUCKET }}" context matrix | |
| echo "slide-matrix=$(cat matrix)" >> $GITHUB_OUTPUT | |
| - name: Upload context | |
| uses: actions/upload-artifact@v5 | |
| with: | |
| name: context | |
| path: demo/context | |
| outputs: | |
| slide-matrix: ${{ steps.start-tiling.outputs.slide-matrix }} | |
| tile: | |
| name: Tile | |
| environment: demo-site | |
| needs: setup | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: ${{ fromJson(needs.setup.outputs.slide-matrix) }} | |
| steps: | |
| - name: Check out repo | |
| uses: actions/checkout@v5 | |
| - name: Set up Python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: ${{ env.PYTHON_VER }} | |
| - name: Cache dependencies | |
| uses: actions/cache/restore@v4 | |
| with: | |
| key: ${{ env.PIP_CACHE_KEY }} | |
| path: /home/runner/.cache/pip | |
| fail-on-cache-miss: true | |
| - name: Install dependencies | |
| run: pip install --break-system-packages ${PYTHON_DEPS} | |
| - name: Download context | |
| uses: actions/download-artifact@v6 | |
| with: | |
| name: context | |
| path: demo | |
| - name: Tile slide | |
| working-directory: demo | |
| env: | |
| AWS_ACCESS_KEY_ID: ${{ secrets.DEMO_TILER_AWS_KEY_ID }} | |
| AWS_SECRET_ACCESS_KEY: ${{ secrets.DEMO_TILER_AWS_SECRET_KEY }} | |
| run: | | |
| ./_synctiles.py tile context "${{ matrix.slide }}" summary | |
| echo "ARTIFACT_NAME=summary-$(echo "${{ matrix.slide }}" | tr -c "a-zA-Z0-9\n" _)" >> $GITHUB_ENV | |
| - name: Upload summary | |
| uses: actions/upload-artifact@v5 | |
| with: | |
| name: ${{ env.ARTIFACT_NAME }} | |
| path: demo/summary | |
| finish: | |
| name: Finish tiling | |
| environment: demo-site | |
| needs: tile | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check out repo | |
| uses: actions/checkout@v5 | |
| - name: Set up Python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: ${{ env.PYTHON_VER }} | |
| - name: Cache dependencies | |
| uses: actions/cache/restore@v4 | |
| with: | |
| key: ${{ env.PIP_CACHE_KEY }} | |
| path: /home/runner/.cache/pip | |
| fail-on-cache-miss: true | |
| - name: Install dependencies | |
| run: pip install --break-system-packages ${PYTHON_DEPS} | |
| - name: Download context | |
| uses: actions/download-artifact@v6 | |
| with: | |
| name: context | |
| path: demo | |
| - name: Download summaries | |
| uses: actions/download-artifact@v6 | |
| with: | |
| pattern: "summary-*" | |
| path: demo/summary | |
| merge-multiple: true | |
| - name: Finish tiling | |
| working-directory: demo | |
| env: | |
| AWS_ACCESS_KEY_ID: ${{ secrets.DEMO_TILER_AWS_KEY_ID }} | |
| AWS_SECRET_ACCESS_KEY: ${{ secrets.DEMO_TILER_AWS_SECRET_KEY }} | |
| run: | | |
| ./_synctiles.py finish context summary |