Jenkins with superpowers
-
Upload
ideato -
Category
Technology
-
view
932 -
download
0
Transcript of Jenkins with superpowers
![Page 2: Jenkins with superpowers](https://reader031.fdocuments.us/reader031/viewer/2022030305/5870e0981a28abcf288b49fb/html5/thumbnails/2.jpg)
Why I should prefer on-premise Jenkins
vs SaaS like Travis or CircleCI ?
![Page 3: Jenkins with superpowers](https://reader031.fdocuments.us/reader031/viewer/2022030305/5870e0981a28abcf288b49fb/html5/thumbnails/3.jpg)
Let’s talk about $$$
TravisCI startup plan costs 130$/monthly for 2 concurrent builds and several limits
c4.xlarge( 4 core, 8GB RAM,1Gb/s) ~ 130$/monthly
but I have to spend some time to configure Jenkins…
![Page 4: Jenkins with superpowers](https://reader031.fdocuments.us/reader031/viewer/2022030305/5870e0981a28abcf288b49fb/html5/thumbnails/4.jpg)
Let’s talk about $$$
why should I keep my CI server always ON even outside work hours??!!
here it comes on demand…
C4xlarge for 180h/720h ~ 32$
![Page 5: Jenkins with superpowers](https://reader031.fdocuments.us/reader031/viewer/2022030305/5870e0981a28abcf288b49fb/html5/thumbnails/5.jpg)
Let’s talk about $$$
but my sysadmin has to switch on/off every day??!!
lot of waste and boring things!
![Page 6: Jenkins with superpowers](https://reader031.fdocuments.us/reader031/viewer/2022030305/5870e0981a28abcf288b49fb/html5/thumbnails/6.jpg)
Let’s talk about $$$
AWS CLI + CRON JOBS!!!•20 9 * * 1-5 root/usr/local/bin/jenkins_on.sh•50 19 * * 1-5 root /usr/local/bin/jenkins_off.sh
code will be available on https://www.ideato.it/blog
![Page 7: Jenkins with superpowers](https://reader031.fdocuments.us/reader031/viewer/2022030305/5870e0981a28abcf288b49fb/html5/thumbnails/7.jpg)
Let’s talk about heterogeneity
we have heterogeneous projects…
•PHP versions(5.4, 5.5,5.6) •Elasticsearch(0.9->1.4) •NodeJS •….
with TravisCI I can easily set several PHP versions, how can I run tests for these on JenkinsCI ?
![Page 8: Jenkins with superpowers](https://reader031.fdocuments.us/reader031/viewer/2022030305/5870e0981a28abcf288b49fb/html5/thumbnails/8.jpg)
Let’s talk about heterogeneity
![Page 9: Jenkins with superpowers](https://reader031.fdocuments.us/reader031/viewer/2022030305/5870e0981a28abcf288b49fb/html5/thumbnails/9.jpg)
Let’s talk about heterogeneity
![Page 10: Jenkins with superpowers](https://reader031.fdocuments.us/reader031/viewer/2022030305/5870e0981a28abcf288b49fb/html5/thumbnails/10.jpg)
Let’s talk about heterogeneity
docker images and reusability
![Page 11: Jenkins with superpowers](https://reader031.fdocuments.us/reader031/viewer/2022030305/5870e0981a28abcf288b49fb/html5/thumbnails/11.jpg)
Let’s talk about heterogeneity
docker images and reusability
![Page 12: Jenkins with superpowers](https://reader031.fdocuments.us/reader031/viewer/2022030305/5870e0981a28abcf288b49fb/html5/thumbnails/12.jpg)
Let’s talk about heterogeneity
docker images and reusability
![Page 13: Jenkins with superpowers](https://reader031.fdocuments.us/reader031/viewer/2022030305/5870e0981a28abcf288b49fb/html5/thumbnails/13.jpg)
a possible workflow…
All the additional software(ES, mongoDB..) required should be defined in a Dockerfile, committed inside the project repository
and built on top of CI image
Jenkins job will launch “composer install”,build the image
and run tests inside the container
![Page 14: Jenkins with superpowers](https://reader031.fdocuments.us/reader031/viewer/2022030305/5870e0981a28abcf288b49fb/html5/thumbnails/14.jpg)
Our Dockerfile
for i.e we need Elasticsearch 1.4.2 & Node.js
run_tests will launch services inside the container
![Page 15: Jenkins with superpowers](https://reader031.fdocuments.us/reader031/viewer/2022030305/5870e0981a28abcf288b49fb/html5/thumbnails/15.jpg)
Our Dockerfile
run_tests will launch services and tests through Idephix inside the container
![Page 16: Jenkins with superpowers](https://reader031.fdocuments.us/reader031/viewer/2022030305/5870e0981a28abcf288b49fb/html5/thumbnails/16.jpg)
Let’s talk about performance…
but you build the Dockerfile every time?
Not really…Docker use AUFS & caching layers!!!
![Page 17: Jenkins with superpowers](https://reader031.fdocuments.us/reader031/viewer/2022030305/5870e0981a28abcf288b49fb/html5/thumbnails/17.jpg)
How do you manage the code??
git pull inside the container or
shared code through Docker Volumes??
![Page 18: Jenkins with superpowers](https://reader031.fdocuments.us/reader031/viewer/2022030305/5870e0981a28abcf288b49fb/html5/thumbnails/18.jpg)
first approach more clean and isolate…but Composer?
Composer for large project is a bottleneck with our connectivity
on c4.xlarge we have 1Gb/s…
![Page 19: Jenkins with superpowers](https://reader031.fdocuments.us/reader031/viewer/2022030305/5870e0981a28abcf288b49fb/html5/thumbnails/19.jpg)
Let’s go on Jenkins
![Page 20: Jenkins with superpowers](https://reader031.fdocuments.us/reader031/viewer/2022030305/5870e0981a28abcf288b49fb/html5/thumbnails/20.jpg)
Resuming….
1 day for Jenkins setup 1/2 day for AWS cli cronjob
~ 550€ (one time cost)
+ AWS c4.xlarge 32€ x 12=384€ = 934€
vs TravisCI Startup Plan 114€ x 12 = 1368€
![Page 21: Jenkins with superpowers](https://reader031.fdocuments.us/reader031/viewer/2022030305/5870e0981a28abcf288b49fb/html5/thumbnails/21.jpg)
Thanks for watching
Useful links: http://getidephix.com/
https://www.ideato.it/blog