542 Commits

Author SHA1 Message Date
46faa14428 Merge pull request #1129 from openHPI/updates
Update bundle (with newest rubocop version) and fix offenses
2022-01-04 10:17:58 +01:00
ea85519163 Update bundle (with newest rubocop version) and fix offenses 2022-01-04 09:42:37 +01:00
97e4ecb4d9 Increase wait time for validating Docker image 2021-12-22 19:10:59 +01:00
79edace57b Use BigDecimals for score calculations 2021-12-16 23:12:16 +01:00
0c1a10959c Use file name with file path as identifier 2021-12-15 00:52:31 +01:00
1a5d512689 Check Runner management status in execution environment updates 2021-12-01 18:41:29 +01:00
f22db22110 Enable Poseidon sync after commit 2021-11-26 01:00:31 +01:00
da4e10b990 Add CommunitySolution
* Also slightly refactor some JS files
2021-11-23 01:38:31 +01:00
5aee2aaba8 Add more logging for execution requests 2021-11-18 14:18:41 +01:00
a576d76fda Serialize trestrun for Sentry logging 2021-11-15 00:30:50 +01:00
c2ea27b3ee Add annotation about exceptions to submission.rb 2021-11-14 22:45:37 +01:00
fb92d382ac Skip verification of Docker image if pool size is empty 2021-11-09 17:49:51 +01:00
79da2781e3 Restructure methods in execution_environment.rb 2021-11-04 20:09:19 +01:00
c1ac401a49 Add retries to working_docker_image?
* Also synchronize images during save
2021-11-04 20:09:19 +01:00
ecf470bddd Refactor sync_environment methods
* Add delete_environment method
* Change return value to allow raising an exception
2021-11-04 20:06:40 +01:00
4cd70f2bad Add comment for retries to Runner#execute_command 2021-11-04 18:43:16 +01:00
92eafa145c Swap runner during score if timeout occurred 2021-11-04 18:43:16 +01:00
91af20b5ce Disallow assessment files during run 2021-11-02 16:19:24 +01:00
0b4217b12d Memoize collect_files 2021-11-02 16:19:01 +01:00
2c10b48b70 Execute Command: Guard requesting new runner
* If any exception is thrown, these will be caught now and handled appropriately
2021-11-01 17:13:15 +01:00
bdfcb0da19 Reset previous exception if retrying command execution 2021-11-01 17:13:14 +01:00
475aa8c512 DCP: Allow increasing the pool size when previously empty 2021-11-01 17:13:13 +01:00
b62a7ad129 Prevent non-existing runner_management config to be read 2021-11-01 17:13:11 +01:00
1609bd2e0e Change default of raise_exception for execute_command 2021-11-01 17:13:11 +01:00
4f1a7cde27 Add null strategy for runners
* This is the default strategy used when the runner management is disabled. It might be replaced with a generic Docker strategy in the future (without pooling). For now, it allows normal "operation" of CodeOcean without any runner management. However, as no runner system is configured, no command can be executed.
2021-11-01 17:13:10 +01:00
28c74bc9a5 Improve memoization of @strategy_class 2021-11-01 17:13:08 +01:00
0db6f20933 Move MemoryLimit to Execution Environment 2021-11-01 17:13:06 +01:00
9cc4394296 Allow editing an Execution Environment with active runner management 2021-11-01 17:13:05 +01:00
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
a1db30c288 Clarify EnvironmentNotFound error handling 2021-11-01 17:13:02 +01:00
06ef4430f5 Change exposed_ports to array 2021-11-01 17:13:02 +01:00
90eeb3bb9c Move CodeOcean::FileNameValidator 2021-11-01 17:13:01 +01:00
352e5f4329 Clarify strategy creation in runner.rb with comment 2021-11-01 17:13:01 +01:00
7285978ea3 Re-add test method for SubmissionsController 2021-11-01 17:13:01 +01:00
5f98456276 Extract run_test_file from submission.rb 2021-11-01 17:13:01 +01:00
2377f8370c Clarify set_file and set_files in SubmissionsController 2021-11-01 17:13:00 +01:00
0c22e1392a Remove outdated mnemosyne traces 2021-11-01 17:12:55 +01:00
13c378b980 Remove concurrent ruby gem no longer needed 2021-11-01 17:12:55 +01:00
f77e6d9df8 Simplify code in runner model 2021-11-01 17:12:54 +01:00
30603cb7ab Generalize method and constant names for runner management 2021-11-01 17:12:53 +01:00
e752df1b3c Move EventMachine initialization to Runner::EventLoop 2021-11-01 17:12:53 +01:00
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
c7369366d5 Ensure that only one EventMachine is running 2021-11-01 17:12:52 +01:00
5cc180d0e9 Fix rubocop, I18n, cleanup rebase 2021-11-01 17:12:52 +01:00
2dff81a510 Attach duration information to the exception object 2021-11-01 17:12:52 +01:00
36578a2817 Ensure to save Testrun even when an error occurs 2021-11-01 17:12:52 +01:00
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
1d3f0d7ad8 Handle Faraday errors 2021-11-01 17:12:50 +01:00
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
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