Commit Graph

354 Commits

Author SHA1 Message Date
Sebastian Serth
d87e23b9a3 Add execute_command method to runner.rb
* This is now used by the score and test runs
* This also re-enables the interactive shell for execution environments
2021-11-01 17:13:05 +01:00
Sebastian Serth
68c8f1dbdf DCP: Set sticky bit for folder and secure delete 2021-11-01 17:13:04 +01:00
Sebastian Serth
696cd6a236 Poseidon: Clean workspace between executions 2021-11-01 17:13:03 +01:00
Sebastian Serth
c676785d55 Fix order-dependent runner_spec.rb 2021-11-01 17:13:02 +01:00
Sebastian Serth
06ef4430f5 Change exposed_ports to array 2021-11-01 17:13:02 +01:00
Sebastian Serth
601e1fab5c Remove all occurrences of server-sent events 2021-11-01 17:12:57 +01:00
Sebastian Serth
3fa6ba6c72 Use instance_double for Poseidon Strategy specs 2021-11-01 17:12:57 +01:00
Sebastian Serth
ee1751debf Fix rubocop offenses 2021-11-01 17:12:55 +01:00
Sebastian Serth
5037a73f36 Mock runner management settings for spec 2021-11-01 17:12:54 +01:00
Sebastian Serth
30603cb7ab Generalize method and constant names for runner management 2021-11-01 17:12:53 +01:00
Felix Auringer
9e2cff7558 Attach connection errors to socket
Raising the errors would crash the current thread. As this thread
contains the Eventmachine, that would influence other connections
as well. Attaching the errors to the connection and reading them
after the connection was closed ensures that the thread stays
alive while handling the errors in the main thread of the current
request.
2021-11-01 17:12:53 +01:00
Felix Auringer
c8e1a0bbcb Fix tests for Runner#attach_to_execution
These tests were blocking because of the newly introduced
EventLoop. The messages sent to the EventLoop are now mocked
and the EventLoop isn't blocking anymore in the tests.
2021-11-01 17:12:53 +01:00
Felix Auringer
5cc180d0e9 Fix rubocop, I18n, cleanup rebase 2021-11-01 17:12:52 +01:00
Felix Auringer
2dff81a510 Attach duration information to the exception object 2021-11-01 17:12:52 +01:00
Felix Auringer
cc412b73bc Introduce more error types 2021-11-01 17:12:51 +01:00
Felix Auringer
db2d1e3164 Add tests for DockerContainerPool strategy 2021-11-01 17:12:51 +01:00
Felix Auringer
704407b9fc Add strategy for DockerContainerPool
In order to provide an alternative to Poseidon, a strategy for the
DockerContainerPool is added that is used by the runner model.

Co-authored-by: Sebastian Serth <Sebastian.Serth@hpi.de>
2021-11-01 17:12:51 +01:00
Felix Auringer
1d3f0d7ad8 Handle Faraday errors 2021-11-01 17:12:50 +01:00
Felix Auringer
b48b45de9f Refactor error classes
All runner errors are now in a single file. The not found error
has been splitted into an error for runner not found and for
environment not found.
2021-11-01 17:12:50 +01:00
Felix Auringer
413f9b2705 Improve error resilience and handling
Timeouts are now handled correctly and the Runner automatically
creates the execution environment if it could not be found in
Poseidon. The runner is deleted locally if Poseidon returns
a bad request error.
2021-11-01 17:12:50 +01:00
Felix Auringer
b6bc578aea Move submission scoring from controller concern to submission model
Localization and markdown formatting is now done in a controller
spec in order to bring this logic away from the data and towards
the view.
2021-11-01 17:12:50 +01:00
Felix Auringer
b847daf823 Remove waiting_time from runner model
After removing the logic that stores the duration that has been
waited for a runner in the runner, this now also removes the column
from the database as it is not used anymore.
2021-11-01 17:12:49 +01:00
Felix Auringer
d0d1b1bffd Introduce strategy for runner behavior
The runner model is only a class responsible for storing information
now. Based on the configuration it picks a strategy for the runner
management. The Poseidon strategy is already implemented and tested.
The Docker strategy will follow.
2021-11-01 17:12:49 +01:00
Felix Auringer
cf58be97ee Fix 17 previously failing specs 2021-11-01 17:12:49 +01:00
Konrad Hanff
0280c0282e Add tests for synchronizing all execution environments
This adds policy tests to ensure only an admin can synchronize all
execution environments. It also adds controller tests that check that
all execution environments get synchronized.
2021-11-01 17:12:49 +01:00
Felix Auringer
0978a3be83 Add tests for the different runner errors 2021-11-01 17:12:48 +01:00
Konrad Hanff
5e913c8a1a Skip failing tests
17 tests are always failing, due to changes introduced when adding the
Runner abstraction. To know only these fail, they now get skipped in
order to make it apparent if tests that should not fail do fail in the
pipeline.
2021-11-01 17:12:48 +01:00
Konrad Hanff
d22d24df4d Add tests for execution environment copy to Poseidon 2021-11-01 17:12:48 +01:00
Sebastian Serth
4f9078c6c6 Update usage of Selenium driver 2021-10-17 02:36:27 +02:00
Sebastian Serth
bb4b4ece92 Add ping/pong health check 2021-10-09 23:37:31 +02:00
Sebastian Serth
74e285e9fd Fix rubocop offenses 2021-10-05 12:09:56 +02:00
Sebastian Serth
ae824565db Use older images in FactoryBot models 2021-09-11 21:29:10 +02:00
Sebastian Serth
f349e8a48c Use real temp folder for Docker specs 2021-08-17 12:45:40 +02:00
Sebastian Serth
a0ca15c6ac Fix submission scoring during specs 2021-08-17 12:45:26 +02:00
Sebastian Serth
bf8d8284e2 Prevent creation of temporary users while seeding 2021-07-12 20:43:16 +02:00
Sebastian Serth
d08707f62e Fix switch_locale to return the block result 2021-06-28 16:08:24 +02:00
Sebastian Serth
1b71163a77 Refactor locale with around method 2021-06-25 17:36:56 +02:00
Sebastian Serth
e7cf4ef5db Apply automatic rubocop fixes 2021-06-25 14:41:49 +02:00
Sebastian Serth
cb9870447f Update Bundle
* Also fix new offenses discovered by the new Rubocop version
2021-06-01 17:41:54 +02:00
Sebastian Serth
08d7b89108 Merge pull request #930 from openHPI/own-project
Rebrush action sidebar for implement view
2021-06-01 17:38:55 +02:00
Sebastian Serth
f32661ad78 Rework left sidebar
* Move Buttons from left sidebar to JSTree
* Use light style for collapse sidebar buttons
2021-05-28 17:49:59 +02:00
Sebastian Serth
5243808d54 Apply automatic rubocop fixes 2021-05-17 19:40:38 +02:00
Sebastian Serth
da0a682ffb Apply manual rubocop fixes 2021-05-14 22:03:06 +02:00
Sebastian Serth
6cbecb5b39 Apply automatic rubocop fixes 2021-05-14 22:03:06 +02:00
Sebastian Serth
48904a19fd Fix test for new custom file 2021-05-14 17:35:37 +02:00
Sebastian Serth
ebdfd4ab63 Re-enable oscillating tests 2021-05-12 16:47:05 +02:00
Sebastian Serth
26151920c0 Prevent docker cleaning if no docker test was performed 2021-05-12 16:47:05 +02:00
Sebastian Serth
2b32829e60 Upgrade DatabaseCleaner strategy 2021-05-12 16:47:05 +02:00
Sebastian Serth
8378070bc2 Upgrade to Rails 6.0 and apply new framework defaults 2021-05-12 16:47:05 +02:00
Sebastian Serth
1c2d5bc2a8 Prometheus: Mock config in specs 2021-05-10 18:57:01 +02:00