Repository navigation
[Compose Spec] Make 'run' behave in the same way as 'up' - #7457
Conversation
|
From user perspective, this is how this addition feels: |
|
I am not a huge fan of doing a |
|
Rebased PR on latest |
|
Could someone review this? Thank you! |
|
Hey @rumpl @ndeloof @ulyssessouza - do you have any feedback on this? |
|
Hey @rumpl @ndeloof @ulyssessouza - could you take a look at this PR when you got a moment please? |
|
Now that Compose Spec has been landed, it make sense to merge this PR since it ensures the Hey @rumpl @ndeloof @ulyssessouza, could you take a look? |
|
Hi @EricHripko I can have a look at this but can you rebase it first please? |
|
@aiordache thanks for working with me on this 👍 I've rebased the PR and fixed the tests - looks all green and ready to review 🙂 |
|
Thank you @EricHripko! I had a look and tested the workflow and it works pretty well. I was thinking though why don't we let the |
|
Thank you for taking a look @aiordache 👍 I've re-implemented this using I still need to fix up a few tests, but would love to hear if I'm heading in the right direction 🙂 |
|
I tested the new changes and a small thing to fix is, on a successful run command, we need to press enter to get the shell prompt of the container. |
|
Thanks for your feedback @aiordache 👍 That's interesting - I've not noticed this issue despite testing natively on Windows and inside WSL2. Will try on Mac or a Linux VM to see if I can reproduce. As an aside, I've just updated |
|
@aiordache, I've had a go at Mac as well and I am unable to reproduce this. |
|
@EricHripko I tested it on two different machines running Arch linux (bash shell). |
|
Thank you for sharing this @aiordache 👍 I've tried this on Ubuntu (in bash) and had the following results: Will install Arch to further eliminate the affecting factors. Could you please share the command that exhibits the bug too? |
|
@EricHripko I tested this command: I tried now the |
|
Ah - great! I can indeed confirm that I see the same issue with |
|
Curious; how does this interact with |
|
@thaJeztah, it'll skip the checks if |
|
@aiordache, found the root cause for the issue. It appears that my changes were trying to "start" the container twice. This caused weirdness in some shells. I've simplified the code now and will push once tests look good. |
|
@aiordache this should be all green and ready for review 🙌 I've also updated the PR Overview to include the latest information about how it was implemented and what UX is like 🙂 |
|
Thank you @EricHripko for the effort to get this done. I have tested the latest changes and it works great! If you check my last comment and stash the commits, I could merge this tomorrow unless anybody else sees an issue with it. |
Signed-off-by: Eric Hripko <ehripko@bloomberg.net>
|
Awesome 🎉 Thank you for your review and mentoring throughout this PR - really appreciate it 🙂 I've addressed your feedback and squashed the PR down to a single commit. |
Overview
This PR updates
docker-compose runto wait forcondition: service_healthydependencies to become healthy. This effectively reflects the behaviour thatdocker-compose uphas.Resolves #7453.
Implementation Summary
Project.upnow takes care of creating the one-off container:one_offConvergencePlanProject.updoesn't start the one-off container, this is still responsibility ofrun_one_off_containerPre-commit hooks
According to
script/test/defaultpre-commit hooks pass:Other Changes
(rebased to pick this up from main branch)service.pyandmain.pyhave 2 additional changes I had to apply in order to get pre-commit hooks (namely,flake8) to passforceparameter inremove_containersince it doesn't actually get usedUser Experience
An extra
Creating <project>_<service>_run ... donewill be printed to the terminal in addition to dependency information that's already printed. Examples of happy paths:We're also now getting
upchecks for free. For example, if a dependency is unhealthy andcondition: service_healthywas specified, the following will happen:Testing
docker-compose runindeed works as expected