From 42d09aace169b84469e6cda8ae914855fc0f30b4 Mon Sep 17 00:00:00 2001 From: Graham Christensen Date: Mon, 27 Jul 2020 16:15:13 -0400 Subject: [PATCH 1/4] readme: note the default user/pass --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 100e24f2..cbc50650 100644 --- a/README.md +++ b/README.md @@ -100,7 +100,7 @@ $ foreman start Have a look at the [Procfile](./Procfile) if you want to see how the processes are being started. In order to avoid conflicts with services that might be running on your host, hydra and postgress are started on custom ports: -- hydra-server: 63333 +- hydra-server: 63333 with the username "alice" and the password "foobar" - postgresql: 64444 Note that this is only ever meant as an ad-hoc way of executing Hydra during development. Please make use of the From 128aa0afc98f2e55b427c84aa7702bd6b6625f17 Mon Sep 17 00:00:00 2001 From: Graham Christensen Date: Mon, 27 Jul 2020 16:17:40 -0400 Subject: [PATCH 2/4] foreman: allow using substitutes by default --- foreman/start-evaluator.sh | 1 - foreman/start-hydra.sh | 8 +++++++- foreman/start-notify.sh | 1 - foreman/start-queue-runner.sh | 1 - 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/foreman/start-evaluator.sh b/foreman/start-evaluator.sh index 249c4047..a2858003 100755 --- a/foreman/start-evaluator.sh +++ b/foreman/start-evaluator.sh @@ -3,5 +3,4 @@ # wait for hydra-server to listen while ! nc -z localhost 63333; do sleep 1; done -touch .hydra-data/hydra.conf HYDRA_CONFIG=$(pwd)/.hydra-data/hydra.conf exec hydra-evaluator diff --git a/foreman/start-hydra.sh b/foreman/start-hydra.sh index 79b4fdb8..66773f81 100755 --- a/foreman/start-hydra.sh +++ b/foreman/start-hydra.sh @@ -8,5 +8,11 @@ createdb -h $(pwd)/.hydra-data/postgres -p 64444 hydra hydra-init hydra-create-user alice --password foobar --role admin -touch .hydra-data/hydra.conf +if [ ! -f ./.hydra-data/hydra.conf ]; then + echo "Creating a default hydra.conf" + cat << EOF > .hydra-data/hydra.conf +# test-time instances likely don't want to bootstrap nixpkgs from scratch +use-substitutes = true +EOF +fi HYDRA_CONFIG=$(pwd)/.hydra-data/hydra.conf exec hydra-dev-server --port 63333 diff --git a/foreman/start-notify.sh b/foreman/start-notify.sh index f63997ae..6a647e54 100755 --- a/foreman/start-notify.sh +++ b/foreman/start-notify.sh @@ -3,5 +3,4 @@ # wait for hydra-server to listen while ! nc -z localhost 63333; do sleep 1; done -touch .hydra-data/hydra.conf HYDRA_CONFIG=$(pwd)/.hydra-data/hydra.conf exec hydra-notify diff --git a/foreman/start-queue-runner.sh b/foreman/start-queue-runner.sh index 7c92f4e9..9796b105 100755 --- a/foreman/start-queue-runner.sh +++ b/foreman/start-queue-runner.sh @@ -3,5 +3,4 @@ # wait until hydra is listening on port 63333 while ! nc -z localhost 63333; do sleep 1; done -touch .hydra-data/hydra.conf HYDRA_CONFIG=$(pwd)/.hydra-data/hydra.conf exec hydra-queue-runner From 65a34499f07ecfe939b445e062748ef52c5e32c3 Mon Sep 17 00:00:00 2001 From: Graham Christensen Date: Mon, 27 Jul 2020 16:19:10 -0400 Subject: [PATCH 3/4] foreman/queue runner: run locally to avoid trust issues --- foreman/start-queue-runner.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/foreman/start-queue-runner.sh b/foreman/start-queue-runner.sh index 9796b105..f4fd6048 100755 --- a/foreman/start-queue-runner.sh +++ b/foreman/start-queue-runner.sh @@ -3,4 +3,4 @@ # wait until hydra is listening on port 63333 while ! nc -z localhost 63333; do sleep 1; done -HYDRA_CONFIG=$(pwd)/.hydra-data/hydra.conf exec hydra-queue-runner +NIX_REMOTE_SYSTEMS="" HYDRA_CONFIG=$(pwd)/.hydra-data/hydra.conf exec hydra-queue-runner From 648eb980dd757a6f71f920d8afa7e4b748a3f0fe Mon Sep 17 00:00:00 2001 From: Graham Christensen Date: Mon, 27 Jul 2020 16:46:16 -0400 Subject: [PATCH 4/4] hydra-notify: autoflush stdout too --- src/script/hydra-notify | 1 + 1 file changed, 1 insertion(+) diff --git a/src/script/hydra-notify b/src/script/hydra-notify index 1b4ddf08..6677667c 100755 --- a/src/script/hydra-notify +++ b/src/script/hydra-notify @@ -8,6 +8,7 @@ use Hydra::Helper::AddBuilds; use IO::Select; STDERR->autoflush(1); +STDOUT->autoflush(1); binmode STDERR, ":encoding(utf8)"; my $config = getHydraConfig();