-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
HLD for migrating sonic-gnmi to Bazel #1901
base: master
Are you sure you want to change the base?
Conversation
/azp run |
No pipelines are associated with this pull request. |
/azp run |
No pipelines are associated with this pull request. |
|
||
The primary Make file in each repository will be modified to point to new Bazel build targets and a build file added to each package. | ||
|
||
Gazelle is used to keep build files and dependencies up to date with commands like `gazelle fix` and `gazelle update-repos` |
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.
Who runs these commands? Are the dependencies updated automatically during build?
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.
It can be added to the script for building, but I favor an approach of saying "If you update any dependencies, please also run these commands." Because the output should be confirmed for correctness.
- Local builds went from 20 minutes to 5 minutes on average. | ||
|
||
- Consistency | ||
- We found less issues when setting up new workstations for developers. |
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.
Can you elaborate? Are you talking about building locally on the developer workstation? If yes, please add an appendix section listing the best practices to setup this new build system.
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.
Yes about locally building on workstation. I added a statement to the high level section above about documenting such things.
/azp run |
No pipelines are associated with this pull request. |
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 for proposing this. This should make development a lot more streamline and structural.
|
||
As part of this migration we will also provide a number of documents for setting up a developer environment and basic tasks with Bazel such as adding new components, maintaining dependencies, or debugging build issues. | ||
|
||
#### Improvements |
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.
Consider also elaborate on dev workflows, such as:
bazel test //:foo_test
as opposed to the bulkmake check_gotest
- reproducibility
rm $(DESTDIR)/usr/sbin/gnoi_client | ||
rm $(DESTDIR)/usr/sbin/gnmi_cli | ||
``` | ||
|
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.
Do we have an estimate on the amount of additional system resource require? I think bazel creates a sandbox-ed environment so it might takes some additional disk/memory. Not that it matters but just curious.
go mod tidy && gazelle fix && bazel run :gazelle-update-repos | ||
``` | ||
|
||
#### Change to Makefile |
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.
Currently this Makefile only work for sonic-gnmi located in the structure of buildimage https://github.com/hdwhdw/sonic-gnmi/blob/master/Makefile#L10
Do we need any hack to handle this dependencies from sonic-mgmt-common with bazel?
No description provided.