-
Notifications
You must be signed in to change notification settings - Fork 593
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
Decrease installation size #2455
Comments
I agree completely on the decreasing the size have a little concern with my troubleshooting from making this change but the advantage to the masses outweighs my concerns here. This change is related to the provider schemas. Since each resource is a file we only store unique files. The specs aren't loaded into that PR because it would make too big of change but the result is dramatic. I should add there is so much more to change that this PR is WIP and probably will be for a little while longer. If there is any good wins we can have from this proposal we should explore them. |
Temporary fix for aws-cloudformation#2455 / pre-commit-ci/issues#150
Temporary fix for aws-cloudformation#2455 / pre-commit-ci/issues#150
Okay, thanks for the update. To workaround the issue, I made a fork with many of the specs that my project doesn't need removed: ev-energy@aa45e3a |
https://www.debugbear.com/json-size-analyzer
Was thinking the extra sections |
The one concern I ran into is the availability of |
Tried an approach where we store |
I don't think that's a concern. Pip unconditionally imports I also found this bug where it's discussed whether to try not using zlib in 'ensurepip', the module that installs pip, and the possibility was ignored there too. |
By breaking a part of the spec into individual files and storing only differences from |
Good find @adamchainz. I'm between the zlib approach and the other approach I just mentioned or maybe a hybrid of two. In comparison my zipfile/zlib tests from above increased the time only marginally +2s over all the integration tests. The other thing that we would benefit from is a smarter loading of resource specs as we load them all even though they aren't all used. |
I think right now I like the change in #2457. 18MBs on disk for CloudSpecs and reduced my pylint total runs from ~76s to ~36s. To compare integration test finished in ~15s |
I'm going to mark this one as complete for now. There are probably more efficiencies to be had but v0.71.0 reduced install package size from 144MBs to about 25MBs |
Nice work, thank you! |
Is this feature request related to a new rule or cfn-lint capabilities?
No response
Describe the feature you'd like to request
I tried running cfn-lint with pre-commit on its CI service, pre-commit.ci. I got this error:
Oh no.
Describe the solution you'd like
I’d like the repo to be smaller, similar to the motivations in #2368.
The
src/cfnlint/data/CloudSpecs
directory is huge, as I think you're aware. Gzipping it takes it from 141MB to 8.5MB. The decompress time on read is probably worth it. Also most users will only need the files from a couple of regions.This will also save developer machines' disk space, where there may be several cfn-lint versions installed, between several projects.
Additional context
I suggested similar to botocore: boto/botocore#2365
Is this something that you'd be interested in working on?
Would this feature include a breaking change?
The text was updated successfully, but these errors were encountered: