Skip to content

Commit

Permalink
fixup! Use scheduler to start Everserver
Browse files Browse the repository at this point in the history
  • Loading branch information
oyvindeide committed Nov 13, 2024
1 parent 55a55d4 commit 0a0362f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions src/everest/detached/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ async def start_server(config: EverestConfig, debug: bool = False) -> None:
"Failed to save optimization config: {}".format(e)
)

driver = create_driver(generate_everserver_config(config))
driver = create_driver(get_server_queue_options(config))
try:
args = ["--config-file", config.config_file]
if debug:
Expand Down Expand Up @@ -310,7 +310,7 @@ def _find_res_queue_system(config: EverestConfig):
return QueueSystem(queue_system.upper())


def generate_everserver_config(config: EverestConfig):
def get_server_queue_options(config: EverestConfig):
queue_system = _find_res_queue_system(config)

ever_queue_config = config.server if config.server is not None else config.simulator
Expand Down
14 changes: 7 additions & 7 deletions tests/everest/test_detached.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
ServerStatus,
_find_res_queue_system,
everserver_status,
generate_everserver_config,
get_server_queue_options,
server_is_running,
start_server,
stop_server,
Expand Down Expand Up @@ -180,7 +180,7 @@ def _get_reference_config():

def test_detached_mode_config_base(copy_math_func_test_data_to_tmp):
everest_config, _ = _get_reference_config()
queue_config = generate_everserver_config(everest_config)
queue_config = get_server_queue_options(everest_config)

assert queue_config == LocalQueueOptions(max_running=1)

Expand All @@ -204,7 +204,7 @@ def test_everserver_queue_config_equal_to_run_config(
if name is not None:
simulator_config.update({"name": name})
everest_config.simulator = SimulatorConfig(**simulator_config)
server_queue_option = generate_everserver_config(everest_config)
server_queue_option = get_server_queue_options(everest_config)
ert_config = _everest_to_ert_config_dict(everest_config)

run_queue_option = ert_config["QUEUE_OPTION"]
Expand All @@ -228,7 +228,7 @@ def test_detached_mode_config_only_sim(copy_math_func_test_data_to_tmp, queue_sy
queue_options = [(queue_system.upper(), "MAX_RUNNING", 1)]
reference.setdefault("QUEUE_OPTION", []).extend(queue_options)
everest_config.simulator = SimulatorConfig(**{CK.QUEUE_SYSTEM: queue_system})
queue_config = generate_everserver_config(everest_config)
queue_config = get_server_queue_options(everest_config)
assert str(queue_config.name.name).lower() == queue_system


Expand All @@ -241,7 +241,7 @@ def test_detached_mode_config_error(copy_math_func_test_data_to_tmp):

everest_config.server = ServerConfig(name="server", queue_system="lsf")
with pytest.raises(ValueError, match="so must the everest server"):
generate_everserver_config(everest_config)
get_server_queue_options(everest_config)


@pytest.mark.parametrize(
Expand Down Expand Up @@ -275,7 +275,7 @@ def test_find_queue_system(config: EverestConfig, expected_result):

def test_generate_queue_options_no_config():
config = EverestConfig.with_defaults(**{})
assert generate_everserver_config(config) == LocalQueueOptions(max_running=1)
assert get_server_queue_options(config) == LocalQueueOptions(max_running=1)


@pytest.mark.parametrize(
Expand All @@ -293,4 +293,4 @@ def test_generate_queue_options_no_config():
)
def test_generate_queue_options_use_simulator_values(queue_options, expected_result):
config = EverestConfig.with_defaults(**{"simulator": queue_options})
assert generate_everserver_config(config) == expected_result
assert get_server_queue_options(config) == expected_result

0 comments on commit 0a0362f

Please sign in to comment.