Synchronous service create and service update#31144
Conversation
|
@aaronlehmann what happens if the service created can't be scheduled, because of constraint that cannot be fullfilled for example ? How should it behave ? |
|
I like the feature but it would be a huge breaking change. It feels a bit like the I can see use-cases for this, but should we also attach to the service logs after the service was deployed (like Let me add this to the next maintainers meeting to get more eyes / open the discussion |
You would see one or more of the tasks stuck at "pending". This synchronous mode gives visibility into the problem, which would otherwise require a "service ps" command to notice. |
Would it output the error messages / reason for being unable to deploy the task? |
|
Not at present, but that's definitely possible. |
|
+1 for the feature, -1 for changing the default immediately. I think we need to put it behind a flag for now. We can add a warning when no flag is used, and change the default in a release or two. Changing the default is going to break people who use this command in scripts. |
|
We should also look at this for We discussed this in the maintainers meeting, and like the feature, but (for now) to not be the default. |
|
Huge +1 It's also going to "fix" the workflow for many people that currently do a Or worse - people that just do UX Feedback:
Looks amazing so far! |
|
Looks awesome.
|
|
I'm with @dnephin: huge 👍, but I wouldn't change the default. |
|
Nice work! Regarding re-usability of the service progressbar for other clients that potentially want to display service updates (eg, |
e0e4edd to
1b820c9
Compare
1b820c9 to
76b6a16
Compare
|
Thanks for all the comments. I've updated this to address the feedback. Details below, and new demo here: https://asciinema.org/a/9f9rgk0e7fczkxi5vfu7yofmw
I've changed the behavior so the default is unchanged, and the
Done.
This was an artifact of the progress bar code. I've now added an option that suppresses it.
Changed this so it has a countdown now.
Changed to plain text
Demo linked above. I've done some more testing and refinement of this now. Unfortunately it's not especially straightforward to show the task error, because the ID of the task that paused an update is inside a textual message. But we can figure something out if this would be a big usability win.
Done
Blocked on #31108
It says why. I'm not sure about the "how to continue" part. Any suggestions for what the message should say?
Moved to |
Regarding the verification time - how are we picking the 45 seconds? Also, is this looking at task status or update status? As in, do we take into account the rollback threshold? |
Yeah, but I'm not sure we want to recommend that, because usually there's an underlying problem that should be fixed.
I set
Sort of a mix of both. Basically, if the update pauses or rolls back, we'll see that in the update status. But the progress bars and countdown are driven by task status. |
|
Looks great :) Do we have some CLI designers in the house? @dnephin feedback? |
|
Design LGTM |
|
Hi |
76b6a16 to
9df2fb0
Compare
|
Thanks everyone! |
|
Is there a lil asciinema or GIF of this? |
|
@nathanleclaire: https://asciinema.org/a/9f9rgk0e7fczkxi5vfu7yofmw (slightly out of date, but mostly the same as what was merged) |
|
Hey guys, per @vieux request Play With Docker has been updated with this patch. You can play with it there. Let me know in case you need me to change anything. |
|
@aaronlehmann Great to see this merged 👍 Is there going to be a follow-up for Also, a minor detail: |
Could it be that (because |
|
@thaJeztah No, that would require me putting |
|
@sirlatrom interesting; could you open an issue for that, so that it can be looked into? It should be either fixed, or at least documented |
|
@thaJeztah I believe this is how the go flags package (or whatever is being used in the Docker CLI) works, so it's really just working as designed. The |
|
It's because boolean flags can take an optional argument. |
|
@marcosnils Cool! |
…ommands Synchronous service create and service update
|
This looks great, thank you. Just a quick one if anyone is aware - are there any plans to integrate this with docker stack deploy which in a nutshell creates/updates a collection of services? Thanks again! |
|
@thaJeztah - Thank you. |
Change "service create" and "service update" to wait until the creation or update finishes, when
--detach=falseis specified. Show progress bars for the overall operation and for each individual task (when there are a small enough number of tasks), unless-q/--quietis specified.Internals:
Cosmetic/UX:
^C, the command should print a notice that the creation or update is still continuing in the background.cc @docker/core-swarmkit-maintainers @tiborvass @anusha-ragunathan