Skip to content

update "deploy to hippo" documentation#560

Merged
bacongobbler merged 3 commits into
spinframework:mainfrom
bacongobbler:update-deploy-docs
Jun 17, 2022
Merged

update "deploy to hippo" documentation#560
bacongobbler merged 3 commits into
spinframework:mainfrom
bacongobbler:update-deploy-docs

Conversation

@bacongobbler

@bacongobbler bacongobbler commented Jun 10, 2022

Copy link
Copy Markdown
Contributor

Based on feedback/testing with recent changes to nomad-local-demo, spin,
and hippo.

Couple of notes on the changes:

  1. There is no need to run a local version of Hippo - nomad-local-demo runs an instance for you on nomad
  2. http://hippo.local.fermyon.link is set up with Traefik so that routes will resolve
  3. No need for HTTPS or the -k flag because everything is over HTTP
  4. The nomad dashboard lookup isn't necessary - the domain will be http://<channel_name>.<app_name>.hippo.local.fermyon.link/hello, which is routable via Traefik (see http://localhost:8081 for more details)

Signed-off-by: Matthew Fisher matt.fisher@fermyon.com

Comment thread docs/content/deploying-to-hippo.md Outdated
```
# this command opens up the nomad dashboard in your browser
$ nomad ui
$ curl http://spin-deploy.spin-hello-world.hippo.local.fermyon.link/hello

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Note that this URL is currently incorrect. At the moment Spin creates a channel called spin-hello-world resulting in the domain http://spin-hello-world.spin-hello-world.hippo.local.fermyon.link/hello

IIRC there is work in-development to change this, so this should be changed to reflect the new URL once complete.

cc @michelleN

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Also, with spin 0.2.0 (60907c4 2022-06-10) I'm seeing an app URL with no hippo section:
Screen Shot 2022-06-13 at 10 26 28 AM

@bacongobbler bacongobbler Jun 13, 2022

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Good catch. I believe this is because nomad-local-demo uses local.fermyon.link as the platform domain instead of hippo.local.fermyon.link. nomad-aws-demo uses hippo.ip_address.sslip.io as the platform domain.

Both work because both use wildcard A records to point to Traefik. I would prefer to use the http://myapp.hippo.domain convention to signify to the user that "this app is running on Hippo".

We have two options:

  1. update nomad-local-demo to match nomad-aws-demo (no changes to this doc required)
  2. update nomad-aws-demo to match nomad-local-demo (changes to this doc required)

Let's chat about this offline

cc @adamreese

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Ah, thanks for comparing scenarios. Indeed, we should decide on a consistent approach. 👍

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

the channel name has been updated to be spin-deploy!

Comment thread docs/content/deploying-to-hippo.md Outdated
In the future, spin deploy will give the user a domain to hit for the running app. In the meantime, find the IP address and port for the running app int he Nomad dashboard.

Check the Nomad UI for the running job.
In the future, `spin deploy` will give the user a domain to hit for the running

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

quick thought: how far away are we from implementing this? Will it be in Spin 0.3? @michelleN

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Right now it does give the domain for the application. @itowlson is working on making sure we also get the available routes in #568

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This is done.

Based on feedback/testing with recent changes to nomad-local-demo, spin,
and hippo.

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

@vdice vdice left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I ran through this updated doc and the deploy flow worked great for me (on Mac OS).

cc @dicej if/when convenient to also give this a try.

Comment thread docs/content/deploying-to-hippo.md Outdated
```
# this command opens up the nomad dashboard in your browser
$ nomad ui
$ curl http://spin-deploy.spin-hello-world.hippo.local.fermyon.link/hello

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Also, with spin 0.2.0 (60907c4 2022-06-10) I'm seeing an app URL with no hippo section:
Screen Shot 2022-06-13 at 10 26 28 AM

@dicej

dicej commented Jun 13, 2022

Copy link
Copy Markdown
Contributor

I'll test these instructions shortly.

BTW, regardless of whether/when fermyon/nomad-local-demo#13 is merged, I think we should include explicit instructions to install the relevant subset of prerequisites in the root user's path, e.g.:

Please note: Nomad, Spin, Bindle, and Traefik must be installed such that they appear in the root user's PATH since Nomad is run using sudo. The run_servers.sh script used below may complain if this is not the case.

If I'm reading @bacongobbler's recent comments correctly, the above might not be necessary on Mac, so we could scope the above message to just Linux users, if appropriate.

Edit: nevermind -- we decided to use a different approach for fermyon/nomad-local-demo#13, so no doc changes needed.

@dicej

dicej commented Jun 13, 2022

Copy link
Copy Markdown
Contributor

I'm following the instructions from bacongobbler:update=deploy-docs from the beginning, and getting this when creating the user:

 $ hippo register --username user2 --password password --url http://hippo.local.fermyon.link
Error: 404 page not found

And indeed, when I try to log in to http://localhost:5309/, I get a 400 error (should probably be a 401?), so apparently the user wasn't created. Any tips on debugging this?

The run_servers.sh seems to be healthy, and everything appears to be running, FWIW.

@dicej

dicej commented Jun 13, 2022

Copy link
Copy Markdown
Contributor

Regarding my last comment: I just now noticed the new hippo-cli release. Will retry with that. Sorry for the noise!

@dicej

dicej commented Jun 13, 2022

Copy link
Copy Markdown
Contributor

Same issue with Hippo v0.13.0:

 $ hippo --version
hippo 0.13.0
 $ hippo register --username user2 --password password --url http://hippo.local.fermyon.link
Error: 404 page not found

@bacongobbler

Copy link
Copy Markdown
Contributor Author

update: after a 🍐 session with @dicej, it turned out to be some stale services that were not cleaned up from previous invocations of nomad-local-demo's run_servers.sh. Consul never shut down.

@dicej

dicej commented Jun 13, 2022

Copy link
Copy Markdown
Contributor

Okay, after resolving the rogue consul process issue, I was able to follow the instructions without issue, except for the last step. As @vdice noted above, the correct URL to pass to curl is http://spin-hello-world.spin-hello-world.local.fermyon.link/hello as of this writing.

Comment thread docs/content/deploying-to-hippo.md Outdated

Start Nomad, Consul, and Traefik using the `run_servers.sh` script from the [nomad-local-demo repo](https://github.com/fermyon/nomad-local-demo).
Start Nomad, Consul, and Traefik using the `run_servers.sh` script from the
[nomad-local-demo repo](https://github.com/fermyon/nomad-local-demo).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This can now change to point to fermyon/installer... Not sure if we want to link specifically to https://github.com/fermyon/installer/tree/main/local

Suggested change
[nomad-local-demo repo](https://github.com/fermyon/nomad-local-demo).
[fermyon/installer repo](https://github.com/fermyon/installer).

@michelleN michelleN left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

The doman

Comment thread docs/content/deploying-to-hippo.md Outdated

Check that the Hippo platform is running by making sure you see the hippo dashboard in the browser at https://localhost:5309.
Check that the Hippo platform is running by making sure you see the hippo
dashboard in the browser at <http://hippo.local.fermyon.link>

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Did the domain change recently?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

nvm I just tested the latest local demo script and realized this is current! please disregard

Comment thread docs/content/deploying-to-hippo.md Outdated
In the future, spin deploy will give the user a domain to hit for the running app. In the meantime, find the IP address and port for the running app int he Nomad dashboard.

Check the Nomad UI for the running job.
In the future, `spin deploy` will give the user a domain to hit for the running

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Right now it does give the domain for the application. @itowlson is working on making sure we also get the available routes in #568

Signed-off-by: Matthew Fisher <matt.fisher@fermyon.com>
@bacongobbler

Copy link
Copy Markdown
Contributor Author

Updated as per feedback. The document now points to https://fermyon.dev.

All links currently do not work; please use https://canary.fermyon.dev for now.

@radu-matei

Copy link
Copy Markdown
Member

Thanks, @bacongobbler!
In a follow-up PR, we can update the guide with details about spin deploy, how it works, and an end-to-end example.

Thanks!

@vdice vdice left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Besides #560 (comment) as a follow-up, I think the only remaining change needed in this PR is updating this line: https://github.com/fermyon/spin/blob/main/docs/templates/content_sidebar.hbs#L37

Signed-off-by: Matthew Fisher <matt.fisher@fermyon.com>
@bacongobbler

Copy link
Copy Markdown
Contributor Author

done

@radu-matei radu-matei requested a review from michelleN June 17, 2022 21:59
@bacongobbler bacongobbler merged commit f0fd101 into spinframework:main Jun 17, 2022
@bacongobbler bacongobbler deleted the update-deploy-docs branch June 17, 2022 23:26
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.

5 participants