Repository navigation
Serve models through chunkmirage by default #110
Workflow file for this run
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: Tests | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| jobs: | |
| test: | |
| name: pytest (${{ matrix.extras }}) | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| # "test" alone proves the core install works without peft; the finetune | |
| # leg runs the tests marked `finetune` too. | |
| extras: ["test", "test,finetune"] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.11" | |
| cache: pip | |
| - name: Install | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -e ".[${{ matrix.extras }}]" --extra-index-url https://download.pytorch.org/whl/cpu | |
| - name: Test | |
| run: pytest -m "not gpu and not lsf and not minio and not network" | |
| lint: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.11" | |
| - run: pip install ruff | |
| # Syntax errors, undefined names and similar outright bugs only; style is | |
| # not enforced. | |
| - run: ruff check --select E9,F63,F7,F82 cellmap_flow tests | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: "22" | |
| # The dashboard's scripts are ES modules, served as they are. Plain | |
| # `node --check file.js` passes a file with import/export in it even | |
| # when it has a syntax error, so each one goes in as a module on stdin. | |
| - name: Dashboard JavaScript syntax | |
| run: | | |
| status=0 | |
| for f in $(find cellmap_flow/dashboard/static/js -name '*.js' | sort); do | |
| node --input-type=module --check < "$f" || { echo "::error file=$f::syntax error"; status=1; } | |
| done | |
| exit $status | |
| package: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.11" | |
| - run: pip install build twine | |
| - run: python -m build | |
| - run: twine check dist/* | |
| - name: Wheel contains only the cellmap_flow package | |
| run: | | |
| python - <<'EOF' | |
| import glob, zipfile | |
| wheel = glob.glob("dist/*.whl")[0] | |
| names = zipfile.ZipFile(wheel).namelist() | |
| top = {n.split("/")[0] for n in names} | |
| stray = {t for t in top if t != "cellmap_flow" and not t.endswith(".dist-info")} | |
| assert not stray, f"wheel installs stray top-level entries: {sorted(stray)}" | |
| assert "cellmap_flow/models/models.yaml" in names, "model catalog missing from wheel" | |
| print(wheel, "ok") | |
| EOF | |
| # The pages load their templates' scripts and styles from the package | |
| # as they are, so a file the package data misses breaks a page silently. | |
| - name: Wheel ships every dashboard template and static file | |
| run: | | |
| python - <<'EOF' | |
| import glob, os, zipfile | |
| wheel = glob.glob("dist/*.whl")[0] | |
| names = set(zipfile.ZipFile(wheel).namelist()) | |
| files = [p for d in ("templates", "static") | |
| for p in glob.glob(f"cellmap_flow/dashboard/{d}/**/*", recursive=True) | |
| if os.path.isfile(p)] | |
| missing = sorted(p for p in files if p not in names) | |
| assert files and not missing, f"dashboard files missing from the wheel: {missing}" | |
| assert any(n.startswith("cellmap_flow/dashboard/static/js/lib/") for n in names), \ | |
| "static/js/lib/*.js missing from the wheel" | |
| print(len(files), "dashboard files ok") | |
| EOF | |
| - name: Installed wheel imports | |
| run: | | |
| python -m venv /tmp/wheel-env | |
| /tmp/wheel-env/bin/pip install dist/*.whl --extra-index-url https://download.pytorch.org/whl/cpu | |
| cd /tmp && /tmp/wheel-env/bin/python -c "import cellmap_flow; from cellmap_flow.globals import g; print(cellmap_flow.__version__, sorted(g.model_catalog))" | |
| deploy-manifest: | |
| name: pixi lockfile matches pixi.toml | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| # Fileglancer launches cellmap-flow with `pixi run` from the lockfile | |
| # (runnables.yaml), so a manifest change without a re-lock would break | |
| # the deployment at install time. | |
| - run: curl -fsSL https://pixi.sh/install.sh | PIXI_VERSION=v0.80.0 bash | |
| - run: ~/.pixi/bin/pixi lock --check |