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

Implement MockDriver #6788

Merged
merged 1 commit into from
Dec 18, 2023
Merged

Implement MockDriver #6788

merged 1 commit into from
Dec 18, 2023

Conversation

pinkwah
Copy link
Contributor

@pinkwah pinkwah commented Dec 12, 2023

LocalDriver differs from the HPC drivers in that it is made of three
parts that are run in sequence. init the subprocess, wait for the
process to complete and kill when the user wants to cancel. Between
the three parts the driver needs to send JobEvents to the Scheduler.

This commit implements a MockDriver, where the user can optionally
specify a simplified version of each of init, wait or kill,
depending on what they wish to do.

@pinkwah pinkwah force-pushed the taskdriver branch 2 times, most recently from ed21dd5 to 159b0c7 Compare December 12, 2023 11:42
@codecov-commenter
Copy link

codecov-commenter commented Dec 12, 2023

Codecov Report

Attention: 1 lines in your changes are missing coverage. Please review.

Comparison is base (e4230ff) 83.88% compared to head (207254f) 83.88%.
Report is 1 commits behind head on main.

Files Patch % Lines
src/ert/async_utils.py 0.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #6788   +/-   ##
=======================================
  Coverage   83.88%   83.88%           
=======================================
  Files         365      365           
  Lines       21383    21398   +15     
  Branches      948      948           
=======================================
+ Hits        17937    17950   +13     
- Misses       3152     3154    +2     
  Partials      294      294           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

driver = MockDriver(init=init)

sch = scheduler.Scheduler(driver)
sch.add_realization(realization, callback_timeout=lambda _: None)
Copy link
Contributor

Choose a reason for hiding this comment

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

can remove callback_timeout from this function call.

@pinkwah pinkwah force-pushed the taskdriver branch 2 times, most recently from bf5137f to d710981 Compare December 14, 2023 09:54
Copy link
Contributor

@berland berland left a comment

Choose a reason for hiding this comment

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

👌🏻

@pinkwah pinkwah force-pushed the taskdriver branch 2 times, most recently from e2834d8 to 0470e9c Compare December 14, 2023 12:38
@pinkwah pinkwah added the release-notes:skip If there should be no mention of this in release notes label Dec 14, 2023
@pinkwah pinkwah force-pushed the taskdriver branch 6 times, most recently from b6fe7c6 to 10243a3 Compare December 14, 2023 14:37
LocalDriver differs from the HPC drivers in that it is made of three
parts that are run in sequence. `init` the subprocess, `wait` for the
process to complete and `kill` when the user wants to cancel. Between
the three parts the driver needs to send `JobEvent`s to the `Scheduler`.

This commit implements a `MockDriver`, where the user can optionally
specify a simplified version of each of `init`, `wait` or `kill`,
depending on what they wish to do.
@pinkwah pinkwah merged commit af717e2 into equinor:main Dec 18, 2023
43 of 44 checks passed
@pinkwah pinkwah deleted the taskdriver branch December 18, 2023 09:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-notes:skip If there should be no mention of this in release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants