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

Initial commit for new runtime and base class #360

Merged
merged 10 commits into from
Sep 23, 2024
Merged

Initial commit for new runtime and base class #360

merged 10 commits into from
Sep 23, 2024

Conversation

mathialo
Copy link
Collaborator

The idea here is to split the responsibilities of the current base class into two: A runtime and an extractor.

The runtime is responsible for parsing command line arguments, loading config files and so on, before spawning the extractor in a separate process. The runtime will automatically restart the extractor if it crashes, but can also be asked by the extractor to restart it - for example after a config change.

The extractor class is then only responsible for running the extractor application itself, making it much cleaner.

Copy link

codecov bot commented Sep 12, 2024

Codecov Report

Attention: Patch coverage is 5.97015% with 189 lines in your changes missing coverage. Please review.

Project coverage is 73.60%. Comparing base (f969745) to head (4724544).
Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
cognite/extractorutils/unstable/core/runtime.py 0.00% 77 Missing ⚠️
cognite/extractorutils/unstable/core/base.py 0.00% 63 Missing ⚠️
...te/extractorutils/unstable/configuration/models.py 28.57% 25 Missing ⚠️
cognite/extractorutils/unstable/core/__main__.py 0.00% 19 Missing ⚠️
cognite/extractorutils/unstable/core/_messaging.py 0.00% 3 Missing ⚠️
cognite/extractorutils/configtools/_util.py 50.00% 1 Missing ⚠️
...e/extractorutils/unstable/configuration/loaders.py 50.00% 1 Missing ⚠️

❗ There is a different number of reports uploaded between BASE (f969745) and HEAD (4724544). Click for more details.

HEAD has 1 upload less than BASE
Flag BASE (f969745) HEAD (4724544)
4 3
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #360      +/-   ##
==========================================
- Coverage   78.73%   73.60%   -5.14%     
==========================================
  Files          29       33       +4     
  Lines        2634     2830     +196     
==========================================
+ Hits         2074     2083       +9     
- Misses        560      747     +187     
Files with missing lines Coverage Δ
cognite/extractorutils/configtools/_util.py 65.00% <50.00%> (ø)
...e/extractorutils/unstable/configuration/loaders.py 37.50% <50.00%> (ø)
cognite/extractorutils/unstable/core/_messaging.py 0.00% <0.00%> (ø)
cognite/extractorutils/unstable/core/__main__.py 0.00% <0.00%> (ø)
...te/extractorutils/unstable/configuration/models.py 70.28% <28.57%> (-14.33%) ⬇️
cognite/extractorutils/unstable/core/base.py 0.00% <0.00%> (ø)
cognite/extractorutils/unstable/core/runtime.py 0.00% <0.00%> (ø)

... and 2 files with indirect coverage changes

The idea here is to split the responsibilities of the current base class
into two: A runtime and an extractor.

The runtime is responsible for parsing command line arguments, loading
config files and so on, before spawning the extractor in a separate
process. The runtime will automatically restart the extractor if it
crashes, but can also be asked by the extractor to restart it -  for
example after a config change.

The extractor class is then only responsible for running the extractor
application itself, making it much cleaner.
@mathialo mathialo marked this pull request as ready for review September 16, 2024 07:24
@mathialo mathialo requested a review from a team as a code owner September 16, 2024 07:24
Copy link
Contributor

@rsjr rsjr left a comment

Choose a reason for hiding this comment

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

LGTM

@mathialo mathialo merged commit dbb02a1 into master Sep 23, 2024
5 checks passed
@mathialo mathialo deleted the new-runtime branch September 23, 2024 08:12
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.

2 participants