Commit Graph

30 Commits

Author SHA1 Message Date
17c1e379c2 Fix busy waiting on stdin
When running an execution, Nomad continuously reads from the stdin
reader. Because the readers we implemented (codeOceanToRawReader and
nullReader) return zero if there is no input available, this leads to
busy waiting and a high CPU load on Poseidon. By waiting indefinitely in
case of the nullReader and for at least one byte on case of the
codeOceanToRawReader before returning, we prevent this issue.
2021-06-21 08:20:04 +00:00
2e4a975588 Implement even more merge request comments 2021-06-15 12:05:51 +02:00
ff582805b4 Move Nomad job creation to Nomad package
Previously, low level Nomad job creation was done in the environment manager.
It used many functions of the nomad package so we felt like this logic
better belongs to the nomad package.
2021-06-15 11:38:02 +02:00
87f823756b Implement merge request comments 2021-06-15 11:37:47 +02:00
25d78df557 Restore existing jobs and fix rebase (7c99eff3) issues 2021-06-15 11:37:35 +02:00
c7d59810e5 Use Nomad jobs as runners instead of allocations
As we can't control which allocations are destroyed when downscaling a job, we decided
to use Nomad jobs as our runners. Thus for each runner we prewarm for an environment,
a corresponding job is created in Nomad. We create a default job that serves as a template
for the runners. Using this, already existing execution environments can easily be restored,
once Poseidon is restarted.
2021-06-15 11:35:54 +02:00
8de489929e Remove stderr fifo after interactive execution with stderr finished
Previously the stderr fifo would not be removed, leaving unwanted
artifacts from the execution behind. We now remove the stderr fifo
after the command finished.
2021-06-14 15:04:09 +02:00
f122dd9376 Split stdout and stderr on interactive execution
When running a command interactively, we previously would get stdout
and stderr both served on stdout by Nomad. To circumvent this issue,
we now start a separate execution inside the allocation to split
both streams.
2021-06-11 08:47:25 +00:00
32fe47d669 Implement linting issues and merge request comments 2021-06-09 08:35:20 +00:00
4b5f0a3eb6 Add tests for runner manager updating runners 2021-06-09 08:35:20 +00:00
d0a2a1d96c Add tests for receiving allocation updates from Nomad 2021-06-09 08:35:20 +00:00
3f572261c2 Add updating cached allocations 2021-06-09 08:35:20 +00:00
02b3f52a11 Add ability to copy files to and delete files from runner 2021-06-02 14:54:54 +02:00
6084b00e23 Exit MonitorEvaluation once stream is closed
As we pass the context to the Nomad API event stream, they close
the event stream once the passed context is cancelled. We use this
to exit our receive loop on the event stream once the stream is closed,
instead of having to check the context manually.
2021-05-28 06:52:38 +00:00
f228a3e599 Add Nomad job registration with monitoring afterwards
Once a Nomad job is registered, we listen to the Nomad event stream
and return once we find the evaluation to complete.
2021-05-28 06:52:38 +00:00
4c3cc0cc4c Move Nomad job creation logic to environment manager 2021-05-28 06:52:38 +00:00
6da9080bce Add option to configure Nomad namespace 2021-05-18 12:10:39 +00:00
1f921b2ce2 Resolve merge conflicts 2021-05-12 12:02:12 +02:00
cee5eee622 Rename job scale functions to be consistent in naming 2021-05-12 10:46:15 +02:00
a2a9ed367a Add tests for api client creation 2021-05-12 10:46:11 +02:00
dfd34144f8 Store default Nomad job in apiClient to cache it 2021-05-12 07:52:22 +00:00
1aaad5c5fe Add default Nomad job and job creation 2021-05-12 07:52:22 +00:00
fde334a610 Perform a few renamings 2021-05-11 14:26:05 +02:00
54df1e8ec8 Move api querier to own file 2021-05-11 14:26:05 +02:00
94f02fad02 Add tests for LoadAvailableRunners method 2021-05-11 14:26:05 +02:00
bb757c7375 Only load available runners 2021-05-11 14:26:04 +02:00
ba51956ec3 Add destroy runner route 2021-05-10 16:28:35 +02:00
dba7160a41 Implement merge request review comments 2021-05-10 12:14:56 +02:00
0dc4d28c1b Add e2e tests in ci stage 2021-05-07 12:54:15 +02:00
c092199693 Add basic nomad integration and runner provider 2021-05-04 13:08:04 +02:00