-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Support --detach
flag in docker stack deploy / rm
#373
Comments
When |
Perhaps the same (set of) progress bars as for service create/update - grouped per service (although I can see that becoming too verbose with large stacks containing lots of services Should we have someone from the UX / design team craft a design? |
That might be overkill. We need to keep it consistent with the service commands, so I think there are only really two options. Either progress of tasks (grouped if possible as you've suggested) or progress of services. |
Progress of services seems a good choice to me. When I'm deploying a stack of a few services the number of underlying tasks can be large and progress can be overwhelming. I would quickly tune out of it. |
IIRC, the progress bars for services already have a threshold; if more than X tasks for a service, then a single progress bar is shown, instead of per task (I should check the code) |
I'd say that anything returning Progress bars are definitely a nice addition, but it's more important IMO to be able to know if your deployment succeeded or not. Currently, you cannot reliably deploy using compose file from a CI service. Given that |
I just noticed the origin issue (moby/moby#32367) suggested the progress bars would be one per service, instead of per task. |
@dnephin It is my impression that that is how |
No, I'm pretty sure all the |
@dnephin You are correct, of course. I suppose any command that is supposed to show the status of multiple services interactively should provide a similar user experience? Which would that be, one progress bar per task, or one per service? |
Based on that, a similar approach should probably be used for stack deploy, showing tasks if tasks<maxProgressBars, and services if it exceeds that constant. |
I'm very interested about that one. I don't know about you guys but typically we use to run our e2e tests on a true docker (mono host) swarm... so very handy to easily know when we can launch our e2e test suite against the deployed infra. I'm ok to work on this one but 1st I have to understand well on what I can rely. I've listed the current/desired states returned by
Also the Note: Since few weeks we also have some services deployed with a restart policy condition to |
Ok, after some further investigation in fact it's pretty straight to the point as docker stack deploy implementation call under the hood some service update/create that already support |
I have created this project until this feature is available in docker cli: https://github.com/karibbu/docker-php |
Until this feature is implemented, how do I tell if a stack was updated successfully? |
Any update on this, or on nullobject's question above? |
Is there any news when this could be implemented? I'd like to use |
For deploying stack with Ansible, I modified You can find the modified module in this gist, hope it's useful. |
@ushuz I didn't know about that module. Thank you! |
--detach
flag in docker stack deploy--detach
flag in docker stack deploy / rm
Updates? |
Is there a target release date for this enhancement? |
I don't think someone is working on this currently, but contributions welcome if someone wants to work on this |
Without this feature, it is not clear whether we should proceed to the next step in CI/CD or not. Also, it is not clear, what happens if we run |
@drozzy: We have the same problem, but we solved it with few lines of Powershell. Run this right after your Do { $Services = $(docker stack services [YOUR-STACK-NAME] -q); $Inspects = (docker service inspect $Services) | ConvertFrom-Json $Updating = @(); $Completed = @(); $Rolledback = @(); ForEach ($Service in $Inspects | Where-Object { $_.UpdateStatus -ne $null }) { if ($Service.UpdateStatus.State -eq 'completed') { $Completed += $Service } elseif ($Service.UpdateStatus.State -like 'rollback*') { $Rolledback += $Service } $Updating += $Service; } "Waiting for {0} service(s) to update ({1} completed / {2} rollback)" -f $Updating.Count, $Completed.Count, $Rolledback.Count Start-Sleep 5 } Until ($Updating.Count -eq ($Completed.Count + $Rolledback.Count)) |
Thanks, but my understanding was that swarm accepts the command right away and you’re free to logout of the shell? Are you saying you need to hang around until it’s all done? What if there is an error and rollback or failure with an unhealthy service? |
@drozzy Once the That doesn't mean that the deployment is done, in the sense that all services are running. But, the CLI's job is done, and it's up to the swarm to reach the desired state. |
@drozzy: Yes. We wait on all our updates is completely done - so we can warn the developers about a rollback action, if anything has failed in the deployment. We have some extra code to mark a deployment as failed. But I don't copied that, into the code snippet above :-) |
Thanks guys! Is there any way to know that a rollback was done (if I set my docker swarm to rollback automatically)? Perhaps some sort of event is fired? If not, I guess I would have to do something along the lines as @sorenhansendk suggested. But I think this is something docker swarm should provide out of the box (unless I'm missing something?) |
@drozzy: Yes - please change this line:
to this one:
|
Adding to the list of external implementations, here's a script to run after a |
I'd like to share my script waiting for Compared to existing solutions it shows update progress per instance of each service.
|
If someone would like to discuss being funded to work on this issue, please gimme a shout [email protected]. We need this as part of a project which we're using swarm as the underlying orchestrator and having to write custom workarounds for the fact that |
It's been almost 2 years since the last activity on this ticket... makes me think the devs don't really actively monitor these tickets, which is unfortunate for such a widely used product. If they really wanted to compete with k8s, they'd prioritize quality-of-life features like this. |
Hey everyone 👋 I got to work on this long-standing issue with the help of @withlogicco! I hope to close this one soon! In the meantime, you can test the binary (2023.05.03-master.withlogicco.detach) that includes implementations of the Happy deployments! |
Yessss @gmargaritis! Let us know how we can support you! This feature is so so so needed. In our downstream project, we implemented a work-around that kept things going for the time bring but I'd love to have this upstream functionality. More in https://git.coopcloud.tech/coop-cloud/organising/issues/209 |
Closing, as this has been implemented for the upcoming v26.0 release in; With the above PRs merged, this feature is functional, but the UX is not perfect yet, so a tracking-ticket is created to look at future improvements; |
👋 @thaJeztah, Thank you for your comments and co-ordination! Also, I would like to thank @withlogicco for supporting me in this one! I’ll be more than happy to continue with a follow-up, and make it even more user-friendly. |
@gmargaritis can i just say you're an absolute hero for fixing this. some heroes do not wear capes. you deserve a medal! this makes the entire ecosystems deployments and undeployments more stable. it's really wild how much impact this change has... already enjoying the benefits! |
@decentral1se Super happy to hear that it's already making an impact 🎉 Thank you for the kind words ✌️ |
The
docker stack deploy
command should support a--detach
flag much like thedocker service create
anddocker service update
commands.The text was updated successfully, but these errors were encountered: