Sebastian Serth
28c74bc9a5
Improve memoization of @strategy_class
2021-11-01 17:13:08 +01:00
Sebastian Serth
0db6f20933
Move MemoryLimit to Execution Environment
2021-11-01 17:13:06 +01:00
Sebastian Serth
9cc4394296
Allow editing an Execution Environment with active runner management
2021-11-01 17:13:05 +01:00
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
a1db30c288
Clarify EnvironmentNotFound error handling
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
90eeb3bb9c
Move CodeOcean::FileNameValidator
2021-11-01 17:13:01 +01:00
Sebastian Serth
352e5f4329
Clarify strategy creation in runner.rb with comment
2021-11-01 17:13:01 +01:00
Sebastian Serth
7285978ea3
Re-add test method for SubmissionsController
2021-11-01 17:13:01 +01:00
Sebastian Serth
5f98456276
Extract run_test_file from submission.rb
2021-11-01 17:13:01 +01:00
Sebastian Serth
2377f8370c
Clarify set_file and set_files in SubmissionsController
2021-11-01 17:13:00 +01:00
Sebastian Serth
0c22e1392a
Remove outdated mnemosyne traces
2021-11-01 17:12:55 +01:00
Sebastian Serth
13c378b980
Remove concurrent ruby gem no longer needed
2021-11-01 17:12:55 +01:00
Felix Auringer
f77e6d9df8
Simplify code in runner model
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
e752df1b3c
Move EventMachine initialization to Runner::EventLoop
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
c7369366d5
Ensure that only one EventMachine is running
2021-11-01 17:12:52 +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
36578a2817
Ensure to save Testrun even when an error occurs
2021-11-01 17:12:52 +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
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
d5b274c9f2
Introduce new error types for runners
...
The errors are raised in the runner model and in the runner connection
class. In the submission controller the errors are rescued and,
depending on the error, the status timeout / container depleted is
sent to the client.
2021-11-01 17:12:48 +01:00
Konrad Hanff
90fac7b94c
Copy execution environment to Poseidon on create and update
...
When creating or updating an execution environment, an API call to
Poseidon is made with the necessary information to create the
corresponding Nomad job.
If runner management is configured, his will display a warning
(currently in the same color as if it were a success) in the UI, if the
API call fails. The environment is saved even if it fails.
If runner management is not configured, this warning will not be created.
2021-11-01 17:12:48 +01:00
Felix Auringer
b762c73ddd
Update usage of Poseidon API to newest API version (0.2.2)
...
copy file, create and execute command had to be adapted.
2021-11-01 17:12:47 +01:00
Felix Auringer
8d968e01e6
Move RunnerConnection into class Runner
...
The old approach was to require the runner connection. This did
not work anymore with Zeitwerk in Rails 6. @sebastian.serth and I
moved the Connection class in `lib` into the ActiveRecord class
`Runner`. This will also work with future changes like specific
error classes. Furthermore the config was fixed and simplified.
Co-authored-by: Sebastian Serth <Sebastian.Serth@hpi.de >
2021-11-01 17:12:47 +01:00
Felix Auringer
63d997a7e3
Fix Rubocop offenses after Rubocop was reconfigured
2021-11-01 17:12:47 +01:00
Felix Auringer
fc6aa12b0a
Remove handling of runner timeouts
2021-11-01 17:12:47 +01:00
Konrad Hanff
286a3f394d
Fix autocorrectable rubocop offences and implement suggestions
2021-11-01 17:12:46 +01:00
Konrad Hanff
17bd2d8726
Reuse runners per user and execution environment
...
Co-authored-by: Jan-Eric Hellenberg <jan-eric.hellenberg@student.hpi.uni-potsdam.de >
Co-authored-by: Maximilian Pass <maximilian.pass@student.hpi.uni-potsdam.de >
2021-11-01 17:12:46 +01:00
Konrad Hanff
2404c1c36c
Rename variables from container to runner
2021-11-01 17:12:45 +01:00
Konrad Hanff
3e6534567d
Move copy_submission_files from runner to submission
2021-11-01 17:12:45 +01:00
Konrad Hanff
cf1e4d6edf
Rename API routes
2021-11-01 17:12:44 +01:00
Konrad Hanff
347e4728a0
Rework protocol inside websocket
...
Co-authored-by Felix Auringer <felix.auringer@student.hpi.uni-potsdam.de >
2021-11-01 17:12:44 +01:00
Konrad Hanff
6a4e302f4e
Fix socket handling and add configuration option
...
Co-authored-by: Felix Auringer <felix.auringer@student.hpi.uni-potsdam.de >
2021-11-01 17:12:43 +01:00
Konrad Hanff
92b249e7b3
Reimplement scoring and create connection abstraction
...
Co-authored-by: Felix Auringer <felix.auringer@student.hpi.uni-potsdam.de >
2021-11-01 17:12:43 +01:00
Konrad Hanff
1546f70818
Begin to refactor websocket handling and implement test
...
Co-authored-by: Felix Auringer <felix.auringer@student.hpi.uni-potsdam.de >
2021-11-01 17:12:43 +01:00
Konrad Hanff
3cf70a33d8
Integrate new API with websocket (run only)
...
Co-authored-by: Felix Auringer <felix.auringer@student.hpi.uni-potsdam.de >
2021-11-01 17:12:43 +01:00
Konrad Hanff
2e2cd1855e
Add Container abstration with new API calls and adapt running a submission
...
Co-authored-by: Felix Auringer <felix.auringer@student.hpi.uni-potsdam.de >
2021-11-01 17:12:43 +01:00
Sebastian Serth
6a255ced5b
Exclude content attribute of files to be trimmed
2021-10-08 19:30:55 +02:00
Sebastian Serth
6321b2edef
trim whitespace from beginning and end of string attributes
2021-10-08 19:30:54 +02:00
Sebastian Serth
74e285e9fd
Fix rubocop offenses
2021-10-05 12:09:56 +02:00
Sebastian Serth
671c2bd28b
Allow changes to internal user when password is void
2021-07-12 13:27:41 +02:00
Sebastian Serth
110f1a5750
Fix rubocop offenses after bundle update
2021-06-30 09:13:25 +02:00
Sebastian Serth
e7cf4ef5db
Apply automatic rubocop fixes
2021-06-25 14:41:49 +02:00