-
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 #34 from bento-platform/user-dropdown
chore: service user drop down in dockerfile
- Loading branch information
Showing
6 changed files
with
82 additions
and
53 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,16 @@ | ||
#!/bin/bash | ||
|
||
export FLASK_DEBUG=false | ||
if [ -z "${INTERNAL_PORT}" ]; then | ||
# Set default internal port to 5000 | ||
export INTERNAL_PORT=5000 | ||
fi | ||
cd /wes || exit | ||
|
||
# Clean up after any crashed previous container runs | ||
job_store_path="${SERVICE_TEMP:-tmp}/toil_job_store" | ||
if [ -d "${job_store_path}" ]; then | ||
echo "[bento_wes] [entrypoint] Cleaning Toil job store" | ||
toil clean "file:${SERVICE_TEMP:-tmp}/toil_job_store" | ||
fi | ||
# Create bento_user + home | ||
source /create_service_user.bash | ||
|
||
# Start Celery worker with log level dependent on BENTO_DEBUG | ||
echo "[bento_wes] [entrypoint] Starting celery worker" | ||
celery_log_level="INFO" | ||
if [[ | ||
"${BENTO_DEBUG}" == "true" || | ||
"${BENTO_DEBUG}" == "True" || | ||
"${BENTO_DEBUG}" == "1" || | ||
"${CHORD_DEBUG}" == "true" || | ||
"${CHORD_DEBUG}" == "True" || | ||
"${CHORD_DEBUG}" == "1" | ||
]]; then | ||
celery_log_level="DEBUG" | ||
# Fix permissions on /wes | ||
chown -R bento_user:bento_user /wes | ||
chmod -R o-rwx /wes/tmp # Remove all access from others for /wes/tmp | ||
if [[ -d /env ]]; then | ||
chown -R bento_user:bento_user /env | ||
fi | ||
celery --app bento_wes.app worker --loglevel="${celery_log_level}" & | ||
|
||
# Start API server | ||
echo "[bento_wes] [entrypoint] Starting gunicorn" | ||
# using 1 worker, multiple threads | ||
# see https://stackoverflow.com/questions/38425620/gunicorn-workers-and-threads | ||
gunicorn bento_wes.app:application \ | ||
--workers 1 \ | ||
--threads "$(( 2 * $(nproc --all) + 1))" \ | ||
--bind "0.0.0.0:${INTERNAL_PORT}" | ||
# Drop into bento_user from root and execute the CMD specified for the image | ||
exec gosu bento_user "$@" |
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 |
---|---|---|
|
@@ -4,7 +4,7 @@ build-backend = "poetry.core.masonry.api" | |
|
||
[tool.poetry] | ||
name = "bento_wes" | ||
version = "0.8.3" | ||
version = "0.8.4" | ||
description = "Workflow execution service for the Bento platform." | ||
authors = [ | ||
"David Lougheed <[email protected]>", | ||
|
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,38 @@ | ||
#!/bin/bash | ||
|
||
export FLASK_DEBUG=false | ||
if [ -z "${INTERNAL_PORT}" ]; then | ||
# Set default internal port to 5000 | ||
export INTERNAL_PORT=5000 | ||
fi | ||
|
||
# Clean up after any crashed previous container runs | ||
job_store_path="${SERVICE_TEMP:-tmp}/toil_job_store" | ||
if [ -d "${job_store_path}" ]; then | ||
echo "[bento_wes] [entrypoint] Cleaning Toil job store" | ||
toil clean "file:${SERVICE_TEMP:-tmp}/toil_job_store" | ||
fi | ||
|
||
# Start Celery worker with log level dependent on BENTO_DEBUG | ||
echo "[bento_wes] [entrypoint] Starting celery worker" | ||
celery_log_level="INFO" | ||
if [[ | ||
"${BENTO_DEBUG}" == "true" || | ||
"${BENTO_DEBUG}" == "True" || | ||
"${BENTO_DEBUG}" == "1" || | ||
"${CHORD_DEBUG}" == "true" || | ||
"${CHORD_DEBUG}" == "True" || | ||
"${CHORD_DEBUG}" == "1" | ||
]]; then | ||
celery_log_level="DEBUG" | ||
fi | ||
celery --app bento_wes.app worker --loglevel="${celery_log_level}" & | ||
|
||
# Start API server | ||
echo "[bento_wes] [entrypoint] Starting gunicorn" | ||
# using 1 worker, multiple threads | ||
# see https://stackoverflow.com/questions/38425620/gunicorn-workers-and-threads | ||
gunicorn bento_wes.app:application \ | ||
--workers 1 \ | ||
--threads "$(( 2 * $(nproc --all) + 1))" \ | ||
--bind "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