Skip to content
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(*): add SIP for spin deploy #304

Merged
merged 2 commits into from
Apr 26, 2022
Merged

docs(*): add SIP for spin deploy #304

merged 2 commits into from
Apr 26, 2022

Conversation

michelleN
Copy link
Member

@michelleN michelleN commented Mar 31, 2022

Signed-off-by: Michelle Dhanani michelle@fermyon.com

TODO: update sip index once #202 is merged

- Environment variable: HIPPO_URL
- Flag: --hippo-url
- Hippo authentication information
- Environment variable: HIPPOTOKEN
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

HIPPO_TOKEN?


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.).
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What channel will spin deploy use? Does that need another option?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By default, the channel will be named "spin-deploy" and yes we'll need another option for that. I'll add that to the doc!

- 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._
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A refresh token API is expected to land the next Hippo release, so perhaps it'd be worth going through with implementing client token support. Implementing token refreshes would only be a few lines of code once 0.6.0 lands.

Have a look at hippo's UI for a good implementation of session management: https://github.com/deislabs/hippo/blob/main/src/Web/ClientApp/src/app/_services/session.service.ts

You could implement "forced login" from two directions:

  1. Implementing an HTTP interceptor, sniffing incoming responses from Hippo. If a 401 response is returned, ask the user to log back in.
  2. Check the token's expiry date before sending a request. If it has expired, force the user to log back in. Eventually, this could be replaced with the refresh token API.

If it helps, here's hippo-cli's client implementation: https://github.com/deislabs/hippo-cli/blob/main/src/hippo/client.rs

bacongobbler added a commit to bacongobbler/hippo-cli that referenced this pull request Apr 7, 2022
As of Hippo 0.6, the wagi runtime has been replaced with the Spin
runtime. The Spin CLI plans to implement commands like `spin deploy`
which will be used to package and distribute a Spin application to
Hippo.[1]

This change reduces the Hippo CLI to the bare minimum. The new role of
the Hippo CLI is to implement all of the endpoints available through the
hippo-openapi project. This is to help serve as a reference point for
those looking to write their own Hippo clients against the
hippo-openapi[2] project (like Spin), and it could also serve as a
useful administrator tool looking to inspect and/or understand the Hippo
API.

[1]: fermyon/spin#304
[2]: https://github.com/fermyon/hippo-openapi

Signed-off-by: Matthew Fisher <matt.fisher@fermyon.com>
bacongobbler added a commit to bacongobbler/hippo-cli that referenced this pull request Apr 7, 2022
As of Hippo 0.6, the wagi runtime has been replaced with the Spin
runtime. The Spin CLI plans to implement commands like `spin deploy`
which will be used to package and distribute a Spin application to
Hippo.[1]

This change reduces the Hippo CLI to the bare minimum. The new role of
the Hippo CLI is to implement all of the endpoints available through the
hippo-openapi project. This is to help serve as a reference point for
those looking to write their own Hippo clients against the
hippo-openapi[2] project (like Spin), and it could also serve as a
useful administrator tool looking to inspect and/or understand the Hippo
API.

[1]: fermyon/spin#304
[2]: https://github.com/fermyon/hippo-openapi

Signed-off-by: Matthew Fisher <matt.fisher@fermyon.com>
bacongobbler added a commit to bacongobbler/hippo-cli that referenced this pull request Apr 13, 2022
As of Hippo 0.6, the wagi runtime has been replaced with the Spin
runtime. The Spin CLI plans to implement commands like `spin deploy`
which will be used to package and distribute a Spin application to
Hippo.[1]

This change reduces the Hippo CLI to the bare minimum. The new role of
the Hippo CLI is to implement all of the endpoints available through the
hippo-openapi project. This is to help serve as a reference point for
those looking to write their own Hippo clients against the
hippo-openapi[2] project (like Spin), and it could also serve as a
useful administrator tool looking to inspect and/or understand the Hippo
API.

[1]: fermyon/spin#304
[2]: https://github.com/fermyon/hippo-openapi

Signed-off-by: Matthew Fisher <matt.fisher@fermyon.com>
Signed-off-by: Michelle Dhanani <michelle@fermyon.com>
Signed-off-by: Michelle Dhanani <michelle@fermyon.com>

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. 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.).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hippo currently only works with Wagi applications.

Hippo was recently updated — deislabs/hippo#580

Copy link
Member

@radu-matei radu-matei left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One small comment, but overall LGTM.

Thanks!

@radu-matei
Copy link
Member

Is there anything else we need to address in this PR before merging?

Thanks!

@radu-matei radu-matei added the sip Improvement proposal: a design or architecture proposal for discussion and consensus label Apr 24, 2022
bacongobbler added a commit to bacongobbler/hippo-cli that referenced this pull request Apr 25, 2022
As of Hippo 0.6, the wagi runtime has been replaced with the Spin
runtime. The Spin CLI plans to implement commands like `spin deploy`
which will be used to package and distribute a Spin application to
Hippo.[1]

This change reduces the Hippo CLI to the bare minimum. The new role of
the Hippo CLI is to implement all of the endpoints available through the
hippo-openapi project. This is to help serve as a reference point for
those looking to write their own Hippo clients against the
hippo-openapi[2] project (like Spin), and it could also serve as a
useful administrator tool looking to inspect and/or understand the Hippo
API.

[1]: fermyon/spin#304
[2]: https://github.com/fermyon/hippo-openapi

Signed-off-by: Matthew Fisher <matt.fisher@fermyon.com>
@michelleN michelleN merged commit b7d0c26 into fermyon:main Apr 26, 2022
@michelleN michelleN deleted the sip001 branch April 26, 2022 16:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sip Improvement proposal: a design or architecture proposal for discussion and consensus
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants