feat: support only running a subset of components of a Spin app#323
Conversation
2bf7c2d to
0f44cc3
Compare
calebschoepp
left a comment
There was a problem hiding this comment.
Looking for a few cleanup things but I think this is on the right track!
Signed-off-by: Kate Goldenring <kate.goldenring@fermyon.com>
0f44cc3 to
d4fa84d
Compare
|
@calebschoep CI is failing with: |
calebschoepp
left a comment
There was a problem hiding this comment.
Thanks for addressing those comments!
I re-ran the test and it passed. Looks like flakiness? Not sure why it would be flaky though b/c we always make sure the executor is set before referencing it. |
| strategy: | ||
| matrix: | ||
| app: [cpu-load-gen, hello-world, outbound-http, variabletester, redis-sample] | ||
| app: [cpu-load-gen, hello-world, outbound-http, variabletester, redis-sample, salutations] |
| ```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.
wonder how we can keep this updated automagically
There was a problem hiding this comment.
maybe we start pushing a latest tag?
|
Could we add an e2e for this (or an issue) as a follow up task |
@michelleN sure. I'll add that as a follow up and use it as an opportunity to update the image reference to one in the spinkube GHCR |
|
@michelleN @endocrimes @calebschoepp feel free to merge whenever appropriate. I don't have perms |
|
@calebschoepp @michelleN @endocrimes I realized i need to add support to Spintainer executor as well but adding the diff --git a/internal/controller/spinapp_controller.go b/internal/controller/spinapp_controller.go
index f3e3ff3..66dbe78 100644
--- a/internal/controller/spinapp_controller.go
+++ b/internal/controller/spinapp_controller.go
@@ -461,10 +461,16 @@ func constructDeployment(ctx context.Context, app *spinv1alpha1.SpinApp, config
ReadinessProbe: readinessProbe,
}
} else if config.SpinImage != nil {
+ components_flag := ""
+ if app.Spec.Components != nil {
+ for _, component := range app.Spec.Components {
+ components_flag = fmt.Sprintf("--component_id=%s", component)
+ }
+ }
container = corev1.Container{
Name: app.Name,
Image: *config.SpinImage,
- Args: []string{"up", "--listen", fmt.Sprintf("0.0.0.0:%d", spinapp.DefaultHTTPPort), "-f", app.Spec.Image, "--runtime-config-file", "/runtime-config.toml"},
+ Args: []string{"up", "--listen", fmt.Sprintf("0.0.0.0:%d", spinapp.DefaultHTTPPort), "-f", app.Spec.Image, "--runtime-config-file", "/runtime-config.toml", components_flag},
Ports: []corev1.ContainerPort{{
Name: spinapp.HTTPPortName,
ContainerPort: spinapp.DefaultHTTPPort, |
Signed-off-by: Kate Goldenring <kate.goldenring@fermyon.com>
|
Added test here: #328 |
Draft until support for executing only a set of components is merged in the shim: spinframework/containerd-shim-spin#197
Spin changes: spinframework/spin#2826.