Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

chore(examples): migrate to v2 manifest #1962

Merged
merged 6 commits into from
Oct 26, 2023

Conversation

vdice
Copy link
Member

@vdice vdice commented Oct 26, 2023

Ref #1947

I tried to keep all changes to just the spin.toml manifest file for each example, but cracked and had to include the following add'l changes as I tested/ran the examples:

  • Updates to a few outdated tinygo example READMEs
  • Minor update to the spin-timer README
  • Fix for the wasi-http-streaming-file to reference the correct file
  • Rename config-tinygo to variables-tinygo in line with pre-existing variables-rust and our no longer using "config" in the manifest

@vdice vdice requested review from lann, itowlson and michelleN October 26, 2023 18:36
@vdice vdice force-pushed the chore/examples-v2-manifest branch from 7ab87fb to 160387f Compare October 26, 2023 18:59
Signed-off-by: Vaughn Dice <vaughn.dice@fermyon.com>
@vdice vdice force-pushed the chore/examples-v2-manifest branch from 160387f to ff8b738 Compare October 26, 2023 19:00
@lann
Copy link
Collaborator

lann commented Oct 26, 2023

Sorry, I had meant to get a spin doctor migrator in place for this.

Copy link
Contributor

@itowlson itowlson left a comment

Choose a reason for hiding this comment

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

Only suggestion is very non-blocking and since your eyes must be bleeding by now I'm good with picking it up at some much later date!

[component.trigger]
route = "/outbound"
[component.build]

Copy link
Contributor

Choose a reason for hiding this comment

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

Non-blocking style suggestion: I would omit the blank line between the component data and the build section - especially when there are multiple components, the visual grouping helps keep the eye track them as a unit

Copy link
Member Author

Choose a reason for hiding this comment

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

Oh thank you @itowlson -- I meant to ask about preferred style for the manifests. Indeed, I'd like to align these to represent our suggested formatting. I see the templates you've updated follow your suggestion above, so I'll do the same. Let me know if there are any other style suggestions -- might as well implement them in this PR.

Copy link
Member Author

Choose a reason for hiding this comment

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

workdir = "outbound-http"
command = "cargo build --target wasm32-wasi --release"

[[component]]
id = "outbound-http-to-same-app"
[component.outbound-http-to-same-app]
source = "outbound-http-to-same-app/target/wasm32-wasi/release/outbound_http_to_same_app.wasm"
# To make outbound calls to components in the same Spin app, use the special value self.
# This is not yet supported in cloud.
Copy link
Contributor

Choose a reason for hiding this comment

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

This comment might be out of date

Copy link
Member Author

Choose a reason for hiding this comment

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

Indeed, I'm pretty sure it is. I'll create a separate PR to remove...

Copy link
Member Author

Choose a reason for hiding this comment

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

> [the Wasm examples](https://github.com/tinygo-org/tinygo/tree/release/src/examples/wasm).

Building this as a WebAssembly module can be done using the `tinygo` compiler:
# Spin component in TinyGo
Copy link
Contributor

Choose a reason for hiding this comment

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

omg it's like I read this three files ago. "you are in a mazy of twisty HTTP samples, all alike"

Copy link
Member Author

Choose a reason for hiding this comment

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

😂 good point... let me see about a more specific title.

Copy link
Member Author

Choose a reason for hiding this comment

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

vdice added 4 commits October 26, 2023 15:05
Signed-off-by: Vaughn Dice <vaughn.dice@fermyon.com>
Signed-off-by: Vaughn Dice <vaughn.dice@fermyon.com>
Signed-off-by: Vaughn Dice <vaughn.dice@fermyon.com>
Signed-off-by: Vaughn Dice <vaughn.dice@fermyon.com>
@vdice vdice force-pushed the chore/examples-v2-manifest branch from cf4e880 to 62ff297 Compare October 26, 2023 21:20
Signed-off-by: Vaughn Dice <vaughn.dice@fermyon.com>
@itowlson itowlson enabled auto-merge October 26, 2023 23:49
@itowlson itowlson merged commit d44e19b into fermyon:main Oct 26, 2023
9 checks passed
@vdice vdice deleted the chore/examples-v2-manifest branch October 27, 2023 00:07
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
No open projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants