diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 18c04fc..97994cc 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -21,7 +21,15 @@ jobs: packages: write strategy: matrix: - lancedb: ["0.3.1", "0.3.4", "0.5", "0.16.0", "0.24.3", "0.29.2", "0.33.0", "0.36.0"] + include: + - { lancedb: "0.3.1", dockerfile: ./docker/Dockerfile.legacy } + - { lancedb: "0.3.4", dockerfile: ./docker/Dockerfile.legacy } + - { lancedb: "0.5", dockerfile: ./docker/Dockerfile.legacy } + - { lancedb: "0.16.0", dockerfile: ./docker/Dockerfile } + - { lancedb: "0.24.3", dockerfile: ./docker/Dockerfile } + - { lancedb: "0.29.2", dockerfile: ./docker/Dockerfile } + - { lancedb: "0.33.0", dockerfile: ./docker/Dockerfile } + - { lancedb: "0.36.0", dockerfile: ./docker/Dockerfile } steps: - name: Checkout repository @@ -64,7 +72,7 @@ jobs: uses: docker/build-push-action@v7 with: context: . - file: ./docker/Dockerfile + file: ${{ matrix.dockerfile }} load: true platforms: linux/amd64 tags: smoke:${{ matrix.lancedb }} @@ -126,7 +134,7 @@ jobs: uses: docker/build-push-action@v7 with: context: . - file: ./docker/Dockerfile + file: ${{ matrix.dockerfile }} push: ${{ github.event_name != 'pull_request' }} tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} @@ -141,17 +149,27 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - lancedb: ["0.3.1", "0.3.4", "0.5", "0.16.0", "0.24.3", "0.29.2", "0.33.0", "0.36.0"] + include: + - { lancedb: "0.3.1", legacy: true } + - { lancedb: "0.3.4", legacy: true } + - { lancedb: "0.5", legacy: true } + - { lancedb: "0.16.0", legacy: false } + - { lancedb: "0.24.3", legacy: false } + - { lancedb: "0.29.2", legacy: false } + - { lancedb: "0.33.0", legacy: false } + - { lancedb: "0.36.0", legacy: false } steps: - name: Checkout repository uses: actions/checkout@v5 - name: Set up Python + if: matrix.legacy == false uses: actions/setup-python@v6 with: python-version: '3.11' - name: Install dependencies + if: matrix.legacy == false run: | python -m pip install --upgrade pip pip install -c backend/constraints-${{ matrix.lancedb }}.txt \ @@ -160,6 +178,23 @@ jobs: pip install pytest httpx2 - name: Run API endpoint tests + if: matrix.legacy == false run: | cd backend python -m pytest tests/ -v + + - name: Build legacy test environment + if: matrix.legacy == true + run: | + docker build \ + -f docker/Dockerfile.legacy-test \ + --build-arg LANCEDB_VERSION=${{ matrix.lancedb }} \ + -t legacy-tests:${{ matrix.lancedb }} \ + . + + - name: Run API endpoint tests in legacy environment + if: matrix.legacy == true + run: | + docker run --rm \ + -v "${GITHUB_WORKSPACE}:/src:ro" \ + legacy-tests:${{ matrix.lancedb }} diff --git a/CHANGELOG.md b/CHANGELOG.md index ffe5678..97d2270 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -25,6 +25,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed - `docker build` no longer fails with "the destination must be a directory and end with a /". `COPY backend/*.py .` needs a trailing slash when it copies more than one file. The classic builder rejected it, the BuildKit builder did not (#62). - CI publishes no image until the test job passes. The build job now depends on the test job, so a failing test stops the release (#66). +- CI and release builds preserve the legacy LanceDB 0.3.1, 0.3.4, and 0.5 variants by reusing their last published dependency layers. Their packages are no longer available from PyPI (#92). ## [0.3.1] - 2026-06-11 diff --git a/README.md b/README.md index bc6719e..ef1e184 100644 --- a/README.md +++ b/README.md @@ -149,7 +149,9 @@ docker build -f docker/Dockerfile \ # Build multiple versions for testing docker build -f docker/Dockerfile --build-arg LANCEDB_VERSION=0.24.3 -t lance-data-viewer:lancedb-0.24.3 . docker build -f docker/Dockerfile --build-arg LANCEDB_VERSION=0.16.0 -t lance-data-viewer:lancedb-0.16.0 . -docker build -f docker/Dockerfile --build-arg LANCEDB_VERSION=0.3.4 -t lance-data-viewer:lancedb-0.3.4 . + +# Legacy packages are no longer on PyPI, so reuse their published dependency layer +docker build -f docker/Dockerfile.legacy --build-arg LANCEDB_VERSION=0.3.4 -t lance-data-viewer:lancedb-0.3.4 . # Make your Lance data readable (one-time setup) chmod -R o+rx data @@ -177,7 +179,9 @@ cd backend && python -m pytest tests/ -v ``` Swap the constraints file to test against a different Lance version. CI runs -the suite against every supported version. +the suite against every supported version. LanceDB 0.3.1, 0.3.4, and 0.5 can +only be tested through their published images because their packages are no +longer available from PyPI. ### Development workflow @@ -237,4 +241,4 @@ The viewer provides advanced visualization for vector embeddings: ### Contributing See [CONTRIBUTING.md](CONTRIBUTING.md) for the design constraints and how to -propose changes. Release history lives in [CHANGELOG.md](CHANGELOG.md). \ No newline at end of file +propose changes. Release history lives in [CHANGELOG.md](CHANGELOG.md). diff --git a/docker/Dockerfile.legacy b/docker/Dockerfile.legacy new file mode 100644 index 0000000..1f9ba70 --- /dev/null +++ b/docker/Dockerfile.legacy @@ -0,0 +1,51 @@ +ARG LEGACY_IMAGE=ghcr.io/lance-format/lance-data-viewer +ARG LANCEDB_VERSION=0.3.4 + +# LanceDB 0.3.1, 0.3.4, and 0.5 are no longer available from PyPI. Preserve +# their installed dependency trees from the last published multi-arch images, +# then build a clean runtime image with the current application source. +FROM ${LEGACY_IMAGE}:lancedb-${LANCEDB_VERSION} AS legacy-dependencies + +FROM python:3.11-slim-bookworm + +RUN groupadd -r appuser && useradd -r -g appuser -u 1001 appuser + +RUN apt-get update && apt-get install -y --no-install-recommends \ + curl \ + && rm -rf /var/lib/apt/lists/* + +COPY --from=legacy-dependencies /home/appuser/.local /home/appuser/.local + +WORKDIR /app + +COPY backend/*.py ./ +COPY VERSION . +COPY docker/entrypoint.sh /app/entrypoint.sh +COPY web/vanilla/ /web/ + +RUN chmod +x /app/entrypoint.sh +RUN chown -R appuser:appuser /app /web +RUN chmod -R 755 /web + +USER appuser + +ENV PATH=/home/appuser/.local/bin:$PATH +ENV DATA_PATH=/data +ENV PORT=8080 + +EXPOSE 8080 + +HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \ + CMD curl -fsS http://localhost:${PORT}/healthz || exit 1 + +ARG LANCEDB_VERSION=0.3.4 +ARG APP_VERSION=0.0.0-dev + +LABEL org.opencontainers.image.title="Lance Data Viewer" +LABEL org.opencontainers.image.description="Read-only web viewer for Lance datasets" +LABEL org.opencontainers.image.source="https://github.com/lance-format/lance-data-viewer" +LABEL org.opencontainers.image.version="${APP_VERSION}" +LABEL org.opencontainers.image.licenses="MIT" +LABEL com.github.lancedb.version="${LANCEDB_VERSION}" + +ENTRYPOINT ["/app/entrypoint.sh"] diff --git a/docker/Dockerfile.legacy-test b/docker/Dockerfile.legacy-test new file mode 100644 index 0000000..09738f6 --- /dev/null +++ b/docker/Dockerfile.legacy-test @@ -0,0 +1,14 @@ +ARG LEGACY_IMAGE=ghcr.io/lance-format/lance-data-viewer +ARG LANCEDB_VERSION=0.3.4 + +# Reuse only the unavailable legacy dependency set. The repository is mounted +# at /src when this image runs, so pytest always exercises the checked-out code. +FROM ${LEGACY_IMAGE}:lancedb-${LANCEDB_VERSION} + +USER root +RUN python -m pip install --no-cache-dir pytest httpx2 + +ENV PYTHONPATH=/home/appuser/.local/lib/python3.11/site-packages +WORKDIR /src/backend +ENTRYPOINT ["python", "-m", "pytest", "-o", "cache_dir=/tmp/pytest_cache", "tests/"] +CMD ["-v"]