Jump to: navigation, search

Deployment


Overview

OpenDaylight strives to support modern, automated deployments by providing high quality upstream deployment building blocks.

The packaging and delivery pipeline provided by upstream OpenDaylight can be abstracted into three layers.

  • Packages: Software packages, like RPMs and Debs.
  • Configuration management: Tools like Ansible and Puppet that consume the Package Layer to deploy and configure OpenDaylight.
  • Pre-built images: Environments with OpenDaylight pre-installed (by the Package Layer) and configured (by the Config Management Layer), possibly for a specific use case. We use Packer to build VMs and containers, packaged into Vagrant base boxes and Docker images.

Packages

The Packaging Layer of the packaging and delivery stack provided by upstream OpenDaylight is responsible for handling package-level dependencies (Java), creating required user and groups, installing OpenDaylight's files with the correct ownerships and permissions and configuring systemd to manage OpenDaylight's service.

RPM

OpenDaylight is packaged as an RPM and distributed on the CentOS Community Build System.

RPM Install

To install OpenDaylight from the CentOS CBS, simply configure your package manager with information about the appropriate OpenDaylight CBS repository. Find the version of OpenDaylight you'd like to install and curl down the appropriate .repo configuration file.

$ sudo curl -o /etc/yum.repos.d/opendaylight-4-release.repo "<URL to repo config>"
$ sudo yum install -y opendaylight

Once you have OpenDaylight installed, use the included systemd support for managing its service.

$ sudo systemctl start opendaylight
$ sudo systemctl is-active opendaylight
active
$ ssh -p 8101 karaf@localhost
# password "karaf"
opendaylight-user@root>feature:install ...  

RPM Examples

Working example VMs that install OpenDaylight using the RPM are provided by the vagrant-opendaylight project. Some curl down the .repo file and install ODL directly (as shown above), others use configuration management tools to install ODL via its RPM (as described below).

$ vagrant up cent7_rpm_be
$ vagrant ssh cent7_rpm_be
$ sudo systemctl is-active opendaylight 
active
$ sudo yum info opendaylight | grep Version
Version     : 4.0.0
$ ssh -p 8101 karaf@localhost
# password "karaf"
opendaylight-user@root>

Example VMs for each ODL RPM version are documented in the RPM Versions section.

RPM Building

The complete environment (Vagrant + scripts) for building OpenDaylight's SRPM is shared in Integration/Packaging's rpm directory.

[~/packaging/rpm]$ vagrant up
[~/packaging/rpm]$ vagrant ssh
[vagrant@localhost ~]$ /vagrant/build.py -v 4 0 0 1
[vagrant@localhost ~]$ ls -rc /vagrant/cache | tail -n 2
opendaylight-4.0.0-1.el7.src.rpm
opendaylight-4.0.0-1.el7.noarch.rpm

For more information, see integration/packaging/rpm/README.

RPM Versions

ODL Version RPM Repository Recommended .repo File Example installs Notes
Boron Latest Testing nfv7-opendaylight-5-testing opendaylight-5-testing.repo Frequent builds from OpenDaylight's stable/boron branch are provided for consumption by projects that need to test against the most recent version of ODL, like OPNFV. They are not official OpenDaylight releases (which are well-tested and blessed by the ODL TSC). Builds are typically based on autorelease artifacts, which are built by autorelease-release-boron.
Beryllium Latest Testing nfv7-opendaylight-4-testing opendaylight-4-testing.repo cent7_rpm_be_latest, f23_rpm_be_latest Frequent builds from OpenDaylight's stable/beryllium branch are provided for consumption by projects that need to test against the most recent version of ODL, like OPNFV. They are not official OpenDaylight releases (which are well-tested and blessed by the ODL TSC). Builds are typically based on autorelease artifacts, which are built by autorelease-release-beryllium.
Beryllium 4.2.0 nfv7-opendaylight-42-release opendaylight-42-release.repo cent7_rpm_be_sr2
Beryllium 4.1.0 nfv7-opendaylight-41-release opendaylight-41-release.repo cent7_rpm_be_sr1
Beryllium 4.0.0 nfv7-opendaylight-40-release opendaylight-40-release.repo cent7_rpm_be, f23_rpm_be
Lithium SR4 3.4.0 nfv7-opendaylight-34-release opendaylight-34-release.repo cent7_li_sr4
Lithium SR3 3.3.0 nfv7-opendaylight-33-release opendaylight-33-release.repo cent7_rpm_li_sr3, f23_rpm_li_sr3
Lithium SR2 3.2.0 nfv7-opendaylight-32-release opendaylight-32-release.repo cent7_rpm_li_sr2, f23_rpm_li_sr2
Lithium SR1 3.1.0 nfv7-opendaylight-31-release opendaylight-31-release.repo f23_rpm_li_sr1
Lithium 3.0.0 nfv7-opendaylight-30-release opendaylight-30-release.repo f22_rpm_li, f23_rpm_li
Helium SR4 2.4.0 nfv7-opendaylight-24-release opendaylight-24-release.repo cent7_rpm_he_sr4

Deb

OpenDaylight is packaged as a .deb and distributed on the OpenSUSE Build Service and Launchpad PPA's.

Deb Install

To install OpenDaylight from the OpenSUSE Build Service, simply follow the instructions given here.

To install OpenDaylight for Ubuntu from Launchpad PPA's, find the release (beryllium / boron / carbon) that you'd like to install, add the team's repository and install the package.

$ sudo add-apt-repository ppa:odl-team/<release>
$ sudo apt-get update
$ sudo apt-get install opendaylight

Once you have OpenDaylight installed, use the included systemd support for managing its service.

$ sudo systemctl start opendaylight
$ sudo systemctl is-active opendaylight
active
$ ssh -p 8101 karaf@localhost
# password "karaf"
opendaylight-user@root>feature:install ...  

Deb Building

The complete environment (Vagrant + scripts) for building OpenDaylight's Debs is shared in Integration/Packaging's deb directory.

[~/packaging/deb]$ vagrant up
[~/packaging/deb]$ vagrant ssh
[vagrant@localhost ~]$ /vagrant/build.py -v 5 0 0 1
[vagrant@localhost ~]$ ls -rc /vagrant/cache | tail -n 1
opendaylight_5.0.0-1_all.deb

For more information, see integration/packaging/deb/README.

Configuration Management

The Packaging Layer of the packaging and delivery stack provided by upstream OpenDaylight installs OpenDaylight via the Packaging Layer and then does any additional configuration required by the particular deployment's requirements. Examples include setting Karaf features to install at boot, remapping OpenDaylight ports, opening OpenDaylight ports in firewalld and managing OpenDaylight's systemd service. As additional knobs are required to configure deployments, upstream support should be added here.

Ansible Role

The OpenDaylight Integration/Packaging project provides an Ansible role for OpenDaylight.

The Ansible role provides consistent, well-understood OpenDaylight installation and configuration.

Ansible consumes OpenDaylight's RPM (via a local path, remote URL or yum repo) and builds on its installation by providing pre-built tasks for configuring and managing OpenDaylight.

Ansible logic is expressed in YAML, which makes it simple and human-readable.

This Ansible playbook provides a minimal working example of installing OpenDaylight using the Ansible role, accepting all the default configuration.

---
- hosts: all
  sudo: yes
  roles:
    - role: opendaylight

This will install OpenDaylight from the CentOS Community Build System, keep all the default configurations, open the required ports in firewalld if it's active and start OpenDaylight with systemd if it's installed.

A nearly universal requirement for OpenDaylight deployments is to install a set of Karaf features, with the exact set varying by deployment. For automated deployments where manually logging into Karaf's CLI and issuing feature:install commands is unacceptable, modifying the featuresBoot configuration is a common solution. To handle this use case with the Ansible role, simply pass a list of the extra features you'd like to install at ODL boot.

---
- hosts: all
  sudo: yes
  roles:
    - role: opendaylight
      extra_features: ['odl-toaster', 'your-feature-here']

The Ansible role supports installing from a yum repository, locally cached RPM or URL to a remote RPM. This playbook shows a minimal working example of a locally cached RPM install.

---
- hosts: all
  sudo: yes
  roles:
    - role: opendaylight
      install_method: "rpm_path"
      rpm_path: "/vagrant/opendaylight-3.0.0-2.el7.noarch.rpm"

The Ansible role's source is currently on GitHub under dfarrell07/ansible-opendaylight, as it needs to be in a stand-along repo for tagging. Once the ODL Forge exists, we hope to move it there and submodule it in Integration/Packaging. The role is also indexed on Ansible Galaxy. Now that Integration/Packaging exists, we're in the process of moving it to an official OpenDaylight Ansible Galaxy account.

For additional information, see the Ansible docs, the README, the CONTRIBUTING docs and the working examples provided by the vagrant-opendaylight project.

Puppet Module

The OpenDaylight Integration/Packaging project provides a Puppet module for OpenDaylight.

The Puppet module provides consistent, well-understood OpenDaylight installation and configuration.

Puppet consumes OpenDaylight as an RPM from a yum repository (recommended) or as links to a raw ODL release artifact tarball and a unitfile to describe how to manage ODL's service (systemd/Upstart).

Puppet Manifests use a DSL to describe machine configurations.

A manifest that simply invokes the opendaylight class, passing no parameters, will install and start OpenDaylight with a default configuration.

class { 'opendaylight':
}

To set extra Karaf features to be installed at OpenDaylight start time, pass them in a list to the extra_features param. The extra features you pass will typically be driven by the requirements of your ODL install. You'll almost certainly need to pass some.

class { 'opendaylight':
  extra_features => ['odl-toaster', 'your-feature-here'],
}

The Puppet module's source is currently on GitHub under dfarrell07/puppet-opendaylight, as it needs to be in a stand-along repo for tagging. Once the ODL Forge exists, we hope to move it there and submodule it in Integration/Packaging. The module is also indexed on the Puppet Forge. Now that Integration/Packaging exists, we're in the process of moving it to an official OpenDaylight Puppet Forge account.

For additional documentation, see the README and CONTRIBUTING files in the codebase as well as the working examples provided by the vagrant-opendaylight project.

Pre-Built Images

The Pre-Built Image Layer of the packaging and delivery stack provided by upstream OpenDaylight consumes the Packaging and Configuration Management Layers to provide well-understood, repeatable, pre-configured OpenDaylight environments. We use Packer, which in turn uses our Ansible role and RPM, to build VMs packaged as Vagrant base boxes and containers packaged as Docker images.

Packer

The OpenDaylight Integration/Packaging project uses Packer to build its VMs (packaged as Vagrant base boxes) and containers (packaged as Docker images).

Packer provides a modular build process that allows the reuse of existing packaging and deployment building blocks, like the RPM and Ansible role. As the build process is fully described in version controlled configurations, all artifacts can be trivially reproduced.

[~/packaging/packer]$ cat vars/opendaylight-4.4.0.json
{
   "odl_version": "4.4.0",
   "docker_repo": "opendaylight/odl",
   "rpm_repo_file": "opendaylight-44-release.repo",
   "rpm_repo_url": "'https://git.opendaylight.org/gerrit/gitweb?p=integration/packaging.git;a=blob_plain;f=rpm/example_repo_configs/opendaylight-44-release.repo'"
}
[~/packaging/packer]$ cat vars/fedora-24.json
{
   "os_name": "fedora",
   "os_version": "24",
   "guest_os_type": "Fedora_64",
   "iso_urls": "https://download.fedoraproject.org/pub/fedora/linux/releases/24/Server/x86_64/iso/Fedora-Server-dvd-x86_64-24-1.2.iso",
   "iso_checksum": "1c0971d4c1a37bb06ec603ed3ded0af79e22069499443bb2d47e501c9ef42ae8"
}
[~/packaging/packer]$ packer build -var-file=vars/opendaylight-4.4.0.json -var-file=vars/fedora-24.json templates/virtualbox.json
<snip>
Builds finished. The artifacts of successful builds are:
--> 'virtualbox' provider box: opendaylight-4.4.0-fedora-24.box
[~/packaging/packer]$ ls -rc | tail -n 1
opendaylight-4.4.0-fedora-24.box

The resulting Vagrant base box can then be imported and consumed.

[~/packaging/packer]$ vagrant box add --name "opendaylight" \
                                             opendaylight-4.4.0-fedora-24.box
[~/packaging/packer]$ mkdir ~/sandbox; cd $_
[~/sandbox]$ vagrant init -m opendaylight
[~/sandbox]$ cat Vagrantfile
Vagrant.configure(2) do |config|
  config.vm.box = "opendaylight"
end
[~/sandbox]$ vagrant up
==> default: Importing base box 'opendaylight'...
[~/sandbox]$ vagrant ssh
[vagrant@localhost ~]$ sudo systemctl is-active opendaylight
active
[~/packaging/packer]$ packer build -var-file=vars/opendaylight-4.4.0.json -var-file=vars/fedora-24.json templates/docker.json
<snip>
Builds finished. The artifacts of successful builds are:
--> 'docker' provider: opendaylight/odl:4.4.0 image tagged

The new ODL Docker image will appear in Docker's local index.

[~/packaging/packer]$ docker images | grep opendaylight
opendaylight/odl  4.4.0  <snip>
[~/packaging/packer]$ docker run -ti opendaylight/odl:4.4.0 /opt/opendaylight/bin/karaf
<snip>
opendaylight-user@root>feature:install ...

As OpenDaylight moves towards a Continuous Release process and Integration/Packaging works to build an upstream Continuous Delivery pipeline on top of it, Packer will likely serve as a key part of future automated build pipelines.

The OpenDaylight Packer configuration lives in the Integration/Packaging project's repository under packaging/packer. For more information, see the README in that repo, the main Packer docs and these slides about ODL's Packer setup.

Vagrant Base Boxes

The OpenDaylight Integration/Packaging project provides pre-configured OpenDaylight VMs packaged as Vagrant base boxes.

The Vagrant base boxes are built using the Integration/Packaging project's Packer configuration and are fully reproducible from that configuration. Since Packer reuses OpenDaylight's RPM and Ansible role for the install and configuration, it's easy to build custom Vagrant base boxes by passing parameters to the Ansible role.

Since the Vagrant base box pre-built, the long and compute/network heavy install and configuration process is baked-in and doesn't need to be repeated at every vagrant up. The same property would apply to more specialized (and complex, slower to build) VMs defined by Int/Pack's Packer configuration, such as development tools VMs.

Consuming OpenDaylight via a Vagrant base box is trivial:

[~/sandbox]$ vagrant init -m opendaylight/odl
[~/sandbox]$ cat Vagrantfile
Vagrant.configure(2) do |config|
  config.vm.box = "opendaylight/odl"
end
[~/sandbox]$ vagrant up
[~/sandbox]$ vagrant ssh
[vagrant@localhost ~]$ sudo systemctl is-active opendaylight
active

OpenDaylight's Vagrant base boxes can be built from Integration/Packaging's Packer configuration or consumed pre-built from the Atlas account managed by Integration/Packaging.

Containers

The OpenDaylight Integration/Packaging project provides pre-configured OpenDaylight containers packaged as Docker images.

As with the Vagrant base boxes, OpenDaylight's containers are built using the Integration/Packaging project's Packer configuration and are fully reproducible from that configuration. Since Packer reuses OpenDaylight's RPM and Ansible role for the install and configuration, it's easy to build custom containers by passing parameters to the Ansible role.

It's possible to get a running ODL Karaf shell with a single line via Docker:

[~]$ docker run -ti opendaylight/odl:3.0.0 /opt/opendaylight/bin/karaf
<snip>
opendaylight-user@root>feature:install ...

OpenDaylight's containers can be built from Integration/Packaging's Packer configuration or consumed pre-built from OpenDaylight's official DockerHub.