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

feat(deploy): add spin deploy command #353

Merged
merged 2 commits into from Apr 22, 2022
Merged

Conversation

michelleN
Copy link
Member

@michelleN michelleN commented Apr 14, 2022

This is an MVP for the spin deploy command. Given
a bindle server url, hippo server url, and hippo
username/password, this command will create
(1) and push a bindle containing the app to the bindle server
(2) a Hippo App with the name provided in the Spin.toml
(3) a Hippo channel in the Hippo App called "spin-deploy"
and create a post request to register a revision in Hippo.
If an app with the same name already exists, this command will
return an error. If a channel with the name spin-deploy exists,
this will return an error. These errors will be handled more
gracefully with prompts/helpful error messages in subsequent PRs.

This commit it meant to lay the groundwork for the deploy command
so folks can start playing with it and collect opinions.

To play with this command:

  1. Use the nomad-local-demo to deploy nomad (+ Consul, Traefik, Vault) and bindle.
  2. Clone Hippo and in Infrastructure/Jobs/NomadJob.cs, change the driver setting from "exec" to "raw_exec". Remove the artifact stanza so that Nomad uses your local Spin binary. Be sure to set the bindle url env variable given in the ./run_servers.sh output
  3. Start hippo with the nomad scheduler and bindle url.
$ dotnet build
$ dotnet run \
--Scheduler:Driver=nomad \
  --Bindle:Url="${BINDLE_URL}"
  1. Create a hippo account. Use these creds in the next step
  2. Build the wasm module for an example app and then spin deploy --bindle-server <bindle-url> --hippo-username <username> --hippo-password <password>

@michelleN michelleN force-pushed the deploy branch 4 times, most recently from d2abd3a to 31a7504 Compare April 14, 2022 01:50
This is an MVP for the spin deploy command. Given
a bindle server url, hippo server url, and hippo
username/password, this command will create
(1) and push a bindle containing the app to the bindle server
(2) a Hippo App with the name provided in the Spin.toml
(3) a Hippo channel in the Hippo App called "spin-deploy"
and create a post request to register a revision in Hippo.
If an app with the same name already exists, this command will
return an error. If a channel with the name spin-deploy exists,
this will return an error. These errors will be handled more
gracefully with prompts/helpful error messages in subsequent PRs.

This commit it meant to lay the groundwork for the deploy command
so folks can start playing with it and collect opinions.
src/commands/deploy.rs Outdated Show resolved Hide resolved
src/commands/deploy.rs Outdated Show resolved Hide resolved
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.

I deployed the Nomad infra, started Hippo, and got an application up and running!
The only thing not working was routing using the default local domain, but I suspect that's an issue with my setup.

Creating the application, channel, and starting it using Nomad worked for me (with the mention that if running IPv6, both Bindle and the Nomad job definition from Hippo need [] around the IP address — ref fermyon/nomad-local-demo#5).

(I have a few non-blocking comments related to error messages and default addresses).

I think this is in a great spot to be iterated on, LGTM.

* fix error message

Signed-off-by: Michelle Dhanani <michelle@fermyon.com>
@radu-matei
Copy link
Member

:shipit:!

@michelleN michelleN merged commit ef39884 into fermyon:main Apr 22, 2022
@michelleN michelleN deleted the deploy branch April 22, 2022 18:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants