Skip to content
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

[cli] graceful stop command #3968

Merged
merged 5 commits into from
Jan 31, 2017
Merged

[cli] graceful stop command #3968

merged 5 commits into from
Jan 31, 2017

Conversation

benoitf
Copy link
Contributor

@benoitf benoitf commented Jan 31, 2017

What does this PR do?

Introduce graceful stop command for cli
by default, stopcommand is performing a graceful stop : stop all services then stop and remove containers
using --forcethe graceful stop is not done : we stop containers and remove containers

auth can be used with --user and --password

What issues does this PR fix or reference?

#3886

Changelog and Release Note Information

Changelog

Add graceful stop (disable with --force) in CLI

Release Notes:
We have introduced a way to perform a graceful stop of Che. Previously, Che server stops would be timeout based, meaning that if any workspaces were running when the Che server was stopped, they would continue to run. We have introduced a graceful stop that will initiate shutdown of all workspaces before initiating a shutdown of the server. If workspaces are configured to auto-snapshot during stop, then graceful stop will wait for all workspaces to be snapped before stopping the server.

The default CLI stop command now performs a graceful stop. It stops all services then stops and remove containers. You can optionally add a --force option to stop and remove containers without waiting for workspaces to stop. For authenticated servers like Codenvy, authentication can be provided by --user and --password.

default graceful stop: docker run ... eclipse/che stop
skip graceful stop: docker run ... eclipse/che stop --force
use auth : docker run ... eclipse/che stop --user <myemail> --password <my-secret>

Docs Pull Request

eclipse-che/che-docs#117
codenvy/docs#61

Change-Id: I1b1f9eecb666f5e3ca989ec0a7b46a3d9330ec67
Signed-off-by: Florent BENOIT <fbenoit@codenvy.com>
…sure that channel is subscribed when we subscribe for it

Change-Id: I6b316f1ba2e2391e1793459406664365c095c924
Signed-off-by: Florent BENOIT <fbenoit@codenvy.com>
…stop introduced by #3892

Change-Id: Id131d3b2c334aabb38418213dbc2ac381dba8552
Signed-off-by: Florent BENOIT <fbenoit@codenvy.com>
if —force is used, then it is the same behaviour than before
else by default a new action graceful-stop is called which calls the /api/system/stop and wait that the remote side is going into “READY_TO_SHUTDOWN” mode.
after that the stop of containers is performed

if auth is required, —user and —password can provide the auth data

Change-Id: Ifea9bd32b0dfd2965e5365bc4ee54eb7c8714fc9
Signed-off-by: Florent BENOIT <fbenoit@codenvy.com>
@benoitf benoitf added kind/enhancement A feature request - must adhere to the feature request template. severity/blocker Causes system to crash and be non-recoverable or prevents Che developers from working on Che code. status/code-review This issue has a pull request posted for it and is awaiting code review completion by the community. labels Jan 31, 2017
@benoitf benoitf added this to the 5.2.0 milestone Jan 31, 2017
@benoitf benoitf self-assigned this Jan 31, 2017
@TylerJewell
Copy link

Since this is a new feature then the release notes to have a deeper explanation and example.

@benoitf
Copy link
Contributor Author

benoitf commented Jan 31, 2017

@TylerJewell ok I've updated release notes section

@riuvshin
Copy link
Contributor

what will happen if auth is not provided ?
like in first example docker run ... eclipse/che stop

@benoitf
Copy link
Contributor Author

benoitf commented Jan 31, 2017

@riuvshin if auth is required it will tell you that you can't perform operation as you need authentication

@riuvshin
Copy link
Contributor

so maybe we have to add --force here https://github.com/eclipse/che/blob/master/dockerfiles/base/scripts/base/commands/cmd_destroy.sh#L40 because in case of destroy who will care about auth

@benoitf
Copy link
Contributor Author

benoitf commented Jan 31, 2017

@riuvshin yes good catch

@benoitf
Copy link
Contributor Author

benoitf commented Jan 31, 2017

@riuvshin what about cmd_stop in cmd_upgrade ?

@riuvshin
Copy link
Contributor

in cmd_upgrade we must do graceful stop, so I think we have to change cmd_upgrade to ask user do manually stop with auth before cmd_upgrade same as we do for cmd_backup https://github.com/eclipse/che/blob/master/dockerfiles/base/scripts/base/commands/cmd_backup.sh#L29

@TylerJewell @benoitf wdyt guys?

@benoitf
Copy link
Contributor Author

benoitf commented Jan 31, 2017

@riuvshin yes looks like the proper solution for me. So the user can decide if he performs a stop right now, delay it and do it with force or not

@TylerJewell
Copy link

Yes, I think that makes sense to me, too.

… is the same behaviour than before else by default a new action graceful-stop is called which calls the /api/system/stop and wait that the remote side is going into “READY_TO_SHUTDOWN” mode. after that the stop of containers is performed

Change-Id: Ibfd684a5f8fb17d13e8b86f42a10c76fe66a70dd
Signed-off-by: Florent BENOIT <fbenoit@codenvy.com>
@benoitf
Copy link
Contributor Author

benoitf commented Jan 31, 2017

ok, I've added the changes

@TylerJewell
Copy link

I updated the release notes comment.

@benoitf benoitf added status/pending-merge and removed status/code-review This issue has a pull request posted for it and is awaiting code review completion by the community. status/pending-merge labels Jan 31, 2017
@benoitf benoitf merged commit afc473f into master Jan 31, 2017
@codenvy-ci
Copy link

@JamesDrummond JamesDrummond mentioned this pull request Feb 6, 2017
9 tasks
@benoitf benoitf deleted the che#3886 branch May 24, 2017 09:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement A feature request - must adhere to the feature request template. severity/blocker Causes system to crash and be non-recoverable or prevents Che developers from working on Che code.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants