Skip to content

Commit

Permalink
Merge pull request #41 from bento-platform/dev-image-rm-venv
Browse files Browse the repository at this point in the history
Remove virtual environment from dev image; add VSCode debug config; update prod base image
  • Loading branch information
davidlougheed authored Mar 22, 2023
2 parents f731f18 + 1781982 commit b7065ec
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 11 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ghcr.io/bento-platform/bento_base_image:python-debian-2023.02.27
FROM ghcr.io/bento-platform/bento_base_image:python-debian-2023.03.22

# Run as root in the Dockerfile until we drop down to the service user in the entrypoint
USER root
Expand Down
17 changes: 14 additions & 3 deletions dev.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,20 @@
FROM ghcr.io/bento-platform/bento_base_image:python-debian-2023.02.27
FROM ghcr.io/bento-platform/bento_base_image:python-debian-2023.03.22

LABEL org.opencontainers.image.description="Local development image the Bento aggregation service."
LABEL devcontainer.metadata='[{ \
"remoteUser": "bento_user", \
"customizations": { \
"vscode": { \
"extensions": ["ms-python.python", "eamodio.gitlens"], \
"settings": {"workspaceFolder": "/aggregation"} \
} \
} \
}]'

# Run as root in the Dockerfile until we drop down to the service user in the entrypoint
USER root

RUN source /env/bin/activate && pip install --no-cache-dir "uvicorn[standard]==0.20.0"
RUN pip install --no-cache-dir "uvicorn[standard]==0.20.0"

WORKDIR /aggregation

Expand All @@ -14,7 +25,7 @@ COPY poetry.lock .
# Install production + development dependencies
# Without --no-root, we get errors related to the code not being copied in yet.
# But we don't want the code here, otherwise Docker cache doesn't work well.
RUN source /env/bin/activate && poetry install --no-root
RUN poetry install --no-root

# Don't copy code in, since it gets mounted in with development mode.
# Copy in an entrypoint + runner script so we have somewhere to start.
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "poetry.core.masonry.api"

[tool.poetry]
name = "bento_aggregation_service"
version = "0.18.0"
version = "0.18.1"
description = "Search result aggregation service for the Bento platform."
authors = ["David Lougheed <[email protected]>"]
readme = "README.md"
Expand Down
9 changes: 3 additions & 6 deletions run.dev.bash
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,10 @@

cd /aggregation || exit

# Set .gitconfig for development
/set_gitconfig.bash
# The default base image entrypoint takes care of creating bento_user and configuring git

source /env/bin/activate

# Update dependencies and install module locally (similar to pip install -e: "editable mode")
poetry install
# Update dependencies and install module locally
/poetry_user_install_dev.bash

export BENTO_DEBUG=true
export CHORD_DEBUG=true
Expand Down

0 comments on commit b7065ec

Please sign in to comment.