diff --git a/docker/base-hornbill/Dockerfile b/docker/base-hornbill/Dockerfile index 3ed7cb5..0ace54e 100644 --- a/docker/base-hornbill/Dockerfile +++ b/docker/base-hornbill/Dockerfile @@ -1,4 +1,4 @@ -ARG HORNBILL_IMAGE="hstreamdb/hornbill:latest" +ARG HORNBILL_IMAGE="ghcr.io/hstreamdb/hornbill:latest" FROM ${HORNBILL_IMAGE} ENV DEBIAN_FRONTEND=noninteractive @@ -61,6 +61,10 @@ RUN apt-get -qy --no-install-recommends install \ # Config SSH for Jepsen connection COPY ./init-ssh.sh /usr/local/bin/init-ssh +# Install FoundationDB cli tool +COPY --from=foundationdb/foundationdb:7.3.43 /usr/bin/fdbcli /usr/bin/fdbcli +RUN chmod +x /usr/bin/fdbcli + EXPOSE 22 RUN chmod +x /usr/local/bin/init-ssh diff --git a/docker/fdb-hornbill/start.sh b/docker/fdb-hornbill/start.sh index 7cbfe07..852c807 100644 --- a/docker/fdb-hornbill/start.sh +++ b/docker/fdb-hornbill/start.sh @@ -1,12 +1,14 @@ -FDB_CLUSTER_FILE="/etc/foundationdb/fdb.cluster" -FDB_PORT=4500 -FDB_NETWORKING_MODE="container" -fdbcli="/usr/bin/fdbcli" +export FDB_CLUSTER_FILE="/etc/foundationdb/fdb.cluster" +export FDB_PORT=4500 +export FDB_NETWORKING_MODE="container" +export fdbcli="/usr/bin/fdbcli" ## start fdb server -/var/fdb/scripts/fdb.bash >> /tmp/$HOSTNAME.log 2>&1 & +/var/fdb/scripts/fdb.bash >>/tmp/$HOSTNAME.log 2>&1 & ## wait & configure +# wait for fdb.cluster file +while [ ! -f $FDB_CLUSTER_FILE ]; do sleep 0.1; done # Attempt to connect. Configure the database if necessary. if ! $fdbcli -C $FDB_CLUSTER_FILE --exec status --timeout 1 ; then config="configure new single ssd; status" diff --git a/docker/meta-hornbill/start-meta.sh b/docker/meta-hornbill/start-meta.sh index f76a0d8..c483abc 100644 --- a/docker/meta-hornbill/start-meta.sh +++ b/docker/meta-hornbill/start-meta.sh @@ -1,4 +1,9 @@ echo "docker:docker@fdb:4500" > /etc/fdb.cluster + +while ! fdbcli -C /etc/fdb.cluster --exec "tenant get hstream" --timeout 1 ; do + sleep 1; +done + /usr/local/bin/hstream-meta-server --host 0.0.0.0 \ --port 8964 \ --log-level trace \ diff --git a/docker/node-hornbill/start-server.sh b/docker/node-hornbill/start-server.sh index 669bccf..1ce4a5a 100644 --- a/docker/node-hornbill/start-server.sh +++ b/docker/node-hornbill/start-server.sh @@ -4,6 +4,10 @@ echo "docker:docker@fdb:4500" > /etc/fdb.cluster +while ! fdbcli -C /etc/fdb.cluster --exec "tenant get hstream" --timeout 1 ; do + sleep 1; +done + SERVER_ID=$(echo $(hostname) | cut -c 2-) # n_i -> i MY_IP=$(hostname -I | head -n1 | awk '{print $1;}') /usr/local/bin/hstream-server \