OpenDaylight CI/CD updates

Daniel Farrell
(Red Hat)
@dfarrell07

ODL's CD Pipeline

ODL'S CD PIPELINE

Three-layer stack

ODL'S CD PIPELINE

Packaging layer

ODL'S CD PIPELINE

RPM, .deb

ODL'S CD PIPELINE

Configuration Management Layer

ODL'S CD PIPELINE

Puppet module, Ansible role

ODL'S CD PIPELINE

Pre-Configured Images Layer

ODL'S CD PIPELINE

Containers, VMs
(Docker, Vagrant base boxes)

PACKAGE LAYER

PACKAGE LAYER

Handles system-level dependencies
(Java...)

PACKAGE LAYER

Lays down the basic files

PACKAGE LAYER

Creates required users/groups

PACKAGE LAYER

Sets permissions

PACKAGE LAYER

Configures systemd

PACKAGE LAYER

RPMs and .debs

RPM

(el7)

RPM

CD packaging pipeline

RPM

Build jobs triggered daily + on autorelease

RPM

Builds published to Nexus after test gating


RPM

Install ODL's repo
[~]$ sudo curl -o /etc/yum.repos.d/opendaylight-8-devel.repo \
                  <URL to repo config>

RPM

Install ODL
[~]$ sudo yum install -y opendaylight
<snip>
Installed:
  opendaylight.noarch 0:opendaylight-8.1.0-0.1.20180326snap57.el7
Complete!

RPM

Manage service with systemd
[~]$ sudo systemctl start opendaylight
[~]$ sudo systemctl is-active opendaylight
active

RPM

Connect to Karaf shell, install features
$ ssh -p 8101 karaf@localhost
opendaylight-user@root>feature:install ...    

Deb/OpenSuse RPM

deb

Parallel el7 RPM pipeline

CONFIG MANAGEMENT LAYER

CONFIG MANAGEMENT LAYER

Installs ODL via package layer

CONFIG MANAGEMENT LAYER

Edits files to apply configuration
(Karaf features, port mappings, L3, logging, HA, security groups, IPv4 vs V6, VPP config, Java heap, user/pass...)

CONFIG MANAGEMENT LAYER

Manages ODL's systemd service

PUPPET

Puppet

Well-developed API
class opendaylight::params {
  $default_features = ['config', 'standard', 'region', 'package', 'kar', 'ssh', 'management']
  $extra_features = []
  $odl_rest_port = '8080'
  $odl_bind_ip = '0.0.0.0'
  $rpm_repo = 'opendaylight-6-testing'
  $deb_repo = 'ppa:odl-team/boron'
  $log_levels = {}
  $enable_ha = false
  $ha_node_ips = []
  $ha_node_index = 0
  $security_group_mode = 'stateful'
  $vpp_routing_node = ''
  $java_opts = '-Djava.net.preferIPv4Stack=true'
  $manage_repositories = true
  $username = 'admin'
  $password = 'admin'
}

Puppet

Good OS Support
(CentOS, Fedora, Debian)

Puppet

Well tested in ODL CI

PUPPET

Syntax, rspec-puppet, Puppet linting
desc "Run syntax, lint, and spec tests."
task :test => [
  :syntax,
  :lint,
  :metadata_lint,
  :spec,
]

PUPPET

Coala linting
Executing section git...
Executing section spacing...
Executing section markdown...
Executing section rest...
Executing section yaml...
Executing section json...
Executing section xml...

Puppet

Beaker system testing

Puppet

Deploy against real containers/VMs

Puppet

Verify resulting state

Puppet

Repeat for various configs

Puppet

Consumed by OPNFV Apex et al

ANSIBLE

Ansible

Good OS support
(CentOS, Fedora, OpenSUSE, Ubuntu)

Ansible

Good ODL CI


Ansible

Consumed by OPNFV XCI

ANSIBLE

TODO: Verify jobs from OPNFV on ODL patches

PRE-CONFIGURED IMAGES

PRE-CONFIGURED IMAGES

Environment with ODL installed and configured

PRE-CONFIGURED IMAGES

Built using config management layer

PRE-CONFIGURED IMAGES

VM images
(Vagrant base boxes)

PRE-CONFIGURED IMAGES

Containers
(Docker)

PRE-CONFIGURED IMAGES

Built with Packer

PACKER

Packer

Creates ODL's Vagrant base box + Docker image

Packer

Everything's in VCS

Packer

Common Ansible path
(powerful config, free updates)

CONTAINERS

Containers

Example: One-liner Karaf shell

Containers

$ docker run -ti opendaylight/odl /opt/opendaylight/bin/karaf

Containers

$ docker ps
CONTACONTAINER ID   IMAGE                  COMMAND
b2869594fab3        opendaylight/odl:latest   "/opt/opendaylight/bin/karaf"

CONTAINERS

Available on DockerHub

VAGRANT BASE BOXes

Vagrant Base Boxes

Example

Vagrant Base Boxes

[~/sandbox]$ vagrant init -m opendaylight/odl
[~/sandbox]$ cat Vagrantfile
Vagrant.configure(2) do |config|
  config.vm.box = "opendaylight/odl"
end

Vagrant Base Boxes

[~/sandbox]$ vagrant up

Vagrant Base Boxes

    default: URL: https://atlas.hashicorp.com/opendaylight/odl
==> default: Adding box 'opendaylight/odl' (v6.0.0)

Vagrant Base Boxes

[~/sandbox]$ vagrant status
Current machine states:

default                   running (libvirt)

Vagrant Base Boxes

[~/sandbox]$ vagrant ssh

Vagrant Base Boxes

[vagrant@localhost ~]$ sudo systemctl is-active opendaylight
active

VAGRANT BASE BOXES

Available on Atlas

CONCLUSION

CONCLUSION

OpenDaylight has many deployment options

CONCLUSION

Use upstream tools vs baking your own

CONCLUSION

Contributions encouraged!

CONTACT

Daniel Farrell
Twitter, IRC: dfarrell07
Email: dfarrell@redhat.com
Made with Slides.com