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

Add go build tags no_openziti to reduce image/executable build size #789

Closed
judehung opened this issue Oct 31, 2024 · 0 comments · Fixed by #795
Closed

Add go build tags no_openziti to reduce image/executable build size #789

judehung opened this issue Oct 31, 2024 · 0 comments · Fixed by #795
Assignees
Labels
enhancement New feature or request

Comments

@judehung
Copy link
Member

🚀 Feature Request

Relevant Package [REQUIRED]

This feature request is for all services using go-mod-bootstrap.

Description [REQUIRED]

The usage of OpenZiti packages to support zero trust feature significantly increases the binary 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, 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.

Describe the solution you'd like

Add go build tags no_openziti for excluding the openziti libs from build. This requires some code refactoring to separate the OpenZiti library invocation and a dummy implementation if desired.

Describe alternatives you've considered

None
@judehung judehung added the enhancement New feature or request label Oct 31, 2024
@github-project-automation github-project-automation bot moved this to New Issues in Technical WG Oct 31, 2024
@cloudxxx8 cloudxxx8 moved this from New Issues to In Progress in Technical WG Nov 1, 2024
judehung added a commit to judehung/go-mod-bootstrap that referenced this issue Nov 8, 2024
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/go-mod-bootstrap that referenced this issue Nov 9, 2024
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>
@cloudxxx8 cloudxxx8 moved this from In Progress to QA/Code Review in Technical WG Nov 11, 2024
cloudxxx8 pushed a commit that referenced this issue Nov 19, 2024
* feat: Add new go build tag no_openziti to reduce build size

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 specifying
no_openziti tag.

Also remove vestigal zc variables and ZitiContext struct per discussion
with https://github.com/dovholuknf in
#659 (comment)

Signed-off-by: Jude Hung <jude@iotechsys.com>

* feat: rename the zerotrust_no_ziti.go to no_ziti.go

Signed-off-by: Jude Hung <jude@iotechsys.com>

---------

Signed-off-by: Jude Hung <jude@iotechsys.com>
@github-project-automation github-project-automation bot moved this from QA/Code Review to Odessa Done in Technical WG Nov 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Odessa Done
Development

Successfully merging a pull request may close this issue.

1 participant