Skip to content

Commit

Permalink
Use uv dev deps in CI, and remove dev docker builds
Browse files Browse the repository at this point in the history
  • Loading branch information
ml-evs committed Oct 8, 2024
1 parent 09d5faf commit 721c322
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 39 deletions.
6 changes: 3 additions & 3 deletions .docker/app_dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions .docker/server_dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand All @@ -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
Expand Down
36 changes: 2 additions & 34 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 721c322

Please sign in to comment.