Provider Binaries
The binaries section can be used to specify helper binaries Devsy should download that help the provider to accomplish its tasks.
An example of this type of provider are:
- devsy-provider-aws
- devsy-provider-azure
- devsy-provider-civo
- devsy-provider-digitalocean
- devsy-provider-gcloud
Each binary that is required is declared through:
binaries:
NAME:
- os: # Which OS is this specific binary
arch: # Binary arch
path: # Remote (URL) or local path to binary
checksum: # sha sum of the binary
archivePath: # If it's an archive, the relative path to the binary. Supported archives are .tgz, .tar, .tar.gz, .zip
name: # Optional name to store the binary as locally. Defaults to the file name derived from path.When Adding a provider, Devsy will match the binary for your OS and Arch and download the specific one for it.
Not every provider needs a binaries section. Built-in providers that wrap an
already-installed local CLI — such as docker, apple (the container CLI) or
microsandbox — instead expose an option (e.g. DOCKER_PATH, CONTAINER_PATH)
pointing to the binary the user already has on their machine, rather than
downloading one. Use binaries when your provider needs to fetch and manage its
own helper binary.
Example of the binary section in a provider.yaml:
binaries:
AWS_PROVIDER:
- os: linux
arch: amd64
path: https://github.com/devsy-org/devsy-provider-aws/releases/download/v0.0.1-alpha.15/devsy-provider-aws-linux-amd64
checksum: d1e774419d90c3ed399963d9322d57bfdcee189767eabb076a2c2e926bfd9b8b
- os: linux
arch: arm64
path: https://github.com/devsy-org/devsy-provider-aws/releases/download/v0.0.1-alpha.15/devsy-provider-aws-linux-arm64
checksum: fa15c13e3f0619170d002f9dae3ef41c9949a4595a71c5efe364d89ada604cec
- os: darwin
arch: amd64
path: https://github.com/devsy-org/devsy-provider-aws/releases/download/v0.0.1-alpha.15/devsy-provider-aws-darwin-amd64
checksum: fb89d41f6ce3e01e953f3ffd18f85bd5a42dd633abafd5d586dc9d9b1322166c
- os: darwin
arch: arm64
path: https://github.com/devsy-org/devsy-provider-aws/releases/download/v0.0.1-alpha.15/devsy-provider-aws-darwin-arm64
checksum: 82b6713069fa061ea59941600ed32a15f73806a9af3074d67a20ed367d18b2aa
- os: windows
arch: amd64
path: https://github.com/devsy-org/devsy-provider-aws/releases/download/v0.0.1-alpha.15/devsy-provider-aws-windows-amd64.exe
checksum: 49bd899d439f38d4e8647102db1c18b7a0d5242b3c09c89071b20a5444e20a81Binary Checksum
Each binary is also verified over an expected checksum. This is important to
ensure that whatever binary is declared in provider.yaml is indeed executed on
the machine.
Use binaries in commands
Devsy will make the binary path available through an environment variable within the exec section. For example:
binaries:
MY_BINARY:
....
exec:
init: ${MY_BINARY} init
....Use binaries in options
You can also use binaries within the option command attribute. For example:
binaries:
MY_BINARY:
....
options:
MY_OPTION:
command: ${MY_BINARY} retrieve-optionUse binaries on the agent side
You can also define binaries Devsy should install on the agent side through agent.binaries. These binaries can then be used within the agent.exec section to automatically stop a virtual machine if inactive.
For example:
agent:
path: ${AGENT_PATH}
binaries:
GCLOUD_PROVIDER:
- os: linux
arch: amd64
path: https://github.com/devsy-org/devsy-provider-gcloud/releases/download/v0.0.1-alpha.10/devsy-provider-gcloud-linux-amd64
checksum: 38f92457507563ee56ea40a2ec40196d12ac2bbd50a924d76f55827e96e5f831
- os: linux
arch: arm64
path: https://github.com/devsy-org/devsy-provider-gcloud/releases/download/v0.0.1-alpha.10/devsy-provider-gcloud-linux-arm64
checksum: 48e8dfa20962f1c3eb1e3da17d57842a0e26155df2b94377bcdf5b8070d7b17e
exec:
shutdown: |-
${GCLOUD_PROVIDER} stop --raw