diff --git a/docker/Dockerfile.util b/docker/Dockerfile.util deleted file mode 100644 index 9b41ba5..0000000 --- a/docker/Dockerfile.util +++ /dev/null @@ -1,7 +0,0 @@ -FROM alpine:3.14 - -RUN apk add --update netcat-openbsd && \ - rm -rf /var/cache/apk/* - -COPY wait_for_up.bash /bin/wait_for_up -RUN chmod +x /bin/wait_for_up diff --git a/docker/init_starburst.bash b/docker/init_starburst.bash index 4fbf2d1..c516cfc 100755 --- a/docker/init_starburst.bash +++ b/docker/init_starburst.bash @@ -7,6 +7,5 @@ cd .. set -exo pipefail docker-compose -f docker-compose-starburst.yml build -docker-compose -f docker/util.yml build docker-compose -f docker-compose-starburst.yml up -d -docker-compose -f docker/util.yml run --rm util wait_for_up trino 8080 10 +timeout 5m bash -c -- 'while ! docker-compose -f docker-compose-starburst.yml logs trino 2>&1 | tail -n 1 | grep "SERVER STARTED"; do sleep 2; done' diff --git a/docker/init_trino.bash b/docker/init_trino.bash index fda13b2..c41c665 100755 --- a/docker/init_trino.bash +++ b/docker/init_trino.bash @@ -7,6 +7,5 @@ cd .. set -exo pipefail docker-compose -f docker-compose-trino.yml build -docker-compose -f docker/util.yml build docker-compose -f docker-compose-trino.yml up -d -docker-compose -f docker/util.yml run --rm util wait_for_up trino 8080 +timeout 5m bash -c -- 'while ! docker-compose -f docker-compose-trino.yml logs trino 2>&1 | tail -n 1 | grep "SERVER STARTED"; do sleep 2; done' diff --git a/docker/util.yml b/docker/util.yml deleted file mode 100644 index 72fbc24..0000000 --- a/docker/util.yml +++ /dev/null @@ -1,12 +0,0 @@ -version: "3.5" - -services: - util: - build: - context: . - dockerfile: Dockerfile.util - -networks: - default: - external: - name: dbt-net diff --git a/docker/wait_for_up.bash b/docker/wait_for_up.bash deleted file mode 100644 index dca816b..0000000 --- a/docker/wait_for_up.bash +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/sh -HOST=$1 -PORT=$2 -TIMEOUT=${3:-3} -[[ -z $HOST ]] && exit 1 -[[ -z $PORT ]] && exit 1 - -for run in $(seq 1 $TIMEOUT); do - nc -z $HOST $PORT - [[ $? -eq 0 ]] && exit 0 - sleep 15 -done - -nc -z $HOST $PORT -[[ $? -eq 0 ]] && exit 0 - -echo "$HOST:$PORT was not open after $TIMEOUT connection attempts" -exit 1