diff --git a/build/COPY_ROOT/opt/ai-dock/bin/get-cfqt-jupyter.sh b/build/COPY_ROOT/opt/ai-dock/bin/get-cfqt-jupyter.sh deleted file mode 100755 index 1d13ce2..0000000 --- a/build/COPY_ROOT/opt/ai-dock/bin/get-cfqt-jupyter.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/bash - -service="jupyter" -port=${JUPYTER_PORT:-8888} - -if [[ -z $CF_QUICK_TUNNELS ]]; then - printf "\n** You have not enabled Cloudflare quick tunnels **\n\n" - printf "To enable, you can do the following:\n\n" - printf "1. export CF_QUICK_TUNNELS=true\n" - printf "2. supervisorctl restart %s\n\n" $service - exit 1 -fi - -if [[ -f /var/log/supervisor/quicktunnel-${service}.log ]]; then - grep -b0 -a0 'trycloudflare.com' /var/log/supervisor/quicktunnel-${service}.log - if [[ $? -gt 0 ]]; then - printf "\n** Something may have gone wrong setting up the %s tunnel **\n\n" $service - printf "To set up manually you can run the following command:\n\n" - printf "cloudflared tunnel --url localhost:%s > /var/log/supervisor/quicktunnel-%s.log 2>&1 &\n\n" $port $service - fi -else - printf "** The %s tunnel has not yet started **\n\n" - if [[ -f /run/provisioning_script ]]; then - printf "The container is still being provisioned. Check the logs for progress (logtail.sh)\n\n" - else - printf "Please wait a moment and try again.\n\n" - fi -fi \ No newline at end of file diff --git a/build/COPY_ROOT/opt/ai-dock/bin/jupyter-start-service.sh b/build/COPY_ROOT/opt/ai-dock/bin/jupyter-start-service.sh index 0febb4e..f380975 100755 --- a/build/COPY_ROOT/opt/ai-dock/bin/jupyter-start-service.sh +++ b/build/COPY_ROOT/opt/ai-dock/bin/jupyter-start-service.sh @@ -1,7 +1,7 @@ #!/bin/bash -if [[ -f /run/provisioning_script ]]; then - printf "** The container is still being provisioned **\n\n" +if [[ -f /run/container_config || -f /run/workspace_sync ]]; then + printf "** The container is still being prepared **\n\n" printf "Your service will start automatically - Check the logs for progress (logtail.sh)\n\n" elif [[ -z $1 ]]; then printf "Please specify a service to start\n\n" 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 91ae0f6..dc00040 100755 --- a/build/COPY_ROOT/opt/ai-dock/bin/supervisor-jupyter.sh +++ b/build/COPY_ROOT/opt/ai-dock/bin/supervisor-jupyter.sh @@ -41,30 +41,27 @@ function start() { printf "%s" "$file_content" > /run/http_ports/$PROXY_PORT # Delay launch until micromamba is ready - if [[ -f /run/workspace_moving ]]; then + if [[ -f /run/workspace_sync ]]; then + printf "Waiting for workspace sync...\n" /usr/bin/python3 /opt/ai-dock/fastapi/logviewer/main.py \ -p $LISTEN_PORT \ - -r 5 \ + -r 3 \ -s "${SERVICE_NAME}" \ -t "Preparing ${SERVICE_NAME}" & fastapi_pid=$! - while [[ -f /run/workspace_moving ]]; do + while [[ -f /run/workspace_sync ]]; do sleep 1 done - printf "\nStarting %s... " ${SERVICE_NAME:-service} kill $fastapi_pid & wait -n - printf "OK\n" - else - printf "Starting %s...\n" ${SERVICE_NAME} fi kill -9 $(lsof -t -i:$LISTEN_PORT) > /dev/null 2>&1 & wait -n - printf "Starting Jupyter %s...\n" ${JUPYTER_MODE^} + printf "\nStarting %s...\n" "${SERVICE_NAME:-service}" micromamba run -n jupyter jupyter \ $JUPYTER_MODE \ diff --git a/build/Dockerfile b/build/Dockerfile index 40a470a..4d26a27 100644 --- a/build/Dockerfile +++ b/build/Dockerfile @@ -8,7 +8,6 @@ LABEL org.opencontainers.image.description "Jupyter lab/notebook with Python ker LABEL maintainer="Rob Ballantyne " -ENV OPT_SYNC=$OPT_SYNC ENV IMAGE_SLUG="jupyter-python" # Add new paths at front