-
Notifications
You must be signed in to change notification settings - Fork 192
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: optimize scripts for parallel startup of Looker docker image (#881)
* fix: optimize scripts for parellel startup of Looker docker image * fix: Default value of LOOKERSDK_API_VERSION if it is not set * fix: try to get python-ci working properly * fix: debug python-ci * fix: debug python-ci try again * Make sure repo is checked out first otherwise weird rade conditions happen
- Loading branch information
1 parent
a4dfb3c
commit 5624c72
Showing
6 changed files
with
126 additions
and
116 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#!/bin/sh | ||
|
||
check_looker() { | ||
status=$(curl --silent --insecure --write "%{http_code}" \ | ||
--data "client_id=$LOOKERSDK_CLIENT_ID&client_secret=$LOOKERSDK_CLIENT_SECRET"\ | ||
$LOOKERSDK_BASE_URL/api/${LOOKERSDK_API_VERSION:-4.0}/login\ | ||
-o /dev/null) | ||
} | ||
|
||
MAX_RETRIES=160 | ||
ATTEMPTS=1 | ||
status=0 | ||
check_looker | ||
while [ $status -ne 200 ]; | ||
do | ||
RETRY_MSG="after $ATTEMPTS attempts: $MAX_RETRIES retries remaining." | ||
if [ $ATTEMPTS -ge $MAX_RETRIES ]; | ||
then | ||
echo 'Looker took too long to start' | ||
exit 1 | ||
else | ||
if [ $status -ne 0 ]; | ||
then | ||
echo "Received status($status) from Looker $RETRY_MSG" | ||
else | ||
echo "Looker server connection rejected $RETRY_MSG" | ||
fi | ||
fi | ||
|
||
sleep 2 | ||
ATTEMPTS=$(( $ATTEMPTS + 1 )) | ||
check_looker | ||
done | ||
echo "Looker ready after $ATTEMPTS attempts" | ||
exit 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters