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 dataservice #548

Merged
merged 7 commits into from
Mar 28, 2024
Merged

Conversation

aaraney
Copy link
Member

@aaraney aaraney commented Mar 13, 2024

dmod.dataservice -- 0.8.2

Changes

  • Extract dataservice tasks into separate classes.

@aaraney aaraney force-pushed the refactor-dataservice branch 2 times, most recently from 0c08d8f to d184db0 Compare March 14, 2024 19:48
@aaraney aaraney added the refactor Code Cleanup and Restructuring label Mar 14, 2024
@aaraney aaraney changed the title (WIP) Refactor dataservice Refactor dataservice Mar 15, 2024
@aaraney aaraney marked this pull request as ready for review March 15, 2024 14:46
@aaraney aaraney added the maas MaaS Workstream label Mar 15, 2024
Extract long running ServiceManager tasks into their own objects:

- RequiredDataChecksManager
- TempDatasetsManager
- DataProvisionManager

`Count` synchronization type added to facilitate cross-task signaling.
- move main function to of file for readability
- setup and inject subsystem dependencies
- reintroduce init_{{subsystem}}_helper methods once on ServiceManager
  to private functions
- explicitly fail when service does not use object store. this was
  previously a bug.
@aaraney
Copy link
Member Author

aaraney commented Mar 22, 2024

@robertbartel, just rebased.

Copy link
Contributor

@robertbartel robertbartel left a comment

Choose a reason for hiding this comment

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

For the most part this looks good. There are a handful of changes I think are needed, and then a couple of things I bring up just in case more discussion will help.

python/services/dataservice/dmod/dataservice/service.py Outdated Show resolved Hide resolved
python/services/dataservice/dmod/dataservice/service.py Outdated Show resolved Hide resolved
python/services/dataservice/dmod/dataservice/service.py Outdated Show resolved Hide resolved
while True:
# Ensure that mark and sweep doesn't proceed while something is potentially to linking datasets
while self._tracker.value > 0:
await asyncio.sleep(10)
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we encapsulate this in the ActiveOperationTracker class also?

@aaraney
Copy link
Member Author

aaraney commented Mar 27, 2024

Thanks for the reviews! Ill fix this up and have it ready for re-review in the morning.

improve clarity of the utility of `ActiveOperationTracker` in doc
strings and parameter names / instance variables.
@aaraney
Copy link
Member Author

aaraney commented Mar 28, 2024

Just pushed up resolutions for the requested improvements. This is ready for re-review now, @robertbartel!

@aaraney aaraney self-assigned this Mar 28, 2024
@robertbartel robertbartel dismissed christophertubbs’s stale review March 28, 2024 17:48

Chris's requested changes have been made, as have mine, and I've separately approved.

@robertbartel robertbartel merged commit d04e3d0 into NOAA-OWP:master Mar 28, 2024
8 checks passed
@aaraney
Copy link
Member Author

aaraney commented Mar 28, 2024

Thanks, @robertbartel!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
maas MaaS Workstream refactor Code Cleanup and Restructuring
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants