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

local_resource should have a way to expose stdin #3442

Open
nicks opened this issue Jun 11, 2020 · 3 comments
Open

local_resource should have a way to expose stdin #3442

nicks opened this issue Jun 11, 2020 · 3 comments
Labels
enhancement New feature or request

Comments

@nicks
Copy link
Member

nicks commented Jun 11, 2020

Repro steps:

  1. Checkout tilt
  2. Add this Tiltfile
local_resource('web', serve_cmd='cd web && yarn run start')

Expected behavior:

We should start up the tilt webpack server on 3000

Actual behavior:

The tilt webpack server dies with exit code 0 immediately

The problem:

Webpack exits immediately if no stdin is attached to the process

The workaround:

Rewrite the Tiltfile like this:

local_resource('web', serve_cmd='cd web && tail -f /dev/null | yarn run start')

which creates a "dumb" stdin that webpack can pull from forever

Possible solutions:

Most orchestration systems have an stdin parameter so you can specify stdin
https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.18/#container-v1-core

@nicks nicks changed the title local_resource should have a way to expose stding local_resource should have a way to expose stdin Jun 11, 2020
@nicks nicks added the enhancement New feature or request label Jun 11, 2020
@emschwartz
Copy link

Just ran into this issue trying to get Tilt to run the webpack dev server. In case anyone else searches for the error, it prints Server exited with exit code 0. Adding ail -f /dev/null | yarn start resolved the issue.

@lizzthabet
Copy link
Contributor

@nicks, does #5641 solve this issue? i'm able to run the tilt webpack dev server without any problems.

@nicks
Copy link
Member Author

nicks commented Apr 25, 2022

@lizzthabet nope! that's just for local() in the tiltfile.

i wouldn't be surprised if webpack got fixed to handle this mode, but there are still lots of tools that don't handle stdin correctly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants