-
Notifications
You must be signed in to change notification settings - Fork 9
Smaller ansible packages (no tests/ dir?) #29
Comments
We've discussed this a bit at today's meeting. The main problem is that we're still waiting for an answer from RH legal. We'll try to speed up that process. A side-discussion started on how to make it easier to prepare more specialized (and thus smaller) environments. A related discussion for that is #31. |
I'd like to revisit this at the next meeting if we have the time and I have submitted a PR to exclude files from future builds of community.general that I would hope to propose for every collection included in the package: ansible-collections/community.general#3517 My understanding of the potential legal liabilities is that we should avoid modifying or editing built collection tarballs that are published upstream. Therein lies not just potential legal or licensing issues but security ones as well: the checksums would no longer match and thus it would be harder to validate the trustworthiness of what we ship. However, if the files in question are excluded from the build to begin with, they would not land in the tarball and this should not be a problem. |
I've linked an additional PR to community.network for the sake of discussion. To put things into perspective, between just community.general and community.network, we're talking about excluding over 2k files which saves 10s off of the installation duration and reduces the uncompressed size on disk from 33MB to 15.6MB. |
We unfortunately didn't get time to discuss this during the meeting though it spawned a discussion right after, copied here for posterity. In terms of take-aways:
|
I've been increasing the scope of testing for 5.0.0rc1 (including packaging in fedora) and I must re-iterate that I find this particularly problematic. The Fedora RPM testing coverage highlighted thousands of errors and warnings of which we can ignore a sizeable chunk (ansible modules are not executable) but the remaining majority are related to tests and so, so many unnecessary files (files like I cannot in good conscience continue to knowingly and willingly ship all of these files, even if only considering how this reflects in terms of quality and professionalism to the community. What might this look like in practice ? My current proposal in the fedora spec includes the following (and it's not even exhaustive):
That short snippet returns On another note, from a performance standpoint, it cuts the installation time in more than half on my (relatively fast) laptop:
I would like to strongly suggest that we include this cleanup as part of the build process and spin an ansible 5.0.0rc2 package. |
Currently
|
From today's discussion:
|
I will look at wheel building and making sure that the extra files aren't included in the wheel (and thus in the user's install), even if they are still in the tarball. I think this is the only thing we can really do without hearing from legal. Also for Ansible 6, there will be a larger reduce of files in community.general and community.network due to them dropping the symlinks, which currently unfortunately get duplicated by setup.py. This is a tiny reduction compared to omitting tests etc., but better than nothing :) |
Here is a WIP PR for removing files from the bdist: ansible-community/antsibull-build#342 |
In any case, if we want to do this already for 5.x.0, then we need some testing, and this should be announced in time (more than a couple of weeks in advance) so that collection authors/maintainers have some time to check whether this breaks something. (While this shouldn't happen, you could have non-module plugins which depend on data, or even Python files, inside tests/, or other directories we are excluding. Or there could be other files in plugins/ we want to exclude for some reason, but which are actually needed by a plugin.) |
this PR should remind us when we review collections for inclusion to check for unnecessary files ansible-collections/overview#196. Please take a look |
Since this will happen for Ansible 6 (with the first 6.0.0 alpha targetted for next week) I'm going to close this. |
Summary
SUMMARY
Hello,
As asked, reposting this from ansible-collections/overview#177
Not to be nitpicking, but when installing the metapackage ansible 3.4.0, I was surprised by the size the docker image I built took.
To be more specific, create a virtualenv and install ansible with
pip3 install --no-cache-dir ansible==3.4.0
Then :
That was at first glance.
While I understand the need of the unit and integration tests, they can become heavy in disk space consumption.
Maybe I missed something, but is there a requirement to have them shipped in the release builds ?
ISSUE TYPE
Additional Information
No response
The text was updated successfully, but these errors were encountered: