Commit Graph

327 Commits

Author SHA1 Message Date
8a7eae1a56 Migrated to proforma 0.6
Fixed all failing specs
2021-11-23 19:37:38 +01:00
86c6ad7ea3 Poseidon: Use absolute path to remove workspace directory 2021-11-17 17:44:09 +01:00
3608856397 Merge pull request #1079 from openHPI/sync_execution_environments
Sync execution environments
2021-11-09 18:44:35 +01:00
fb92d382ac Skip verification of Docker image if pool size is empty 2021-11-09 17:49:51 +01:00
1dce6c59ab Add note about default ACL for Docker mount dir 2021-11-08 22:39:10 +01:00
b179dadce6 Mock CodeOcean::Config for Poseidon strategy 2021-11-04 20:09:20 +01:00
79e8caea45 Remove outdated execution environments after syncing all 2021-11-04 20:09:20 +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
7f47af99cb Fix order-dependent specs 2021-11-04 19:15:33 +01:00
dcafbb9d46 DCP: Change HTTP verbs 2021-11-01 17:13:12 +01:00
1609bd2e0e Change default of raise_exception for execute_command 2021-11-01 17:13:11 +01:00
01ec9343cf Remove usage of DockerClient 2021-11-01 17:13:10 +01:00
2551ea709b Remove 'previous' DockerContainerPool implementation 2021-11-01 17:13:09 +01:00
9d833e37b3 Use Net::HTTP::Persistent for requests to Poseidon 2021-11-01 17:13:09 +01:00
25b007dfda [Spec] Fix return value of image_tags for mocked DockerClient 2021-11-01 17:13:09 +01:00
e8c686ce75 [Spec] Clean seed_secs with truncation 2021-11-01 17:13:09 +01:00
c1cff29147 [Spec] Initialize environment for Docker testing 2021-11-01 17:13:08 +01:00
953643f05e [Spec] Use strings for image names 2021-11-01 17:13:08 +01:00
ada438b230 Add release and pool_size methods to DCP 2021-11-01 17:13:07 +01:00
2b98905acb Remove usage of DockerClient from execution_environments_controller.rb 2021-11-01 17:13:07 +01:00
0db6f20933 Move MemoryLimit to Execution Environment 2021-11-01 17:13:06 +01:00
1dfee31079 Fix order-dependent execution_environments_controller_spec.rb 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
68c8f1dbdf DCP: Set sticky bit for folder and secure delete 2021-11-01 17:13:04 +01:00
696cd6a236 Poseidon: Clean workspace between executions 2021-11-01 17:13:03 +01:00
c676785d55 Fix order-dependent runner_spec.rb 2021-11-01 17:13:02 +01:00
06ef4430f5 Change exposed_ports to array 2021-11-01 17:13:02 +01:00
601e1fab5c Remove all occurrences of server-sent events 2021-11-01 17:12:57 +01:00
3fa6ba6c72 Use instance_double for Poseidon Strategy specs 2021-11-01 17:12:57 +01:00
ee1751debf Fix rubocop offenses 2021-11-01 17:12:55 +01:00
5037a73f36 Mock runner management settings for spec 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
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
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
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
cc412b73bc Introduce more error types 2021-11-01 17:12:51 +01:00
db2d1e3164 Add tests for DockerContainerPool strategy 2021-11-01 17:12:51 +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
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
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
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
cf58be97ee Fix 17 previously failing specs 2021-11-01 17:12:49 +01:00
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
0978a3be83 Add tests for the different runner errors 2021-11-01 17:12:48 +01:00
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