-
Notifications
You must be signed in to change notification settings - Fork 3k
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-cli package could lose some weight #7387
Comments
Thank you for the feedback. You made a great point. We will definitely look into this. I will keep this issue open and assign it to myself. |
@marstr, could you please prioritize this work and get it done sometime in April? |
I'm excited to take care of this :) |
@marstr Thanks for picking this up, I've just been through another painfully slow upgrade (to 2.0.60 under WSL/Ubuntu) so I can assure you this fix will be welcomed! |
Geat that this is finally getting looked at! Every time I update the CLI, I kiss goodbye to my machine for ~20 minutes. I dread updating it. Looking forward to these changes |
20 minutes? Yikes. Which platform are you using @benc-uk? Maybe Ubuntu via WSL? |
Yes. I've had some snide comments from customers about the CLI in this regard |
All the more reason to get this taken care of. Thanks for the honest feedback. |
The WSL file system being slow when transfer large number of files were the problem when I looked at it months ago. Windows Defender is more about the cold start time of the command. |
It's a pipe dream at this point as I can see the amount of work that's gone into this Python version of the CLI, but... A single executable (i.e. based on golang) would be ideal. I've been working with Kubernetes, Helm and Terraform. Their tooling is written in Golang and it's really nice just having this single static binary you can put anywhere EDIT: the new AzCopy V10 has gone down this route |
If you look into my GitHub profile, you'll see that I'm a huge fan of Go and have spent a non-trivial part of my career on/with it. I love Terraform and k8s, and am envious of their ease of distribution. TBH, there are a lot of benefits to Go, but with a project like ours where we need to support many many contributors across the company, asking people to learn Go is a much heavier lift than asking them to use/learn Python. Not to mention, I don't think this product is at burn-it down and rewrite quality just yet ;) |
I totally understand, that's why I prefixed my comment with "this is a pipe dream" 😄 Hopefully some tidy up of the packaging is all that is required to get things speedy again |
@marstr Will slimming the |
Yes! That's what I'm working on right now. |
This (use some REST api directly) is exactly what we are investigating in the Microsoft Graph migration (#12946). If it turns out to be working well, we may incorporate this method in all future command modules or code-gen'ed modules. |
I was stunned to find that my diagnostic Docker containers grew by over 1GB when I installed the Azure CLI. This is ... astonishing. |
Appreciate the work going on to slim down the install! In case it's of interest, our use case is to run it inside AWS CloudShell, which has a home dir (the only writable bit) size limit of 1GB, and we only need enough of the CLI to support |
I don't think there's anyway out of this now, beyond a full rewrite in Go, Rust or Dotnet etc, something that can compile to a single binary Each week that passes the CLL gets larger and larger, and the chances of a rewrite smaller and smaller Where does it stop? When the CLI takes up 2GB? 5GB? 50GB? |
@benc-uk Have you tried https://github.com/clumio-code/azure-sdk-trim ? I wrote this a while back to delete older API directories that are obviously superfluous in 99% of cases and the If you call it from a Dockerfile make sure to have it in the same |
@benc-uk, If you do an It is actually the Azure Python SDK ( Rewriting in Go, Rust, .NET won't give too much benefit as those Azure SDKs are equally huge. |
Agreed, but with a compiled language you ship a binary, you don't ship the SDK with it! If I wrote a Go app that used the Go SDK for Azure, used a few functions from the SDK, and compiled it - it would be completely standalone executable and only a few megabytes |
I still want to see a version of Azure CLI that can be composed of different components more easily, but I've written a blog post that can hopefully help some people out: https://usrme.xyz/posts/how-to-trim-a-container-image-that-includes-azure-cli/. Using the methods described there I was able to slim an image from 1.17GB to 307MB! |
I was trying to find a cli mainly for azure devops. Installing the cli literally (via pip) shocked me. My usage is just to manage repositories & pull requests. I understand the installer itself is pretty small, but having 1G of dependencies is not ideal, at-least for my use case Isn't there way to decouple modules and use them independently, the current az cli is kind of overkill for my workflow. |
Some people are confusing or don't understand the problem. Even more I see with great surprise that some say that changing to Go we will practically not gain anything regarding the size of the CLI, surely they are the ones who love and support the current development that is a disaster. |
quite true on the actual issue of dependency hell, just looking at the pip install execution logs makes ones eyes water in disbelief. Looking at other major cloud providers I can see their equivalent cli tools weigh in differently Does it add more confusion to request a 'core' cli that is smaller but handles common activities (VMs, Blobs, AD, etc) or is that just masking the fundamental issue. think I would nearly prefer to dynamically add extensions to whatever i need rather than pulling down everything. |
I've created this pr to fix the problem. #25801 |
The
azure-cli
package (Ubuntu Xenial) could stand to lose some weight.😲 and 😳 don't begin to describe my reaction at the size difference between the AWS CLI and the Azure CLI packages.
python3
(on platforms where it is known there is a recent enough Python 3)?_py3
variants even included ifaz
is always run with Python 3?It's also not just about the size; install speed is also a thing. It takes 50 seconds to install the single
azure-cli
package on Azure machine, with its 39 000 files (dpkg-query -L azure-cli | wc -l
: 39094), just a little less than installing the twentyish packages that comprise all ofawscli
's dependencies (that can be used by other software on the system).The text was updated successfully, but these errors were encountered: