Skip to content

Commit

Permalink
fix attempt: retry deployments
Browse files Browse the repository at this point in the history
  • Loading branch information
yoomlam committed Jun 8, 2024
1 parent 68a6cad commit 5004809
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
16 changes: 11 additions & 5 deletions .github/workflows/push-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -167,10 +167,16 @@ jobs:
echo "$CONFIG_TEMPLATE" | BUILD_DATE=$(date +%Y-%m-%d-%T%z) envsubst > config.json
cat config.json
echo "Creating new deployment"
aws lightsail create-container-service-deployment --cli-input-json file://config.json
sleep 10
./.github/workflows/waitForLightsail.sh deployment
for ((i = 0 ; i < ${DEPLOY_RETRIES:=3} ; i++ )); do
echo "## Deploy attempt $((i+1)) of $DEPLOY_RETRIES"
echo "Creating new deployment"
aws lightsail create-container-service-deployment --cli-input-json file://config.json
sleep 10
if ./.github/workflows/waitForLightsail.sh deployment; then
echo "Success"
break;
fi
done
# TODO: warm up vector DB on startup
2 changes: 1 addition & 1 deletion 05-assistive-chatbot/chatbot_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def healthcheck(request: Request):
build_date = os.environ.get("BUILD_DATE", "")

logger.info("Returning: Healthy %s %s", build_date, git_sha)
return HTMLResponse(f"Healthy {build_date} {git_sha}")
return HTMLResponse(f"Healthy {git_sha} built at {build_date}")


if __name__ == "__main__":
Expand Down

0 comments on commit 5004809

Please sign in to comment.