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

The charm size got 10x bigger due to cygrpc.cpython-38-x86_64-linux-gnu.so with debug symbols #545

Closed
nobuto-m opened this issue Nov 1, 2023 · 2 comments

Comments

@nobuto-m
Copy link
Contributor

nobuto-m commented Nov 1, 2023

Bug Description

As you can see blow, the charm size got 10x bigger in candidate/beta/edge compared to the stable one.

$ juju info prometheus-k8s

...

channels: |
  latest/stable:     129  2023-09-04  (129)  10MB   amd64  ubuntu@20.04
  latest/candidate:  146  2023-09-11  (146)  123MB  amd64  ubuntu@20.04
  latest/beta:       146  2023-09-11  (146)  123MB  amd64  ubuntu@20.04
  latest/edge:       153  2023-10-20  (153)  124MB  amd64  ubuntu@20.04
  1.0/stable:        129  2023-09-11  (129)  10MB   amd64  ubuntu@20.04
  1.0/candidate:     146  2023-09-11  (146)  123MB  amd64  ubuntu@20.04
  1.0/beta:          146  2023-09-11  (146)  123MB  amd64  ubuntu@20.04
  1.0/edge:          146  2023-09-11  (146)  123MB  amd64  ubuntu@20.04

By looking into the content, the dominant factor is the following file in non stable ones.

$ du -h prometheus-k8s_edge/venv/grpc/_cython/cygrpc.cpython-38-x86_64-linux-gnu.so 
297M	prometheus-k8s_edge/venv/grpc/_cython/cygrpc.cpython-38-x86_64-linux-gnu.so

After looking up the internet (grpc/grpc#21958), there was a hint that the binary may contain the debug info in it. And indeed, stripping the debug info by hand trimmed down the size significantly.

$ strip --strip-debug prometheus-k8s_edge/venv/grpc/_cython/cygrpc.cpython-38-x86_64-linux-gnu.so 

$ du -h prometheus-k8s_edge/venv/grpc/_cython/cygrpc.cpython-38-x86_64-linux-gnu.so 
14M	prometheus-k8s_edge/venv/grpc/_cython/cygrpc.cpython-38-x86_64-linux-gnu.so

Not so sure how to fix the situation properly in this charm though.

To Reproduce

$ juju download --channel 1.0/stable prometheus-k8s
Base "ubuntu@22.04" is not supported for charm "prometheus-k8s", trying base "ubuntu@20.04"
Fetching charm "prometheus-k8s" revision 129 using "1.0/stable" channel and base "amd64/ubuntu/20.04"
Install the "prometheus-k8s" charm with:
    juju deploy ./prometheus-k8s_r129.charm

$ unzip -d prometheus-k8s_stable ./prometheus-k8s_r129.charm
$ juju download --channel 1.0/edge prometheus-k8s
Base "ubuntu@22.04" is not supported for charm "prometheus-k8s", trying base "ubuntu@20.04"
Fetching charm "prometheus-k8s" revision 146 using "1.0/edge" channel and base "amd64/ubuntu/20.04"
Install the "prometheus-k8s" charm with:
    juju deploy ./prometheus-k8s_r146.charm

$ unzip -d prometheus-k8s_edge ./prometheus-k8s_r146.charm
$ du -sh prometheus-k8s_*/
381M	prometheus-k8s_edge/
36M	prometheus-k8s_stable/

Environment

  1.0/stable:        129  2023-09-11  (129)  10MB   amd64  ubuntu@20.04
  1.0/edge:          146  2023-09-11  (146)  123MB  amd64  ubuntu@20.04

Relevant log output

N/A

Additional context

No response

@nobuto-m nobuto-m changed the title The charm size got 10x bigger than before The charm size got 10x bigger due to cygrpc.cpython-38-x86_64-linux-gnu.so with debug symbols Nov 7, 2023
@mmkay
Copy link
Contributor

mmkay commented Dec 7, 2023

Most likely this is related to charm tracing support introduction in the prometheus charm which uses gRPC to communicate with tempo. We're investigating switching to another protocol in canonical/tempo-k8s-operator#53.

@mmkay
Copy link
Contributor

mmkay commented Feb 1, 2024

After #569, latest edge release is 27MB. It's more than 10MB as there are new libraries included, but it's not 127 MB anymore.

channels: |
  latest/stable:     159  2024-01-16  (159)  125MB  amd64  ubuntu@20.04
  latest/candidate:  165  2024-01-16  (165)  127MB  amd64  ubuntu@20.04
  latest/beta:       165  2024-01-16  (165)  127MB  amd64  ubuntu@20.04
  latest/edge:       170  2024-02-01  (170)  27MB   amd64  ubuntu@20.04
  1.0/stable:        156  2023-12-12  (156)  124MB  amd64  ubuntu@20.04
  1.0/candidate:     159  2023-12-12  (159)  125MB  amd64  ubuntu@20.04
  1.0/beta:          159  2023-12-12  (159)  125MB  amd64  ubuntu@20.04
  1.0/edge:          159  2023-12-12  (159)  125MB  amd64  ubuntu@20.04

@mmkay mmkay closed this as completed Feb 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants