Skip to content
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

Refactor everserver 2 #9777

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

frode-aarstad
Copy link
Contributor

@frode-aarstad frode-aarstad commented Jan 16, 2025

Issue
Resolves #9290

Approach
Short description of the approach

(Screenshot of new behavior in GUI if applicable)

  • PR title captures the intent of the changes, and is fitting for release notes.
  • Added appropriate release note label
  • Commit history is consistent and clean, in line with the contribution guidelines.
  • Make sure unit tests pass locally after every commit (git rebase -i main --exec 'pytest tests/ert/unit_tests -n logical -m "not integration_test"')

When applicable

  • When there are user facing changes: Updated documentation
  • New behavior or changes to existing untested code: Ensured that unit tests are added (See Ground Rules).
  • Large PR: Prepare changes in small commits for more convenient review
  • Bug fix: Add regression test for the bug
  • Bug fix: Create Backport PR to latest release

@frode-aarstad frode-aarstad self-assigned this Jan 16, 2025
Copy link

codspeed-hq bot commented Jan 16, 2025

CodSpeed Performance Report

Merging #9777 will not alter performance

Comparing frode-aarstad:refactor-everserver-2 (071bbbc) with main (e49946f)

Summary

✅ 24 untouched benchmarks

@frode-aarstad frode-aarstad added the release-notes:maintenance Automatically categorise as maintenance change in release notes label Jan 17, 2025
Copy link
Collaborator

@oyvindeide oyvindeide left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, some minor comments and questions

)

if self._everest_config.simulator.queue_system.name == "local":
# if run_model._queue_config.queue_system == QueueSystem.LOCAL:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be able to just use the commented out line, as it is lower case everywhere now.

is_done = False
exit_code = None
# loop unil the optimization is done
while not is_done:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very minor and only if you a agree, but suggest a rename to: done, think it reads a bit better.

@@ -41,7 +41,7 @@
from everest.util import makedirs_if_needed


@pytest.mark.flaky(reruns=5)
# @pytest.mark.flaky(reruns=5)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No longer flaky?

from everest.util import makedirs_if_needed


def _string_exists_in_file(file_path, string):
return string in Path(file_path).read_text(encoding="utf-8")


@pytest.mark.flaky(reruns=5)
# @pytest.mark.flaky(reruns=5)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No longer flaky?

Comment on lines +269 to +284
async def server_running():
while True:
event = await driver.event_queue.get()
if isinstance(event, FinishedEvent) and event.iens == 0:
return

driver = await start_server(config, debug=True)
try:
wait_for_server(config.output_dir, 120)
start_experiment(
server_context=ServerConfig.get_server_context(config.output_dir),
config=config,
)
except (SystemExit, RuntimeError) as e:
raise e
await server_running()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps make this a small function for reuse? Looks like it can be used in the test below as well?

def extract_errors_from_file(path: str):
with open(path, encoding="utf-8") as f:
content = f.read()
return re.findall(r"(Error \w+.*)", content)


def wait_for_server_simple(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be possible to join this with wait_for_server?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-notes:maintenance Automatically categorise as maintenance change in release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Split everserver functionality between starting server and submitting experiment
2 participants