Skip to content
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

Support multi trigger apps #53

Merged
merged 3 commits into from
Apr 15, 2024

Conversation

rajatjindal
Copy link
Member

@rajatjindal rajatjindal commented Mar 27, 2024

This PR adds support for running Spin apps with multiple triggers. I opened the draft PR to be able to collect some initial feedback.

I've also added a testcase to demonstrate running the multi-trigger-app workload and will be working on adding the integration test for the same.

@rajatjindal rajatjindal force-pushed the support-multi-trigger-app branch 5 times, most recently from ef00656 to cbcac65 Compare April 3, 2024 04:47
@rajatjindal rajatjindal marked this pull request as ready for review April 3, 2024 05:26
@rajatjindal rajatjindal requested a review from Mossaka April 3, 2024 05:26
Comment on lines 248 to 249
// exit as soon as any of the trigger completes/exits
let (result, _, rest) = future::select_all(futures_list).await;
Copy link
Contributor

@jsturtevant jsturtevant Apr 3, 2024

Choose a reason for hiding this comment

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

Why as soon as one completes? Would that mean if the result of one of the others failed we wouldn't know about it? should we be waiting for all triggers finish, or some type of queue to handle the various results?

Copy link
Member Author

Choose a reason for hiding this comment

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

Hello James,

this is to keep it in sync with the Spin behavior

Copy link
Member

Choose a reason for hiding this comment

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

could we add a log to print which trigger failed / terminates?

Copy link
Member Author

Choose a reason for hiding this comment

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

👍

time="2024-04-04T02:58:27.951588261Z" level=info msg=" >>> trigger type 'redis' exited"

Copy link
Member Author

Choose a reason for hiding this comment

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

@jsturtevant - does that answer your question? (re: exit behavior). thanks.

Copy link
Contributor

Choose a reason for hiding this comment

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

this is to keep it in sync with the Spin behavior

Interesting! I guess we should do the same as spin cli, thanks!

Copy link
Member Author

@rajatjindal rajatjindal Apr 4, 2024

Choose a reason for hiding this comment

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

one other interesting difference (please correct me if I am wrong), is that Spin starts a new process for most of these triggers and shim does not.

I am not sure if that makes any difference or if we could do that (start further child process) in shim at all. but i thought it will be good to note that difference here.

Copy link
Member

@Mossaka Mossaka left a comment

Choose a reason for hiding this comment

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

Mostly LGTM, there is one pending comment from James that I am interested in seeing resolved as well.

@rajatjindal rajatjindal force-pushed the support-multi-trigger-app branch from a1dc1a6 to cf672ff Compare April 4, 2024 05:17
@rajatjindal rajatjindal requested a review from Mossaka April 4, 2024 19:19
@rajatjindal rajatjindal force-pushed the support-multi-trigger-app branch from cf672ff to 12aa63f Compare April 9, 2024 17:02
@rajatjindal
Copy link
Member Author

Hi @kate-goldenring / @Mossaka , I have rebased this PR and it is ready for review again. thank you

Copy link
Member

@Mossaka Mossaka left a comment

Choose a reason for hiding this comment

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

LGTM

@Mossaka
Copy link
Member

Mossaka commented Apr 10, 2024

Need a rebase

@kate-goldenring
Copy link
Collaborator

@rajatjindal it looks like the multi trigger app failed to run in the CI (even though the test passed): https://github.com/spinkube/containerd-shim-spin/actions/runs/8619544944/job/23625457710?pr=53#step:8:1234

@rajatjindal rajatjindal force-pushed the support-multi-trigger-app branch 3 times, most recently from 0bcc203 to ec798c4 Compare April 15, 2024 11:17
Signed-off-by: Rajat Jindal <rajatjindal83@gmail.com>
@rajatjindal rajatjindal force-pushed the support-multi-trigger-app branch from 9252b50 to 3b8a4bd Compare April 15, 2024 11:34
@rajatjindal
Copy link
Member Author

rajatjindal commented Apr 15, 2024

@rajatjindal it looks like the multi trigger app failed to run in the CI (even though the test passed): https://github.com/spinkube/containerd-shim-spin/actions/runs/8619544944/job/23625457710?pr=53#step:8:1234

I looked at the failure. this test multi-trigger app also require redis pod to be running. I think what we saw in that CI failure was a transient error while redis-pod was getting ready.

The assertions in integration tests would pass only if the multi-trigger app is running and expected responses are returned from it.

I reran the tests as part of rebasing this PR, and tests seems to be working as expected.

Please let me know if you think there is something else that might be triggering this behavior, i am happy to investigate more in that case.

Signed-off-by: Rajat Jindal <rajatjindal83@gmail.com>
Signed-off-by: Rajat Jindal <rajatjindal83@gmail.com>
@rajatjindal rajatjindal force-pushed the support-multi-trigger-app branch from 3b8a4bd to 9229593 Compare April 15, 2024 12:20
@rajatjindal
Copy link
Member Author

Hi @kate-goldenring @Mossaka , this PR has been rebased now, and seems to be ready for final set of review/merge.

Thank you so much for your patience while I got this PR into a stable state.

Copy link
Contributor

@devigned devigned left a comment

Choose a reason for hiding this comment

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

lgtm

@devigned devigned merged commit 0892076 into spinkube:main Apr 15, 2024
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants