moldcamp - multidimentional testing workflow. cibox
TRANSCRIPT
![Page 1: MoldCamp - multidimentional testing workflow. CIBox](https://reader035.vdocuments.net/reader035/viewer/2022062711/55c957c4bb61eb1d758b45bc/html5/thumbnails/1.jpg)
https://github.com/propeoplemd/cibox
Multidimensional testing workflow before merge to master. CIBox suite.
@podarok
Andrii PodanenkoDevOps Architect, FFWcohttps://www.drupal.org/u/podarok
![Page 2: MoldCamp - multidimentional testing workflow. CIBox](https://reader035.vdocuments.net/reader035/viewer/2022062711/55c957c4bb61eb1d758b45bc/html5/thumbnails/2.jpg)
Oldschool development workflow
![Page 3: MoldCamp - multidimentional testing workflow. CIBox](https://reader035.vdocuments.net/reader035/viewer/2022062711/55c957c4bb61eb1d758b45bc/html5/thumbnails/3.jpg)
Development infrastructure
● single development environment
● separate company dev server (multiple vhosts
one per project)
● SaaS solutions (Acquia, Pantheon, …)
![Page 4: MoldCamp - multidimentional testing workflow. CIBox](https://reader035.vdocuments.net/reader035/viewer/2022062711/55c957c4bb61eb1d758b45bc/html5/thumbnails/4.jpg)
Coding process
● all commits directly to master
● master deployed to dev site (sometimes
automatically)
● code review on dev site after deployment
![Page 5: MoldCamp - multidimentional testing workflow. CIBox](https://reader035.vdocuments.net/reader035/viewer/2022062711/55c957c4bb61eb1d758b45bc/html5/thumbnails/5.jpg)
Configuration process
● master database, get pulled to local dev
environments (backup & migrate)
● changes to configuration happens on dev site
manually
![Page 6: MoldCamp - multidimentional testing workflow. CIBox](https://reader035.vdocuments.net/reader035/viewer/2022062711/55c957c4bb61eb1d758b45bc/html5/thumbnails/6.jpg)
Problems
● shared resources on dev environment -> dev conflicts (cache, solr, mysql, apache)
● too much time to configure all services on local dev desktop (varnish, solr)
● large gap between Dev and Ops (only one guru able to do production release)
![Page 7: MoldCamp - multidimentional testing workflow. CIBox](https://reader035.vdocuments.net/reader035/viewer/2022062711/55c957c4bb61eb1d758b45bc/html5/thumbnails/7.jpg)
“Newschool” development workflow
![Page 8: MoldCamp - multidimentional testing workflow. CIBox](https://reader035.vdocuments.net/reader035/viewer/2022062711/55c957c4bb61eb1d758b45bc/html5/thumbnails/8.jpg)
Local development
● local virtualized environment (vagrant)
● started from puphpet.com but switched to ansible
● based on ubuntu 12.04 (upgrading to 14.04)
![Page 9: MoldCamp - multidimentional testing workflow. CIBox](https://reader035.vdocuments.net/reader035/viewer/2022062711/55c957c4bb61eb1d758b45bc/html5/thumbnails/9.jpg)
Database
● no configuration on demo/stage/prod sites
● code driven development
● database/profile workflow
![Page 10: MoldCamp - multidimentional testing workflow. CIBox](https://reader035.vdocuments.net/reader035/viewer/2022062711/55c957c4bb61eb1d758b45bc/html5/thumbnails/10.jpg)
Code process
● Github pull requests workflow
● code review before merge to master
● code style checks, test runs
● security tests
● QA on builds
![Page 11: MoldCamp - multidimentional testing workflow. CIBox](https://reader035.vdocuments.net/reader035/viewer/2022062711/55c957c4bb61eb1d758b45bc/html5/thumbnails/11.jpg)
Extra tools
● os monitoring to see resources consuming
operations (multinode munin)
● automated complex deployments Acquia
deployment
● visual regression testing ->
● urls health checks ->
![Page 12: MoldCamp - multidimentional testing workflow. CIBox](https://reader035.vdocuments.net/reader035/viewer/2022062711/55c957c4bb61eb1d758b45bc/html5/thumbnails/12.jpg)
Visual regression
● http://backtrac.io SaaS
● screenshots before / after release, diff
● automated scheduled screenshots / diffs
● authenticated user
● register and start using now!
![Page 13: MoldCamp - multidimentional testing workflow. CIBox](https://reader035.vdocuments.net/reader035/viewer/2022062711/55c957c4bb61eb1d758b45bc/html5/thumbnails/13.jpg)
![Page 14: MoldCamp - multidimentional testing workflow. CIBox](https://reader035.vdocuments.net/reader035/viewer/2022062711/55c957c4bb61eb1d758b45bc/html5/thumbnails/14.jpg)
URLs health checks
● https://github.com/ygerasimov/website-size-scan
● scans all URLs in the file, checks sizes of images
● logs 404s, 5xx, etc.
● written on golang
![Page 16: MoldCamp - multidimentional testing workflow. CIBox](https://reader035.vdocuments.net/reader035/viewer/2022062711/55c957c4bb61eb1d758b45bc/html5/thumbnails/16.jpg)
CI for project and VM with Drupal initial codebase
Project initial creation playbook
github.yml
Continuous Integration for a project
jenkinsbox.yml
CIBox code structure
![Page 17: MoldCamp - multidimentional testing workflow. CIBox](https://reader035.vdocuments.net/reader035/viewer/2022062711/55c957c4bb61eb1d758b45bc/html5/thumbnails/17.jpg)
Steps for getting started
2. Repository initialization
● Make needed changes to github.yml● Run ansible-playbook github.yml● push generated codebase folder to
github repo● check Pull Request builder with newly
created change to readme.md● profit
1. CI server● Get virtual or real server from
hosting provider (Ubuntu LTS 64 bit only for now)
● Set root password● Make initial config changes to
jenkinsbox.yml and inventory● Run ansible-playbook
jenkinsbox.yml from a shell● Make changes to jenkins UI with
credentials to github repo
How to deploy whole CI system
![Page 18: MoldCamp - multidimentional testing workflow. CIBox](https://reader035.vdocuments.net/reader035/viewer/2022062711/55c957c4bb61eb1d758b45bc/html5/thumbnails/18.jpg)
ansible playbook for installing CI server
- Jenkins powered install
- Needed Jenkins’s plugins
- LAMP stack + SSL
- PHP Code Sniffer, scss-lint
- Java JDK
- Jetty && Apache Solr
- Selenium && Behat packages
- Optimized and preconfigured configs
jenkinsbox.yml
![Page 19: MoldCamp - multidimentional testing workflow. CIBox](https://reader035.vdocuments.net/reader035/viewer/2022062711/55c957c4bb61eb1d758b45bc/html5/thumbnails/19.jpg)
A bunch of jobs with scripts for running playbooks
Preconfigured Jenkins
- Pull Request Builder
- Skeleton for Backup production database
- Demo site builder
- Disk space cleaner
![Page 20: MoldCamp - multidimentional testing workflow. CIBox](https://reader035.vdocuments.net/reader035/viewer/2022062711/55c957c4bb61eb1d758b45bc/html5/thumbnails/20.jpg)
During run of github.yml you’ll get a codebase that has latest drupal in
drupal folder and scripts for future CI builds and tests with Vagrant VM.
Latest drupal, adminer, devops scripts, basic profile
Main project code structure
![Page 21: MoldCamp - multidimentional testing workflow. CIBox](https://reader035.vdocuments.net/reader035/viewer/2022062711/55c957c4bb61eb1d758b45bc/html5/thumbnails/21.jpg)
Vagrant + virtualbox (optional lxc) + ansible provisioner
We are using trick for sharing ansible roles between CI server and VM provisioning scripts for making sure we have equal environments for both.
Basic stuff for now (all are inside splitted ansible roles):
composer, pear, ansible, apache, memcached, mysql, php, sdebug, shprof, selenium, behat, drush, jetty solr, phpdaemon, php codesniffer, apache ssl, custom swap.
Just vagrant up and you are ready to go coding.
Vagrant box
![Page 22: MoldCamp - multidimentional testing workflow. CIBox](https://reader035.vdocuments.net/reader035/viewer/2022062711/55c957c4bb61eb1d758b45bc/html5/thumbnails/22.jpg)
how to work with CIBox
Developer point of view
![Page 23: MoldCamp - multidimentional testing workflow. CIBox](https://reader035.vdocuments.net/reader035/viewer/2022062711/55c957c4bb61eb1d758b45bc/html5/thumbnails/23.jpg)
Single task flow
![Page 24: MoldCamp - multidimentional testing workflow. CIBox](https://reader035.vdocuments.net/reader035/viewer/2022062711/55c957c4bb61eb1d758b45bc/html5/thumbnails/24.jpg)
Comments by CI bot
![Page 25: MoldCamp - multidimentional testing workflow. CIBox](https://reader035.vdocuments.net/reader035/viewer/2022062711/55c957c4bb61eb1d758b45bc/html5/thumbnails/25.jpg)
Development phases
1. Reinstall from scratch every build by reinstall.yml
playbook
2. Update path, content can be edited at stage by
reinstall.yml playbook and pp_environment: staging
3. SLA (production) update path with QA testing on stage
![Page 26: MoldCamp - multidimentional testing workflow. CIBox](https://reader035.vdocuments.net/reader035/viewer/2022062711/55c957c4bb61eb1d758b45bc/html5/thumbnails/26.jpg)
technical information
How CI works
![Page 27: MoldCamp - multidimentional testing workflow. CIBox](https://reader035.vdocuments.net/reader035/viewer/2022062711/55c957c4bb61eb1d758b45bc/html5/thumbnails/27.jpg)
Profile based flowReinstalls Drupal from scratch every builder time
![Page 28: MoldCamp - multidimentional testing workflow. CIBox](https://reader035.vdocuments.net/reader035/viewer/2022062711/55c957c4bb61eb1d758b45bc/html5/thumbnails/28.jpg)
SQL based flowImports SQL dump every build and prepares it to codebase
![Page 29: MoldCamp - multidimentional testing workflow. CIBox](https://reader035.vdocuments.net/reader035/viewer/2022062711/55c957c4bb61eb1d758b45bc/html5/thumbnails/29.jpg)
Team rules
● Never merge own Pull Request
● Never push directly to main repo master branch
● master branch is stable
● There should be two siblings for every role (optional)
● Bugs introduced from specific PR would be nice to
assign to its reviewer. (optional)
![Page 30: MoldCamp - multidimentional testing workflow. CIBox](https://reader035.vdocuments.net/reader035/viewer/2022062711/55c957c4bb61eb1d758b45bc/html5/thumbnails/30.jpg)
Responsibility
Due to the fact all DevOps scripts are in the same repo with a project itself - any developer can change workflow at any point.
Team does manage all the steps for DevOps scripts, no need to involve Ops into the team.
![Page 31: MoldCamp - multidimentional testing workflow. CIBox](https://reader035.vdocuments.net/reader035/viewer/2022062711/55c957c4bb61eb1d758b45bc/html5/thumbnails/31.jpg)
Flow Bottlenecks● Dependency from github(gitlab, bitbucket)
● If CI server down - team get stopped on code review step
● New developers should follow new rules. (Coder is tough)
● DevOps must be a team member(s)
● Code Review get hurt
● Builds are slow on huge projects
● Decent desktops for a team (SSD is a must)
● Minimal task >=1 hour
● Overall system is pretty complex
● Not so easy to start for new teams or companies
![Page 32: MoldCamp - multidimentional testing workflow. CIBox](https://reader035.vdocuments.net/reader035/viewer/2022062711/55c957c4bb61eb1d758b45bc/html5/thumbnails/32.jpg)
How to start using CIBox in your team● Contribute* to CIBox and get more familiar with its subsystems.● Install the flow for some internal project without tough deadline● Organize codesprint with CIBox as workflow● Start to use 1-2 parts of the system and add new parts every
following project○ sniffers.yml○ tests.yml○ reinstall.yml○ Vagrant box○ ansible scripting(playbooks)○ Jenkins○ Github PR for manual code review
*CIBox is opensource, based on popular technologies...
![Page 33: MoldCamp - multidimentional testing workflow. CIBox](https://reader035.vdocuments.net/reader035/viewer/2022062711/55c957c4bb61eb1d758b45bc/html5/thumbnails/33.jpg)
Usefull linksDocumentation
● https://github.com/propeoplemd/cibox
● https://github.com/propeoplemd/cibox/blob/master/README.md
● https://github.com/propeoplemd/cibox/blob/master/github/files/drupal7/scripts/README.reinstall.md
Presentations
● http://events.drupal.org/losangeles2015/sessions/multidimensional-testing-workflow-merge-master
● http://druler.com/node/888
● http://www.slideshare.net/podarok/drupal-continuous-integration-workflow
● http://www.slideshare.net/podarok/start-using-vagrant-now
● http://www.slideshare.net/podarok/live-deployment-ci-drupal
● http://www.slideshare.net/ygerasimov/ci-drupal-camp-berlin-2014
● http://www.slideshare.net/ygerasimov/vagrant-stanford-drupalcamp-2014
● http://www.slideshare.net/ygerasimov/continuous-integration-stanford-2014
Blog posts
● http://wearepropeople.com/blog/how-we-use-vagrant-in-our-drupal-development-workflow
● http://wearepropeople.com/blog/building-quality-into-drupal-development-workflow
![Page 34: MoldCamp - multidimentional testing workflow. CIBox](https://reader035.vdocuments.net/reader035/viewer/2022062711/55c957c4bb61eb1d758b45bc/html5/thumbnails/34.jpg)
Questions?
http://bit.ly/ffw-ciboxAndrii PodanenkoDevOps Architecthttps://www.drupal.org/u/podarok