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

azure-mgmt-network is huge #11149

Closed
yoava333 opened this issue Apr 30, 2020 · 39 comments
Closed

azure-mgmt-network is huge #11149

yoava333 opened this issue Apr 30, 2020 · 39 comments
Assignees
Labels
customer-reported Issues that are reported by GitHub users external to the Azure organization. Mgmt This issue is related to a management-plane library. needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team Network - Virtual Network question The issue doesn't require a change to the product in order to be resolved. Most issues start as that Service Attention Workflow: This issue is responsible by Azure service team.

Comments

@yoava333
Copy link

  • Package Name: azure-mgmt-network
  • Package Version: 10.1.0
  • Operating System: alpine-3.11.6
  • Python Version: 3.8

Describe the bug
azure-mgmt-network is the biggest dependency by far for my project, the size on disk is 110MB, which means that it slows down everything else - like building & publishing my application.

To Reproduce
Steps to reproduce the behavior:

  1. pip install azure-mgmt-network
  2. inspect the site-packages/azure/mgmt/network folder

Expected behavior
I would expect the SDK to be much lighter, for comparison the entire GCP python SDK is ~5MB and boto3+botocore is ~50MB (which includes the entire SDK).
If I were to install azure-mgmt-compute & azure-mgmt-resource I would get another 30MB, in one of my applications the azure folder is 250MB bigger than all the rest of the filesystem combined.

@ghost ghost added needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. customer-reported Issues that are reported by GitHub users external to the Azure organization. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that labels Apr 30, 2020
@ghost ghost removed the needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. label Apr 30, 2020
@lilyjma lilyjma added the Mgmt This issue is related to a management-plane library. label Apr 30, 2020
@chenjianfei2017
Copy link
Contributor

hi @yoava333 , i checked the pkg size, it is huge because network has multi versions, when you download this pkg, it will download pkgs of all version, we will discuss this on our meeting, thx.

@allenjzhang allenjzhang added the feature-request This issue requires a new behavior in the product in order be resolved. label May 1, 2020
@lmazuel lmazuel added this to the Backlog milestone May 4, 2020
@lmazuel lmazuel removed the feature-request This issue requires a new behavior in the product in order be resolved. label May 5, 2020
@RodgeFu RodgeFu assigned chenjianfei2017 and unassigned zikalino May 6, 2020
@RodgeFu
Copy link
Member

RodgeFu commented May 6, 2020

@lmazuel , do you have any suggestion here? is it possible to optimize the codegen to reduce the size? thanks.

@lmazuel lmazuel removed this from the Backlog milestone May 11, 2020
@RodgeFu RodgeFu added the Service Attention Workflow: This issue is responsible by Azure service team. label May 15, 2020
@ghost
Copy link

ghost commented May 15, 2020

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @aznetsuppgithub.

@RodgeFu
Copy link
Member

RodgeFu commented May 15, 2020

We did some investigation and found that the current network package still include very old api-version. Add "Service Attention" label to include service team to confirm whether we still need to support all the api-versions, it will be helpful to reduce the size if some old api-version can be removed from the package. thanks.

@ghost
Copy link

ghost commented May 19, 2020

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @aznetsuppgithub.

@ghost
Copy link

ghost commented Aug 12, 2020

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @vnetsuppgithub.

@talmachani
Copy link

Any update on this?

@ghost
Copy link

ghost commented Oct 5, 2020

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @vnetsuppgithub.

@yoav-orca
Copy link

Could you update on the status of this issue?

Azure right now is ~330MB I cannot use the sdk it in an AWS Lambda function anymore

image

@sodul
Copy link

sodul commented Aug 16, 2021

We have written a script that deletes the unreferenced older APIs. It does delete a good chunk of the API folders but not all of it. With the script the Azure directory is now just under 300MB instead of over 700MB. It is compatible with most, but not all, third party packages, as long as they do not point to a version that is trimmed.

https://github.com/clumio-code/azure-sdk-trim

@skuethe
Copy link

skuethe commented Sep 27, 2021

Any update on this? Azure CLI size is getting out of hand :(

@xiangyan99
Copy link
Member

Do we have any decisions?

We have similar problem when we ship conda packages.

@RAY-316 RAY-316 added the issue-addressed Workflow: The Azure SDK team believes it to be addressed and ready to close. label Dec 15, 2021
@ghost
Copy link

ghost commented Dec 15, 2021

Hi @yoava333. Thank you for opening this issue and giving us the opportunity to assist. We believe that this has been addressed. If you feel that further discussion is needed, please add a comment with the text “/unresolve” to remove the “issue-addressed” label and continue the conversation.

@yoav-orca
Copy link

/unresolve
@RAY-316 the issue not addressed/resolved the issue is only getting bigger, the package size of the network along (azure-mgmt-network) is now 286MB, which is almost 3 times larger than the original issue.

@ghost
Copy link

ghost commented Dec 15, 2021

Hi yoav-orca, only the original author of the issue can ask that it be unresolved. Please open a new issue with your scenario and details if you would like to discuss this topic with the team.

@yoava333
Copy link
Author

/unresolve

@ghost ghost added needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team and removed issue-addressed Workflow: The Azure SDK team believes it to be addressed and ready to close. labels Dec 15, 2021
@travcunn
Copy link

travcunn commented Mar 11, 2022

Any updates? I'd like to use the SDK in AWS Lambda but the package is too large

@sodul
Copy link

sodul commented Mar 11, 2022

@travcunn you can try my tool, which will bring the azure packages down to something less massive (300-400MB), but that might still be too large for Lambda.
https://github.com/clumio-code/azure-sdk-trim

As far as I can tell, this is something that was reported years ago and each release is still growing bigger, so it does not seem to be a priority at Microsoft.

@jsntcy you did communicate almost a year ago, can you share if anything came out of your meetings? You can share with your product teams that some decision makers are using this bug as an example as to why Azure should be avoided in favor of AWS.

@jsntcy jsntcy assigned msyyc and unassigned jsntcy Mar 11, 2022
@jsntcy
Copy link
Member

jsntcy commented Mar 11, 2022

@sodul, I'm not in SDK team now. @msyyc, please share the update for this issue.

@msyyc
Copy link
Member

msyyc commented Mar 11, 2022

HI, we have gradually reduced the size for several release: #21301.
What size do you expect?

@jiasli
Copy link
Member

jiasli commented Mar 11, 2022

According to #21301 (comment), 21.1MB is still too large. Azure CLI 2.34.1 (https://azcliprod.blob.core.windows.net/msi/azure-cli-2.34.1.msi) is 52.3MB, which means azure-mgmt-network is almost half the size of whole Azure CLI.

@msyyc
Copy link
Member

msyyc commented Mar 14, 2022

Let me paste the data in e-mail to raise more attention for architect

@prawalgangwar
Copy link

prawalgangwar commented May 11, 2022

Facing issues with pylance in VSCode. The python language server crashes as soon as I installed azure-mgmt-network via pip3 install azure-mgmt-network

[Info  - 12:24:51 PM] (4436) [BG(1)] Long operation: parsing: XXX/dev_env/lib/python3.10/site-packages/azure/mgmt/network/v2019_12_01/operations/_operations.py (2541ms)
[Info  - 12:24:56 PM] (4436) [BG(1)] Long operation: parsing: XXX/dev_env/lib/python3.10/site-packages/azure/mgmt/network/v2020_04_01/operations/_operations.py (4044ms)
[Info  - 12:25:04 PM] (4436) [BG(1)] Long operation: parsing: XXX/dev_env/lib/python3.10/site-packages/azure/mgmt/network/v2020_05_01/operations/_operations.py (7680ms)
[Error - 12:25:21 PM] (4436) Error occurred on background thread: {"code":"ERR_WORKER_OUT_OF_MEMORY"}```

mbaldessari added a commit to mbaldessari/utility-container that referenced this issue May 28, 2022
See Azure/azure-sdk-for-python#11149
and Azure/azure-sdk-for-python#17801
The size of the azure sdk is ridiculous because they keep old (and unused
APIs) around. We run this azure_sdk_trim.py to prune the unused APIs while
still maintaining a good compatibility level.

This shaves off about 0.5GB from the image. The full images is now
around ~1GB.
day0hero pushed a commit to validatedpatterns/utility-container that referenced this issue May 28, 2022
* Stop installing pip from pip

The UBI9 image is recent enough, that we can just rely on the
system-packaged pip. Should the need arise we can always backtrack
on that, but for now let's stick to the pip rpm we're being provided.

* Remove some unneeded collections

Namely we remove "fortinet cisco dellemc f5networks junipernetworks mellanox netapp"

This saves us ~400MB
Before:
localhost/utility-container                  latest      4cd658d42edf  28 seconds ago  1.97 GB

After:
localhost/utility-container                  latest      685c976bab41  22 seconds ago  1.54 GB

* Run pip install in a single command

No need now to have multiple invocations.

* Reduce the Azure sdk size impact

See Azure/azure-sdk-for-python#11149
and Azure/azure-sdk-for-python#17801
The size of the azure sdk is ridiculous because they keep old (and unused
APIs) around. We run this azure_sdk_trim.py to prune the unused APIs while
still maintaining a good compatibility level.

This shaves off about 0.5GB from the image. The full images is now
around ~1GB.

* Install git-core only

This avoids us installing perl-libs. The fundamental git commands
(clone) are in git-core and those are the only ones we are likely going
to need for the foreseeable future.

* Make kubectl a symlink to oc

This won't have an impact on the final size of the image or on du
calculations. But it makes the intent clearer as the two commands have
the exact same content.

* Add ARG variabls to remove some rpms

We have some rpms we remove via microdnf (fonts) and some
that we forcefully remove as we'll likely never ever need those
via rpm -e --nodepts (cracklib-dict)

* Move the openshift_client version to a variable

So it will be easier to change and there is less clustter in the
Containerfile

* Fix some small hadolint warnings

Quote any >= sign and move the -y as a first argument

* Fix package names indentation in README and add vi
@lmazuel
Copy link
Member

lmazuel commented Jan 9, 2023

Duplicate of #17801, where we're posting most update on the topic

@lmazuel lmazuel closed this as completed Jan 9, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Apr 12, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
customer-reported Issues that are reported by GitHub users external to the Azure organization. Mgmt This issue is related to a management-plane library. needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team Network - Virtual Network question The issue doesn't require a change to the product in order to be resolved. Most issues start as that Service Attention Workflow: This issue is responsible by Azure service team.
Projects
None yet
Development

No branches or pull requests