-
Notifications
You must be signed in to change notification settings - Fork 364
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
docs: document aqua/ubi better #3234
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,25 @@ | ||
# Aqua Backend | ||
|
||
[Aqua](https://aquaproj.github.io/) tools may be used natively in mise. Aqua is encouraged as a backend for new tools if they | ||
cannot be used with ubi as aqua tools directly fetch tarballs from the vendor without requiring unsafe | ||
code execution in a plugin. | ||
[Aqua](https://aquaproj.github.io/) tools may be used natively in mise. aqua is the ideal backend | ||
to use for new tools since they don't require plugins, they work on windows, they offer security | ||
features like cosign/slsa verification in addition to checksums. aqua installs also show more progress | ||
bars, which is nice. | ||
|
||
You do not need to separately install aqua. The aqua CLI is not used in mise at all. What is used is | ||
the [aqua registry](https://github.com/aquaproj/aqua-registry) which is a bunch of yaml files that get compiled into the mise binary on release. | ||
Here's an example of one of these files: [`aqua:hashicorp/terraform`](https://github.com/aquaproj/aqua-registry/blob/main/pkgs/hashicorp/terraform/registry.yaml). | ||
mise has a reimplementation of aqua that knows how to work with these files to install tools. | ||
|
||
As of this writing, aqua is relatively new to mise and because a lot of tools are being converted from | ||
asdf to aqua, there may be some configuration in aqua tools that need to be tightened up. I put some | ||
common issues below and would strongly recommend contributing changes back to the aqua registry if you | ||
notice problems. The maintainer is super responsive and great to work with. | ||
|
||
If all else fails, you can disable aqua entirely with [`MISE_DISABLE_BACKENDS=aqua`](/configuration/settings.html#disable_backends). | ||
|
||
Currently aqua plugins don't support setting environment variables or doing more than simply downloading | ||
binaries though (and I'm not sure this functionality would ever get added), so some tools will likely | ||
always require plugins like asdf/vfox. | ||
|
||
The code for this is inside the mise repository at [`./src/backend/aqua.rs`](https://github.com/jdx/mise/blob/main/src/backend/aqua.rs). | ||
|
||
|
@@ -32,3 +49,31 @@ to use the aqua backend. To see these tools, run `mise registry | grep aqua:`. | |
import Settings from '/components/settings.vue'; | ||
</script> | ||
<Settings child="aqua" :level="3" /> | ||
|
||
## Common aqua issues | ||
|
||
Here's some common issues I've seen when working with aqua tools. | ||
|
||
### Supported env missing | ||
|
||
The aqua registry defines supported envs for each tool of the os/arch. I've noticed some of these | ||
are simply missing os/arch combos that are in fact supported—possibly because it was added after | ||
the registry was created for that tool. | ||
|
||
The fix is simple, just edit the `supported_envs` section of `registry.yaml` for the tool in question. | ||
|
||
### Using `version_filter` instead of `version_prefix` | ||
|
||
This is a weird one that doesn't causes weird issues in mise. In general in mise we like versions like | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Wondering if this was meant to be "that causes" or "that doesn't cause", now it's a bit between the two :) |
||
`1.2.3` with no decoration like `v1.2.3` or `cli-v1.2.3`. This consistency not only makes `mise.toml` | ||
cleaner but, it also helps make things like `mise up` function right because it's able to parse it as | ||
semver without dealing with a bunch of edge-cases. | ||
|
||
Really if you notice aqua tools are giving you versions that aren't simple triplets, it's worth fixing. | ||
|
||
One common thing I've seen is registries using a `version_filter` expression like `Version startsWith "Version startsWith "atlascli/""`. | ||
|
||
This ultimately causes the version to be `atlascli/1.2.3` which is not what we want. The fix is to use | ||
`version_prefix` instead of `version_filter` and just put the prefix in the `version_prefix` field. | ||
In this example, it would be `atlascli/`. mise will automatically strip this out and add it back in, | ||
which it can't do with `version_filter`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jdx Rather than aqua plugins, do you perhaps mean "aqua tools" or "the aqua backend"?
In the first paragraph you mention that aqua doesn't require plugins:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes thank you