Refactor CodeOcean::Config class

The new architecture memorizes settings (which we mostly did after reading the config so far) and also exposes the resulting file path as well as further settings.

This change is a prerequisite to define a dependency with Sprockets.
This commit is contained in:
Sebastian Serth
2024-05-08 21:31:55 +03:00
committed by Sebastian Serth
parent dcaedfa9fe
commit 336519b21d
4 changed files with 11 additions and 7 deletions

View File

@ -146,7 +146,7 @@ class Runner::Strategy::DockerContainerPool < Runner::Strategy
def self.config
@config ||= begin
# Since the docker configuration file contains code that must be executed, we use ERB templating.
docker_config = CodeOcean::Config.new(:docker).read(erb: true)
docker_config = CodeOcean::Config.new(:docker, erb: true).read
codeocean_config = CodeOcean::Config.new(:code_ocean).read[:runner_management] || {}
# All keys in `docker_config` take precedence over those in `codeocean_config`
docker_config.merge codeocean_config