From d1237c315d3ff4c79427df1e603ec0057862aeeb Mon Sep 17 00:00:00 2001 From: Andreas Rammhold Date: Wed, 13 May 2020 17:37:25 +0200 Subject: [PATCH 01/10] Add runHydra shell runHyda automatically starts hydra and postgres: ``` $ nix-shell -A runHydra ``` The shell receives hydra from the working copy as buildInput. Running hydra, queue-runner, evaluator and postgres is managed by foreman (https://github.com/ddollar/foreman) and configured in `Procfile`. --- .gitignore | 1 + Procfile | 4 ++++ flake.nix | 7 ++++++- run-hydra.nix | 16 ++++++++++++++++ scripts/start-evaluator.sh | 6 ++++++ scripts/start-hydra.sh | 11 +++++++++++ scripts/start-postgres.sh | 4 ++++ scripts/start-queue-runner.sh | 6 ++++++ 8 files changed, 54 insertions(+), 1 deletion(-) create mode 100644 Procfile create mode 100644 run-hydra.nix create mode 100755 scripts/start-evaluator.sh create mode 100755 scripts/start-hydra.sh create mode 100755 scripts/start-postgres.sh create mode 100755 scripts/start-queue-runner.sh diff --git a/.gitignore b/.gitignore index f0e7b240..b5693cf3 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,7 @@ Makefile Makefile.in .deps +.hydra-data /config.guess /config.log /config.status diff --git a/Procfile b/Procfile new file mode 100644 index 00000000..42267366 --- /dev/null +++ b/Procfile @@ -0,0 +1,4 @@ +hydra-server: ./scripts/start-hydra.sh +hydra-queue-runner: ./scripts/start-queue-runner.sh +hydra-evaluator: ./scripts/start-evaluator.sh +postgres: ./scripts/start-postgres.sh diff --git a/flake.nix b/flake.nix index ec6e0349..f8e316f8 100644 --- a/flake.nix +++ b/flake.nix @@ -104,13 +104,16 @@ [ makeWrapper autoconf automake libtool unzip nukeReferences pkgconfig libpqxx gitAndTools.topGit mercurial darcs subversion bazaar openssl bzip2 libxslt perlDeps perl final.nix - postgresql95 # for running the tests boost (if lib.versionAtLeast lib.version "20.03pre" then nlohmann_json else nlohmann_json.override { multipleHeaders = true; }) ]; + checkInputs = [ + postgresql95 + ]; + hydraPath = lib.makeBinPath ( [ subversion openssh final.nix coreutils findutils pixz gzip bzip2 lzma gnutar unzip git gitAndTools.topGit mercurial darcs gnused bazaar @@ -290,6 +293,8 @@ nixpkgs.overlays = [ self.overlay nix.overlay ]; }; + runHydra = pkgs.callPackage ./run-hydra.nix {}; + nixosModules.hydraTest = { imports = [ self.nixosModules.hydra ]; diff --git a/run-hydra.nix b/run-hydra.nix new file mode 100644 index 00000000..7012e26e --- /dev/null +++ b/run-hydra.nix @@ -0,0 +1,16 @@ +{ foreman, mkShell, hydra, netcat, postgresql95 }: +{ doCheck ? true }: +mkShell { + buildInputs = [ + foreman (hydra.overrideAttrs (_: { inherit doCheck; })) netcat postgresql95 + ]; + + shellHook = '' + export HYDRA_HOME="src/" + mkdir -p .hydra-data + export HYDRA_DATA="$(pwd)/.hydra-data" + export HYDRA_DBI='dbi:Pg:dbname=hydra;host=localhost;' + + exec foreman start + ''; +} diff --git a/scripts/start-evaluator.sh b/scripts/start-evaluator.sh new file mode 100755 index 00000000..c0b43cf3 --- /dev/null +++ b/scripts/start-evaluator.sh @@ -0,0 +1,6 @@ +#!/bin/sh + +# wait for hydra-server to listen +while ! nc -z localhost 3000; do sleep 1; done + +exec hydra-evaluator diff --git a/scripts/start-hydra.sh b/scripts/start-hydra.sh new file mode 100755 index 00000000..70bd9beb --- /dev/null +++ b/scripts/start-hydra.sh @@ -0,0 +1,11 @@ +#!/bin/sh + +# wait for postgresql to listen +while ! nc -z localhost 5432; do sleep 1; done + +createdb -h $(pwd)/.hydra-data/postgres hydra + +hydra-init +hydra-create-user alice --password foobar --role admin + +exec hydra-server diff --git a/scripts/start-postgres.sh b/scripts/start-postgres.sh new file mode 100755 index 00000000..fae2c4cb --- /dev/null +++ b/scripts/start-postgres.sh @@ -0,0 +1,4 @@ +#!/bin/sh + +initdb ./.hydra-data/postgres +exec postgres -D ./.hydra-data/postgres -k $(pwd)/.hydra-data/postgres diff --git a/scripts/start-queue-runner.sh b/scripts/start-queue-runner.sh new file mode 100755 index 00000000..4b2741f7 --- /dev/null +++ b/scripts/start-queue-runner.sh @@ -0,0 +1,6 @@ +#!/bin/sh + +# wait until hydra is listening on port 3000 +while ! nc -z localhost 3000; do sleep 1; done + +hydra-queue-runner From eb06a435aba269e35837f583693878a9f3941449 Mon Sep 17 00:00:00 2001 From: Andreas Rammhold Date: Wed, 13 May 2020 20:30:10 +0200 Subject: [PATCH 02/10] Add devShell for faster feedback This adds a `devShell` which unlike `runHydra` doesn't start hydra automatically and doesn't receive hydra as build input. It is better suited for interactive development cycles: ``` $ nix-shell -A devShell $ ./bootstrap $ configurePhase $ make $ # hack hack hack $ foreman start # test test test $ # hack hack hack ``` --- flake.nix | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/flake.nix b/flake.nix index f8e316f8..3135de4d 100644 --- a/flake.nix +++ b/flake.nix @@ -294,6 +294,15 @@ }; runHydra = pkgs.callPackage ./run-hydra.nix {}; + devShell = pkgs.hydra.overrideAttrs (old: { + buildInputs = old.buildInputs ++ [ pkgs.foreman pkgs.netcat ]; + shellHook = old.shellHook + '' + export HYDRA_HOME="src/" + mkdir -p .hydra-data + export HYDRA_DATA="$(pwd)/.hydra-data" + export HYDRA_DBI='dbi:Pg:dbname=hydra;host=localhost;' + ''; + }); nixosModules.hydraTest = { imports = [ self.nixosModules.hydra ]; From 07a44652600dd0b3326ff71049b2998a6bc4620f Mon Sep 17 00:00:00 2001 From: Tobias Pflug Date: Thu, 14 May 2020 11:49:29 +0200 Subject: [PATCH 03/10] 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 From 0add1cc6d8a2a706f5330c1fa727845275797953 Mon Sep 17 00:00:00 2001 From: Tobias Pflug Date: Thu, 14 May 2020 12:29:25 +0200 Subject: [PATCH 04/10] Default to `devShell` in shell.nix --- shell.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shell.nix b/shell.nix index 8b8aa5aa..cd9ccd4c 100644 --- a/shell.nix +++ b/shell.nix @@ -3,4 +3,4 @@ (import (fetchTarball https://github.com/edolstra/flake-compat/archive/master.tar.gz) { src = builtins.fetchGit ./.; -}).shellNix +}).defaultNix.devShell From 45ac8e0cbc1c8a21c6b942ab665513c5e043ccb5 Mon Sep 17 00:00:00 2001 From: Tobias Pflug Date: Thu, 14 May 2020 12:53:01 +0200 Subject: [PATCH 05/10] README.md: info about runHydra/foreman Add sections about using `runHydra` and `foreman` --- README.md | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/README.md b/README.md index c4a40de9..113254b7 100644 --- a/README.md +++ b/README.md @@ -70,6 +70,7 @@ Make sure **State** at the top of the page is set to "_Enabled_" and click on "_ ### Building Hydra You can build Hydra via `nix-build` using the provided [default.nix](./default.nix): + ``` $ nix-build ``` @@ -84,6 +85,44 @@ $ configurePhase # NOTE: not ./configure $ make ``` +### Development Workflow + +When working on new features or bug fixes you want to be able to run Hydra from your working copy. There are +two ways to do this. One is better for interactive development and provides faster feedback cycles, the other +is more convenient for a single test run of Hydra from the working copy (suiteable for PR reviews). + +#### Using runHydra + +Hydra can be built and executed using the `runHydra` shell: + +``` +$ nix-shell default.nix -A runHydra +``` + +This will spawn a shell that starts hydra-server, hydra-queue-runner, hydra-evaluator and postgres using [foreman](https://github.com/ddollar/foreman). +In order to not collide with potentially existing installations running on default ports hydra and postgres are running on custom ports: + +- hydra-server: 63333 +- postgresql: 64444 + +**Note**: In some cases you may want to skip test execution. You can do so by passing `doCheck false`: + +``` +$ nix-shell default.nix -A runHydra --arg doCheck false +``` + +#### Using foreman + +When you are actively working on the code, you need fast feedback cycles and thus want incremental builds. Instead of using +`runHydra` you can just run `foreman start` directly in the normal `nix-shell` environment: + +``` +$ nix-shell +$ # hack hack +$ make +$ foreman start +``` + ### JSON API You can also interface with Hydra through a JSON API. The API is defined in [hydra-api.yaml](./hydra-api.yaml) and you can test and explore via the [swagger editor](https://editor.swagger.io/?url=https://raw.githubusercontent.com/NixOS/hydra/master/hydra-api.yaml) From d9d58b7055bbb26c53022479fec78dc4357a727a Mon Sep 17 00:00:00 2001 From: Tobias Pflug Date: Thu, 14 May 2020 15:15:38 +0200 Subject: [PATCH 06/10] Use pg_ctl for readiness check Using `pg_ctl status` is more reliable than relying checking an open port via netcat. --- flake.nix | 2 +- run-hydra.nix | 4 ++-- scripts/start-hydra.sh | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/flake.nix b/flake.nix index df8708ba..87e402dd 100644 --- a/flake.nix +++ b/flake.nix @@ -295,7 +295,7 @@ runHydra = pkgs.callPackage ./run-hydra.nix {}; devShell = pkgs.hydra.overrideAttrs (old: { - buildInputs = old.buildInputs ++ [ pkgs.foreman pkgs.netcat ]; + buildInputs = old.buildInputs ++ [ pkgs.foreman ]; shellHook = old.shellHook + '' export HYDRA_HOME="src/" mkdir -p .hydra-data diff --git a/run-hydra.nix b/run-hydra.nix index fc410f43..59eb2740 100644 --- a/run-hydra.nix +++ b/run-hydra.nix @@ -1,8 +1,8 @@ -{ foreman, mkShell, hydra, netcat, postgresql95 }: +{ foreman, mkShell, hydra, postgresql95 }: { doCheck ? true }: mkShell { buildInputs = [ - foreman (hydra.overrideAttrs (_: { inherit doCheck; })) netcat postgresql95 + foreman (hydra.overrideAttrs (_: { inherit doCheck; })) postgresql95 ]; shellHook = '' diff --git a/scripts/start-hydra.sh b/scripts/start-hydra.sh index 815ee500..4898a1f3 100755 --- a/scripts/start-hydra.sh +++ b/scripts/start-hydra.sh @@ -1,7 +1,7 @@ #!/bin/sh -# wait for postgresql to listen -while ! nc -z localhost 64444; do sleep 1; done +# wait for postgresql to be up +while ! pg_ctl -D $(pwd)/.hydra-data/postgres status; do sleep 1; done createdb -h $(pwd)/.hydra-data/postgres -p 64444 hydra From 1bcb8d0be9d94c963821d5f947cbaa8c26d9cab7 Mon Sep 17 00:00:00 2001 From: Tobias Pflug Date: Thu, 14 May 2020 15:24:32 +0200 Subject: [PATCH 07/10] Use `pg_isready` for readiness check Co-authored-by: Graham Christensen --- scripts/start-hydra.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/start-hydra.sh b/scripts/start-hydra.sh index 4898a1f3..3b9c7dfd 100755 --- a/scripts/start-hydra.sh +++ b/scripts/start-hydra.sh @@ -1,7 +1,7 @@ #!/bin/sh -# wait for postgresql to be up -while ! pg_ctl -D $(pwd)/.hydra-data/postgres status; do sleep 1; done +# wait for postgresql to listen +while ! pg_isready -h $(pwd)/.hydra-data/postgres -p 64444; do sleep 1; done createdb -h $(pwd)/.hydra-data/postgres -p 64444 hydra From fc0eb02ffe35444b81445a91960399a10f1a99fb Mon Sep 17 00:00:00 2001 From: Tobias Pflug Date: Thu, 14 May 2020 15:27:43 +0200 Subject: [PATCH 08/10] Run `hydra-dev-server` Execute hydra-dev-server instead of hydra-server Co-authored-by: Graham Christensen --- scripts/start-hydra.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/start-hydra.sh b/scripts/start-hydra.sh index 3b9c7dfd..79b4fdb8 100755 --- a/scripts/start-hydra.sh +++ b/scripts/start-hydra.sh @@ -9,4 +9,4 @@ hydra-init hydra-create-user alice --password foobar --role admin touch .hydra-data/hydra.conf -HYDRA_CONFIG=$(pwd)/.hydra-data/hydra.conf exec hydra-server --port 63333 +HYDRA_CONFIG=$(pwd)/.hydra-data/hydra.conf exec hydra-dev-server --port 63333 From 31262f14fb8e52baf93bccdfd0d4e0075900501f Mon Sep 17 00:00:00 2001 From: Tobias Pflug Date: Fri, 15 May 2020 13:48:21 +0200 Subject: [PATCH 09/10] Address PR comments: - scripts -> foreman - drop runHydra - drop devShell - move postgresql to buildInputs --- Procfile | 8 ++++---- flake.nix | 18 ++++++------------ {scripts => foreman}/start-evaluator.sh | 0 {scripts => foreman}/start-hydra.sh | 0 {scripts => foreman}/start-postgres.sh | 0 {scripts => foreman}/start-queue-runner.sh | 0 run-hydra.nix | 16 ---------------- shell.nix | 2 +- 8 files changed, 11 insertions(+), 33 deletions(-) rename {scripts => foreman}/start-evaluator.sh (100%) rename {scripts => foreman}/start-hydra.sh (100%) rename {scripts => foreman}/start-postgres.sh (100%) rename {scripts => foreman}/start-queue-runner.sh (100%) delete mode 100644 run-hydra.nix diff --git a/Procfile b/Procfile index 42267366..2ccd32b2 100644 --- a/Procfile +++ b/Procfile @@ -1,4 +1,4 @@ -hydra-server: ./scripts/start-hydra.sh -hydra-queue-runner: ./scripts/start-queue-runner.sh -hydra-evaluator: ./scripts/start-evaluator.sh -postgres: ./scripts/start-postgres.sh +hydra-server: ./foreman/start-hydra.sh +hydra-queue-runner: ./foreman/start-queue-runner.sh +hydra-evaluator: ./foreman/start-evaluator.sh +postgres: ./foreman/start-postgres.sh diff --git a/flake.nix b/flake.nix index 87e402dd..2611bd01 100644 --- a/flake.nix +++ b/flake.nix @@ -105,13 +105,14 @@ gitAndTools.topGit mercurial darcs subversion bazaar openssl bzip2 libxslt perlDeps perl final.nix boost + postgresql95 (if lib.versionAtLeast lib.version "20.03pre" then nlohmann_json else nlohmann_json.override { multipleHeaders = true; }) ]; checkInputs = [ - postgresql95 + foreman ]; hydraPath = lib.makeBinPath ( @@ -124,6 +125,10 @@ shellHook = '' PATH=$(pwd)/src/hydra-evaluator:$(pwd)/src/script:$(pwd)/src/hydra-eval-jobs:$(pwd)/src/hydra-queue-runner:$PATH PERL5LIB=$(pwd)/src/lib:$PERL5LIB + export HYDRA_HOME="src/" + mkdir -p .hydra-data + export HYDRA_DATA="$(pwd)/.hydra-data" + export HYDRA_DBI='dbi:Pg:dbname=hydra;host=localhost;port=64444' ''; preConfigure = "autoreconf -vfi"; @@ -293,17 +298,6 @@ nixpkgs.overlays = [ self.overlay nix.overlay ]; }; - runHydra = pkgs.callPackage ./run-hydra.nix {}; - devShell = pkgs.hydra.overrideAttrs (old: { - buildInputs = old.buildInputs ++ [ pkgs.foreman ]; - shellHook = old.shellHook + '' - export HYDRA_HOME="src/" - mkdir -p .hydra-data - export HYDRA_DATA="$(pwd)/.hydra-data" - export HYDRA_DBI='dbi:Pg:dbname=hydra;host=localhost;port=64444' - ''; - }); - nixosModules.hydraTest = { imports = [ self.nixosModules.hydra ]; diff --git a/scripts/start-evaluator.sh b/foreman/start-evaluator.sh similarity index 100% rename from scripts/start-evaluator.sh rename to foreman/start-evaluator.sh diff --git a/scripts/start-hydra.sh b/foreman/start-hydra.sh similarity index 100% rename from scripts/start-hydra.sh rename to foreman/start-hydra.sh diff --git a/scripts/start-postgres.sh b/foreman/start-postgres.sh similarity index 100% rename from scripts/start-postgres.sh rename to foreman/start-postgres.sh diff --git a/scripts/start-queue-runner.sh b/foreman/start-queue-runner.sh similarity index 100% rename from scripts/start-queue-runner.sh rename to foreman/start-queue-runner.sh diff --git a/run-hydra.nix b/run-hydra.nix deleted file mode 100644 index 59eb2740..00000000 --- a/run-hydra.nix +++ /dev/null @@ -1,16 +0,0 @@ -{ foreman, mkShell, hydra, postgresql95 }: -{ doCheck ? true }: -mkShell { - buildInputs = [ - foreman (hydra.overrideAttrs (_: { inherit doCheck; })) postgresql95 - ]; - - shellHook = '' - export HYDRA_HOME="src/" - mkdir -p .hydra-data - export HYDRA_DATA="$(pwd)/.hydra-data" - export HYDRA_DBI='dbi:Pg:dbname=hydra;host=localhost;port=64444' - - exec foreman start - ''; -} diff --git a/shell.nix b/shell.nix index cd9ccd4c..8b8aa5aa 100644 --- a/shell.nix +++ b/shell.nix @@ -3,4 +3,4 @@ (import (fetchTarball https://github.com/edolstra/flake-compat/archive/master.tar.gz) { src = builtins.fetchGit ./.; -}).defaultNix.devShell +}).shellNix From 006233d7f35272ccd8e2ff8da37f524d03151d2d Mon Sep 17 00:00:00 2001 From: Tobias Pflug Date: Fri, 15 May 2020 13:59:36 +0200 Subject: [PATCH 10/10] README.md update - drop any mention of runHydra - link foreman and mention Procfile --- README.md | 41 ++++++++++++----------------------------- 1 file changed, 12 insertions(+), 29 deletions(-) diff --git a/README.md b/README.md index 113254b7..100e24f2 100644 --- a/README.md +++ b/README.md @@ -85,36 +85,10 @@ $ configurePhase # NOTE: not ./configure $ make ``` -### Development Workflow +### Executing Hydra During Development -When working on new features or bug fixes you want to be able to run Hydra from your working copy. There are -two ways to do this. One is better for interactive development and provides faster feedback cycles, the other -is more convenient for a single test run of Hydra from the working copy (suiteable for PR reviews). - -#### Using runHydra - -Hydra can be built and executed using the `runHydra` shell: - -``` -$ nix-shell default.nix -A runHydra -``` - -This will spawn a shell that starts hydra-server, hydra-queue-runner, hydra-evaluator and postgres using [foreman](https://github.com/ddollar/foreman). -In order to not collide with potentially existing installations running on default ports hydra and postgres are running on custom ports: - -- hydra-server: 63333 -- postgresql: 64444 - -**Note**: In some cases you may want to skip test execution. You can do so by passing `doCheck false`: - -``` -$ nix-shell default.nix -A runHydra --arg doCheck false -``` - -#### Using foreman - -When you are actively working on the code, you need fast feedback cycles and thus want incremental builds. Instead of using -`runHydra` you can just run `foreman start` directly in the normal `nix-shell` environment: +When working on new features or bug fixes you need to be able to run Hydra from your working copy. This +can be done using [foreman](https://github.com/ddollar/foreman): ``` $ nix-shell @@ -123,6 +97,15 @@ $ make $ 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 +- postgresql: 64444 + +Note that this is only ever meant as an ad-hoc way of executing Hydra during development. Please make use of the +NixOS module for actually running Hydra in production. + ### JSON API You can also interface with Hydra through a JSON API. The API is defined in [hydra-api.yaml](./hydra-api.yaml) and you can test and explore via the [swagger editor](https://editor.swagger.io/?url=https://raw.githubusercontent.com/NixOS/hydra/master/hydra-api.yaml)