Top Banner
Multi-node environment as a Jenkins slave aka “compound-slave” Denis Chernilevskiy Head of Media Advertising Department
31

JUC Europe 2015: Multi-Node Environment as a Jenkins Slave (Compound-Slave)

Jan 15, 2017

Download

Technology

CloudBees
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: JUC Europe 2015: Multi-Node Environment as a Jenkins Slave (Compound-Slave)

Multi-node environment as a Jenkins slave aka “compound-slave”

Denis Chernilevskiy

Head of Media Advertising Department

Page 2: JUC Europe 2015: Multi-Node Environment as a Jenkins Slave (Compound-Slave)

The image cannot be displayed. Your computer may not have enough memory to open the image, or the image may have been corrupted. Restart your computer, and then open the file again. If the red x still appears, you may have to delete the image and then insert it again.

Common use-case the “prehistory”

Multi-node environment as a Jenkins slave

Page 3: JUC Europe 2015: Multi-Node Environment as a Jenkins Slave (Compound-Slave)

Common use-case

4

He’s famous The “slave” The “job”

Page 4: JUC Europe 2015: Multi-Node Environment as a Jenkins Slave (Compound-Slave)

│ Test this please!

Page 5: JUC Europe 2015: Multi-Node Environment as a Jenkins Slave (Compound-Slave)

The quest

6

Nodes Cloud Deploy Get results Test

Page 6: JUC Europe 2015: Multi-Node Environment as a Jenkins Slave (Compound-Slave)

The solution

▌  Cloud – Amazon/OpenStack/Docker/…

▌  Deploy – JClouds/DockerCloud + Chef/Salt/Ansible/…

▌  Test – PyTest/TestNG/…

▌  Results – Allure Framework/xUnit/…

7

Page 7: JUC Europe 2015: Multi-Node Environment as a Jenkins Slave (Compound-Slave)

How it works

▌  The common job concept

›  Take 1 slave

›  Deploy the system under test to the slave

›  Deploy and run tests on the same slave

›  Clean the slave

›  Return the slave to the pool

8

Page 8: JUC Europe 2015: Multi-Node Environment as a Jenkins Slave (Compound-Slave)

│ Perfectly fits with 1 slave

Page 9: JUC Europe 2015: Multi-Node Environment as a Jenkins Slave (Compound-Slave)

│ But what if…

Page 10: JUC Europe 2015: Multi-Node Environment as a Jenkins Slave (Compound-Slave)

11

Page 11: JUC Europe 2015: Multi-Node Environment as a Jenkins Slave (Compound-Slave)

The image cannot be displayed. Your computer may not have enough memory to open the image, or the image may have been corrupted. Restart your computer, and then open the file again. If the red x still appears, you may have to delete the image and then insert it again.

The “real life” of QA/DevOps the problem

Multi-node environment as a Jenkins slave

Page 12: JUC Europe 2015: Multi-Node Environment as a Jenkins Slave (Compound-Slave)

│ Yandex MediaAd platform

Page 13: JUC Europe 2015: Multi-Node Environment as a Jenkins Slave (Compound-Slave)

│ Test this please!

Page 14: JUC Europe 2015: Multi-Node Environment as a Jenkins Slave (Compound-Slave)

Process requirements

▌  Auto build, deploy, test

▌  Continuous Integration

▌  “Green trunk”

15

Page 15: JUC Europe 2015: Multi-Node Environment as a Jenkins Slave (Compound-Slave)

System components

▌  Front-end UI and API

▌  Ad.Management

▌  Ad.Selection ▌  Ad.Storage

▌  SocDem prediction & machine learning

16

Page 16: JUC Europe 2015: Multi-Node Environment as a Jenkins Slave (Compound-Slave)

│ None fits into 1 slave…

Page 17: JUC Europe 2015: Multi-Node Environment as a Jenkins Slave (Compound-Slave)

The obvious “not a solution” J

▌  Use Jenkins

▌  Get a slave for the job

▌  Get some more cloud nodes (somehow)

▌  Use the slave as a launchpad (run deploy, tests remotely)

18

Page 18: JUC Europe 2015: Multi-Node Environment as a Jenkins Slave (Compound-Slave)

│ Not for us J

Page 19: JUC Europe 2015: Multi-Node Environment as a Jenkins Slave (Compound-Slave)

Why not?

▌  Laziness. The less new code, the better! ▌  Separate nodes management

▌  JClouds not reused ▌  Lack of visibility

20

Page 20: JUC Europe 2015: Multi-Node Environment as a Jenkins Slave (Compound-Slave)

│ Several slaves per job?

Page 21: JUC Europe 2015: Multi-Node Environment as a Jenkins Slave (Compound-Slave)

│ Need to refactor core…

Page 22: JUC Europe 2015: Multi-Node Environment as a Jenkins Slave (Compound-Slave)

│ Several nodes as a slave!

Page 23: JUC Europe 2015: Multi-Node Environment as a Jenkins Slave (Compound-Slave)

The image cannot be displayed. Your computer may not have enough memory to open the image, or the image may have been corrupted. Restart your computer, and then open the file again. If the red x still appears, you may have to delete the image and then insert it again.

“Compound-slaves” plugin the solution

Multi-node environment as a Jenkins slave

Page 24: JUC Europe 2015: Multi-Node Environment as a Jenkins Slave (Compound-Slave)

Features

▌  Group several nodes as a compound-slave

›  Existing nodes grouping

›  Get & group from the cloud

25

Page 25: JUC Europe 2015: Multi-Node Environment as a Jenkins Slave (Compound-Slave)

Features

▌  Cloud provisioning

›  Plugins with a “Cloud” interface

›  Using labels from the cloud plugin

›  Number of each label to provision

26

Page 26: JUC Europe 2015: Multi-Node Environment as a Jenkins Slave (Compound-Slave)

Features

▌  Roles and labelling

›  Distinct nodes

›  Default labels

27

Page 27: JUC Europe 2015: Multi-Node Environment as a Jenkins Slave (Compound-Slave)

The image cannot be displayed. Your computer may not have enough memory to open the image, or the image may have been corrupted. Restart your computer, and then open the file again. If the red x still appears, you may have to delete the image and then insert it again.

Here comes the DEMO! J

Page 28: JUC Europe 2015: Multi-Node Environment as a Jenkins Slave (Compound-Slave)

Features

▌  General

›  Built-in slave management

›  Built-in job-slave provisioning

▌  Visibility

›  Built-in dashboards

›  Built-in job steps configuration

29

Page 29: JUC Europe 2015: Multi-Node Environment as a Jenkins Slave (Compound-Slave)

│ Profit! J

Page 30: JUC Europe 2015: Multi-Node Environment as a Jenkins Slave (Compound-Slave)

Links

▌  wiki.jenkins-ci.org/display/JENKINS/Compound+Slaves

▌  github.com/jenkinsci/compound-slaves-plugin

31

Page 31: JUC Europe 2015: Multi-Node Environment as a Jenkins Slave (Compound-Slave)

Contacts

[email protected]

+79250351311 @dchernilevskiy

denis.chernilevskiy

Denis Chernilevskiy

Head of Yandex MediaAd Department