-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #323 from kate-goldenring/component-filtering
feat: support only running a subset of components of a Spin app
- Loading branch information
Showing
12 changed files
with
99 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
main.wasm | ||
.spin/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 <kate.goldenring@fermyon.com>"] | ||
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"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | ||
replicas: 1 | ||
executor: containerd-shim-spin | ||
# Configure the application to only contain the "hello" component | ||
# Who doesn't hate goodbyes? | ||
components: ["hello"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters