. display in 68x24 .. display in 88x24 .. pygments yaml? (only file breaks (---) tinted) .. slide on high level v3 changes .. slide on nodepool .. transition:: dissolve :duration: 0.4 Test Slide ========== .. hidetitle:: .. ansi:: images/testslide.ans Preshow ======= .. hidetitle:: .. ansi:: images/cursor.ans images/cursor2.ans Zuul ==== .. hidetitle:: .. ansi:: images/title.ans Red Hat ======= .. hidetitle:: .. container:: handout i work for .. ansi:: images/redhat.ans OpenStack ========= .. hidetitle:: .. ansi:: images/openstack.ans OpenStack Infra =============== :: "most insane CI infrastructure I've ever been a part of" -- Alex Gaynor "OpenStack Infra are like the SpaceX of CI" -- Emily Dunham Zuul ==== .. hidetitle:: .. ansi:: images/zuul.ans Ansible ======= .. hidetitle:: .. ansi:: images/ansible.ans Presentation Checklist ====================== :: [X] Logos Spoilers ======== * What Zuul v3 does * multiple repositories * integrated deliverable * gated commits * open tooling * nobody is special * testing like deployment OpenStack Is ============ * Federated * Distributed * Large * Open * Not Alone Federated ========= * Hundreds of involved companies * No 'main' company * "Decisions are made by those who show up" * Union of priorities/use cases Impact of being Federated ========================= * No company can appoint people to positions in the project * The project cannot fire anyone * Variable background of contributors * Heavy reliance on consensus Distributed =========== * There is no office * Contributor base is global * Multitude of contributor backgrounds Impact of being Distributed =========================== * Tooling must empower all contributors, regardless of background, skill level or cultural context * Heavy preference for text-based communication * Cannot assume US-centric needs or solutions Large numbers of ================ * Contributors (\~2k in any given 6 month period) * Changes * Code Repositories (1955 as of this morning) OpenStack Scale Comparison ========================== * 2KJPH (2,000 jobs per hour) * Build Nodes from 13 Regions of 5 Public and 2 Private OpenStack Clouds * Rackspace, Internap, OVH, Vexxhost, CityCloud and Linaro, Limestone * 10,000 changes merged per month Four Opens ========== * Open Source (we don't hold back Enterprise features, we don't cripple things) * Open Design (design process open to all, decisions are not made inside company doors) * Open Development (public source code, public code review, all code is reviewed and gated) * Open Community (lazy consensus, democratic leadership from participants, public logged meetings in IRC, public archived mailing lists) We're Not Alone =============== * Dependencies (libvirt/kvm/xen, mysql/pg, rabbit, python/javascript, ceph/gluster, ansible/salt/puppet/chef, ovs/odl) * Adjacencies (kubernetes, ansible, terraform, opnfv, spinnaker) * Vendors (plugins, products, services, distros) Developer Process In a Nutshell =============================== * Code Review - nobody has direct commit/push access * 3rd-Party CI for vendors * Gated Commits OpenStack Developer Workflow ============================ .. container:: handout * Who has submitted a patch? * Who wants to? * (Who is here because the name of this talk is weird?) :: Hack Review Test ========= ========== ========== push approve +-------------+ +-------------+ | | | | +------+--+ +--v----+--+ +--v-------+ | | | | | | | $EDITOR | | Gerrit | | Zuul | | | | | | | +------^--+ +--+----^--+ +--+-------+ | | | | +-------------+ +-------------+ clone merge Gerrit ====== .. hidetitle:: .. container:: handout explain patch upload, zuul runs, test results displayed in gerrit this is all the interface to zuul users need to see switch to actual gertty screenshot also show zuul status page but zuul is doing a lot of work behind the scenes, and if you look closer, this is what you see .. ansi:: images/color-gertty.ans Zuul Architecture ================= .. ansi:: images/architecture.ans Presentation Checklist ====================== :: [x] Logos [x] Architecture diagram Nodepool ======== * A separate program that works very closely with *Zuul* * Builds images daily and uploads to clouds * Creates and destroys (at least) a vm for every job (Remember that 2,000 jobs per hour number?) Not just for OpenStack ====================== * Zuul v3 is in production for OpenStack (in OpenStack VMs) Also running at: * BMW (control plane in OpenShift) * Easystack * GoDaddy (control plane in Kubernetes) * OpenContrail * OpenLab * Red Hat * others ... Zuul in a nutshell ================== * Listens for code events * Prepares appropriate job config and git repo states * Allocates nodes for test jobs * Pushes git repo states to nodes * Runs user-defined Ansible playbooks * Collects/reports results * Potentially merges change Gating ====== .. cowsay:: Every change proposed for a repository is tested before it merges. Co-gating ========= .. cowsay:: Changes to a set of repositories merge monotonically such that each change is tested with the current state of all the other related repositories before it merges. Parallel Co-gating ================== .. cowsay:: Changes are serialized such that each change is tested with all of the changes ahead of it to satisfy the co-gating requirement while being able to run tests for multiple changes simultaneously. Presentation Checklist ====================== :: [x] Logos [x] Architecture diagram [x] Cows Zuul Simulation =============== .. transition:: pan .. container:: handout * todo .. ansi:: images/zsim-00.ans Zuul Simulation =============== .. transition:: cut .. container:: handout * todo .. ansi:: images/zsim-01.ans Zuul Simulation =============== .. transition:: cut .. container:: handout * todo .. ansi:: images/zsim-02.ans Zuul Simulation =============== .. transition:: cut .. container:: handout * todo .. ansi:: images/zsim-03.ans Zuul Simulation =============== .. transition:: cut .. container:: handout * todo .. ansi:: images/zsim-04.ans Zuul Simulation =============== .. transition:: cut .. container:: handout * todo .. ansi:: images/zsim-05.ans Zuul Simulation =============== .. transition:: cut .. container:: handout * todo .. ansi:: images/zsim-06.ans Zuul Simulation =============== .. transition:: cut .. container:: handout * todo .. ansi:: images/zsim-07.ans Zuul Simulation =============== .. transition:: cut .. container:: handout * todo .. ansi:: images/zsim-08.ans Zuul Simulation =============== .. transition:: cut .. container:: handout * todo .. ansi:: images/zsim-09.ans Zuul Simulation =============== .. transition:: cut .. container:: handout * todo .. ansi:: images/zsim-10.ans Zuul Simulation =============== .. transition:: cut .. container:: handout * todo .. ansi:: images/zsim-11.ans Zuul Simulation =============== .. transition:: cut .. container:: handout * todo .. ansi:: images/zsim-12.ans Zuul Simulation =============== .. transition:: cut .. container:: handout * todo .. ansi:: images/zsim-13.ans Zuul Simulation =============== .. transition:: cut .. container:: handout * todo .. ansi:: images/zsim-14.ans Zuul Simulation =============== .. transition:: cut .. container:: handout * todo .. ansi:: images/zsim-15.ans Zuul Simulation =============== .. transition:: cut .. container:: handout * todo .. ansi:: images/zsim-16.ans Zuul Simulation =============== .. transition:: cut .. container:: handout * todo .. ansi:: images/zsim-17.ans Zuul Simulation =============== .. transition:: cut .. container:: handout * todo .. ansi:: images/zsim-18.ans Zuul Simulation =============== .. transition:: cut .. container:: handout * todo .. ansi:: images/zsim-19.ans Zuul Simulation =============== .. transition:: cut .. container:: handout * todo .. ansi:: images/zsim-20.ans Zuul Simulation =============== .. transition:: cut .. container:: handout * todo .. ansi:: images/zsim-21.ans Zuul Simulation =============== .. transition:: cut .. container:: handout * todo .. ansi:: images/zsim-22.ans Cross-Project Dependencies ========================== Testing or gating dependencies manually specified by developers .. container:: progressive * shade https://review.openstack.org/513913 Add unittest tips jobs * os-client-config https://review.openstack.org/513915 Add shade-tox-tips jobs Depends-On: https://review.openstack.org/513913 * os-client-config https://review.openstack.org/513751 Added nat_source flag for networks Depends-On: https://review.openstack.org/513915 * shade https://review.openstack.org/51391 Add support for configured NAT source variable Depends-On: https://review.openstack.org/513751 Live Configuration Changes ========================== .. container:: handout Zuul is a distributed system, with a distributed configuration. .. code:: yaml - tenant: name: openstack source: gerrit: config-repos: - 'project-config' project-repos: - 'nova' - 'keystone' - 'devstack-gate' Zuul Startup ============ * Read config file Zuul Startup ============ * Read config file * Ask mergers for branches of each repo .. ansi:: images/startup1.ans Zuul Startup ============ * Read config file * Ask mergers for branches of each repo * Ask mergers for .zuul.yaml for each branch of each repo .. ansi:: images/startup2.ans When .zuul.yaml Changes ======================= .. container:: progressive * Zuul looks for changes to .zuul.yaml * Asks mergers for updated content * Splices into configuration used for that change * Works with cross-repo dependencies ("This change depends on a change to the job definition") How do you use this thing? ========================== .. transition:: tilt .. hidetitle:: .. figlet:: Configuration Pipelines ========= * A process definition that connects git repositories, jobs, and reporting mechanisms. * A context to fix a set of jobs to each project. Check Pipeline ============== .. code:: yaml - pipeline: name: check manager: independent source: gerrit trigger: gerrit: - event: patchset-created - event: change-restored success: gerrit: verified: 1 Gate Pipeline ============= .. code:: yaml - pipeline: name: gate manager: dependent source: gerrit trigger: gerrit: - event: comment-added approval: - workflow: 1 success: gerrit: verified: 2 submit: true Jobs ==== * Jobs run on nodes from nodepool (static or dynamic) * Metadata defined in Zuul's configuration * Execution content in Ansible * Jobs may be defined centrally or in the repo being tested * Jobs have contextual variants that simplify configuration Job === .. code:: yaml - job: name: 'base' timeout: '30m' nodes: 'ubuntu-xenial' workspace: '/opt/workspace' pre-run: - 'setup-host' post-run: - 'archive-logs' Simple Job ========== .. code:: yaml - job: name: 'python27' parent: 'base' Simple Job Variant ================== .. code:: yaml - job: name: 'python27' branch: 'stable/mitaka' nodes: 'ubuntu-trusty' Multi-node Job ============== .. container:: handout nodepool, shrews .. code:: yaml - job: name: 'devstack-multinode' parent: 'base' nodes: - name: 'controller' image: 'ubuntu-xenial' - name: 'compute' image: 'ubuntu-xenial' Projects ======== * Projects are git repositories * Specify a set of jobs for each pipeline Project ======= .. code:: yaml - project: name: 'nova' check: jobs: - python27 - python35 - docs Project with Local Variant ========================== .. code:: yaml - project: name: 'nova' check: jobs: - python27 - python35 - docs - pypy: voting: false Project with More Local Variants ================================ .. code:: yaml - project: name: 'nova' check: jobs: - python27 - python35 - docs: files: '^docs/.*$' - pypy: voting: false Project with Many Local Variants ================================ .. code:: yaml - project: name: 'nova' check: jobs: - python27: nodes: 'ubuntu-xenial' - python27: branch: 'stable/newton' nodes: 'ubuntu-trusty' - python35 - docs: files: '^docs/.*$' - pypy: voting: false Project with Job Dependencies ============================= .. code:: yaml - project: name: nova release: jobs: - build-tarball: jobs: - upload-tarball: jobs: - update-mirror Playbooks ========= * Jobs run playbooks * Playbooks may be defined centrally or in the repo being tested * Playbooks can use roles from current or other Zuul repos or Galaxy Devstack-gate / Tempest Playbook ================================ .. code:: yaml # devstack-gate / tempest playbook --- hosts: all roles: - setup-multinode-networking - partition-swap - configure-mirrors - run-devstack - run-tempest Simple Shell Playbook ===================== .. code:: yaml --- hosts: controller roles: - shell: | cd $WORKSPACE ./run_tests.sh Test Like Production ==================== If you use Ansible for deployment, your test and deployment processes and playbooks are the same Important Links =============== * https://zuul-ci.org/ * https://git.zuul-ci.org/cgit/zuul * https://zuul-ci.org/docs/zuul * https://zuul-ci.org/docs/zuul-jobs/ * https://docs.openstack.org/infra/openstack-zuul-jobs/ * freenode:#zuul Questions ========= .. ansi:: images/questions.ans Presentty ========= .. hidetitle:: .. transition:: pan .. figlet:: Presentty * Console presentations written in reStructuredText * Cross-fade, pan, tilt, cut transitions * Figlet, cowsay! * https://pypi.python.org/pypi/presentty