@@ -6,11 +6,16 @@ IFS=$(printf '\n\t')
66
77INFO=" INFO: [$( basename " $0 " ) ] "
88
9- # BOOTING application ---------------------------------------------
109echo " $INFO " " Booting in ${SC_BOOT_MODE} mode ..."
1110echo " $INFO " " User :$( id " $( whoami) " ) "
1211echo " $INFO " " Workdir : $( pwd) "
1312
13+ #
14+ # DEVELOPMENT MODE
15+ #
16+ # - prints environ info
17+ # - installs requirements in mounted volume
18+ #
1419if [ " ${SC_BUILD_TARGET} " = " development" ]; then
1520 echo " $INFO " " Environment :"
1621 printenv | sed ' s/=/: /' | sed ' s/^/ /' | sort
@@ -23,31 +28,34 @@ if [ "${SC_BUILD_TARGET}" = "development" ]; then
2328 cd -
2429 echo " $INFO " " PIP :"
2530 uv pip list
26-
27- echo " $INFO " " Setting entrypoint to use watchmedo autorestart..."
28- entrypoint=' watchmedo auto-restart --recursive --pattern="*.py;*/src/*" --ignore-patterns="*test*;pytest_simcore/*;setup.py;*ignore*" --ignore-directories --'
29-
30- elif [ " ${SC_BUILD_TARGET} " = " production" ]; then
31- entrypoint=" "
3231fi
3332
3433if [ " ${SC_BOOT_MODE} " = " debug" ]; then
3534 # NOTE: production does NOT pre-installs debugpy
3635 uv pip install --no-cache-dir debugpy
3736fi
3837
38+ #
39+ # RUNNING application
40+ #
3941APP_LOG_LEVEL=${STORAGE_LOGLEVEL:- ${LOG_LEVEL:- ${LOGLEVEL:- INFO} } }
4042SERVER_LOG_LEVEL=$( echo " ${APP_LOG_LEVEL} " | tr ' [:upper:]' ' [:lower:]' )
41-
42- # RUNNING application ----------------------------------------
43- echo " $INFO " " Selected config ${SC_BUILD_TARGET} "
4443echo " $INFO " " Log-level app/server: $APP_LOG_LEVEL /$SERVER_LOG_LEVEL "
4544
4645if [ " ${SC_BOOT_MODE} " = " debug" ]; then
47- # NOTE: needs debupgy installed
48- echo " $INFO " " Debugpy initializing in port ${STORAGE_REMOTE_DEBUGGING_PORT} with ${SC_BUILD_TARGET} "
49- eval " $entrypoint " python3 -m debugpy --listen 0.0.0.0:" ${STORAGE_REMOTE_DEBUGGING_PORT} " -m \
50- simcore_service_storage run
46+ reload_dir_packages=$( find /devel/packages -maxdepth 3 -type d -path " */src/*" ! -path " *.*" -exec echo ' --reload-dir {} \' \; )
47+
48+ exec sh -c "
49+ cd services/storage/src/simcore_service_storage && \
50+ python -m debugpy --listen 0.0.0.0:${STORAGE_REMOTE_DEBUGGING_PORT} -m uvicorn main:the_app \
51+ --host 0.0.0.0 \
52+ --reload \
53+ $reload_dir_packages
54+ --reload-dir . \
55+ --log-level \" ${SERVER_LOG_LEVEL} \"
56+ "
5157else
52- exec simcore-service-storage run
58+ exec uvicorn simcore_service_storage.main:the_app \
59+ --host 0.0.0.0 \
60+ --log-level " ${SERVER_LOG_LEVEL} "
5361fi
0 commit comments