From 07a44652600dd0b3326ff71049b2998a6bc4620f Mon Sep 17 00:00:00 2001 From: Tobias Pflug Date: Thu, 14 May 2020 11:49:29 +0200 Subject: [PATCH] Use custom ports for postgres/hydra Use custom ports so hydra and postgres can run in environments where the default ports are in use already. --- flake.nix | 2 +- run-hydra.nix | 2 +- scripts/start-evaluator.sh | 5 +++-- scripts/start-hydra.sh | 7 ++++--- scripts/start-postgres.sh | 2 +- scripts/start-queue-runner.sh | 7 ++++--- 6 files changed, 14 insertions(+), 11 deletions(-) diff --git a/flake.nix b/flake.nix index 3135de4d..df8708ba 100644 --- a/flake.nix +++ b/flake.nix @@ -300,7 +300,7 @@ export HYDRA_HOME="src/" mkdir -p .hydra-data export HYDRA_DATA="$(pwd)/.hydra-data" - export HYDRA_DBI='dbi:Pg:dbname=hydra;host=localhost;' + export HYDRA_DBI='dbi:Pg:dbname=hydra;host=localhost;port=64444' ''; }); diff --git a/run-hydra.nix b/run-hydra.nix index 7012e26e..fc410f43 100644 --- a/run-hydra.nix +++ b/run-hydra.nix @@ -9,7 +9,7 @@ mkShell { export HYDRA_HOME="src/" mkdir -p .hydra-data export HYDRA_DATA="$(pwd)/.hydra-data" - export HYDRA_DBI='dbi:Pg:dbname=hydra;host=localhost;' + export HYDRA_DBI='dbi:Pg:dbname=hydra;host=localhost;port=64444' exec foreman start ''; diff --git a/scripts/start-evaluator.sh b/scripts/start-evaluator.sh index c0b43cf3..249c4047 100755 --- a/scripts/start-evaluator.sh +++ b/scripts/start-evaluator.sh @@ -1,6 +1,7 @@ #!/bin/sh # wait for hydra-server to listen -while ! nc -z localhost 3000; do sleep 1; done +while ! nc -z localhost 63333; do sleep 1; done -exec hydra-evaluator +touch .hydra-data/hydra.conf +HYDRA_CONFIG=$(pwd)/.hydra-data/hydra.conf exec hydra-evaluator diff --git a/scripts/start-hydra.sh b/scripts/start-hydra.sh index 70bd9beb..815ee500 100755 --- a/scripts/start-hydra.sh +++ b/scripts/start-hydra.sh @@ -1,11 +1,12 @@ #!/bin/sh # wait for postgresql to listen -while ! nc -z localhost 5432; do sleep 1; done +while ! nc -z localhost 64444; do sleep 1; done -createdb -h $(pwd)/.hydra-data/postgres hydra +createdb -h $(pwd)/.hydra-data/postgres -p 64444 hydra hydra-init hydra-create-user alice --password foobar --role admin -exec hydra-server +touch .hydra-data/hydra.conf +HYDRA_CONFIG=$(pwd)/.hydra-data/hydra.conf exec hydra-server --port 63333 diff --git a/scripts/start-postgres.sh b/scripts/start-postgres.sh index fae2c4cb..c3fd7669 100755 --- a/scripts/start-postgres.sh +++ b/scripts/start-postgres.sh @@ -1,4 +1,4 @@ #!/bin/sh initdb ./.hydra-data/postgres -exec postgres -D ./.hydra-data/postgres -k $(pwd)/.hydra-data/postgres +exec postgres -D ./.hydra-data/postgres -k $(pwd)/.hydra-data/postgres -p 64444 diff --git a/scripts/start-queue-runner.sh b/scripts/start-queue-runner.sh index 4b2741f7..7c92f4e9 100755 --- a/scripts/start-queue-runner.sh +++ b/scripts/start-queue-runner.sh @@ -1,6 +1,7 @@ #!/bin/sh -# wait until hydra is listening on port 3000 -while ! nc -z localhost 3000; do sleep 1; done +# wait until hydra is listening on port 63333 +while ! nc -z localhost 63333; do sleep 1; done -hydra-queue-runner +touch .hydra-data/hydra.conf +HYDRA_CONFIG=$(pwd)/.hydra-data/hydra.conf exec hydra-queue-runner