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

Pluggable abstraction of base image interactions and support scripts #637

Open
nitzmahone opened this issue Dec 8, 2023 · 1 comment
Open
Labels
needs_triage New item that needs to be triaged

Comments

@nitzmahone
Copy link
Member

Pluggable abstraction of base image interactions and support scripts

It's becoming apparent that Builder may need a pluggable distro/environment support abstraction. Package manager interactions and dependency resolution are by far the most common need, but there are many others.

Stream-of-conciousness dump follows; mainly just wanted to capture these thoughts in one place publicly instead of dribbling them out repeatedly in various conversations...

A primary theme for Builder 3.0 was making things more generic, e.g. support for arbitrary base images, additional user-definable hook points during key build events. It makes the tool more flexible and EE builds more performant by eliminating hard-coded steps that might be redundant or unnecessary, at the cost of requiring users to be more specific about the environment they're building upon. Since then, we've fielded a lot of requests that seem, at first blush, diametrically opposed. Some want to make builder even more generic, e.g. supporting non-RHEL base images. Others want us to add more
"magical" handling of environment/distro specific situations, e.g. Python interpreter discovery, package manager detection/arg generation, OS package repo config, custom CA cert management. On the surface, they're all reasonable requests- especially for common situations, it shouldn't be necessary for every user to reinvent the wheel with the same custom build steps, but implementing everything as a first-class feature in builder itself is likely prohibitive for both implementation and ongoing maintenance/testing costs.

I'm also loathe to watch Builder follow the same path Ansible Core itself did: over time, the codebase became littered with untestable special cases that were accepted with little more assurance than "worked on my machine". Even the reasons for their existence are often lost to history, and they become a major impediment to platform improvements for fear of unknown breakage. The collections abstraction has allowed us to minimize new occurrences of these problems in Ansible Core, since responsibility for bespoke behavior is offloaded to collection authors. If we can come up with a similar pluggable abstraction (perhaps even packaged in collections) that allows reusable customizations for these common cases, we can wrap the existing upstream functionality in it to provide the same experience, while allowing users to augment or replace them when the need arises to do something more or different. The builder team's responsibility is limited to carefully defining and maintaining the abstraction itself, along with whatever builtin implementations we choose to support upstream.

For some of these items, there may be a lot of overlap with Ansible Core. Package manager abstraction? Sounds like the package action. Python dep installs? Sounds like the pip module. Finding a Python interpreter? Sounds like Core interpreter discovery. Seems like we should probably allow leveraging that where reasonable. Need to also be careful not to go so far as just reimplementing Ansible Container 😉.

@github-actions github-actions bot added the needs_triage New item that needs to be triaged label Dec 8, 2023
@Shrews
Copy link
Contributor

Shrews commented Dec 11, 2023

FYI, you had already created #553 for capturing some of your ideas around some of this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs_triage New item that needs to be triaged
Projects
None yet
Development

No branches or pull requests

2 participants