microservices/deployment-service/snakeapi_service/entrypoint.sh

22 lines
501 B
Bash
Raw Normal View History

2025-04-25 09:21:18 -07:00
#!/usr/bin/env bash
2025-04-29 11:40:06 -07:00
last_mod=0
2025-04-25 09:21:18 -07:00
while true; do
aws --endpoint-url "$AWS_ENDPOINT_URL_S3" --region "$AWS_REGION" \
2025-04-29 11:40:06 -07:00
s3 sync "s3://$BUCKET_NAME/$INSTANCE_PREFIX" . --exclude "*" --include "notebook.ipynb"
if [ -f "notebook.ipynb" ]; then
new_mod=$(stat -c %Y notebook.ipynb)
else
new_mod=0
fi
2025-04-25 09:21:18 -07:00
2025-04-29 11:40:06 -07:00
if [ "$new_mod" -ne "$last_mod" ]; then
last_mod=$new_mod
jupyter nbconvert --to notebook --execute --inplace --ExecutePreprocessor.timeout=0 notebook.ipynb
fi
2025-04-25 09:21:18 -07:00
sleep 1
done