Skip to content
This repository has been archived by the owner on Jul 23, 2020. It is now read-only.

Optimise plugin disk space in Jenkins #4568

Closed
chmouel opened this issue Nov 20, 2018 · 16 comments
Closed

Optimise plugin disk space in Jenkins #4568

chmouel opened this issue Nov 20, 2018 · 16 comments

Comments

@chmouel
Copy link

chmouel commented Nov 20, 2018

The plugins directory consume over 383Mb out of 478mb and is copied over and over everywhere which cause a scale issue on the gluster volumes,

Longer discussion here :

https://chat.openshift.io/developers/pl/ic6z8bppkbf8jb78z8bhsoispe

@chmouel
Copy link
Author

chmouel commented Dec 4, 2018

More discussions and investigation here:

https://chat.openshift.io/developers/pl/sm4bacg41iye3bwn3cau4hwr7r

patch to symlink the hpi/jpi instead of copying fabric8-jenkins/jenkins-openshift-base#49 saves around 187mb

@chmouel
Copy link
Author

chmouel commented Dec 5, 2018

Symlink directory into the image saves us 358MB in total,

@ppitonak
Copy link
Collaborator

ppitonak commented Dec 5, 2018

"In total" is confusing... Is it 358 MB per user or per cluster?

How will symlink handle various versions of Jenkins?

@chmouel
Copy link
Author

chmouel commented Dec 5, 2018

"In total" is confusing... Is it 358 MB per user or per cluster?

there is no global plugins 'folder' in our infrastructure so it is per user,

How will symlink handle various versions of Jenkins?

I am not sure i understand your question, did you read the patch?

@hrishin
Copy link

hrishin commented Dec 6, 2018

Some observations for the sym link patch

Plugin management:

  1. installed artifcatory plugin from plugins.txt
    plugin worked ✔️
    plugins size

First boot

sh-4.2$ du -hs /var/lib/jenkins/plugins/
247M    /var/lib/jenkins/plugins/
  1. installed prometheous plugin (without restart option) from Jenkins admin conosle
    plugin worked ✔️
    plugins size

First boot (without restarting jenkins)

sh-4.2$ du -hs .
216M	
  1. installed MSBuild plugin (with restart option) from jenkins admin console
    Plugin worked ✔️
    plugins size

After the first boot but jenkins process restarted in running pod

217M	/var/lib/jenkins/plugins/

after second boot (scaling jenkins pod down and up)

without rm -rf plugins

sh-4.2$ du -hs /var/lib/jenkins/plugins/
26M     /var/lib/jenkins/plugins/

with rm -rf plugins

sh-4.2$ du -hs /var/lib/jenkins/plugins/
247M    /var/lib/jenkins/plugins/

Basic test

  1. Run the pipeline builds
    In all cases it worked well ✔️

@chmouel
Copy link
Author

chmouel commented Dec 6, 2018

Thanks for all of those tests @hrishin, is there any chances you can try another scenario if that's not too hard to test :

boot with a version of a plugin and reboot with an updated version of a plugin and see if it pickups the new version?

@hrishin
Copy link

hrishin commented Dec 6, 2018

Yes @chmouel we have tested by deploying a new version of sync-plugin, Jenkins was able to pick it up.

I was not able to run pipelines, as jenkins is behaving wiredly due to idler issue. Rest of behavior stays same as per previous observation.

hrishin added a commit to hrishin/openshift-jenkins-s2i-config that referenced this issue Dec 10, 2018
In order to reduce the plugins storage space, this
patch switches to new base image.

Fixes

 - openshiftio/openshift.io#4568
@chmouel
Copy link
Author

chmouel commented Dec 10, 2018

As for doing the proper way when we merge the image with upstream here is some thought out of this discussion from https://chat.openshift.io/developers/pl/n3z1jyxh93b33cw1zdgayp5oce :

image

hrishin added a commit to hrishin/saas-openshiftio that referenced this issue Dec 10, 2018
This patch reduces the plugins storage space required
for each tenant jenkins

Fixes
 - openshiftio/openshift.io#4568
alexeykazakov pushed a commit to openshiftio/saas-openshiftio that referenced this issue Dec 11, 2018
This patch reduces the plugins storage space required
for each tenant jenkins

Fixes
 - openshiftio/openshift.io#4568
hrishin added a commit to hrishin/saas-openshiftio that referenced this issue Dec 27, 2018
This patch reduces the plugins storage space required
for each tenant jenkins

Fixes
    - openshiftio/openshift.io#4568
hrishin added a commit to hrishin/saas-openshiftio that referenced this issue Jan 3, 2019
…n plugin (vaaf8961)

This patch
- updates jenkins configuration to reduces the plugins storage
space required for each tenant jenkins. (fix#1)
- update bayesian jenkins plugin to 0.3.3 which has
enhancements to support osio-pipeline. (fix#2)

Updates f8-tenant image: vaaf8961

Fixes
    - openshiftio/openshift.io#4568
    - https://openshift.io/openshiftio/Openshift_io/plan/detail/1216
hrishin added a commit to hrishin/saas-openshiftio that referenced this issue Jan 3, 2019
…n plugin (vb355188)

This patch
- updates jenkins configuration to reduces the plugins storage
space required for each tenant jenkins. (fix#1)
- update bayesian jenkins plugin to 0.3.3 which has
enhancements to support osio-pipeline. (fix#2)

Updates f8-tenant image: vb355188

Fixes
    - openshiftio/openshift.io#4568
    - https://openshift.io/openshiftio/Openshift_io/plan/detail/1216
@piyush-garg
Copy link
Collaborator

Tenant update has been done. Closing this,

@hrishin
Copy link

hrishin commented Jan 14, 2019

@pbergene could we confirm if this issue has fixed with recent tenant update? It should drop the gluster storage usage(Not able to make grasp looking at Zabbix). If not feel free to reopen this issue. Thank you

@hrishin
Copy link

hrishin commented Jan 17, 2019

Can see some reduction in gluster storage usage.

@chmouel @sthaha

image

@chmouel
Copy link
Author

chmouel commented Jan 17, 2019

Really nice! 😍

Great work 💪

@pbergene
Copy link
Collaborator

Good job indeed! We have a couple of graphs which show it even more dramatically. The device space also contains snapshots and is not a direct measure of space used by PVs, but we can clearly see the updates go in with this one :)

@hrishin
Copy link

hrishin commented Jan 21, 2019

Thanks @pbergene ! for giving confimation.

@chmouel
Copy link
Author

chmouel commented Jan 21, 2019

@hrishin We need to plan for merging a better looking (i.e: not hack) patch to jenkins upstream, since they are affected as well and we want to consume their images asap,

/cc @arilivigni

@hrishin
Copy link

hrishin commented Jan 21, 2019

Yes @chmouel.
Filed an issue fabric8io/openshift-jenkins-s2i-config#232 for it.

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

No branches or pull requests

5 participants