-
Notifications
You must be signed in to change notification settings - Fork 25
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
feat: support only running a subset of components of a Spin app #323
feat: support only running a subset of components of a Spin app #323
Conversation
2bf7c2d
to
0f44cc3
Compare
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.
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:
|
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.
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. |
@@ -14,7 +14,7 @@ jobs: | |||
runs-on: ubuntu-latest | |||
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] |
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
@@ -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 comment
The 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 comment
The reason will be displayed to describe this comment to others. Learn more.
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.