Commit Graph

14 Commits

Author SHA1 Message Date
87f823756b Implement merge request comments 2021-06-15 11:37:47 +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
61bc7d0143 Add unit tests for provide runner route 2021-06-10 06:11:31 +00:00
32fe47d669 Implement linting issues and merge request comments 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
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
17c9839fac Refactor runners and websocket tests 2021-05-19 14:52:03 +02:00
83ea552cf7 Refactor interfaces to use a runner manager and an environment manager.
See https://gitlab.hpi.de/codeocean/codemoon/poseidon/-/issues/44.
2021-05-19 14:52:03 +02:00
94f02fad02 Add tests for LoadAvailableRunners method 2021-05-11 14:26:05 +02:00
ba51956ec3 Add destroy runner route 2021-05-10 16:28:35 +02:00
e45cd92557 Fix bad import rebase artifacts 2021-05-10 12:59:18 +00:00
52b80583b5 Implement review suggestions
Improve logging, constants for routes, RWMutex for ExerciseRunners,
use url.URL for websocket url building
2021-05-06 09:38:00 +02:00
07cdf17eb4 Move execution request map to runners 2021-05-06 08:03:48 +02:00
612bc55bdd Add tests for runners execute route
Co-authored-by: Tobias Kantusch <tobias.kantusch@student.hpi.uni-potsdam.de>
2021-05-06 08:03:48 +02:00