Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
coutoPL committed Dec 6, 2023
1 parent 5348cc5 commit 0349170
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 4 deletions.
3 changes: 2 additions & 1 deletion docker/streaming/restart.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,5 @@ source ../../common/scripts/utils.sh

export ADDITIONAL_COMPOSE_FILE="-f $(fullPath ./docker-compose-streaming.yml)"

../common/restartDocker.sh
../common/restartDocker.sh
./waitForDesignerStart.sh
2 changes: 1 addition & 1 deletion docker/streaming/showDockerServices.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ source ../../common/scripts/utils.sh

export ADDITIONAL_COMPOSE_FILE="-f $(fullPath ./docker-compose-streaming.yml)"

../common/invokeDocker.sh ps
../common/invokeDocker.sh ps
3 changes: 2 additions & 1 deletion docker/streaming/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ source ../../common/scripts/utils.sh
export ADDITIONAL_COMPOSE_FILE="-f $(fullPath ./docker-compose-streaming.yml)"

[[ "$NO_PULL" == "true" ]] || ../common/invokeDocker.sh pull
../common/invokeDocker.sh up -d --wait
../common/invokeDocker.sh up -d
./waitForDesignerStart.sh

cat << EOF
----------------------------------------------------------------------------------
Expand Down
29 changes: 29 additions & 0 deletions docker/streaming/waitForDesignerStart.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/bin/bash -e

cd "$(dirname "$0")"

TIMEOUT_SECONDS=120
TIMEOUT_START=$(date +%s)
TIMEOUT_END=$((TIMEOUT_START + TIMEOUT_SECONDS))

../common/invokeDocker.sh restart designer # todo: remove

echo "Waiting for Nu Designer start ..."

while true; do
DESIGNER_STATUS=$(../common/invokeDocker.sh ps -q designer | xargs docker inspect -f '{{ .State.Health.Status }}')

if [ "$DESIGNER_STATUS" == "healthy" ]; then
echo "Nu Designer started!"
break
fi

CURRENT_TIME=$(date +%s)

if [ "$CURRENT_TIME" -ge "$TIMEOUT_END" ]; then
echo "Nu Designer failed to started within $TIMEOUT_SECONDS seconds!"
exit 1
fi

sleep 5
done
1 change: 0 additions & 1 deletion docker/streaming/waitForDockerHealthchecks.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#!/bin/bash -ex
#!/bin/bash -ex

cd "$(dirname "$0")"

Expand Down

0 comments on commit 0349170

Please sign in to comment.