Make it possible to start/stop/restart individual services
See original GitHub issueWhat should we add or change to make your life better?
I’m using Tye to run a couple of infrastructure containers (SEQ, Postgres, Cassandra, RabbitMQ, etc), a couple of our services as containers and the service(s) I’m currently working on as csproj(s). About ~20 services all in all.
I jump a lot between branches (code reviews, fixes here and there, etc) and most of the time I want to keep a base set of containers running sine they hardly ever change between revisions. But, I would like to be able to stop, start and restart specific services (both containers and csprojs) on demand.
Restarting Tye entirely can take a long time, when maybe all I really want is to restart a single service or change the version of an image. I have tried to use watch
where that is applicable, but unfortunately that causes VS to hang depending on what parts of the code that changes (a common lib for example). And it doesn’t work when changing image versions.
I think there are a couple of different commands that would help me in my daily work. All of these would require that Tye can run in detached mode:
tye run <service name>
. Would make it possible to add a specific service to the current Tye instance.tye stop <service name>
. Would stop a specific service.tye restart <service name>
. Would restart a specific service.
I wanted to see how feasible this is with the current architecture of Tye, so I did a small PoC where I made it possible to restart a single (csproj) service from the Dashboard. You can have a look at it here. It seems to be working fine, but would require a bit of refactoring, it’s not the prettiest solution at the moment.
I would love to spend more time on this and make a proper PR, and I really think it would add a lot of value.
Why is this important to you?
Tye has really simplified my daily workflow, in that it lets me run a combination of containers and csprojs together. I also really like that I can configure them and easily decide what to run in a single file.
Unfortunately, jumping around between branches forces me to restart Tye entirely between each run, which takes a lot of time.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:31
- Comments:5 (1 by maintainers)
Top GitHub Comments
Thanks for the feedback @jooooel . Your scenarios is definitely not unique, and the suggestion you have seems promising.
We have a few ideas around improving the inner loop speed in tye, especially around running multiple times. One idea we are thinking about is a daemon mode where tye is always running and commands to tye run would just add them to the daemon. That way in your example, you could arbitrarily start and stop specific services accordingly. This also would allow you to have things always running in the background without having them restart on each execution of tye run.
I could see it looking like this:
tye run
is the same as today, ctrl-C to kill all things that are started with tye runtye start
does tye run but returns after all projects/images are startedtye stop
stops images and projects that are already runningtye restart
does the restartAlso, all of these could be specified for a specific service.
This would be a very nice feature. I’ve found that using tye, I need to continuously stop all services to see the new updates.