versioning
gedw99 opened this issue · comments
https://github.com/aquaproj/aqua is golang and has a markup language but also has versioning.
there is also a registry, so you can declare the mapping the name to where the binary is stored. the registry is just a github repo.
Its pretty good. takes a while to get used to its cli.
https://github.com/suzuki-shunsuke/pinact uses aqua to pin github actions. just one example
The tengo stuff is completely replaced by 3 lines of json
registry vs nami: a github repo too, and more, such as url
declare the mapping vs nami: declare a jb file
BTW, is there a mapping file example? for example nami: httpserver.js
by unknown
actually, I haven't used github action, I think its concepts and syntax are a bit too much, so I didn't learn it. Does aqua have to work with github action?
by unknown
Let's explain the problem with a concrete example. If we want to convert https://github.com/txthinking/nami/blob/master/package/httpserver.js to aqua, what steps do we need to do, and what files to write
by unknown
actually, I haven't used github action, I think its concepts and syntax are a bit too much, so I didn't learn it. Does aqua have to work with github action?
by unknown
no. Its just an example of how it can be used.
there are 3 downloads which are golang.
aqua is a general command for using aqua.
aqua-proxy if on any computer, allows you to call a binary that is not there yet, by version. it will download it and then let the command call through to the binary. Its doing exactly what "serverless" does.
aqua-registry allow you to submit any binary to the registry. So its for devs.
# https://github.com/aquaproj/aqua
go install github.com/aquaproj/aqua/v2/cmd/aqua@latest
# https://github.com/aquaproj/aqua-proxy
go install github.com/aquaproj/aqua-proxy/cmd/aqua-proxy@latest
# https://github.com/aquaproj/registry-tool
go install github.com/aquaproj/registry-tool/cmd/aqua-registry@latest
All the packages are here:
https://github.com/aquaproj/aqua-registry
https://github.com/aquaproj/aqua-registry/tree/main/pkgs
if you just look inside one you can see how you describe a package. You can submit any binary.
It also works on Windows, not just Darwin and Linux !!
example of how the registry works.
https://github.com/99designs/aws-vault wants to be put into aqua
https://github.com/aquaproj/aqua-registry/blob/main/pkgs/99designs/aws-vault/pkg.yaml
packages:
- name: 99designs/aws-vault@v7.2.0
- name: 99designs/aws-vault
version: v6.5.0
- name: 99designs/aws-vault
version: v6.3.0
- name: 99designs/aws-vault
version: v5.2.0
- name: 99designs/aws-vault
version: v5.1.0
- name: 99designs/aws-vault
version: v4.7.0
- name: 99designs/aws-vault
version: v3.5.0
- name: 99designs/aws-vault
version: v3.0.0-dev
- name: 99designs/aws-vault
version: v2.4.0
- name: 99designs/aws-vault
version: v2.3.3
- name: 99designs/aws-vault
version: v2.3.2
- name: 99designs/aws-vault
version: v1.0.0
https://github.com/aquaproj/aqua-registry/blob/main/pkgs/99designs/aws-vault/registry.yaml
packages:
- type: github_release
repo_owner: 99designs
repo_name: aws-vault
description: A vault for securely storing and accessing AWS credentials in development environments
asset: aws-vault-{{.OS}}-{{.Arch}}
format: raw
overrides:
- goos: darwin
format: dmg
asset: aws-vault-{{.OS}}-{{.Arch}}.{{.Format}}
supported_envs:
- linux
- darwin
- windows/arm64
checksum:
type: github_release
asset: SHA256SUMS
algorithm: sha256
version_constraint: semver(">= 6.5.0")
version_overrides:
- version_constraint: semver(">= 6.3.0")
asset: aws-vault-{{.OS}}-{{.Arch}}.{{.Format}}
format: dmg
overrides:
- goos: linux
format: raw
asset: aws-vault-{{.OS}}-{{.Arch}}
supported_envs:
- linux
- darwin
- version_constraint: semver(">= 5.2.0")
asset: aws-vault-{{.OS}}-{{.Arch}}.{{.Format}}
format: dmg
overrides:
- goos: linux
format: raw
asset: aws-vault-{{.OS}}-{{.Arch}}
supported_envs:
- linux
- darwin
rosetta2: true
- version_constraint: semver(">= 5.1.0")
asset: aws-vault-{{.OS}}-{{.Arch}}.{{.Format}}
format: dmg
overrides:
- goos: linux
format: raw
asset: aws-vault-{{.OS}}-{{.Arch}}
supported_envs:
- linux
- darwin
rosetta2: true
checksum:
enabled: false
- version_constraint: semver(">= 4.7.0")
asset: aws-vault-{{.OS}}-{{.Arch}}.{{.Format}}
format: dmg
overrides:
- goos: linux
format: raw
asset: aws-vault-{{.OS}}-{{.Arch}}
supported_envs:
- linux/amd64
- darwin
rosetta2: true
checksum:
enabled: false
- version_constraint: semver(">= 3.5.0")
overrides: []
supported_envs:
- linux/amd64
- darwin
rosetta2: true
checksum:
enabled: false
- version_constraint: semver(">= 3.0.0-dev")
overrides: []
replacements:
amd64: x86_64
darwin: Darwin
supported_envs:
- darwin
rosetta2: true
checksum:
enabled: false
- version_constraint: semver(">= 2.4.0")
overrides: []
replacements:
amd64: x86_64
darwin: Darwin
linux: Linux
supported_envs:
- linux/amd64
- darwin
rosetta2: true
checksum:
enabled: false
- version_constraint: semver(">= 2.3.3")
overrides: []
replacements:
amd64: x86_64
darwin: Darwin
supported_envs:
- darwin
rosetta2: true
checksum:
enabled: false
- version_constraint: semver(">= 2.3.2")
overrides: []
replacements:
amd64: x86_64
darwin: Darwin
linux: Linux
supported_envs:
- linux/amd64
- darwin
rosetta2: true
checksum:
enabled: false
- version_constraint: semver("< 2.3.2")
overrides: []
replacements:
amd64: x86_64
darwin: Darwin
supported_envs:
- darwin
rosetta2: true
checksum:
enabled: false
deno based web gui of registry.
web:https://aqua-picker.deno.dev
code: https://github.com/4513ECHO/aqua-picker
I see, and I compare it with nami about a package protoc
/ | nami | aqua |
---|---|---|
How to add package | protoc.js | pkg.yaml, registry.yaml |
Package grammar | javascript | yaml |
Capabilities required by developers | javascript grammar, and put the binary to ~/.nami/cache | Understand the yaml rule syntax defined by aqua |
The better of aqua is that it contains more meta data, such version, description. But nami only has one extra meta data ~/.nami/cache/version
And aqua looks like support multi version, nami only prefers the latest version.
Personally I think, for developers, the javascript (jb) method is simpler and more flexible. The only requirement is to put the binary file under ~/.nami/cache. There are also other package managers that have adopted similar methods, such as brew choosing ruby.
Of course, for non-developers (they may not understand javascript or ruby), perhaps they are more willing to carefully read the rules defined by the package file (yaml). Of course, this is the approach taken by many package managers, such as debian.