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

allowing stdin when running an app using command trigger #37

Open
rajatjindal opened this issue Jul 15, 2024 · 7 comments
Open

allowing stdin when running an app using command trigger #37

rajatjindal opened this issue Jul 15, 2024 · 7 comments

Comments

@rajatjindal
Copy link

I am working on a wasm-console, which requires stdin capabilities. I discussed this briefly on discord and Radu suggested a fix, which worked.

I wanted to check with the team if we are ok with including this unconditionally or we should make this configurable (e.g. via a trigger config)?

thanks in advance.

@rajatjindal
Copy link
Author

FWIW, I think including this unconditionally should be ok (and expected default) when writing commands using webassembly.

radu-matei added a commit to radu-matei/spin-trigger-command that referenced this issue Jul 15, 2024
ref fermyon#37

This commit unconditionally inherits the `spin up` process' stdin.

Given the goal of this trigger is to execute Wasm components to
completion, it makes sense to inherit stdin from the parent's process
and potentially block on waiting for user input.

Signed-off-by: Radu Matei <[email protected]>
@lann
Copy link

lann commented Jul 15, 2024

I think it would be fine for this to be the default for a future e.g. spin run plugin subcommand, but it would be very tricky to make this the default for spin up because of multi-trigger apps.

@radu-matei
Copy link
Member

Are we allowing multi-trigger apps today though?

@rajatjindal
Copy link
Author

but it would be very tricky to make this the default for spin up because of multi-trigger apps.

but it won't block until user explicitly blocks on stdin right? (in which case it should be ok?)

@lann
Copy link

lann commented Jul 15, 2024

Are we allowing multi-trigger apps today though?

I mean multiple trigger executors/types.

but it won't block until user explicitly blocks on stdin right? (in which case it should be ok?)

The issue would be with multiple trigger executors trying to read stdin; spin up should "forward" stdin to only one trigger executor.

@rajatjindal
Copy link
Author

IIRC, I saw somewhere in spin that stdin is a buffer that is passed. if that is true, then maybe it does not matter if multiple components are asking for stdin.

But also open to other suggestions? maybe an explicit config to ask for stdin?

@lann
Copy link

lann commented Jul 17, 2024

One option would be a e.g. --stdin-trigger-type command flag for spin up which would only "forward" stdin to that trigger executor. I would expect that to be the default for any e.g. spin run subcommand.

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

No branches or pull requests

3 participants