tilt-dev / tilt

Define your dev environment as code. For microservice apps on Kubernetes.
https://tilt.dev/
Apache License 2.0
7.59k stars 298 forks source link

Tilt daemon? #4288

Open markgarrigan opened 3 years ago

markgarrigan commented 3 years ago

Describe the Feature You Want

tilt up run as a background process tilt stop would stop the process. Same as ctrl+c during a tilt up process.

Maybe this already exists?? My apologies for not searching hard enough.

Current Behavior

tilt up takes my console

Why Do You Want This?

As a developer, I might want to tilt up on one microservice. Then as I'm working I realize that I want another microservice tilting. I have to open another console and run the tilt args command and I have to remember the tilt up command so that tilt args doesn't stop tilting things that are already tilting. Then if I wanted to do this again. I'd go to the console where I ran tilt args and up arrow then edit the last command.

I'm working on a little CLI where a developer can interactively choose the microservices they want to tilt. Then it runs the tilt up command with those microservices. If tilt was running in the background then the developer could just be in the same console run a command from this CLI and choose to add more microservices and I'd run the tilt args command for them.

Hope that makes sense.

Additional context Add any other context or screenshots about the feature request here.

landism commented 3 years ago

This feature doesn't already exist. Thanks for filing!

The title and first two sections all sound like #4278.

The "why do you want this" section makes me wonder if your concern is more about how awkward it is to edit the set of running enabled services, along the lines of #4039, and maybe the daemonization is less important?

markgarrigan commented 3 years ago

Hmm.. Right.

What if... thinking out loud.... there was a way to start tilt with NO resources started. But it still reads all Tiltfiles and starts the UI. Then in the UI you can just click on resources you want to "tilt up". In that same vein, could the UI also have a "tilt down" button on individual resources? Or a "tilt stop" button that would keep the resource in the cluster but just stop "tilt up" for that resource. That would negate the need for my rudimentary CLI that is sort of doing the same thing.

TimothyLoyer commented 3 years ago

What if... thinking out loud.... there was a way to start tilt with NO resources started.

I've been working on a setup script, and I was attempting to make this exact thing happen. tilt args has the --clear flag which leaves your Tilt session in a similar state, but as far as I could tell there was no way to start Tilt with no resources. If there is a way, it would be really useful. I ended up started it with a single local resource I needed to generate certificates.

nicks commented 2 years ago

some related things we've shipped recently:

cli commands tilt enable and tilt disable: https://docs.tilt.dev/cli/tilt_enable.html https://docs.tilt.dev/cli/tilt_disable.html

the tiltfile api config.clear_enabled_resources(), which lets you specify that tilt up should start with nothing enabled https://docs.tilt.dev/api.html#modules.config.clear_enabled_resources

i still would like to make some improvements here to the cli where you can see all the running tilt instances (sort of like kubectl config get-contexts), and "down" an instance that's running in the background

springroll12 commented 1 year ago

Any progress on this? Requiring tilt to be in the foreground of a terminal is very annoying as a developer. If I want to convince my team to use this tool, it would be nice if it had a way to simply start/stop without occupying a terminal.

Realistically we should be able to spawn the UI without a terminal being open either.

nicks commented 1 year ago

i think you can currently do this as:

tilt up &
sirodoht commented 1 year ago

i think you can currently do this as:

tilt up &

Does this work for people? Doesn't seem to work me.

joeblubaugh commented 1 year ago

@sirodoht it doesn't work for me because tilt needs stdout and stdin. If you redirect stdout and stdin I've been able to make it work: tilt < /dev/null > /dev/null up &

FFdhorkin commented 6 months ago

@sirodoht it doesn't work for me because tilt needs stdout and stdin. If you redirect stdout and stdin I've been able to make it work: tilt < /dev/null > /dev/null up &

The problem with this is that tilt down doesn't kill Tilt - it stops the services, but if you try to run it again, you'll get an error about the port being in use. So you end up having to do tilt down && pkill tilt which is fairly tedious/verbose for a frequently used command.