Commit Graph

218 Commits

Author SHA1 Message Date
Sebastian Serth
9587ecb2b1 Resolve bug where duration of not-started runner cannot be calculated 2022-07-15 00:49:16 +02:00
Sebastian Serth
1183f5cdcd Ensure that the testrun[:status] is available in more cases 2022-07-15 00:49:15 +02:00
Sebastian Serth
0ab3d0bdc1 Fix Rubocop offenses 2022-06-30 14:02:53 +02:00
Sebastian Serth
ea728f54ec Fix remote evaluations URL when using subdirectory for CO 2022-05-14 19:01:54 -04:00
Sebastian Serth
ea02dff0e5 Extend storage of Testrun Messages and truncate long output 2022-04-29 22:44:34 +02:00
Sebastian Serth
5ecba6ef70 Persist TestrunMessages and store timestamp
So far, the Testrun messages are in addition to the Tesstrun.output column
2022-04-29 01:00:51 +02:00
Sebastian Serth
e9efb5bc2b Add exit_code and status to Testruns, create model for TestrunMessages
* This is the first step to migrate the `output` column from Testruns to a dedicated table TestrunMessages
2022-04-28 15:18:51 +02:00
Sebastian Serth
83e09f33ec Merge pull request #1237 from openHPI/aws_experiment
Prepare AWS Experiment
2022-04-18 21:18:29 +02:00
Sebastian Serth
19bd742bc9 Show a localized message if the program was killed.
* This will most likely happen by the OOM killer, thus we inform the user about the memory restriction.
2022-04-15 21:29:55 +02:00
Sebastian Serth
d10735d0a8 Persist Execution Environment when running code 2022-04-15 15:22:19 +02:00
Sebastian Serth
0583076c2b Fix Thread leakage when scoring or testing submissions
It is discouraged to do anything directly within the
Tubesock hijack block. We might only use the callbacks
(onopen, onmessage, onclose, onerror). Otherwise,
Tubesock might not close all Threads correctly and
will keep them awake every five seconds.
2022-04-07 19:57:31 +02:00
Sebastian Serth
0a6ae91db8 Introduce per_page parameter for custom page size 2022-01-12 20:46:54 +01:00
Sebastian Serth
ea85519163 Update bundle (with newest rubocop version) and fix offenses 2022-01-04 09:42:37 +01:00
Sebastian Serth
0c1a10959c Use file name with file path as identifier 2021-12-15 00:52:31 +01:00
Sebastian Serth
695c3de40e Ensure users are signed in before creating a submission 2021-11-14 23:07:44 +01:00
Sebastian Serth
c3642b5d0c Add an empty line before printing exit message
* The empty line is only added if the output is not empty
2021-11-01 17:52:44 +01:00
Sebastian Serth
de83843496 Combine no_output and exit_status messages 2021-11-01 17:13:13 +01:00
Sebastian Serth
7285978ea3 Re-add test method for SubmissionsController 2021-11-01 17:13:01 +01:00
Sebastian Serth
56a1d78793 Use correct embed_option to disable_score 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
345860c779 Adapt output buffering to Poseidon and DCP
* Refactor flushing of messages
* Introduce two separate buffers for stdout and stderr
2021-11-01 17:13:00 +01:00
Sebastian Serth
7e7b7ebdfa Allow flushing the WebSocket connection
* This will prevent the current thread from crashing when a single newline character is received.
2021-11-01 17:12:59 +01:00
Sebastian Serth
f4c806fe43 Forward JSON from runner to client if possible 2021-11-01 17:12:59 +01:00
Sebastian Serth
3240ea7076 Forward input as raw_event to runner
* Also, rename #send to #send_data in order to prevent debugging issues in RubyMine
2021-11-01 17:12:58 +01:00
Sebastian Serth
f896d041f8 Restructure submissions_controller and remove outdated copy_comments method 2021-11-01 17:12:58 +01:00
Sebastian Serth
1403fc03c4 Remove outdated lines from #download method 2021-11-01 17:12:57 +01:00
Sebastian Serth
601e1fab5c Remove all occurrences of server-sent events 2021-11-01 17:12:57 +01:00
Sebastian Serth
4ad898ad8b Remove set_docker_client method from submissions_controller.rb 2021-11-01 17:12:54 +01:00
Felix Auringer
1bf92d8c90 Fix sentry error capturing in submissions controller 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
d1a5773e60 Add debug log statements to runner connection 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
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
cf58be97ee Fix 17 previously failing specs 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
Felix Auringer
63d997a7e3 Fix Rubocop offenses after Rubocop was reconfigured 2021-11-01 17:12:47 +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
575057acd3 Fix some non-autocorrectable linting issues
Many functions in submission_controller.rb still are very long and have
a high complexity. Because the logic for handling execution of
submissions will probably move elsewhere (when switching to
ActionCable), this is fine for now.
2021-11-01 17:12:45 +01:00
Konrad Hanff
80932c0c40 Auto-correct linting issues 2021-11-01 17:12:45 +01:00
Konrad Hanff
cf1e4d6edf Rename API routes 2021-11-01 17:12:44 +01:00
Konrad Hanff
28f8de1a93 Implement workaroud for double render error
Co-authored-by: Felix Auringer <felix.auringer@student.hpi.uni-potsdam.de>
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