diff --git a/build/COPY_ROOT/etc/supervisor/supervisord/conf.d/jupyter.conf b/build/COPY_ROOT/etc/supervisor/supervisord/conf.d/jupyter.conf index 249487b..98877c5 100644 --- a/build/COPY_ROOT/etc/supervisor/supervisord/conf.d/jupyter.conf +++ b/build/COPY_ROOT/etc/supervisor/supervisord/conf.d/jupyter.conf @@ -5,7 +5,7 @@ numprocs=1 directory=/root priority=1000 autostart=true -startsecs=0 +startsecs=5 startretries=3 autorestart=unexpected stopsignal=TERM @@ -15,7 +15,5 @@ killasgroup=true stdout_logfile=/var/log/supervisor/jupyter.log stdout_logfile_maxbytes=10MB stdout_logfile_backups=1 -stderr_logfile=/dev/null -stderr_logfile_maxbytes=0 -stderr_logfile_backups=0 +redirect_stderr=true environment=PROC_NAME="%(program_name)s" \ No newline at end of file diff --git a/build/COPY_ROOT/opt/ai-dock/bin/supervisor-jupyter.sh b/build/COPY_ROOT/opt/ai-dock/bin/supervisor-jupyter.sh index dc00040..3571e4b 100755 --- a/build/COPY_ROOT/opt/ai-dock/bin/supervisor-jupyter.sh +++ b/build/COPY_ROOT/opt/ai-dock/bin/supervisor-jupyter.sh @@ -13,7 +13,7 @@ function cleanup() { function start() { if [[ -z $JUPYTER_MODE || ! "$JUPYTER_MODE" = "notebook" ]]; then - JUPYTER_MODE="lab" + JUPYTER_MODE="notebook" fi if [[ -z $JUPYTER_PORT ]]; then @@ -25,7 +25,7 @@ function start() { if [[ ${SERVERLESS,,} = "true" ]]; then printf "Refusing to start $SERVICE_NAME service in serverless mode\n" - exit 0 + exec sleep 10 fi file_content="$( @@ -58,12 +58,12 @@ function start() { wait -n fi - kill -9 $(lsof -t -i:$LISTEN_PORT) > /dev/null 2>&1 & + kill $(lsof -t -i:$LISTEN_PORT) > /dev/null 2>&1 & wait -n printf "\nStarting %s...\n" "${SERVICE_NAME:-service}" - micromamba run -n jupyter jupyter \ + exec micromamba run -n jupyter jupyter \ $JUPYTER_MODE \ --allow-root \ --ip=127.0.0.1 \ diff --git a/build/Dockerfile b/build/Dockerfile index 4d26a27..74b3acb 100644 --- a/build/Dockerfile +++ b/build/Dockerfile @@ -20,7 +20,7 @@ COPY ./COPY_ROOT/ / # Use build scripts to ensure we can build all targets from one Dockerfile in a single layer. # Don't put anything heavy in here - We can use multi-stage building above if necessary. -RUN /opt/ai-dock/bin/build/layer0/init.sh +RUN /opt/ai-dock/bin/build/layer0/init.sh | tee /var/log/build.log # Keep init.sh as-is and place additional logic in /opt/ai-dock/bin/preflight.sh CMD ["init.sh"]