-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #16 from bento-platform/modernize
Dockerfiles and switch to async (Quart)
- Loading branch information
Showing
31 changed files
with
1,722 additions
and
290 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
name: Build and push bento_drop_box_service | ||
on: | ||
release: | ||
types: [ published ] | ||
pull_request: | ||
branches: | ||
- master | ||
push: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
build-push: | ||
runs-on: ubuntu-latest | ||
|
||
permissions: | ||
contents: read | ||
packages: write | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Run Bento build action | ||
uses: bento-platform/bento_build_action@v0.6 | ||
with: | ||
registry: ghcr.io | ||
registry-username: ${{ github.actor }} | ||
registry-password: ${{ secrets.GITHUB_TOKEN }} | ||
image-name: ghcr.io/bento-platform/bento_drop_box_service | ||
development-dockerfile: dev.Dockerfile | ||
dockerfile: Dockerfile |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
FROM ghcr.io/bento-platform/bento_base_image:python-debian-latest | ||
|
||
# Use uvicorn (instead of hypercorn) in production since I've found | ||
# multiple benchmarks showing it to be faster - David L | ||
RUN pip install --no-cache-dir poetry==1.2.2 "uvicorn[standard]==0.20.0" | ||
|
||
# Backwards-compatible with old BentoV2 container layout | ||
WORKDIR /drop-box | ||
|
||
COPY pyproject.toml pyproject.toml | ||
COPY poetry.toml poetry.toml | ||
COPY poetry.lock poetry.lock | ||
|
||
# Install production 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 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_drop_box_service bento_drop_box_service | ||
COPY entrypoint.sh entrypoint.sh | ||
COPY LICENSE LICENSE | ||
COPY README.md README.md | ||
|
||
# Install the module itself, locally (similar to `pip install -e .`) | ||
RUN poetry install --without dev | ||
|
||
CMD [ "sh", "./entrypoint.sh" ] |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,6 @@ | ||
import configparser | ||
import os | ||
from importlib import metadata | ||
|
||
__all__ = ["name", "__version__"] | ||
|
||
config = configparser.ConfigParser() | ||
config.read(os.path.join(os.path.dirname(os.path.realpath(__file__)), "package.cfg")) | ||
|
||
name = config["package"]["name"] | ||
__version__ = config["package"]["version"] | ||
name = __package__ | ||
__version__ = metadata.version(__package__) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.