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

Extract and log warnings from forward model steps #10050

Merged
merged 1 commit into from
Feb 13, 2025

Conversation

berland
Copy link
Contributor

@berland berland commented Feb 12, 2025

Each individual forward model step is run in a separate subprocess and has no relation to Erts root logger. Thus, in order to log warnings, there is no other way than parsing the stdout and stderr files for anything that looks interesting.

It is assumed that each realization will trigger approximately the same set of warnings, so the first realization to be finished will get the honour of exposing its warnings.

Issue
Resolves #10039

  • 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 'just rapid-tests')

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

Copy link

codspeed-hq bot commented Feb 12, 2025

CodSpeed Performance Report

Merging #10050 will not alter performance

Comparing berland:extract_warnings (4b95223) with main (8cc0934)

Summary

✅ 25 untouched benchmarks

@berland berland force-pushed the extract_warnings branch 2 times, most recently from 7613b99 to 7ade322 Compare February 13, 2025 06:00
@berland berland added the release-notes:new-feature Automatically categorise as new feature in release notes label Feb 13, 2025
Comment on lines 367 to 370
"Warning:" in line
or "FutureWarning" in line
or "DeprecationWarning" in line
or "WARNING" in line
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
"Warning:" in line
or "FutureWarning" in line
or "DeprecationWarning" in line
or "WARNING" in line
"Warning" in line
or "warning" in line

Would just checking this be sufficient, or would we pick up unwanted things?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That is an open question for now :) . Probably no and yes.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I will add some test code that makes it more specific what we want to include and not, based on what I can find in real life examples on scratch.

Copy link
Contributor

Choose a reason for hiding this comment

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

Potentially we just want FutureWarnings first. Then we can add more later. The most permissive would be re.search('warning', line, re.IGNORECASE).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In one example runpath..

$ grep -i warning *stdout* *stderr* | wc -l
15587

(of which 7000 are unique). I think we must be more specific.

Each individual forward model step is run in a separate subprocess and has no relation
to Erts root logger. Thus, in order to log warnings, there is no other way than parsing
the stdout and stderr files for anything that looks interesting.

It is assumed that each realization will trigger approximately the same set of warnings,
so the first realization to be finished will get the honour of exposing its warnings.

Warning lines are truncated to 2048 characters in length, and identical
warnings from the same file will be deduplicated (their count will be
shown).
"Warning:" in line
or "FutureWarning" in line
or "DeprecationWarning" in line
or "UserWarning" in line
Copy link
Contributor

Choose a reason for hiding this comment

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

Are we sure why we want all these? If any one of those are from a know source, adding a comment about the intended source would be a good idea.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It depends on our purpose, is this only for getting Future/DeprecationWarnings or do we also want to make a "service" to the users to be able to show warnings in the GUI at a later stage? (#9381 )

@berland berland merged commit 2f22166 into equinor:main Feb 13, 2025
27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-notes:new-feature Automatically categorise as new feature in release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Parse stdout/stderr from forward model steps for Warnings
3 participants