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

In preparation for future Spin 1.5 CLI #765

Merged
merged 13 commits into from
Sep 15, 2023
Merged

In preparation for future Spin 1.5 CLI #765

merged 13 commits into from
Sep 15, 2023

Conversation

tpmccallum
Copy link
Contributor

@tpmccallum tpmccallum commented Jul 26, 2023

Signed-off-by: tpmccallum tim.mccallum@fermyon.com

This PR just parks some of the work that Mung did on 1.5 tabs in code blocks; a PR with blank 1.5 code blocks in preparation for the inevitable Spin 1.5 release.

Content must go through a pre-merge checklist.

Pre-Merge Content Checklist

This documentation has been checked to ensure that:

  • The title, template, and date` are all set
  • Does this PR have a new menu item (anywhere in templates/*.hbs files) that points to a document .md that is set to publish in the future? If so please only publish the .md and .hbs changes in real-time (otherwise there will be a menu item pointing to a .md file that does not exist)
  • File does not use CRLF, but uses plain LF (hint: use cat -ve <filename> | grep '^M' | wc -l and expect 0 as a result)
  • Has passed bart check
  • Has been manually tested by running in Spin/Bartholomew (hint: use PREVIEW_MODE=1 and run npm run styles to update styling)
  • Headings are using Title Case
  • Code blocks have the programming language set to properly highlight syntax and the proper copy directive
  • Have tested with npm run test and resolved all errors
  • Relates to an existing (potentially outdated) blog article? If so please add URL in blog to point to this content.

Signed-off-by: tpmccallum tim.mccallum@fermyon.com

Just creating a PR with blank 1.5 code blocks in preparation for inevitable Spin 1.5 release.

Signed-off-by: Timothy McCallum <tim.mccallum@fermyon.com>
@github-actions
Copy link

🚀 preview deployed successfully to Fermyon Cloud and available at https://fermyon-developer-pr-765-rrso7lpj.fermyon.app

@tpmccallum
Copy link
Contributor Author

Keep an eye out for possible updates at
spin cloud link
spin plugins install

Signed-off-by: Timothy McCallum <tim.mccallum@fermyon.com>
@tpmccallum
Copy link
Contributor Author

tpmccallum commented Sep 11, 2023

Please add any additional tasks/suggestions to the following list:

Error: Newer version 0.6.0post.1693903439 of plugin 'js2wasm' is already installed. To downgrade to version 0.6.0, run `spin plugins upgrade` with the `--downgrade` flag.
  • Probably better to just instruct the user on delete canary rather than how to downgrade plugins so the installer can work i.e. spin plugins upgrade --downgrade js2wasm. If a user tries to do the latter then end up with this issue

@vdice
Copy link
Member

vdice commented Sep 13, 2023

@tpmccallum cloud plugin 0.2.0 is now out, so the new spin cloud apps subcommands are ready to add.

@vdice
Copy link
Member

vdice commented Sep 13, 2023

Spin v1.5.0 is now out, as well as js2wasm v0.6.0

@tpmccallum
Copy link
Contributor Author

Thanks @vdice
That is super helpful, I will get onto that asap.

Signed-off-by: tpmccallum <tim.mccallum@fermyon.com>
Signed-off-by: tpmccallum <tim.mccallum@fermyon.com>
Signed-off-by: tpmccallum <tim.mccallum@fermyon.com>
Signed-off-by: Timothy McCallum <tim.mccallum@fermyon.com>
Copy link
Member

@mikkelhegn mikkelhegn left a comment

Choose a reason for hiding this comment

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

LGTM - with two fixes.

content/cloud/cloud-command-reference.md Outdated Show resolved Hide resolved
content/cloud/cloud-command-reference.md Outdated Show resolved Hide resolved
Copy link
Contributor

@kate-goldenring kate-goldenring left a comment

Choose a reason for hiding this comment

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

Just one nit. Thanks Tim!

content/spin/http-outbound.md Outdated Show resolved Hide resolved
content/spin/http-outbound.md Outdated Show resolved Hide resolved

## Granting HTTP Permissions to Components Within a Spin App

> Components **within a Spin app can easily communicate with each other** via outbound http provided they are configured with `allowed_http_hosts = ["self"]`
Copy link
Contributor

Choose a reason for hiding this comment

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

I can't get GitHub to make this a suggestion because of embedded backticks, but here is a cough suggestion. Just aiming to clarify that self is not only in allowed_http_hosts and to build out a bit more info about the behaviour.


In an HTTP component, you can use the special host self to make HTTP requests within the current Spin application. For example, if you make an outbound HTTP request to http://self/api/customers/, Spin replaces self with whatever host the application is running on. It also replaces the URL scheme (http or https) with the scheme of the current HTTP request. For example, if the application is running in the cloud, Spin changes http://self/api to https://.../api.

Using self means that the application doesn't need to know the URL where it's deployed, or whether it's running locally versus in the cloud.

This doesn't work in Redis components because Spin uses the incoming HTTP request to determine the current host.

You must still grant permission by including self in allowed_http_hosts:

allowed_http_hosts = ["self"]

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks Ivan, this is REALLY helpful.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added in the new push.

tpmccallum and others added 5 commits September 15, 2023 09:21
Signed-off-by: tpmccallum tim.mccallum@fermyon.com

Co-authored-by: Mikkel Mork Hegnhoj <12242001+mikkelhegn@users.noreply.github.com>
Signed-off-by: Timothy McCallum <tim.mccallum@fermyon.com>
Signed-off-by: tpmccallum tim.mccallum@fermyon.com

Co-authored-by: Mikkel Mork Hegnhoj <12242001+mikkelhegn@users.noreply.github.com>
Signed-off-by: Timothy McCallum <tim.mccallum@fermyon.com>
Signed-off-by: tpmccallum tim.mccallum@fermyon.com

Co-authored-by: Kate Goldenring <kate.goldenring@fermyon.com>
Signed-off-by: Timothy McCallum <tim.mccallum@fermyon.com>
Signed-off-by: tpmccallum tim.mccallum@fermyon.com

Co-authored-by: itowlson <ivan.towlson@fermyon.com>
Signed-off-by: Timothy McCallum <tim.mccallum@fermyon.com>
Signed-off-by: tpmccallum <tim.mccallum@fermyon.com>
Signed-off-by: tpmccallum <tim.mccallum@fermyon.com>
Signed-off-by: tpmccallum <tim.mccallum@fermyon.com>
@tpmccallum tpmccallum merged commit 09b0e6d into main Sep 15, 2023
3 checks passed
@tpmccallum tpmccallum deleted the tpmccallum-patch-8 branch September 15, 2023 00:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants