-
Notifications
You must be signed in to change notification settings - Fork 277
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
Build incremental components through build workflow with loading previous build manifest #4289
Conversation
Signed-off-by: Zelin Hao <[email protected]>
Signed-off-by: Zelin Hao <[email protected]>
Signed-off-by: Zelin Hao <[email protected]>
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #4289 +/- ##
==========================================
+ Coverage 91.18% 91.27% +0.08%
==========================================
Files 189 189
Lines 6146 6163 +17
==========================================
+ Hits 5604 5625 +21
+ Misses 542 538 -4 ☔ View full report in Codecov by Sentry. |
I'm looking to add additional tests to fix the cov. |
Signed-off-by: Zelin Hao <[email protected]>
39ef847
to
a8d01d0
Compare
PR is ready for review. Seems like some issues with Maven so that the groovy test failed. |
441c604
to
9e890bf
Compare
Signed-off-by: Zelin Hao <[email protected]>
9e890bf
to
225b0ec
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is pretty clean. See below, rename/simplify. Document this feature?
src/run_build.py
Outdated
|
||
logging.info(f"Build {components} incrementally.") | ||
|
||
build_manifest_data = BuildManifest.from_path(build_manifest_path).__to_dict__() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rename this to build_manifest
and pass around as BuildManifest
, rather than a dict.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. Working on the changes.
Signed-off-by: Zelin Hao <[email protected]>
src/build_workflow/build_recorder.py
Outdated
self.components_hash: Dict[str, Dict[str, Any]] = {} | ||
|
||
if build_manifest: | ||
build_manifest_data = build_manifest.__to_dict__() | ||
self.data = build_manifest_data |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe you should be able to iterate through components without turning the build manifest into a dictionary first, which would remove the need for the build_manifest_data
variable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that would require to change the logics in other sections for example to_manifest
from build_recorder
since it generates the build manifest based on dictionary. Do you think it's necessary or it may be overcomplicated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Whatever you need to add to build_manifest
is a good idea. It should look like this here:
self.data = dict(build_manifest)
for component in build_manifest.components:
self.components_hash[component.name] = dict(component)
or even
self.data = dict(build_manifest)
self.components_hash = dict(build_manifest.components)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see what you mean! Updated in the latest commit. Thanks for suggestion!
Signed-off-by: Zelin Hao <[email protected]>
@dblock Just added some documentations. Please help review it as well. Thanks! |
Signed-off-by: Zelin Hao <[email protected]>
Signed-off-by: Zelin Hao <[email protected]>
Just reviewed with @zelinh on this PR. I have no issues with the implementation and is clear on the details.
The 1st route needs more implementation, while the 2nd route requires one more logging. Thanks. |
After discussing again among @gaiksaya @zelinh and I, we have decided to make both Later, we can make both parameters work together, in cases where user want to use Thanks. |
Signed-off-by: Zelin Hao <[email protected]>
Updated based on what @peterzhuamazon @gaiksaya and I discussed earlier. Please help review it again. Thanks! @peterzhuamazon @gaiksaya @dblock |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Almost there!
Please add test for skipping the entire build and ensure the graceful exit.
Thanks!
Signed-off-by: Zelin Hao <[email protected]>
Added new tests. I tried locally and it works.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Great enhancement @zelinh 👏
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @zelinh , please open the improvement issue related to both parameters when you have time.
Thanks.
Issue created here as we discussed. #4320 |
Description
This is the last PR to enable incremental build on the Python workflow.
The idea of this PR is to build those components that were detected by
rebuild_component
frombuild_incremental
class.Firstly we add a new parameter to the
build_recorder
class so that it could load existing build manifest if provided; otherwise generate a brand new manifest.Then similar to how we build in
run_build.py
, here for incremental build, we are importing the previous build manifest and only build the list of components frombuildIncremental.rebuild_plugins()
.Issues Resolved
#4210
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.