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

DM-42631: Add CC-IN2P3 (Slurm) as a target site #28

Merged
merged 18 commits into from Feb 1, 2024
Merged

Conversation

airnandez
Copy link
Contributor

Checklist

  • ran Jenkins
  • added a release note for user-visible changes to doc/changes

Copy link

codecov bot commented Jan 25, 2024

Codecov Report

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

Comparison is base (afe5867) 47.46% compared to head (30d75e4) 47.20%.

❗ Current head 30d75e4 differs from pull request most recent head 569ec1f. Consider uploading reports for the commit 569ec1f to get more accurate results

Files Patch % Lines
python/lsst/ctrl/bps/parsl/site.py 33.33% 4 Missing ⚠️
python/lsst/ctrl/bps/parsl/workflow.py 50.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #28      +/-   ##
==========================================
- Coverage   47.46%   47.20%   -0.27%     
==========================================
  Files          11       11              
  Lines         375      375              
  Branches       61       61              
==========================================
- Hits          178      177       -1     
+ Misses        191      189       -2     
- Partials        6        9       +3     

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

Copy link
Contributor

@PaulPrice PaulPrice left a comment

Choose a reason for hiding this comment

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

Third commit should be squashed into the second.
Need to add docs for new feature.
Please consider changing get_parsl_config to supplement/override rather than constructing from scratch.

"""Get Parsl configuration for this site.

This method allows concrete subclasses to override this method to
provide a a Parsl configuration specific for the site. If not
Copy link
Contributor

Choose a reason for hiding this comment

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

a a

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed.

@@ -52,6 +52,10 @@ def get_parsl_config(config: BpsConfig) -> parsl.config.Config:
For details on the site configuration, see `SiteConfig`. For details on the
monitor configuration, see ``get_parsl_monitor``.

Subclasses of `SiteConfig` can override their method ``get_parsl_config``
to configure Parsl for the specific context of the site. A default
Parsl configuration is returned if the subclass did not provide a config.
Copy link
Contributor

Choose a reason for hiding this comment

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

This is something that should get added to the docs.

@@ -65,11 +69,14 @@ def get_parsl_config(config: BpsConfig) -> parsl.config.Config:
Parsl configuration.
"""
site = SiteConfig.from_config(config)
executors = site.get_executors()
retries = get_bps_config_value(site.site, "retries", int, 1)
monitor = site.get_monitor()
Copy link
Contributor

Choose a reason for hiding this comment

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

There's no need to change this. Just stick the new lines in above.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Reverted. I kept the previous style.

retries = get_bps_config_value(site.site, "retries", int, 1)
monitor = site.get_monitor()
if parsl_config := site.get_parsl_config():
return parsl_config
Copy link
Contributor

Choose a reason for hiding this comment

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

The new get_parsl_config in Ccin2p3 replicates the below. Why not have get_parsl_config return values which will be used to supplement/override the ones constructed 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.

Added a method get_parsl_config() to base class SiteConfig, overwritable by subclasses. This seems to me cleaner now.

@airnandez
Copy link
Contributor Author

@PaulPrice Many thanks for your feedback. I think I implemented your recommendations. You may want to check the final result before I merge.

# Path to Parsl run directory. The default set by Parsl is
# 'runinfo' which is not explicit enough for end users given that
# we are using BPS + Parsl + Slurm to execute a workflow.
run_dir = get_bps_config_value(self.site, "run_dir", str, "parsl_runinfo")
Copy link
Contributor

Choose a reason for hiding this comment

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

Oh, this is a nice feature! It might be good to hoist this into the parent class.

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 add that feature to the base class but I suggest we keep runinfo as the default value (i.e. the default value set by Parsl), to keep backwards compatibility for other sites (e.g. Princeton).

@PaulPrice
Copy link
Contributor

Thanks, it looks good. It would be helpful if you could clean up the commit history some, as it looks like there are more commits than changes in the end.

@airnandez airnandez merged commit 145af14 into main Feb 1, 2024
15 checks passed
@airnandez airnandez deleted the tickets/DM-42631 branch February 1, 2024 14:18
@airnandez
Copy link
Contributor Author

I tried to clean the history but failed. Apologies for that. It became a mess: my knowledge of git was not enough to sort things out in a reasonable amount of time, so I preferred to get the code merged as is. Lesson learned for future contributions, hopefully.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants