Commit Graph

11 Commits

Author SHA1 Message Date
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
d3300e839e Add unit tests for separate stdout and stderr on execution 2021-06-11 08:47:25 +00:00
7bbd7b7bae Fix task group name
Previously when creating a job, Poseidon would still use the old
task group name format instead of default-group as expected.
2021-06-09 18:22:28 +02:00
d0a2a1d96c Add tests for receiving allocation updates from Nomad 2021-06-09 08:35:20 +00:00
1be744f2d4 Explicitly set task groups network when networkAccess is false
Previously, updating an environment from with to without network
access would leave the network resource in the task group as they
were before.
2021-06-03 13:21:49 +00:00
3d395f0a38 Set network_mode to bridge to overwrite old setting
Previously, the network_mode was only set when creating a job with
network_access = false. This results in Nomad leaving this setting
as is when updating the job to use network. Thus a job would have
had the mapped ports in the Nomad UI, but the Docker network_mode
would still be 'none'.
2021-06-03 13:21:49 +00:00
242d0175a2 Add tests and end-to-end tests for websocket execution
For unit tests, this mocks the runners Execute method with a
customizable function that operates on the request, streams and exit
channel to simulate a real execution.

End-to-end tests are moved to the tests/e2e_tests folder. The tests
folder allows us to have shared helper functions for all tests in a
separate package (tests) that is not included in the non-test build.

This also adds one second of delay before each end-to-end test case by
using the TestSetup method of suite. By slowing down test execution,
this gives Nomad time to create new allocations when a test requested a
runner. Another solution could be to increase the scale of the job to
have enough allocations for all end-to-end tests.

Co-authored-by: Maximilian Paß <maximilian.pass@student.hpi.uni-potsdam.de>
2021-05-31 12:32:51 +02: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