Skip to content

Commit

Permalink
Merge pull request #13 from bento-platform/fix-dev-image
Browse files Browse the repository at this point in the history
Fix development image & update base images
  • Loading branch information
davidlougheed authored Apr 5, 2023
2 parents aa433c7 + 516769f commit 86be94b
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 41 deletions.
4 changes: 1 addition & 3 deletions 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

# Use uvicorn (instead of hypercorn) in production since I've found
# multiple benchmarks showing it to be faster - David L
Expand All @@ -19,13 +19,11 @@ RUN poetry install --without dev --no-root
# Manually copy only what's relevant
# (Don't use .dockerignore, which allows us to have development containers too)
COPY bento_service_registry bento_service_registry
COPY entrypoint.bash .
COPY run.bash .
COPY LICENSE .
COPY README.md .

# Install the module itself, locally (similar to `pip install -e .`)
RUN poetry install --without dev

ENTRYPOINT [ "/bin/bash", "./entrypoint.bash" ]
CMD [ "/bin/bash", "./run.bash" ]
11 changes: 3 additions & 8 deletions dev.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
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

SHELL ["/bin/bash", "-c"]

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"

# Backwards-compatible with old BentoV2 container layout
WORKDIR /service-registry
Expand All @@ -15,12 +12,10 @@ 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

# Copy entrypoint and runner script in, so we have something to start with - even though it'll get
# overwritten by volume mount.
COPY entrypoint.bash .
COPY run.dev.bash .

ENTRYPOINT [ "/bin/bash", "./entrypoint.bash" ]
CMD [ "/bin/bash", "./run.dev.bash" ]
15 changes: 0 additions & 15 deletions entrypoint.bash

This file was deleted.

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_service_registry"
version = "0.11.1"
version = "0.11.2"
description = "An implementation of GA4GH Service Registry API for the Bento platform."
authors = ["David Lougheed <[email protected]>"]
readme = "README.md"
Expand Down
6 changes: 2 additions & 4 deletions run.bash
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
#!/bin/bash

if [[ -z "${INTERNAL_PORT}" ]]; then
# Set default internal port to 5000
INTERNAL_PORT=5000
fi
# Set default internal port to 5000
: "${INTERNAL_PORT:=5000}"

uvicorn bento_service_registry.app:application \
--workers 1 \
Expand Down
22 changes: 12 additions & 10 deletions run.dev.bash
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
#!/bin/bash

# Set .gitconfig for development
/set_gitconfig.bash
# Update dependencies and install module locally
/poetry_user_install_dev.bash

export QUART_ENV=development
export QUART_APP=bento_service_registry.app:application
export QUART_ENV='development'
export QUART_APP='bento_service_registry.app:application'

if [[ -z "${INTERNAL_PORT}" ]]; then
# Set default internal port to 5000
export INTERNAL_PORT=5000
fi
# Set default internal port to 5000
: "${INTERNAL_PORT:=5000}"

python -m poetry install
python -m debugpy --listen 0.0.0.0:5678 -m quart run --host 0.0.0.0 --port "${INTERNAL_PORT}"
# Set default debugger port to debugpy default
: "${DEBUGGER_PORT:=5678}"

python -m debugpy --listen "0.0.0.0:${DEBUGGER_PORT}" -m quart run \
--host 0.0.0.0 \
--port "${INTERNAL_PORT}"

0 comments on commit 86be94b

Please sign in to comment.