PACKAGES RELEASING OF TESTING AND FOR AUTOMATED …...TESTING WITH KATELLO AND ANSIBLE 14. A R C H I...
Transcript of PACKAGES RELEASING OF TESTING AND FOR AUTOMATED …...TESTING WITH KATELLO AND ANSIBLE 14. A R C H I...
KATELLO AND ANSIBLEKATELLO AND ANSIBLEFOR AUTOMATEDFOR AUTOMATED
TESTING ANDTESTING ANDRELEASING OFRELEASING OF
PACKAGESPACKAGES1
$ WHOAMI$ WHOAMI
Evgeni Golov
Software Engineer at Red Hat
ex-Consultant at Red Hat
Debian and Grml Developer
♥ FOSS ♥
♥ automation ♥
2
MOTIVATIONMOTIVATIONyou build a software productyou ship the product as distribution packagesto your customersthe product has dependencies outside a baseOS (Ruby? node.js? Django?)unit tests are great, but you also need to testthe shipped bits
3
ANSIBLEANSIBLE
4
$ WHATIS ANSIBLE$ WHATIS ANSIBLE
radically simple IT automation enginecontains a big number of modules to executeactions and ensure state on target hostseasily extended by self-written modulesintegrates well with REST APIs
5
ANSIBLE TERMINOLOGYANSIBLE TERMINOLOGYModule - discrete units of code that can beused from the command line or in a playbooktask to execute an action or ensure a stateTask - Module invocation with a set ofparametersPlay - list of Tasks to be executed against a setof hostsPlaybook - �le containing one or more Plays
6
KATELLOKATELLO
7
$ WHATIS KATELLO$ WHATIS KATELLO
plug-in to Foremanadds content management functionality (RPM,DEB, Puppet, Containers, Files)allows to group content for tailoredpresentation to consumersallows snapshots of content for versioning
8
KATELLO TERMINOLOGYKATELLO TERMINOLOGYRepository - Collection of contentProduct - Collection of related repositories(CentOS 7 distribution with repositories fori686 and x86_64)Lifecycle Environment - Environment/stagein your deployment cycle (Test, QA,Production)
Library - special LE that receives the content�rst
9
KATELLO TERMINOLOGYKATELLO TERMINOLOGYContent View - Selection of repositories(CentOS 7 + EPEL 7)
Publish creates a snapshot (Version) of theselected repositories available to LibraryPromote copies a published Content ViewVersion to another LE
Composite Content View - Selection ofContent Views (base OS + Application)
can be published and promoted like a CV
10
KATELLO EXAMPLEKATELLO EXAMPLE
11
STAGING CHANGES WITHSTAGING CHANGES WITHKATELLOKATELLO
every time a (Composite) Content View ispublished, a new Version is createdthis version can be made available to clients bypromoting it to a certain Lifecycle Environmentyou can revert to older versions, if problemsare found after a promotion
12
STAGING CHANGES WITHSTAGING CHANGES WITHKATELLO (EXAMPLE)KATELLO (EXAMPLE)
DEV moving fast, getting changes on everycommitTEST getting changes daily, after a minimalgating happenedQA getting changes weekly, after a basic set oftests passedPROD getting changes whenever QA is happy
13
TESTING WITHTESTING WITHKATELLO AND ANSIBLEKATELLO AND ANSIBLE
14
ARCHITECTURE OVERVIEWARCHITECTURE OVERVIEWSource in Git (GitLab)Jenkins is the main executor, triggered byGitLabKatello is the package storeAnsible is used by Jenkins to interact with theKatello API
15
TEST WORKFLOWTEST WORKFLOWJenkins builds packages on every change(using Koji)Packages are synced to KatelloKatello also syncs external packages (RHEL,RHSCL)Jenkins creates/updates ContentView (RHEL,RHSCL, Packages from Koji)Jenkins tests the content in Library by installingthe software and running end-to-end testsJenkins promotes ContentView to QA
16
PACKAGE BUILDINGPACKAGE BUILDINGOn every change to the source, the following
steps are executed:a new source tarball is generatedthe RPM .spec is updatedthe RPM is built using Koji
17
PACKAGE TESTINGPACKAGE TESTINGJenkins runs a daily pipeline which:
Synchronizes the packages from Koji intoKatello (Library)Executes an Ansible playbook in a Vagrant VM,which:
Subscribes the VM to KatelloInstalls the softwareExecutes a (small) set of tests
When the playbooks �nishes successfully, theContent is promoted to Test
18
FURTHER TESTING ANDFURTHER TESTING ANDRELEASINGRELEASING
The tests executed in the VM ensure that thesoftware is not DOA (they take ~1h)Once a week the content from Test ispromoted to QAThis triggers a large test-suite (>24h!)Plus manual veri�cation of features and �xedbugs that have no automated testsAfter succesful veri�cation, the software isreleased
19
REFERENCESREFERENCESforeman-ansible-modulesforkliftour Ansible playbooksour Jenkins jobs
20
THANKS!THANKS!
die-welt.net
@zhenech
@evgeni
zhenech
21