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

Exited container not get release from Jenkins #229

Open
saibalak80 opened this issue May 7, 2018 · 8 comments
Open

Exited container not get release from Jenkins #229

saibalak80 opened this issue May 7, 2018 · 8 comments

Comments

@saibalak80
Copy link

The containers not getting cleaned. any suggest whats going wrong?

image

CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
3002f37077b9 jenkins-slave:1.7 "/bin/sh -cxe cat ..." 21 seconds ago Starting sad_fermi
f15178ca9657 jenkins-slave:1.7 "/bin/sh -cxe cat ..." 16 minutes ago Exited (0) 10 minutes ago wonderful_mclean
257727b1aa9a jenkins-slave:1.7 "/bin/sh -cxe cat ..." 16 minutes ago Exited (0) 10 minutes ago

@samrocketman
Copy link
Contributor

Need more system information.

  • Linux distro and version.
  • Docker daemon version.

@saibalak80
Copy link
Author

I'm running it on vsphere .

Containers: 1
Running: 1
Paused: 0
Stopped: 0
Images: 11
Server Version: v1.3.1-16055-afdab46
Storage Driver: vSphere Integrated Containers v1.3.1-16055-afdab46 Backend Engine
VolumeStores: default swap
vSphere Integrated Containers v1.3.1-16055-afdab46 Backend Engine: RUNNING
VCH CPU limit: 39600 MHz
VCH memory limit: 64 GiB
VCH CPU usage: 4529 MHz
VCH memory usage: 18.79 GiB
VMware Product: VMware vCenter Server
VMware OS: linux-x64
VMware OS version: 6.0.0
Registry Whitelist Mode: enabled
Whitelisted Registries: x18gvichub01a.prd.cloudnow.dbs.com,x18gvichub01b.prd.cloudnow.dbs.com
Plugins:
Volume: vsphere
Network: bridge
Swarm: inactive
Operating System: linux-x64
OSType: linux-x64
Architecture: x86_64
CPUs: 39600
Total Memory: 64 GiB
ID: vSphere Integrated Containers
Docker Root Dir:
Debug Mode (client): false
Debug Mode (server): false
Registry: registry.hub.docker.com
Experimental: false
Live Restore Enabled: false

@saibalak80
Copy link
Author

Another one issue on below flow.

  1. No containers templates configured
  2. 10 Jobs pending in Queue and waiting for containers.
  3. Configured Template with docker once retention strategy
  4. 10 containers spin up and 8 finished job and die.
  5. 2 were running as its long-running process.
  6. one more job added in the queue and it's waiting for long time to spin a new one.
  7. when the 2 current running jobs completed then only the new containers coming up.

is this expected one,? there should be new slave spin up when job added to the queue right?

@samrocketman
Copy link
Contributor

samrocketman commented May 16, 2018

https://vmware.github.io/vic-product/assets/files/html/1.1/vic_app_dev/container_operations.html vsphere does not appear to be a full implementation of the remote docker API. If you manually delete a single offline agent does the container get removed on the backend? What version of yet another docker plugin are you using?

@saibalak80
Copy link
Author

Yes it does, the version im using is "0.1.0-rc46".

@samrocketman
Copy link
Contributor

samrocketman commented May 16, 2018

@saibalak80 as a temporary workaround you can create a regularly scheduled freestyle job which cleans up dead agents. You would need the groovy plugin installed and run the following system groovy script. https://github.com/samrocketman/jenkins-script-console-scripts/blob/master/cleanup-offline-agents.groovy

I would personally modify it so that it takes into account the age of the agent (i.e. don't delete agents which were just created and make sure the dead agent is at least 5 minutes old) and run it on an infrequent schedule like no less than every 30 minutes. You don't even necessarily need to account for the age of the agent because the docker plugin will just provision new agents after they were deleted.

It's not a perfect workaround but would address infinite resource starvation.

@KostyaSha
Copy link
Owner

AFAIR i did cleanup somewhere. In retentionStrtategy?...

@samrocketman
Copy link
Contributor

samrocketman commented May 17, 2018

I don't experience this when using Docker daemon so it might be a difference with how vsphere containers work compared to Docker.

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

No branches or pull requests

3 participants