From 721c322204289806c8a3b516204cc67c54ddbaac Mon Sep 17 00:00:00 2001 From: Matthew Evans Date: Tue, 8 Oct 2024 15:55:28 +0100 Subject: [PATCH] Use `uv` dev deps in CI, and remove dev docker builds --- .docker/app_dockerfile | 6 +++--- .docker/server_dockerfile | 4 ++-- .github/workflows/ci.yml | 36 ++---------------------------------- 3 files changed, 7 insertions(+), 39 deletions(-) diff --git a/.docker/app_dockerfile b/.docker/app_dockerfile index ed8ff594d..3b1ca9616 100644 --- a/.docker/app_dockerfile +++ b/.docker/app_dockerfile @@ -10,10 +10,10 @@ COPY webapp/package.json webapp/yarn.lock ./ # Using a custom node_modules location to avoid mounting it outside of docker RUN --mount=type=cache,target=/root/.cache/yarn yarn install --frozen-lockfile --modules-folder /node_modules -ENV PATH $PATH:/node_modules/.bin +ENV PATH=$PATH:/node_modules/.bin -FROM base as production -ENV NODE_ENV production +FROM base AS production +ENV NODE_ENV=production # These get replaced by the entrypoint script for production builds. # Set the real values in `.env` files or an external docker-compose. diff --git a/.docker/server_dockerfile b/.docker/server_dockerfile index 9dcb1f395..e81eefab1 100644 --- a/.docker/server_dockerfile +++ b/.docker/server_dockerfile @@ -12,7 +12,7 @@ RUN apt update && apt install -y gnupg curl tree mdbtools && apt clean WORKDIR /opt RUN wget https://fastdl.mongodb.org/tools/db/mongodb-database-tools-ubuntu2204-x86_64-100.9.0.deb && apt install ./mongodb-database-tools-*-100.9.0.deb -FROM base as app +FROM base AS app COPY --from=ghcr.io/astral-sh/uv:0.4 /uv /usr/local/bin/uv ENV UV_LINK_MODE=copy \ @@ -26,7 +26,7 @@ COPY ./pydatalab/pyproject.toml . COPY ./pydatalab/uv.lock . RUN uv sync --locked --no-dev --all-extras -FROM app as production +FROM app AS production WORKDIR /app # Install the local version of the package and mount the repository data to get version info diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ab9cc023b..710db8291 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -35,7 +35,7 @@ jobs: - name: Install dependencies working-directory: ./pydatalab run: | - uv sync --locked --all-extras + uv sync --locked --all-extras --dev - name: Run pre-commit working-directory: ./pydatalab @@ -83,7 +83,7 @@ jobs: - name: Install locked versions of dependencies working-directory: ./pydatalab run: | - uv sync --locked --all-extras + uv sync --locked --all-extras --dev - name: Run all tests working-directory: ./pydatalab @@ -120,38 +120,6 @@ jobs: working-directory: ./webapp run: yarn build - docker: - name: Test dev Docker builds - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v4 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - - name: Build Docker containers - uses: docker/bake-action@v5 - with: - files: docker-compose.yml - load: true - targets: ${{ matrix.target }} - set: | - app_dev.cache-to=type=gha,scope=build-app_dev,mode=max - app_dev.cache-from=type=gha,scope=build-app_dev - app_dev.tags=datalab-app_dev:latest - api_dev.cache-to=type=gha,scope=build-api_dev,mode=max - api_dev.cache-from=type=gha,scope=build-api_dev - api_dev.tags=datalab-api_dev:latest - database_dev.cache-to=type=gha,scope=build-database-dev,mode=max - database_dev.cache-from=type=gha,scope=build-database_dev - database_dev.tags=datalab-database_dev:latest - - - name: Start services - run: | - # Launch dev container profiles and wait for them to come up with healthchecks - docker compose up app_dev api_dev database_dev --wait --no-build --force-recreate -d - e2e: name: e2e tests runs-on: ubuntu-latest