Sebastian Serth
7b834b420b
Merge pull request #1076 from openHPI/runner_management
...
Enable support for runner management
2021-11-01 19:33:59 +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
328055e6e8
DCP: previous_data match should be non-greedy
2021-11-01 17:13:15 +01:00
Sebastian Serth
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
Sebastian Serth
65fe1d902d
DCP: Match java@hostname output
2021-11-01 17:13:15 +01:00
Sebastian Serth
d16917261b
Prevent inactivityTimeout from being smaller than permitted_execution_time
2021-11-01 17:13:14 +01:00
Sebastian Serth
bdfcb0da19
Reset previous exception if retrying command execution
2021-11-01 17:13:14 +01:00
Sebastian Serth
6ff14d6fc7
Connection Buffer: Replace \r in run and score output with \n
2021-11-01 17:13:14 +01:00
Sebastian Serth
1e7cf1c622
Prevent parallel execution of run and test during RfC creation
...
* Otherwise, the output of both might be mixed and saved incorrectly for the RfC
2021-11-01 17:13:14 +01:00
Sebastian Serth
475aa8c512
DCP: Allow increasing the pool size when previously empty
2021-11-01 17:13:13 +01:00
Sebastian Serth
447860892a
Always remove exposed_ports_list
if present
2021-11-01 17:13:13 +01:00
Sebastian Serth
56d219ad8e
[ci-skip] Improve comment for unused_runner_expiration_time
2021-11-01 17:13:13 +01:00
Sebastian Serth
de83843496
Combine no_output and exit_status messages
2021-11-01 17:13:13 +01:00
Sebastian Serth
eaa06ee528
DCP: Prevent double deletion of runner
2021-11-01 17:13:13 +01:00
Sebastian Serth
6a902c41db
DCP: Refactor container
method and usage
2021-11-01 17:13:12 +01:00
Sebastian Serth
537d8bfc95
DCP: Add handling of inactivity timer
2021-11-01 17:13:12 +01:00
Sebastian Serth
dcafbb9d46
DCP: Change HTTP verbs
2021-11-01 17:13:12 +01:00
Sebastian Serth
6209e25ee2
DCP: Move pool location to code_ocean.yml
2021-11-01 17:13:12 +01:00
Sebastian Serth
7bb2ef8588
DCP: Forward data before matching stdout termination
2021-11-01 17:13:12 +01:00
Sebastian Serth
dfdec92c6e
Use ping option only for DCP WebSocket
...
* The Faye::WebSocket library will "buffer" some output of the connection and emit the `on :message` events in the order of the messages. However, when a ping is sent while the connection has already been closed, it will emit the `on :close` event immediately and drop all other messages (in that "buffer"). This is problematic for very short running executions that generate a long output (as this will be cut off without a proper exit message sent by Poseidon).
2021-11-01 17:13:11 +01:00
Sebastian Serth
570809bfe9
Allow whitespace for JSON exit
2021-11-01 17:13:11 +01:00
Sebastian Serth
b62a7ad129
Prevent non-existing runner_management config to be read
2021-11-01 17:13:11 +01:00
Sebastian Serth
3c8017f23e
JS: Ensure to print status messages for score
...
* If only one response is available, no array will be passed (but rather an Object). The impact of this has been tackled with the changes included
2021-11-01 17:13:11 +01:00
Sebastian Serth
1609bd2e0e
Change default of raise_exception for execute_command
2021-11-01 17:13:11 +01:00
Sebastian Serth
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
Sebastian Serth
5550183d7e
[Spec] openhpi/co_execenv_python:3.4 is no longer required
2021-11-01 17:13:10 +01:00
Sebastian Serth
01ec9343cf
Remove usage of DockerClient
2021-11-01 17:13:10 +01:00
Sebastian Serth
20064b0715
DockerClient: Cleanup usage of config
2021-11-01 17:13:10 +01:00
Sebastian Serth
b13a3b084d
Use new available_images routes from DCP
2021-11-01 17:13:10 +01:00
Sebastian Serth
2551ea709b
Remove 'previous' DockerContainerPool implementation
2021-11-01 17:13:09 +01:00
Sebastian Serth
9d833e37b3
Use Net::HTTP::Persistent for requests to Poseidon
2021-11-01 17:13:09 +01:00
Sebastian Serth
25b007dfda
[Spec] Fix return value of image_tags for mocked DockerClient
2021-11-01 17:13:09 +01:00
Sebastian Serth
e8c686ce75
[Spec] Clean seed_secs with truncation
2021-11-01 17:13:09 +01:00
Sebastian Serth
c1cff29147
[Spec] Initialize environment for Docker testing
2021-11-01 17:13:08 +01:00
Sebastian Serth
953643f05e
[Spec] Use strings for image names
2021-11-01 17:13:08 +01:00
Sebastian Serth
28c74bc9a5
Improve memoization of @strategy_class
2021-11-01 17:13:08 +01:00
Sebastian Serth
288c7693f7
Remove dump_docker method for admins
2021-11-01 17:13:08 +01:00
Sebastian Serth
af93603ba3
Use strategy release in admin dashboard
2021-11-01 17:13:08 +01:00
Sebastian Serth
ada438b230
Add release and pool_size methods to DCP
2021-11-01 17:13:07 +01:00
Sebastian Serth
6d1b388e3c
Reorder methods in strategy classes
2021-11-01 17:13:07 +01:00
Sebastian Serth
f3b4be3006
Fix deprecation warning for raise_on_missing_translations
2021-11-01 17:13:07 +01:00
Sebastian Serth
e33af5760d
Delegate initialization to Runner::Strategy
2021-11-01 17:13:07 +01:00
Sebastian Serth
2b98905acb
Remove usage of DockerClient from execution_environments_controller.rb
2021-11-01 17:13:07 +01:00
Sebastian Serth
541afa92f3
Remove ws_client_protocol option
...
* The correct setting will be determined automatically
2021-11-01 17:13:06 +01:00
Sebastian Serth
0db6f20933
Move MemoryLimit to Execution Environment
2021-11-01 17:13:06 +01:00
Sebastian Serth
8a4bd84d04
Add note about using hostnames on IPv6 systems
2021-11-01 17:13:06 +01:00
Sebastian Serth
87c5302336
Switch logging to milliseconds and add more details
...
* By design, most logging happens in an `ensure` block. This ensures that no return value is modified unexpectedly.
2021-11-01 17:13:06 +01:00
Sebastian Serth
1dfee31079
Fix order-dependent execution_environments_controller_spec.rb
2021-11-01 17:13:05 +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