-
Notifications
You must be signed in to change notification settings - Fork 110
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix bug where site config was not propagated to Everest config #9719
base: main
Are you sure you want to change the base?
Conversation
CodSpeed Performance ReportMerging #9719 will degrade performances by 10.3%Comparing Summary
Benchmarks breakdown
|
da1f1db
to
1d74782
Compare
116ec8f
to
f9b110d
Compare
1ae7af5
to
e8f8737
Compare
e8f8737
to
1017e5d
Compare
"name", | ||
"max_running", | ||
"submit_sleep", | ||
"qstat_options", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Were these: qstat_options
and queue_query_timeout
excluded before? If not, should maybe be excluded in a separate commit for clarity
# Use from plugin system if user has not specified | ||
plugin_script = None | ||
if info.context: | ||
plugin_script = info.context.get(info.field_name) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a test that runs this line? EDIT: I see running test_detached
triggers it, but do any of the ERT tests run it? Is this mainly meant for things we run via Everest?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks very good, requires a rebase.
@@ -120,17 +130,13 @@ class LsfQueueOptions(QueueOptions): | |||
|
|||
@property | |||
def driver_options(self) -> dict[str, Any]: | |||
driver_dict = asdict(self) | |||
driver_dict.pop("name") | |||
driver_dict = self.model_dump(exclude={"name", "submit_sleep", "max_running"}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nice ❤️
if site_config: | ||
context["queue_system"] = QueueConfig.from_dict(site_config).queue_options | ||
if activate_script: | ||
context["activate_script"] = ErtPluginManager().activate_script() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you can just have
context["activate_script"] = activate_script
in place of
context["activate_script"] = ErtPluginManager().activate_script()
@@ -276,7 +268,8 @@ def validate_forward_model_job_name_installed(self) -> Self: # pylint: disable= | |||
return self | |||
installed_jobs_name = [job.name for job in install_jobs] | |||
installed_jobs_name += list(script_names) # default jobs | |||
installed_jobs_name += get_system_installed_jobs() # system jobs | |||
if info.context: # Add plugin jobs | |||
installed_jobs_name += info.context.get("install_jobs", {}).keys() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It might have been possible to just move the logic in the function get_system_installed_jobs
and just remove the _dummy_ert_config
function
site_config = ErtConfig.read_site_config()
ert_config: ErtConfig = ErtConfig.with_plugins().from_dict(
config_dict=site_config
)
context = {
"install_jobs": ert_config.installed_forward_model_steps,
}
and avoid setting this through the context, but I guess this works as well.
@staticmethod | ||
def load_file(config_file: str) -> "EverestConfig": | ||
@classmethod | ||
def load_file(cls, config_file: str): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this still have a return type? Maybe Self
?
@@ -807,6 +800,23 @@ def load_file(config_file: str) -> "EverestConfig": | |||
|
|||
raise exp from error | |||
|
|||
@classmethod | |||
def with_plugins(cls, config_dict): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am a bit confused as to why mypy is not complaining about the missing type for the argument config_dict
shouldn't there be a : dict[str, Any]
or something similar?
|
||
def test_detached_mode_config_base(copy_math_func_test_data_to_tmp): | ||
everest_config, _ = _get_reference_config() | ||
def test_detached_mode_config_base(min_config, monkeypatch, tmp_path): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice cleanup ❤️
@@ -814,6 +815,9 @@ def load_file(config_file: str) -> "EverestConfig": | |||
def with_plugins(cls, config_dict): | |||
context = {} | |||
activate_script = ErtPluginManager().activate_script() | |||
site_config = ErtConfig.read_site_config() | |||
if site_config: | |||
context["queue_system"] = QueueConfig.from_dict(site_config).queue_options | |||
if activate_script: | |||
context["activate_script"] = ErtPluginManager().activate_script() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a need to re-invoke ErtPluginManager().activate_script()
after having stored it in a variable?
return LocalQueueOptions(max_running=8) | ||
options = None | ||
if info.context: | ||
options = info.context.get(info.field_name) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Won't info.field_name
always be queue_system
here? Similar question for other instances of this
Issue
Resolves #9783
Approach
Short description of the approach
(Screenshot of new behavior in GUI if applicable)
git rebase -i main --exec 'pytest tests/ert/unit_tests -n logical -m "not integration_test"'
)When applicable