-
-
Notifications
You must be signed in to change notification settings - Fork 52
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
equivalent of docker-compose run: start and attach to process (stdin\stdout) while running deps in background #83
Comments
somehow related to #64 |
it would be great if anything that follows the service name would be passed to the main process as command line argument, so the usage would be
|
Any idea how much work this could be? |
I started to look at this issue before I had to deal with other things. Today there is no good way (at least a way I could find) to embed another process with stdin into the TUI 3rd party that I use. Will it work for you if I provide this functionality without TUI? BTW the In any case, I will try to contact the rivo/tview developer for assistance. I saw that many have tried to achieve something similar, but there are no documented cases of success... |
Thanks for looking into this @F1bonacc1! My use case is for running tests, either as one-shot execution in CI or interactively (in —watch mode) during local development. So TUI is not required. I have actually implemented what I need yesterday while flying back from holidays, I’ll push the branch later tonight and share here so we can have a discussion about it. |
opened a draft PR so we can discuss the implementation: #89 |
Just to add to this discussion, I'm having to resort to this quite lengthy bash script, since there is no easy way to integrate the process-compose readiness into a linear bash script at the moment for CI test runs: |
#89 Is merged in v0.75.1 |
Feature Request
I'd like to be able to run a selected process in forground, with stdin\stdout attached, so that I see it's logs and interact with it from command line. All of it's dependent processes should run in the background (no logs output shown in terminal).
This would be similar to docker-compose run $SERVICE_NAME
For example, given the following
docker-compose.yaml
:when I run
docker-compose run main
, I see the following:which then allows me to provide input at the prompt
the
deps
container keeps running in the background until the main process exits.Use Case:
I'd like to be able to run tests as the main process and a bunch of deps (databases) as other processes in the background. The main process needs to wait for deps before it starts. I am only interested in seeing the test logs in the terminal, and I'd also like to provide input to the test process while it's running: for example, the jest test runner, when ran in
--watch
mode, can be controlled with various keyboard shortcuts which allow to rerun all tests, or only ones that failed.Proposed Change:
Addition of:
run
command, taking 1 process name as argument: this would start all process defined in the config file, while attaching to the named processrun
sub-command to theprocess
command, taking 1 process name as argument: this would start (and attach to) only given process. with all processes in it's dependency tree running in the backgrounda
--no-deps
flag could be nice to haveWho Benefits From The Change(s)?
People who'd like to use PC to interactively run some process, while also running other process on which the main one depends
Alternative Approaches
One could run deps in PC, while the main process outside of it, and use a wrapper script to start\stop PC as needed.
Also, a workaround I am currently using in CI, when running test process and it's deps via PC (with a config similar to this), is a following bash script:
This way only output of
tests
process is shown in CI logs.However this would not work if interaction with the
tests
process was required, like when running tests viajest --watch
.The text was updated successfully, but these errors were encountered: