-
-
Notifications
You must be signed in to change notification settings - Fork 111
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
Implement atmos packages
to install 3rd party tools
#927
Comments
There are several options:
The option 1 is simplest and easiest. The option 2 is not bad. This is an advanced topic, but one of problems is checksum verification in CI. The option 3 is good, but I guess most version managers are not Go Modules but CLI. I don't recommend the option 4. What do you think? |
My main concern is this: it defeats the purpose of the desired functionality, which is to avoid the need to manually install additional tools—including the tooling required to do so (besides Atmos itself). The goal is for everything to "just work" out of the box. I feel so strongly about this that I’d rather hold off until we find a solution that aligns with this principle.
Same response as (1).
Thank you for clarifying this point! This was definitely my preferred approach. I was hoping this approach could work, as I noticed that the packages were not strictly internal. However, I appreciate your warning about the unstable interface and its potential for changes without notice. This raises concerns and gives me pause. Let's see if there's a middle ground (see option 5).
I would prefer to rule this out as well. I’d like to propose two additional options based on your feedback. Option 5: Call Aqua (Preferred)We have an upcoming PR that introduces support for editorconfig. What’s notable about this implementation is that while many editorconfig packages are internal, we were able to call their public methods, achieving a near-native integration within Atmos. What if we did something similar with Aqua? In this model, if Aqua could expose a few stable APIs that provide command-line-like functionality from within Go, Atmos could call those directly. This way there's not a lot of work to maintain in Aqua, while providing other tooling the ability to leverage aqua. While this may sacrifice full flexibility, it offers the advantage of maintaining a native user experience within Atmos. As part of this if we could programmatically pass a string containing aqua configuration, we can then work very well with parts of aqua. We could generate that configuration inside of atmos, so the package manafement can feel more integrated with things like stacks, workflows and custom commands. Option 6: Go-based Aqua Bootstrapper (Less Preferred)This is a riff on your #2. If Aqua provided a method to bootstrap itself programmatically via Go, Atmos could invoke that as part of its process. This approach would enable similar functionality, but with a few limitations. Specifically, we’d be constrained to using Aqua’s configuration files without the ability to embed or extend those configurations directly within Atmos. This limitation concerns me because we’re introducing radical improvements to Atmos configuration handling in an upcoming PR that adds support for remote configurations, local overrides, imports, and more. All of that provides a consistent configuration interface for atmos, including the underlying tooling. I’d like those improvements to be universally applicable across Atmos functionality. |
Sorry for late reply.
|
Probably I don't understand features |
So for a general purpose package manager, aqua is exceptional. For example, I like how we can define packages that install cleanly on a local workstation as well as in CI. The proxy installer is a brilliant feature, almost like lazy loading but for binaries. Never seen that before. I like the fact that only the binaries used are the ones installed, and that they still come from the vetted sources in the aqua configuration. What we are trying to accomplish with this, as a core capability of atmos, is so that atmos can bootstrap everything required to get off the ground. It could mean also bootstrapping aqua itself. When we started writing Atmos, for example, we were keen to use vendir. We in fact started with it, but felt overall it was overkill for the problem we were aiming to solve. We ended up using go-getter to implement something simpler and good enough (but not for @hans-d who went for Vendir anyways!) I feel that this maybe the case here, that if the public APIs of aqua are not yet stable for embedding, and its capabilities are so rich, it may be overkill for the scope of this feature for our purposes. Maybe all we need is a much simpler subset of functionality? Within atmos, we have a controlled environment. Things like the Lazy Install would be easier implemented in other ways, since each command can declare its dependencies in the schema. The goal for this feature is to make running as command in atmos automatically install the versions of the tools it needs, without any other configuration of the host system. This includes
For this reason, want to stay focused on finding a way to accomplish this for a near native feel in atmos. @suzuki-shunsuke if you have any more creative ideas for this simpler use-case, I am open for it! |
I'd like to clarify this point.
For instance, when Atmos installs tflint, do you expect that users can execute |
Hmm. Please give me some time to consider this more deeply.
Probably you would expect this. |
Tools like But the design goal of Atmos isn’t to be just another cog in an existing tool’s wheel—it’s to be the wheel itself. The goal is to establish a consistent automation environment, backed by configuration. The Unix philosophy teaches us to "do one thing well," but the reality is that there are too many tools (too many cogs) that do one thing well—and no unified way to tie them together—the wheel. That’s where Atmos comes in. If your project depends on Developers don’t need to manually configure their shell, install 20 different tools by hand, or wrangle disparate dependencies. Instead, they install Atmos, and it all just works. Your team defines how the tools are used, and Atmos acts as the interface—making it feel as if Atmos itself implements everything. Only, it doesn’t reinvent the wheel—it’s built on the shoulders of giants. |
Actually, no. While we could optimize for that later, our real focus is on using the command within Atmos. The goal of Atmos is that no one should need to write a shell script just to call Atmos—if they do, we've failed. No one should need to rely on Makefiles, Taskfiles, or other task runner tools—if they do, we've failed. Atmos itself should be the interface that seamlessly integrates tools and workflows, providing a superior DX, eliminating the need for ad-hoc scripting or additional tooling just to glue things together. |
To enable users to execute installed tools in workflows, there are several options.
About point 2, this approach is entirely different from aqua, making it difficult to reuse aqua's resources. I’d like to avoid this. Regarding point 3, it's simple and not necessarily a bad approach. However, we would need to install tools for each project and reinstall them every time tool versions change. This results in wasted time and storage. |
How about this?
|
I've created atmos-proxy based on aqua-proxy. https://github.com/suzuki-shunsuke/atmos-proxy
The wrapper abstracts aqua. |
|
@suzuki-shunsuke how would |
https://aquaproj.github.io/docs/guides/command-alias aqua supports command aliases for this. e.g. packages:
- name: hashicorp/[email protected]
- name: hashicorp/terraform
version: v0.13.7
command_aliases:
- command: terraform
alias: terraform-013
# no_link: true
aqua uses hard links on Windows. https://aquaproj.github.io/docs/reference/lazy-install#on-windows
Atmos can define packages in several locations, so we need to define the precedence order.
This is same with aqua-proxy. |
Without Developer Mode, my understanding is still that Admin is required.
What I don't like about this is it requires changing the script to change the alias, rather than changing the version, of the commands. On the other hand, within a single script execution, if both versions are required, using the alias approach is good. But optimizing for the marginal case, doesn't seem ideal for me.
That works |
@suzuki-shunsuke I neglected to respond to this comment. This is a good one, because it highlights the strategic differences of what we're optimizing for in atmos vs aqua. As you know, it's hard to optimize for multiple things at the same time. Aqua for good reason is optimizing for system-wide usage, installing packages so that the user running the commands directly in their terminal get the best experience. Atmos is optimizing for running the commands are dependencies of workflows, subcommands, and components; they should install automatically, and ideally before starting any commands. We should have a visual cue on the screen (e.g. with a spinner), when dependencies are installed. Like with aqua, we want to lazy-install the commands, but we have the privilege of knowing what commands a workflow, component or subcommand depend on. Therefore, the proxy approach is suboptimal. From a UX perspective, we would prefer the installation to happen prior to running the workflows. For example, if there's any problem installing dependencies, we would rather know before we're halfway through the workflow. We want to ensure commands just work, and simplify upgrades.
Overall, I like this as a shim, automatically installed by atmos, as needed — enabling direct execution of the commands installed; however, it's secondary to first-class support within subcommands, workflows and components. It's a "bonus", rather than the primary interface.
This is IMO the preferred route, because it allows the workflows, commands, and components to operate consistently, merely calling the intended command (e.g.
I'm more concerned with the experience inside of one project working well, less concerned with the duplication of binaries (conservation of storage). If we think about terraform providers, they are downloaded in each project. A provider cache directory can be specified with terraform; we could do something similar down the road. Alternatively, so long as binaries are stored in programmatically deterministic locations, multiple projects could update the same target directory and reuse binaries. Paths would need to take into account the source.
Just to reiterate, main priority is to get it working within a project. If we have a strategy for how that could work across projects, that can be implemented later. |
Oh, really? I'll take a look.
I see. Atmos workflows define required packages and their versions, so we can achieve this.
Yes. Command alias is a solution for this. |
One more idea, symlinks can be an optional optimization, if it causes problems. |
Approach 2This is the detail of the option 3 I mentioned before.
Directory structure:
atmos sub commands such as
If commands don't exist in Why is
|
Based on this, I'm concerned we haven't captured the requirement that within a project, multiple tool versions must be supported. Different versions of terraform components can require different versions of terraform/opentofu.
At a minimum, this would need to be:
Regarding |
Warning ⚠ Draft Proposal (still working on it)I will remove this 👆 when proposal finished. General RequirementsMust:
Nice to have:
1️⃣ Global Tool Manifest (
|
Describe the Feature
Atmos should automatically add the packages base-path as a priority search PATH when executing any commands.
Expected Behavior
Packages are automatically installed and available to atmos.
Use Case
Install versions of opentofu or terraform
Install helmfile
Install terraform-docs, tflint, etc.
Support multiple concurrent versions
Install any other binaries needed by workflows, custom commands, etc
Describe Ideal Solution
Atmos Commands
Atmos Configuration
Stack Configuration
Alternatives Considered
No response
Additional Context
See https://github.com/suzuki-shunsuke/tfaction for example implementation
The text was updated successfully, but these errors were encountered: