commit
c4104fe1fa
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -3,6 +3,7 @@
|
||||||
Makefile
|
Makefile
|
||||||
Makefile.in
|
Makefile.in
|
||||||
.deps
|
.deps
|
||||||
|
.hydra-data
|
||||||
/config.guess
|
/config.guess
|
||||||
/config.log
|
/config.log
|
||||||
/config.status
|
/config.status
|
||||||
|
|
4
Procfile
Normal file
4
Procfile
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
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
|
22
README.md
22
README.md
|
@ -70,6 +70,7 @@ Make sure **State** at the top of the page is set to "_Enabled_" and click on "_
|
||||||
### Building Hydra
|
### Building Hydra
|
||||||
|
|
||||||
You can build Hydra via `nix-build` using the provided [default.nix](./default.nix):
|
You can build Hydra via `nix-build` using the provided [default.nix](./default.nix):
|
||||||
|
|
||||||
```
|
```
|
||||||
$ nix-build
|
$ nix-build
|
||||||
```
|
```
|
||||||
|
@ -84,6 +85,27 @@ $ configurePhase # NOTE: not ./configure
|
||||||
$ make
|
$ make
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Executing Hydra During Development
|
||||||
|
|
||||||
|
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
|
||||||
|
$ # hack hack
|
||||||
|
$ 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
|
### 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)
|
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)
|
||||||
|
|
10
flake.nix
10
flake.nix
|
@ -104,13 +104,17 @@
|
||||||
[ makeWrapper autoconf automake libtool unzip nukeReferences pkgconfig libpqxx
|
[ makeWrapper autoconf automake libtool unzip nukeReferences pkgconfig libpqxx
|
||||||
gitAndTools.topGit mercurial darcs subversion bazaar openssl bzip2 libxslt
|
gitAndTools.topGit mercurial darcs subversion bazaar openssl bzip2 libxslt
|
||||||
perlDeps perl final.nix
|
perlDeps perl final.nix
|
||||||
postgresql95 # for running the tests
|
|
||||||
boost
|
boost
|
||||||
|
postgresql95
|
||||||
(if lib.versionAtLeast lib.version "20.03pre"
|
(if lib.versionAtLeast lib.version "20.03pre"
|
||||||
then nlohmann_json
|
then nlohmann_json
|
||||||
else nlohmann_json.override { multipleHeaders = true; })
|
else nlohmann_json.override { multipleHeaders = true; })
|
||||||
];
|
];
|
||||||
|
|
||||||
|
checkInputs = [
|
||||||
|
foreman
|
||||||
|
];
|
||||||
|
|
||||||
hydraPath = lib.makeBinPath (
|
hydraPath = lib.makeBinPath (
|
||||||
[ subversion openssh final.nix coreutils findutils pixz
|
[ subversion openssh final.nix coreutils findutils pixz
|
||||||
gzip bzip2 lzma gnutar unzip git gitAndTools.topGit mercurial darcs gnused bazaar
|
gzip bzip2 lzma gnutar unzip git gitAndTools.topGit mercurial darcs gnused bazaar
|
||||||
|
@ -121,6 +125,10 @@
|
||||||
shellHook = ''
|
shellHook = ''
|
||||||
PATH=$(pwd)/src/hydra-evaluator:$(pwd)/src/script:$(pwd)/src/hydra-eval-jobs:$(pwd)/src/hydra-queue-runner:$PATH
|
PATH=$(pwd)/src/hydra-evaluator:$(pwd)/src/script:$(pwd)/src/hydra-eval-jobs:$(pwd)/src/hydra-queue-runner:$PATH
|
||||||
PERL5LIB=$(pwd)/src/lib:$PERL5LIB
|
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";
|
preConfigure = "autoreconf -vfi";
|
||||||
|
|
7
foreman/start-evaluator.sh
Executable file
7
foreman/start-evaluator.sh
Executable file
|
@ -0,0 +1,7 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
# 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
|
12
foreman/start-hydra.sh
Executable file
12
foreman/start-hydra.sh
Executable file
|
@ -0,0 +1,12 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
# 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
|
||||||
|
|
||||||
|
hydra-init
|
||||||
|
hydra-create-user alice --password foobar --role admin
|
||||||
|
|
||||||
|
touch .hydra-data/hydra.conf
|
||||||
|
HYDRA_CONFIG=$(pwd)/.hydra-data/hydra.conf exec hydra-dev-server --port 63333
|
4
foreman/start-postgres.sh
Executable file
4
foreman/start-postgres.sh
Executable file
|
@ -0,0 +1,4 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
initdb ./.hydra-data/postgres
|
||||||
|
exec postgres -D ./.hydra-data/postgres -k $(pwd)/.hydra-data/postgres -p 64444
|
7
foreman/start-queue-runner.sh
Executable file
7
foreman/start-queue-runner.sh
Executable file
|
@ -0,0 +1,7 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
# 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
|
Loading…
Reference in a new issue