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

Fix general queue options not being added bug #8619

Merged
merged 1 commit into from
Sep 16, 2024

Conversation

jonathan-eq
Copy link
Contributor

@jonathan-eq jonathan-eq commented Sep 3, 2024

Issue
Resolves #8605

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 tests pass locally (after every commit!)

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

@jonathan-eq jonathan-eq self-assigned this Sep 3, 2024
@jonathan-eq jonathan-eq added the release-notes:bug-fix Automatically categorise as bug fix in release notes label Sep 3, 2024
@jonathan-eq
Copy link
Contributor Author

The bug is occurring for the keywords max_running, submit_sleep, and project code.

@jonathan-eq jonathan-eq force-pushed the fix-bug branch 5 times, most recently from 28bb096 to 708cf2b Compare September 3, 2024 12:51
@codecov-commenter
Copy link

codecov-commenter commented Sep 3, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 90.91%. Comparing base (de9d63a) to head (5f58168).
Report is 58 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #8619      +/-   ##
==========================================
+ Coverage   90.85%   90.91%   +0.05%     
==========================================
  Files         339      343       +4     
  Lines       20852    21289     +437     
==========================================
+ Hits        18946    19355     +409     
- Misses       1906     1934      +28     
Flag Coverage Δ
gui-tests 76.12% <95.45%> (+0.35%) ⬆️
integration-tests 53.41% <95.45%> (-0.35%) ⬇️
unit-tests 69.03% <100.00%> (+0.29%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

@jonathan-eq jonathan-eq force-pushed the fix-bug branch 2 times, most recently from 162c109 to 11ffe8f Compare September 10, 2024 08:12
@jonathan-eq
Copy link
Contributor Author

project code

Unsure if project code is affected

@jonathan-eq jonathan-eq force-pushed the fix-bug branch 2 times, most recently from 3fac2eb to 5df708f Compare September 10, 2024 08:29
@jonathan-eq jonathan-eq marked this pull request as ready for review September 10, 2024 08:29
filtered_queue_options = []
for queue_option in value:
if (
"MAX_RUNNING" in queue_option
Copy link
Contributor

Choose a reason for hiding this comment

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

This adds a maintenance problem when we add more queue options later. Can this be automated so we don't need to specifically test for MAX_RUNNING and SUBMIT_SLEEP here?

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 am not sure, as those are the only options that can be both global and queue specific.

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 can test if the string is outside of QUEUE_OPTION, but I wonder if this can cause other bugs which will be difficult to troubleshoot.

if keyword == "QUEUE_OPTION":
filtered_queue_options = []
for queue_option in value:
option_name = queue_option[1]
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 am not a fan of this. Maybe we can change QUEUE_OPTIONS to be Dict[str, Dict[str, str] instead of List[List[str]]?
Something like { "LSF": {"bsub_cmd": "/path/to/cmd"} }

We do this somewhere later on, maybe it can be moved up here instead?
I assume this is due to legacy reasons @berland

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 seems this would require a larger refactoring of ConfigDict, which will not be of priority right now 🌧️

Copy link
Contributor

Choose a reason for hiding this comment

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

They are List[List[str]] initially so we can reason about the order of settings before we interpret them into a Dict.

),
],
)
def test_queue_config_general_max_running_takes_precedence_over_queue_option(
Copy link
Contributor

Choose a reason for hiding this comment

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

Hm, is it really so? I thought that the queue_option takes precedence ... always

@xjules
Copy link
Contributor

xjules commented Sep 13, 2024

Looks very good @jonathan-eq ! Could you squash the commits and improve the commit message?

This commit fixes the issue where the general options `MAX_RUNNING` and
`SUBMIT_SLEEP` would have priority over the equivalent QUEUE_OPTIONS.
It also makes the options set in user config for those keywords take
precedence over what is set in site config.
Copy link
Contributor

@xjules xjules left a comment

Choose a reason for hiding this comment

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

Nice work! Let's bring it in 🚀

@jonathan-eq jonathan-eq merged commit aea8e67 into equinor:main Sep 16, 2024
35 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-notes:bug-fix Automatically categorise as bug fix in release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Possible behaviour change for general queue options
4 participants