-
Notifications
You must be signed in to change notification settings - Fork 1
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 #36 from bento-platform/misc-updates
Misc updates + extraneous debugpy warning fix
- Loading branch information
Showing
16 changed files
with
148 additions
and
100 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
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
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,20 +1,22 @@ | ||
FROM ghcr.io/bento-platform/bento_base_image:python-debian-2022.10.11 | ||
FROM ghcr.io/bento-platform/bento_base_image:python-debian-2022.12.06 | ||
|
||
# TODO: change USER | ||
USER root | ||
|
||
RUN apt install gcc libffi-dev -y | ||
|
||
RUN echo "Building DRS in Production Mode"; | ||
WORKDIR /drs/bento_drs | ||
WORKDIR /drs | ||
RUN mkdir /wes && \ | ||
mkdir -p /drs/bento_drs/data/obj && \ | ||
mkdir -p /drs/bento_drs/data/db; | ||
mkdir -p /drs/data/obj && \ | ||
mkdir -p /drs/data/db | ||
|
||
# Install dependencies | ||
COPY requirements.txt requirements.txt | ||
RUN ["pip", "install", "-r", "requirements.txt"] | ||
COPY . . | ||
|
||
# Run | ||
WORKDIR /drs/bento_drs/chord_drs | ||
COPY startup.sh ./startup.sh | ||
CMD ["sh", "startup.sh"] | ||
# Copy only what's required for a production instance | ||
COPY chord_drs chord_drs | ||
COPY entrypoint.bash . | ||
|
||
ENTRYPOINT ["/bin/bash", "./entrypoint.bash"] |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,17 @@ | ||
from chord_drs import __version__ | ||
|
||
__all__ = ["SERVICE_NAME", "SERVICE_ARTIFACT", "SERVICE_TYPE"] | ||
__all__ = [ | ||
"BENTO_SERVICE_KIND", | ||
"SERVICE_NAME", | ||
"SERVICE_ARTIFACT", | ||
"SERVICE_TYPE", | ||
] | ||
|
||
BENTO_SERVICE_KIND = "drs" | ||
SERVICE_NAME = "Bento Data Repository Service" | ||
SERVICE_ARTIFACT = "drs" | ||
SERVICE_TYPE = f"ca.c3g.chord:{SERVICE_ARTIFACT}:{__version__}" | ||
SERVICE_ARTIFACT = BENTO_SERVICE_KIND | ||
SERVICE_TYPE = { | ||
"group": "ca.c3g.chord", | ||
"artifact": SERVICE_ARTIFACT, | ||
"version": __version__, | ||
} |
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,5 +1,5 @@ | ||
[package] | ||
name = chord_drs | ||
version = 0.7.0 | ||
version = 0.8.0 | ||
authors = Simon Chénard, David Lougheed | ||
author_emails = simon.chenard2@mcgill.ca, david.lougheed@mail.mcgill.ca |
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,18 +1,20 @@ | ||
FROM ghcr.io/bento-platform/bento_base_image:python-debian-2022.10.11 | ||
FROM ghcr.io/bento-platform/bento_base_image:python-debian-2022.12.06 | ||
|
||
# TODO: change USER | ||
USER root | ||
|
||
RUN apt install libffi-dev -y | ||
|
||
RUN echo "Building DRS in Development Mode"; | ||
WORKDIR /drs/bento_drs | ||
WORKDIR /drs | ||
RUN mkdir /wes && \ | ||
mkdir -p /drs/bento_drs/data/obj && \ | ||
mkdir -p /drs/bento_drs/data/db; | ||
COPY ./requirements.txt . | ||
RUN ["pip", "install", "debugpy", "-r", "requirements.txt"] | ||
mkdir -p /drs/data/obj && \ | ||
mkdir -p /drs/data/db; | ||
|
||
# Run | ||
WORKDIR /drs/bento_drs/chord_drs | ||
COPY startup.sh ./startup.sh | ||
# Install requirements | ||
COPY requirements.txt . | ||
RUN pip install debugpy -r requirements.txt | ||
|
||
# Don't copy anything in - the dev compose file will mount the repo | ||
|
||
ENTRYPOINT ["/bin/bash", "./entrypoint.dev.bash"] |
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,18 @@ | ||
#!/bin/bash | ||
|
||
# CWD: /drs | ||
|
||
mkdir -p /drs/data/db | ||
mkdir -p /drs/data/obj | ||
|
||
export FLASK_APP="chord_drs.app:application" | ||
if [ -z "${INTERNAL_PORT}" ]; then | ||
# Set default internal port to 5000 | ||
export INTERNAL_PORT=5000 | ||
fi | ||
|
||
flask db upgrade | ||
|
||
# using 1 worker, multiple threads | ||
# see https://stackoverflow.com/questions/38425620/gunicorn-workers-and-threads | ||
gunicorn "${FLASK_APP}" -w 1 --threads $(expr 2 \* $(nproc --all) + 1) -b "0.0.0.0:${INTERNAL_PORT}" |
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,15 @@ | ||
#!/bin/bash | ||
|
||
export FLASK_ENV=development | ||
export FLASK_APP=chord_drs.app:application | ||
|
||
if [ -z "${INTERNAL_PORT}" ]; then | ||
# Set default internal port to 5000 | ||
export INTERNAL_PORT=5000 | ||
fi | ||
|
||
python -m pip install -r requirements.txt | ||
|
||
flask db upgrade | ||
|
||
python -m debugpy --listen 0.0.0.0:5678 -m flask run --host 0.0.0.0 --port "${INTERNAL_PORT}" |
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.