-
Notifications
You must be signed in to change notification settings - Fork 259
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Michelle Dhanani <[email protected]>
- Loading branch information
Showing
1 changed file
with
47 additions
and
0 deletions.
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 |
---|---|---|
@@ -0,0 +1,47 @@ | ||
title = "SIP 001 - Spin Deploy" | ||
template = "main" | ||
date = "" | ||
|
||
Summary: A Spin CLI command that will deploy a Spin application to the cloud | ||
|
||
Owner: [email protected] | ||
|
||
Created: March 18, 2022 | ||
|
||
Updated: March 31, 2022 | ||
|
||
## Background | ||
|
||
A Spin application — (currently described as a spin.toml file) — is a collection of one or more components, each invoked as a result of an event generated by a trigger. The Spin CLI currently enables running a Spin application locally via the `spin up` command. The Spin CLI also offers a set of commands enabling users to package and push a Spin application to a [Bindle](https://github.com/deislabs/bindle) registry. | ||
|
||
[Hippo](https://github.com/deislabs/hippo) is a self-hosted, open source, Web Assembly PaaS that allows users to deploy and scale Web Assembly applications at scale. Hippo takes a reference to a bindle, deploys it to the cloud and makes it publicly available. Hippo currently only works with Wagi applications and can currently deploy Wagi applications on a Nomad cluster with Traefik for routing. Additionally, Hippo has a concept called “channels” enabling users to track different version categories of an application (ex. alpha, beta, stable, pre-releases, minor versions, etc.). | ||
|
||
A desired feature is to be able to deploy a Spin application to the cloud using Hippo so that it is accessible via a publicly available domain or IP address. | ||
|
||
## Proposal | ||
|
||
Create a `spin deploy` command. This command packages a Spin application as a bindle, pushes it to a bindle registry and instructs Hippo to deploy the application to the cloud. | ||
|
||
This command needs the following configuration to be passed via either flags or environment variables or config file to deploy the application properly and to the right place: | ||
|
||
- Bindle server information | ||
- Environment variable: BINDLE_SERVER_URL | ||
- Flag: --bindle-server | ||
- Hippo URL information | ||
- Environment variable: HIPPO_URL | ||
- Flag: --hippo-url | ||
- Hippo authentication information | ||
- Environment variable: HIPPOTOKEN | ||
- Flag: --hippo-token | ||
- _Note: currently the Hippo auth token expires in 30 minutes and there is no way to refresh the token. We may need to support basic auth in the first iteration as token support will require updates to Hippo._ | ||
|
||
### Assumptions about the Hippo Platform | ||
|
||
The following is a list of assumptions we are making about the Hippo platform that we would need to build in order for this command to work. | ||
|
||
- There needs to be a single endpoint on the Hippo API Server that takes the Spin application information and creates a Hippo application with a default channel configured to watch the correct bindle reference. See [hippo-cli issue #97](https://github.com/deislabs/hippo-cli/issues/97). | ||
- Hippo needs to support running Spin applications and not only Wagi applications. See [hippo issue #579](https://github.com/deislabs/hippo/issues/579). | ||
|
||
### Additional Consideration: Plugin Model | ||
|
||
In the future, we should make this command a plugin for the Spin CLI. People may not want to use the Spin deploy command to deploy to Hippo. They may want to deploy to a different target using a different platform. They should be able to do that via plugins. However, there is no plugin system in Spin at this time and that may require further debate and discussion and consideration, so it's best to continue with `spin deploy` as a built-in subcommand for the time being to be focused about the scope of work. |