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

Add ability to skip removal of container after docker stop via the org.jenkinsci.plugins.docker.workflow.client.DockerClient.SKIP_RM_ON_STOPproperty #189

Merged
merged 1 commit into from
Aug 28, 2020

Conversation

jonsten
Copy link
Contributor

@jonsten jonsten commented Oct 3, 2019

Added a system property which makes it possible to skip removal of containers after stop has been issued (either through container.stop() or during exit of within() step). This is useful for users (like us) which produces very large build trees in our containers, and in some situations, hit the timeout. Rather than extending the timeout we would like our builds to finish fast and then handle cleanup with separate janitor-job.

@oleg-nenashev oleg-nenashev changed the title Add ability to skip removal of container after docker stop Add ability to skip removal of container after docker stop via the org.jenkinsci.plugins.docker.workflow.client.DockerClient.SKIP_TM_ON_STOPproperty Oct 4, 2019
@jonsten jonsten changed the title Add ability to skip removal of container after docker stop via the org.jenkinsci.plugins.docker.workflow.client.DockerClient.SKIP_TM_ON_STOPproperty Add ability to skip removal of container after docker stop via the org.jenkinsci.plugins.docker.workflow.client.DockerClient.SKIP_RM_ON_STOPproperty Oct 21, 2019
@jonsten
Copy link
Contributor Author

jonsten commented Oct 21, 2019

Any idea when this will be merged and released?

@jglick
Copy link
Member

jglick commented Jan 28, 2020

Seems unwise to me. If you have issues at this scale, you are better off managing docker commands explicitly.

@jonsten
Copy link
Contributor Author

jonsten commented Jan 28, 2020

Seems unwise to me. If you have issues at this scale, you are better off managing docker commands explicitly.

So you're telling me that if I use Jenkins in real-world large scale situations I shouldn't use high-level plugins like this one? That is quite worrying statement...

@oleg-nenashev
Copy link
Member

Welcome to the open-source community. People sometimes have strong opinions there :)
Regarding the pull-request itself, I am perfectly fine with it. It does not alter the default behavior, so why not?

@oleg-nenashev oleg-nenashev self-assigned this Jan 28, 2020
@oleg-nenashev
Copy link
Member

P.S: Assigned to myself to get it delivered if no blocking reviews. ETA is after Feb 10 due to the business trips and other emergency tasks

@jonsten
Copy link
Contributor Author

jonsten commented May 11, 2020

Friendly ping on this one, any chance to get it into master and released?

@jonsten
Copy link
Contributor Author

jonsten commented Aug 21, 2020

@oleg-nenashev any news on this one?

@oleg-nenashev
Copy link
Member

As you may guess, COVID destroyed my plans.... quite a lot. I am also not really available in the coming month (announcement). Since @car-roll has been active recently, maybe it would be the best to transfer this pull request.

Will also retrigger CI

@oleg-nenashev oleg-nenashev removed their assignment Aug 22, 2020
Copy link
Collaborator

@car-roll car-roll left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@car-roll car-roll merged commit eb0b0db into jenkinsci:master Aug 28, 2020
@jerrywei116
Copy link

jerrywei116 commented Dec 15, 2023

@oleg-nenashev Could you please give us an example about how to use "org.jenkinsci.plugins.docker.workflow.client.DockerClient.SKIP_RM_ON_STOP" in the jenkins pipeline job? Thanks.

@jonsten
Copy link
Contributor Author

jonsten commented Dec 15, 2023

As the author I can pitch in here, org.jenkinsci.plugins.docker.workflow.client.DockerClient.SKIP_RM_ON_STOP is not intended to be used from individual Jenkins pipeline job. Instead, it governs the behaviour for all Jenkins pipeline jobs running on the controller. I.e. if you set -Dorg.jenkinsci.plugins.docker.workflow.client.DockerClient.SKIP_RM_ON_STOP=true when you start the Java process. Then all jenkins pipeline jobs will stopp removing the container when they terminate the container.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
6 participants