microservices/deployment-service/snakeapi_service/entrypoint.sh

18 lines
463 B
Bash
Raw Normal View History

2025-04-25 09:21:18 -07:00
#!/usr/bin/env bash
2025-04-29 13:28:25 -07:00
NOTEBOOK_DIR="notebooks"
mkdir -p ${NOTEBOOK_DIR}
2025-04-29 11:40:06 -07:00
2025-04-25 09:21:18 -07:00
while true; do
aws --endpoint-url "$AWS_ENDPOINT_URL_S3" --region "$AWS_REGION" \
2025-04-29 13:28:25 -07:00
s3 sync "s3://$BUCKET_NAME/$INSTANCE_PREFIX/notebooks/" "${NOTEBOOK_DIR}/"
2025-04-29 11:40:06 -07:00
2025-04-29 13:28:25 -07:00
latest_notebook=$(ls -t ${NOTEBOOK_DIR}/*.ipynb | head -1)
2025-04-25 09:21:18 -07:00
2025-04-29 13:28:25 -07:00
if [ -n "$latest_notebook" ]; then
jupyter nbconvert --to notebook --execute --inplace --ExecutePreprocessor.timeout=0 "$latest_notebook"
2025-04-29 11:40:06 -07:00
fi
2025-04-25 09:21:18 -07:00
2025-04-29 13:28:25 -07:00
sleep 5
2025-04-25 09:21:18 -07:00
done