-
Notifications
You must be signed in to change notification settings - Fork 30
feat: support only running a subset of components of a Spin app #323
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -56,7 +56,7 @@ Create a k3d cluster: | |
|
|
||
| ```shell | ||
| k3d cluster create wasm-cluster \ | ||
| --image ghcr.io/spinkube/containerd-shim-spin/k3d:v0.15.1 \ | ||
| --image ghcr.io/spinkube/containerd-shim-spin/k3d:v0.16.0 \ | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. wonder how we can keep this updated automagically There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. maybe we start pushing a |
||
| -p "8081:80@loadbalancer" \ | ||
| --agents 2 | ||
| ``` | ||
|
|
||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| main.wasm | ||
| .spin/ |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| module github.com/salutations | ||
|
|
||
| go 1.20 | ||
|
|
||
| require github.com/fermyon/spin/sdk/go/v2 v2.2.0 | ||
|
|
||
| require github.com/julienschmidt/httprouter v1.3.0 // indirect |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| github.com/fermyon/spin/sdk/go/v2 v2.2.0 h1:zHZdIqjbUwyxiwdygHItnM+vUUNSZ3CX43jbIUemBI4= | ||
| github.com/fermyon/spin/sdk/go/v2 v2.2.0/go.mod h1:kfJ+gdf/xIaKrsC6JHCUDYMv2Bzib1ohFIYUzvP+SCw= | ||
| github.com/julienschmidt/httprouter v1.3.0 h1:U0609e9tgbseu3rBINet9P48AI/D3oJs4dN7jwJOQ1U= | ||
| github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| package main | ||
|
|
||
| import ( | ||
| "fmt" | ||
| "net/http" | ||
|
|
||
| spinhttp "github.com/fermyon/spin/sdk/go/v2/http" | ||
| ) | ||
|
|
||
| func init() { | ||
| spinhttp.Handle(func(w http.ResponseWriter, r *http.Request) { | ||
| w.Header().Set("Content-Type", "text/plain") | ||
| fmt.Fprintln(w, "Goodbye!") | ||
| }) | ||
| } | ||
|
|
||
| func main() {} |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| spin_manifest_version = 2 | ||
|
|
||
| [application] | ||
| name = "salutations" | ||
| version = "0.1.0" | ||
| authors = ["Kate Goldenring <[email protected]>"] | ||
| description = "An app that gives salutations" | ||
|
|
||
| [[trigger.http]] | ||
| route = "/hi" | ||
| component = "hello" | ||
|
|
||
| [component.hello] | ||
| source = "../hello-world/main.wasm" | ||
| allowed_outbound_hosts = [] | ||
| [component.hello.build] | ||
| command = "pushd ../hello-world && tinygo build -target=wasi -gc=leaking -no-debug -o main.wasm main.go && popd" | ||
| watch = ["**/*.go", "go.mod"] | ||
|
|
||
| [[trigger.http]] | ||
| route = "/bye" | ||
| component = "goodbye" | ||
|
|
||
| [component.goodbye] | ||
| source = "main.wasm" | ||
| allowed_outbound_hosts = [] | ||
| [component.goodbye.build] | ||
| command = "tinygo build -target=wasi -gc=leaking -no-debug -o main.wasm main.go" | ||
| watch = ["**/*.go", "go.mod"] |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| apiVersion: core.spinoperator.dev/v1alpha1 | ||
| kind: SpinApp | ||
| metadata: | ||
| name: hello-salutation-spinapp | ||
| spec: | ||
| # TODO: change to image hosted at ghcr.io/spinkube/spin-operator/salutations when published | ||
| image: "ghcr.io/kate-goldenring/spin-operator/examples/spin-salutations:20241022-144454" | ||
kate-goldenring marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| replicas: 1 | ||
| executor: containerd-shim-spin | ||
| # Configure the application to only contain the "hello" component | ||
| # Who doesn't hate goodbyes? | ||
| components: ["hello"] | ||
kate-goldenring marked this conversation as resolved.
Show resolved
Hide resolved
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lol love the app name