-
Notifications
You must be signed in to change notification settings - Fork 55
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
feat: Add new go build tag no_openziti to reduce build size #795
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
judehung
force-pushed
the
issue-789
branch
2 times, most recently
from
November 8, 2024 14:44
6e8f540
to
02f877d
Compare
closes edgexfoundry#789 The usage of OpenZiti packages to support zero trust feature significantly increases the build size. For example, core-metadata increases from 14MB to 21MB, core-command increases from 9.8MB to 17MB, device-virtual increases from 18MB to 31MB, and app-service-configurable increases from 22Mb to 34MB. As many edge user scenarios require to deploy EdgeX services on resource-constrained devices without security, allowing that the services can be built without OpenZiti packages and ZeroTrust features can be helpful to user cases which don't need zero trust feature. This commit refactors the codes importing openziti packages with //go:build !no_openziti directive and creates para codes that don't use openziti packages with //go:build no_openziti directive, so users can simply build services by specifying no_openziti tag. Also remove vestigal zc variables and ZitiContext struct per discussion with https://github.com/dovholuknf in edgexfoundry#659 (comment) Signed-off-by: Jude Hung <jude@iotechsys.com>
judehung
added a commit
to judehung/app-functions-sdk-go
that referenced
this pull request
Nov 9, 2024
realetd to edgexfoundry/go-mod-bootstrap#795 As go-mod-bootstrap is updated with new build tag no_openziti with some code refactor, the app-functions-sdk-go also needs to be updated per the refactor. Signed-off-by: Jude Hung <jude@iotechsys.com>
Merged
5 tasks
@dovholuknf please see if you have any opinoin from Jude's refactoring. OpenZiti will still be built in EdgeX by default. |
judehung
added a commit
to judehung/edgex-go
that referenced
this pull request
Nov 11, 2024
related to edgexfoundry/go-mod-bootstrap#795 To allow to build services without openziti, add new targte build-noziti into Makefile Signed-off-by: Jude Hung <jude@iotechsys.com>
Signed-off-by: Jude Hung <jude@iotechsys.com>
cloudxxx8
approved these changes
Nov 19, 2024
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
judehung
added a commit
to judehung/edgex-go
that referenced
this pull request
Nov 19, 2024
related to edgexfoundry/go-mod-bootstrap#795 To allow to build services without openziti, add new targte build-noziti and docker-noziti into Makefile. Also revise README.md to include such information. Signed-off-by: Jude Hung <jude@iotechsys.com>
Merged
5 tasks
judehung
added a commit
to judehung/device-virtual-go
that referenced
this pull request
Nov 19, 2024
related to edgexfoundry/go-mod-bootstrap#795 To allow to build services without openziti, add new targte build-noziti and docker-noziti into Makefile. Also revise README.md to include such information. Signed-off-by: Jude Hung <jude@iotechsys.com>
5 tasks
judehung
added a commit
to judehung/device-modbus-go
that referenced
this pull request
Nov 19, 2024
related to edgexfoundry/go-mod-bootstrap#795 To allow to build services without openziti, add new targte build-noziti and docker-noziti into Makefile. Also revise README.md to include such information. Signed-off-by: Jude Hung <jude@iotechsys.com>
judehung
added a commit
to judehung/app-functions-sdk-go
that referenced
this pull request
Nov 19, 2024
realetd to edgexfoundry/go-mod-bootstrap#795 As go-mod-bootstrap is updated with new build tag no_openziti with some code refactor, the app-functions-sdk-go also needs to be updated per the refactor. Signed-off-by: Jude Hung <jude@iotechsys.com>
judehung
added a commit
to judehung/app-service-configurable
that referenced
this pull request
Nov 19, 2024
related to edgexfoundry/go-mod-bootstrap#795 To allow to build services without openziti, add new targte build-noziti and docker-noziti into Makefile. Also revise README.md to include such information. Signed-off-by: Jude Hung <jude@iotechsys.com>
5 tasks
judehung
added a commit
to IOTechSystems/edgex-go-low-footprint
that referenced
this pull request
Nov 20, 2024
related to edgexfoundry/go-mod-bootstrap#795 To allow to build services without openziti, add new targte build-noziti and docker-noziti into Makefile. Also revise README.md to include such information. Signed-off-by: Jude Hung <jude@iotechsys.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
closes #789
The usage of OpenZiti packages to support zero trust feature significantly increases the build size. For example, core-metadata increases from 14MB to 21MB, core-command increases from 9.8MB to 17MB, device-virtual increases from 18MB to 31MB, and app-service-configurable increases from 22Mb to 34MB. As many edge user scenarios require to deploy EdgeX services on resource-constrained devices without security, allowing that the services can be built without OpenZiti packages and ZeroTrust features can be helpful to user cases which don't need zero trust feature.
This commit refactors the codes importing openziti packages with
//go:build !no_openziti
directive and creates para codes that don't use openziti packages with//go:build no_openziti
directive, so users can simply build services by specifyingno_openziti
tag to build out services without openziti zero trust feature.If your build fails due to your commit message not passing the build checks, please review the guidelines here: https://github.com/edgexfoundry/go-mod-bootstrap/blob/main/.github/Contributing.md
PR Checklist
Please check if your PR fulfills the following requirements:
BREAKING CHANGE:
describing the break)Testing Instructions
To test the new no_openziti build tag, please clone my forked edgex-go repository and checkout issue-789 branch:
The issue-789 branch has updated go.mod to replace go-mod-bootstrap with github.com/judehung/go-mod-bootstrap/v4 v4.0.0-20241109084700-c362e7cd73ed, which contains the changes of this PR:
The issue-789 branch also updates Makefile to include a new target
build-noziti
, and you can build the edgex-go services without openziti packages with following make command:This will build out core services and you can observe their binary executable size shrinks back to the same level as v3.1.
New Dependency Instructions (If applicable)
N/A