class opnfv {
- exec {'disable selinux':
- command => '/usr/sbin/setenforce 0',
- unless => '/usr/sbin/getenforce | grep Permissive',
- }
- include stdlib
- stage { 'presetup':
- before => Stage['setup'],
+ if $::osfamily == 'Fuel' {
+ include opnfv::resolver
+ include opnfv::ntp
+ include opnfv::add_packages
+ include opnfv::odl_docker
+ include opnfv::opncheck
}
- class { "opnfv::repo":
- stage => presetup,
- }
+ if $::osfamily == 'RedHat' {
+
+ exec {'disable selinux':
+ command => '/usr/sbin/setenforce 0',
+ unless => '/usr/sbin/getenforce | grep Permissive',
+ }
+ include stdlib
+ stage { 'presetup':
+ before => Stage['setup'],
+ }
+ class { "opnfv::repo":
+ stage => presetup,
+ }
+ }
}
--- /dev/null
+##############################################################################
+# Copyright (c) 2015 Ericsson AB and others.
+# stefan.k.berg@ericsson.com
+# jonas.bjurel@ericsson.com
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Apache License, Version 2.0
+# which accompanies this distribution, and is available at
+# http://www.apache.org/licenses/LICENSE-2.0
+##############################################################################
+
+# Class: Ntp
+#
+# Add Ntp content passed through astute.yaml into ntp.conf depending on the role
+#
+# Suitable yaml content:
+# <begin>
+# opnfv:
+# ntp:
+# controller: |
+# line 1
+# line 2
+# compute: |
+# line 1
+# line 2
+# <end>
+#
+#
+#
+
+class opnfv::ntp(
+ $file='/etc/ntp.conf'
+) {
+
+ if $::fuel_settings['role'] {
+ if ($::fuel_settings['opnfv'] and
+ $::fuel_settings['opnfv']['ntp']) {
+ case $::fuel_settings['role'] {
+ /controller/: {
+ if $::fuel_settings['opnfv']['ntp']['controller'] {
+ $template = 'opnfv/ntp.conf.controller.erb'
+ $file_content = $::fuel_settings['opnfv']['ntp']['controller']
+ }
+ }
+ /compute/: {
+ if $::fuel_settings['opnfv']['ntp']['compute'] {
+ $template = 'opnfv/ntp.conf.compute.erb'
+ $file_content = $::fuel_settings['opnfv']['ntp']['compute']
+ }
+ }
+ }
+ }
+ }
+
+ if $file_content {
+ package { 'ntp':
+ ensure => installed,
+ }
+
+ file { $file:
+ content => template($template),
+ notify => Service['ntp'],
+ }
+
+ service { 'ntp':
+ ensure => running,
+ enable => true,
+ require => [ Package['ntp'], File[$file]]
+ }
+ }
+}
+
+
--- /dev/null
+##############################################################################
+# Copyright (c) 2015 Ericsson AB and others.
+# daniel.smith@ericsson.com
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Apache License, Version 2.0
+# which accompanies this distribution, and is available at
+# http://www.apache.org/licenses/LICENSE-2.0
+##############################################################################
+
+class opnfv::odl_docker
+{
+ case $::fuel_settings['role'] {
+ /controller/: {
+
+ file { "/opt":
+ ensure => "directory",
+ }
+
+ file { "/opt/opnfv":
+ ensure => "directory",
+ owner => "root",
+ group => "root",
+ mode => 777,
+ }
+
+ file { "/opt/opnfv/odl":
+ ensure => "directory",
+ }
+
+ file { "/opt/opnfv/odl/odl_docker_image.tar":
+ ensure => present,
+ source => "/etc/puppet/modules/opnfv/odl_docker/odl_docker_image.tar",
+ mode => 750,
+ }
+
+ file { "/opt/opnfv/odl/docker-latest":
+ ensure => present,
+ source => "/etc/puppet/modules/opnfv/odl_docker/docker-latest",
+ mode => 750,
+ }
+
+ file { "/opt/opnfv/odl/start_odl_conatiner.sh":
+ ensure => present,
+ source => "/etc/puppet/modules/opnfv/scripts/start_odl_container.sh",
+ mode => 750,
+ }
+ }
+ }
+}
+
--- /dev/null
+##############################################################################
+# Copyright (c) 2015 Ericsson AB and others.
+# stefan.k.berg@ericsson.com
+# jonas.bjurel@ericsson.com
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Apache License, Version 2.0
+# which accompanies this distribution, and is available at
+# http://www.apache.org/licenses/LICENSE-2.0
+##############################################################################
+
+# Class: opnfv::resolver
+#
+# Add resolver content passed through astute.yaml into resolv.conf
+# depending on the role
+#
+# Suitable yaml content:
+# <begin>
+# opnfv:
+# dns:
+# compute:
+# - 100.100.100.2
+# - 100.100.100.3
+# controller:
+# - 100.100.100.102
+# - 100.100.100.104
+# <end>
+#
+#
+#
+
+class opnfv::resolver()
+{
+ if $::fuel_settings['role'] {
+ if $::fuel_settings['role'] == 'primary-controller' {
+ $role = 'controller'
+ } else {
+ $role = $::fuel_settings['role']
+ }
+
+ if ($::fuel_settings['opnfv']
+ and $::fuel_settings['opnfv']['dns']
+ and $::fuel_settings['opnfv']['dns'][$role]) {
+ $nameservers=$::fuel_settings['opnfv']['dns'][$role]
+
+ file { '/etc/resolv.conf':
+ owner => root,
+ group => root,
+ mode => '0644',
+ content => template('opnfv/resolv.conf.erb'),
+ }
+# /etc/resolv.conf is re-generated at each boot by resolvconf, so we
+# need to store there as well.
+ file { '/etc/resolvconf/resolv.conf.d/head':
+ owner => root,
+ group => root,
+ mode => '0644',
+ content => template('opnfv/resolv.conf.erb'),
+ }
+ }
+ }
+}
+
--- /dev/null
+####################################################################
+# Copyright (c) 2015 Ericsson AB and others.
+# daniel.smith@ericsson.com
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Apache License, Version 2.0
+# which accompanies this distribution, and is available at
+# http://www.apache.org/licenses/LICENSE-2.0
+##############################################################################
+#
+# DOCKERFILE TO CREATE ODL IN CONTAINER AND EXPOSE DLUX AND OVSDB TO ODL
+#
+#############################################################################
+
+
+#Set the base image - note: the current release of Karaf is using Jdk7 and alot of 12.04, so we will use it rather than 14.04 and backport a ton of stuff
+FROM ubuntu:12.04
+
+# Maintainer Info
+MAINTAINER Daniel Smith
+
+
+#Run apt-get update one start just to check for updates when building
+RUN echo "Updating APT"
+RUN apt-get update
+RUN echo "Adding wget"
+RUN apt-get install -y wget
+RUN apt-get install -y net-tools
+RUN apt-get install -y openjdk-7-jre
+RUN apt-get install -y openjdk-7-jdk
+RUN apt-get install -y openssh-server
+RUN apt-get install -y vim
+RUN apt-get install -y expect
+RUN apt-get install -y daemontools
+RUN mkdir -p /opt/odl_source
+RUN bash -c 'echo "export JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64" >> ~/.bashrc'
+
+
+
+#Now lets got and fetch the ODL distribution
+RUN echo "Fetching ODL"
+RUN wget https://nexus.opendaylight.org/content/groups/public/org/opendaylight/integration/distribution-karaf/0.2.2-Helium-SR2/distribution-karaf-0.2.2-Helium-SR2.tar.gz -O /opt/odl_source/distribution-karaf-0.2.2-Helium-SR2.tar.gz
+
+RUN echo "Untarring ODL inplace"
+RUN mkdir -p /opt/odl
+RUN tar zxvf /opt/odl_source/distribution-karaf-0.2.2-Helium-SR2.tar.gz -C /opt/odl
+
+RUN echo "Installing DLUX and other features into ODL"
+#COPY dockerfile/container_scripts/start_odl_docker.sh /etc/init.d/start_odl_docker.sh
+COPY container_scripts/start_odl_docker_container.sh /etc/init.d/
+COPY container_scripts/speak.sh /etc/init.d/
+#COPY dockerfile/container_scripts/speak.sh /etc/init.d/speak.sh
+RUN chmod 777 /etc/init.d/start_odl_docker_container.sh
+RUN chmod 777 /etc/init.d/speak.sh
+
+
+
+# Expose the ports
+
+# PORTS FOR BASE SYSTEM AND DLUX
+EXPOSE 8101
+EXPOSE 6633
+EXPOSE 1099
+EXPOSE 43506
+EXPOSE 8181
+EXPOSE 8185
+EXPOSE 9000
+EXPOSE 39378
+EXPOSE 33714
+EXPOSE 44444
+EXPOSE 6653
+
+# PORTS FOR OVSDB AND ODL CONTROL
+EXPOSE 12001
+EXPOSE 6640
+EXPOSE 8080
+EXPOSE 7800
+EXPOSE 55130
+EXPOSE 52150
+EXPOSE 36826
+
+# set the ENTRYPOINT - An entry point allows us to run this container as an exectuable
+CMD ["/etc/init.d/start_odl_docker.sh"]
# http://www.apache.org/licenses/LICENSE-2.0
##############################################################################
-$fuel_settings = parseyaml($astute_settings_yaml)
+#!/usr/bin/expect
+spawn /opt/odl/distribution-karaf-0.2.2-Helium-SR2/bin/client
+expect "root>"
+send "feature:list | grep -i odl-restconf\r"
+send "\r\r\r"
+expect "root>"
+send "logout\r"
-include opnfv::jre
--- /dev/null
+#!/usr/bin/expect
+##############################################################################
+# Copyright (c) 2015 Ericsson AB and others.
+# daniel.smith@ericsson.com
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Apache License, Version 2.0
+# which accompanies this distribution, and is available at
+# http://www.apache.org/licenses/LICENSE-2.0
+##############################################################################
+#
+# Simple expect script to start up ODL client and load feature set for DLUX and OVSDB
+# NOTE: THIS WILL BE REPLACED WITH A PROGRAMATIC METHOD SHORTLY
+#################################################################################
+
+spawn /opt/odl/distribution-karaf-0.2.2-Helium-SR2/bin/client
+expect "root>"
+send "feature:install odl-base-all odl-aaa-authn odl-restconf odl-nsf-all odl-adsal-northbound odl-mdsal-apidocs odl-ovsdb-openstack odl-ovsdb-northbound odl-dlux-core"
+send "\r\r\r"
+expect "root>"
+send "logout\r"
--- /dev/null
+#!/bin/bash
+##############################################################################
+# Copyright (c) 2015 Ericsson AB and others.
+# daniel.smith@ericsson.com
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Apache License, Version 2.0
+# which accompanies this distribution, and is available at
+# http://www.apache.org/licenses/LICENSE-2.0
+##############################################################################
+#
+# Simple expect script to start up ODL client and load feature set for DLUX and OVSDB
+# NOTE: THIS WILL BE REPLACED WITH A PROGRAMATIC METHOD SHORTLY
+#################################################################################
+# Start up script for calling karaf / ODL inside a docker container.
+#
+# This script will also call a couple expect scripts to load the feature set that we want
+
+
+#ENV
+export JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64
+
+#MAIN
+echo "Starting up the da Sheilds..."
+/opt/odl/distribution-karaf-0.2.2-Helium-SR2/bin/karaf server &
+echo "Sleeping 5 bad hack"
+sleep 10
+echo "should see stuff listening now"
+netstat -na
+echo " should see proess running for karaf"
+ps -efa
+echo " Starting the packages we want"
+/etc/init.d/speak.sh
+echo "Printout the status - if its right, you should see 8181 appear now"
+netstat -na
+ps -efa
+
+
+
+## This is a loop that keeps our container going currently, prinout the "status of karaf" to the docker logs every minute
+## Cheap - but effective
+while true;
+do
+ echo "Checking status of ODL:"
+ /opt/odl/distribution-karaf-0.2.2-Helium-SR2/bin/status
+ sleep 60
+done
+
+
# http://www.apache.org/licenses/LICENSE-2.0
##############################################################################
-$fuel_settings = parseyaml($astute_settings_yaml)
+tinker panic 0
+driftfile /var/lib/ntp/ntp.drift
+statistics loopstats peerstats clockstats
+filegen loopstats file loopstats type day enable
+filegen peerstats file peerstats type day enable
+filegen clockstats file clockstats type day enable
+restrict -4 default kod notrap nomodify nopeer noquery
+restrict -6 default kod notrap nomodify nopeer noquery
+restrict 127.0.0.1
+restrict ::1
+<%= @file_content %>
-include opnfv::java
# http://www.apache.org/licenses/LICENSE-2.0
##############################################################################
-In order to test the functionality without performing a full deployment, run "puppet apply" on the
-fake_init.pp which will call only the opnfv::java class.
+tinker panic 0
+driftfile /var/lib/ntp/ntp.drift
+statistics loopstats peerstats clockstats
+filegen loopstats file loopstats type day enable
+filegen peerstats file peerstats type day enable
+filegen clockstats file clockstats type day enable
+restrict -4 default kod notrap nomodify nopeer noquery
+restrict -6 default kod notrap nomodify nopeer noquery
+restrict 127.0.0.1
+restrict ::1
+<%= @file_content %>
DOCKERIMG = opnfv.org/ubuntu-builder:14.04
export TOPDIR := $(shell pwd)
+
#
# END of variables to customize
#############################################################################
SUBDIRS += f_l23network
SUBDIRS += f_resolvconf
SUBDIRS += f_ntp
-SUBDIRS += f_gif
-SUBDIRS += f_libnss
-SUBDIRS += f_libpcs
-SUBDIRS += f_libxt
-SUBDIRS += f_comm_java
-SUBDIRS += f_ca_cert
-SUBDIRS += f_atk_wrap
-SUBDIRS += f_jre_head
-SUBDIRS += f_jre
-SUBDIRS += f_java
-SUBDIRS += f_odl
+SUBDIRS += f_odl_docker
@make -C docker
@docker/runcontext $(DOCKERIMG) $(MAKE) $(MAKEFLAGS) iso
+
+
$(ISOCACHE):
# Clone Fuel to non-persistent location and build
cd /tmp && git clone $(FUEL_MAIN_REPO)
.PHONY: prepare
prepare:
- $(MAKE) -C opendaylight -f Makefile setup
+ #$(MAKE) -C opendaylight -f Makefile setup
.PHONY: odl
odl:
- $(MAKE) -C opendaylight -f Makefile
+ #$(MAKE) -C opendaylight -f Makefile
.PHONY: build-clean $(SUBCLEAN)
build-clean: $(SUBCLEAN)
.PHONY: clean $(SUBCLEAN)
clean: prepare $(SUBCLEAN)
$(MAKE) -C patch-packages -f Makefile clean
- $(MAKE) -C opendaylight -f Makefile clean
+ #$(MAKE) -C opendaylight -f Makefile clean
@rm -f *.iso
@rm -Rf release
@rm -Rf newiso
FUEL_MAIN_REPO := https://github.com/stackforge/fuel-main
FUEL_MAIN_TAG = stable/6.0
-JAVA_MAIN_REPO := https://mirrors.kernel.org/ubuntu/pool/universe/o/openjdk-8
-ATK_MAIN_REPO := https://mirrors.kernel.org/ubuntu/pool/main/j/java-atk-wrapper
-GIF_MAIN_REPO := https://mirrors.kernel.org/ubuntu/pool/main/g/giflib
-CERT_MAIN_REPO := https://mirrors.kernel.org/ubuntu/pool/main/c/ca-certificates
-COMM_MAIN_REPO := https://mirrors.kernel.org/ubuntu/pool/main/j/java-common
-LIBPCS_MAIN_REPO := https://mirrors.kernel.org/ubuntu/pool/main/p/pcsc-lite
-LIBXT_MAIN_REPO := https://mirrors.kernel.org/ubuntu/pool/main/libx/libxtst
-DEFJRE_MAIN_REPO := https://mirrors.kernel.org/ubuntu/pool/main/j/java-common
-LIBNSS_MAIN_REPO := https://mirrors.kernel.org/ubuntu/pool/main/n/nss
+DOCKER_REPO := http://get.docker.com/builds/Linux/x86_64
+DOCKER_TAG := docker-latest
+++ /dev/null
-##############################################################################
-# Copyright (c) 2015 Ericsson AB and others.
-# daniel.smith@ericsson.com
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Apache License, Version 2.0
-# which accompanies this distribution, and is available at
-# http://www.apache.org/licenses/LICENSE-2.0
-##############################################################################
-
-TOP := $(shell pwd)
-include ../config.mk
-
-PACKAGE := libatk-wrapper-java
-VERSION := 0.30.4-4_all
-DEB_NAME := $(PACKAGE)_$(VERSION).deb
-
-.PHONY: all
-all: release/pool/main/$(DEB_NAME)
-
-release/pool/main/$(DEB_NAME):
-ifeq ($(ATK_MAIN_REPO),)
- @echo "No config-spec target for Java, nothing to build"
-else
- @mkdir -p release/pool/main && \
- cd release/pool/main && \
- wget -N $(ATK_MAIN_REPO)/$(DEB_NAME)
- @lintian release/pool/main/$(DEB_NAME)
-endif
-
-.PHONY: clean
-clean:
- @rm -rf release
- @rm -f $(DEB_DEST)/$(DEB_NAME)
-
-
-.PHONY: release
-release:release/pool/main/$(DEB_NAME)
-ifneq ($(ATK_MAIN_REPO),)
- @cp release/pool/main/$(DEB_NAME) $(DEB_DEST)
- @cp -Rvp puppet/modules/* $(PUPPET_DEST)
-endif
-
+++ /dev/null
-class opnfv::atk_wrap {
- if $::osfamily == 'Debian' {
- case $::fuel_settings['role'] {
- /controller/: {
- package { 'libatk-wrapper-java':
- ensure => installed,
- }
- }
- }
- }
-}
-
+++ /dev/null
-##############################################################################
-# Copyright (c) 2015 Ericsson AB and others.
-# stefan.k.berg@ericsson.com
-# jonas.bjurel@ericsson.com
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Apache License, Version 2.0
-# which accompanies this distribution, and is available at
-# http://www.apache.org/licenses/LICENSE-2.0
-##############################################################################
-
-TOP := $(shell pwd)
-include ../config.mk
-
-PACKAGE := ca-certificates
-VERSION := 20130906ubuntu2_all
-DEB_NAME := $(PACKAGE)_$(VERSION).deb
-
-.PHONY: all
-all: release/pool/main/$(DEB_NAME)
-
-release/pool/main/$(DEB_NAME):
-ifeq ($(CERT_MAIN_REPO),)
- @echo "No config-spec target for Java, nothing to build"
-else
- @mkdir -p release/pool/main && \
- cd release/pool/main && \
- wget -N $(CERT_MAIN_REPO)/$(DEB_NAME)
- @lintian release/pool/main/$(DEB_NAME)
-endif
-
-.PHONY: clean
-clean:
- @rm -rf release
- @rm -f $(DEB_DEST)/$(DEB_NAME)
-
-
-.PHONY: release
-release:release/pool/main/$(DEB_NAME)
-ifneq ($(CERT_MAIN_REPO),)
- @cp release/pool/main/$(DEB_NAME) $(DEB_DEST)
- @cp -Rvp puppet/modules/* $(PUPPET_DEST)
-endif
+++ /dev/null
-class opnfv::ca_cert {
- if $::osfamily == 'Debian' {
- case $::fuel_settings['role'] {
- /controller/: {
- package { 'ca-certificates':
- ensure => installed,
- }
- }
- }
- }
-}
+++ /dev/null
-##############################################################################
-# Copyright (c) 2015 Ericsson AB and others.
-# stefan.k.berg@ericsson.com
-# jonas.bjurel@ericsson.com
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Apache License, Version 2.0
-# which accompanies this distribution, and is available at
-# http://www.apache.org/licenses/LICENSE-2.0
-##############################################################################
-
-TOP := $(shell pwd)
-include ../config.mk
-
-PACKAGE := java-common
-VERSION := 0.51_all
-DEB_NAME := $(PACKAGE)_$(VERSION).deb
-
-.PHONY: all
-all: release/pool/main/$(DEB_NAME)
-
-release/pool/main/$(DEB_NAME):
-ifeq ($(COMM_MAIN_REPO),)
- @echo "No config-spec target for Java, nothing to build"
-else
- @mkdir -p release/pool/main && \
- cd release/pool/main && \
- wget -N $(COMM_MAIN_REPO)/$(DEB_NAME)
- @lintian release/pool/main/$(DEB_NAME)
-endif
-
-.PHONY: clean
-clean:
- @rm -rf release
- @rm -f $(DEB_DEST)/$(DEB_NAME)
-
-
-.PHONY: release
-release:release/pool/main/$(DEB_NAME)
-ifneq ($(COMM_MAIN_REPO),)
- @cp release/pool/main/$(DEB_NAME) $(DEB_DEST)
- @cp -Rvp puppet/modules/* $(PUPPET_DEST)
-endif
+++ /dev/null
-class opnfv::comm_java {
- if $::osfamily == 'Debian' {
- case $::fuel_settings['role'] {
- /controller/: {
- package { 'java-common':
- ensure => installed,
- }
- }
- }
- }
-}
+++ /dev/null
-##############################################################################
-# Copyright (c) 2015 Ericsson AB and others.
-# stefan.k.berg@ericsson.com
-# jonas.bjurel@ericsson.com
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Apache License, Version 2.0
-# which accompanies this distribution, and is available at
-# http://www.apache.org/licenses/LICENSE-2.0
-##############################################################################
-
-TOP := $(shell pwd)
-include ../config.mk
-
-PACKAGE := default-jre
-VERSION := 1.7-51_amd64
-DEB_NAME := $(PACKAGE)_$(VERSION).deb
-
-.PHONY: all
-all: release/pool/main/$(DEB_NAME)
-
-release/pool/main/$(DEB_NAME):
-ifeq ($(DEFJRE_MAIN_REPO),)
- @echo "No config-spec target for Java, nothing to build"
-else
- @mkdir -p release/pool/main && \
- cd release/pool/main && \
- wget -N $(DEFJRE_MAIN_REPO)/$(DEB_NAME)
- @lintian release/pool/main/$(DEB_NAME)
-endif
-
-.PHONY: clean
-clean:
- @rm -rf release
- @rm -f $(DEB_DEST)/$(DEB_NAME)
-
-
-.PHONY: release
-release:release/pool/main/$(DEB_NAME)
-ifneq ($(DEFJRE_MAIN_REPO),)
- @cp release/pool/main/$(DEB_NAME) $(DEB_DEST)
- @cp -Rvp puppet/modules/* $(PUPPET_DEST)
-endif
+++ /dev/null
-class opnfv::defjre {
- if $::osfamily == 'Debian' {
- case $::fuel_settings['role'] {
- /controller/: {
- package { 'default-jre':
- ensure => installed,
- }
- }
- }
- }
-}
+++ /dev/null
-##############################################################################
-# Copyright (c) 2015 Ericsson AB and others.
-# stefan.k.berg@ericsson.com
-# jonas.bjurel@ericsson.com
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Apache License, Version 2.0
-# which accompanies this distribution, and is available at
-# http://www.apache.org/licenses/LICENSE-2.0
-##############################################################################
-
-TOP := $(shell pwd)
-include ../config.mk
-
-PACKAGE := libgif4
-VERSION := 4.1.6-11_amd64
-DEB_NAME := $(PACKAGE)_$(VERSION).deb
-
-.PHONY: all
-all: release/pool/main/$(DEB_NAME)
-
-release/pool/main/$(DEB_NAME):
-ifeq ($(GIF_MAIN_REPO),)
- @echo "No config-spec target for Java, nothing to build"
-else
- @mkdir -p release/pool/main && \
- cd release/pool/main && \
- wget -N $(GIF_MAIN_REPO)/$(DEB_NAME)
- @lintian release/pool/main/$(DEB_NAME)
-endif
-
-.PHONY: clean
-clean:
- @rm -rf release
- @rm -f $(DEB_DEST)/$(DEB_NAME)
-
-
-.PHONY: release
-release:release/pool/main/$(DEB_NAME)
-ifneq ($(GIF_MAIN_REPO),)
- @cp release/pool/main/$(DEB_NAME) $(DEB_DEST)
- @cp -Rvp puppet/modules/* $(PUPPET_DEST)
-endif
+++ /dev/null
-class opnfv::gif {
- if $::osfamily == 'Debian' {
- case $::fuel_settings['role'] {
- /controller/: {
- package { 'libgif4':
- ensure => installed,
- }
- }
- }
- }
-}
+++ /dev/null
-##############################################################################
-# Copyright (c) 2015 Ericsson AB and others.
-# stefan.k.berg@ericsson.com
-# jonas.bjurel@ericsson.com
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Apache License, Version 2.0
-# which accompanies this distribution, and is available at
-# http://www.apache.org/licenses/LICENSE-2.0
-##############################################################################
-
-TOP := $(shell pwd)
-include ../config.mk
-
-PACKAGE := openjdk-8-jdk
-VERSION := 8u40~b09-1_amd64
-DEB_NAME := $(PACKAGE)_$(VERSION).deb
-
-.PHONY: all
-all: release/pool/main/$(DEB_NAME)
-
-release/pool/main/$(DEB_NAME):
-ifeq ($(JAVA_MAIN_REPO),)
- @echo "No config-spec target for Java, nothing to build"
-else
- @mkdir -p release/pool/main && \
- cd release/pool/main && \
- wget -N $(JAVA_MAIN_REPO)/$(DEB_NAME)
- @lintian release/pool/main/$(DEB_NAME)
-endif
-
-.PHONY: clean
-clean:
- @rm -rf release
- @rm -f $(DEB_DEST)/$(DEB_NAME)
-
-
-.PHONY: release
-release:release/pool/main/$(DEB_NAME)
-ifneq ($(JAVA_MAIN_REPO),)
- @cp release/pool/main/$(DEB_NAME) $(DEB_DEST)
- @cp -Rvp puppet/modules/* $(PUPPET_DEST)
-endif
+++ /dev/null
-##############################################################################
-# Copyright (c) 2015 Ericsson AB and others.
-# stefan.k.berg@ericsson.com
-# jonas.bjurel@ericsson.com
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Apache License, Version 2.0
-# which accompanies this distribution, and is available at
-# http://www.apache.org/licenses/LICENSE-2.0
-##############################################################################
-
-This directory adds the openjdk-8-jdk Java package and related puppet
-deployment manifest such that it gets built into the .iso image an deployed
-on the stack controller cluster.
-
-The f_java has the following structure:
-.
-+--------+----------+-----------+
- | | |
- puppet/ Makefile README
- | (this file)
- |
- |
- modules/
- |
- |
- |
- opnfv/
- |
- |
- |
- manifests/
- |
- |
- |
- java.pp
-
-Makefile:
-Invoked by the git root Makefile, it pulls the openjdk-8-jdk deb package
-from a propper mirror and pushes i together with the manifests to a fuel
-build artifact directory, such that it eventually gets built into the new
-fuel .iso
-
-java.pp:
-Controls the installation and configuration of java
+++ /dev/null
-class opnfv::java {
- if $::osfamily == 'Debian' {
- case $::fuel_settings['role'] {
- /controller/: {
- package { 'openjdk-8-jdk':
- ensure => installed,
- }
- }
- }
- }
-}
+++ /dev/null
-##############################################################################
-# Copyright (c) 2015 Ericsson AB and others.
-# stefan.k.berg@ericsson.com
-# jonas.bjurel@ericsson.com
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Apache License, Version 2.0
-# which accompanies this distribution, and is available at
-# http://www.apache.org/licenses/LICENSE-2.0
-##############################################################################
-
-In order to test the functionality without performing a full deployment, run "puppet apply" on the
-fake_init.pp which will call only the opnfv::java class.
+++ /dev/null
-##############################################################################
-# Copyright (c) 2015 Ericsson AB and others.
-# stefan.k.berg@ericsson.com
-# jonas.bjurel@ericsson.com
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Apache License, Version 2.0
-# which accompanies this distribution, and is available at
-# http://www.apache.org/licenses/LICENSE-2.0
-##############################################################################
-
-$fuel_settings = parseyaml($astute_settings_yaml)
-
-include opnfv::java
+++ /dev/null
-##############################################################################
-# Copyright (c) 2015 Ericsson AB and others.
-# daniel.smith@ericsson.com
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Apache License, Version 2.0
-# which accompanies this distribution, and is available at
-# http://www.apache.org/licenses/LICENSE-2.0
-##############################################################################
-
-TOP := $(shell pwd)
-include ../config.mk
-
-PACKAGE := openjdk-8-jre
-VERSION := 8u40~b09-1_amd64
-DEB_NAME := $(PACKAGE)_$(VERSION).deb
-
-.PHONY: all
-all: release/pool/main/$(DEB_NAME)
-
-release/pool/main/$(DEB_NAME):
-ifeq ($(JAVA_MAIN_REPO),)
- @echo "No config-spec target for Java, nothing to build"
-else
- @mkdir -p release/pool/main && \
- cd release/pool/main && \
- wget -N $(JAVA_MAIN_REPO)/$(DEB_NAME)
-endif
-
-.PHONY: clean
-clean:
- @rm -rf release
- @rm -f $(DEB_DEST)/$(DEB_NAME)
-
-
-.PHONY: release
-release:release/pool/main/$(DEB_NAME)
-ifneq ($(JAVA_MAIN_REPO),)
- @cp release/pool/main/$(DEB_NAME) $(DEB_DEST)
- @cp -Rvp puppet/modules/* $(PUPPET_DEST)
-endif
-
+++ /dev/null
-
-##############################################################################
-# Copyright (c) 2015 Ericsson AB and others.
-# daniel.smith@ericsson.com
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Apache License, Version 2.0
-# which accompanies this distribution, and is available at
-# http://www.apache.org/licenses/LICENSE-2.0
-##############################################################################
-
-This directory adds the openjdk-8-jre Java package and related puppet
-deployment manifest such that it gets built into the .iso image an deployed
-on the stack controller cluster.
-
-The f_jre has the following structure:
-.
-+--------+----------+-----------+
- | | |
- puppet/ Makefile README
- | (this file)
- |
- |
- modules/
- |
- |
- |
- opnfv/
- |
- |
- |
- manifests/
- |
- |
- |
- jre.pp
-
-Makefile:
-Invoked by the git root Makefile, it pulls the openjdk-8-jre deb package
-from a propper mirror and pushes i together with the manifests to a fuel
-build artifact directory, such that it eventually gets built into the new
-fuel .iso
-
-jre.pp:
-Controls the installation and configuration of java
+++ /dev/null
-class opnfv::jre {
- if $::osfamily == 'Debian' {
-
-
- case $::fuel_settings['role'] {
- /controller/: {
- package { 'openjdk-8-jre':
- ensure => installed,
- }
- }
- }
- }
-}
-
+++ /dev/null
-##############################################################################
-# Copyright (c) 2015 Ericsson AB and others.
-# daniel.smith@ericsson.com
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Apache License, Version 2.0
-# which accompanies this distribution, and is available at
-# http://www.apache.org/licenses/LICENSE-2.0
-##############################################################################
-
-TOP := $(shell pwd)
-include ../config.mk
-
-PACKAGE := openjdk-8-jre-headless
-VERSION := 8u40~b09-1_amd64
-DEB_NAME := $(PACKAGE)_$(VERSION).deb
-
-
-.PHONY: all
-all: release/pool/main/$(DEB_NAME)
-
-release/pool/main/$(DEB_NAME):
-ifeq ($(JAVA_MAIN_REPO),)
- @echo "No config-spec target for Java, nothing to build"
-else
- @mkdir -p release/pool/main && \
- cd release/pool/main && \
- wget -N $(JAVA_MAIN_REPO)/$(DEB_NAME)
- @lintian release/pool/main/$(DEB_NAME)
-endif
-
-.PHONY: clean
-clean:
- @rm -rf release
- @rm -f $(DEB_DEST)/$(DEB_NAME)
-
-
-.PHONY: release
-release:release/pool/main/$(DEB_NAME)
-ifneq ($(JAVA_MAIN_REPO),)
- @cp release/pool/main/$(DEB_NAME) $(DEB_DEST)
- @cp -Rvp puppet/modules/* $(PUPPET_DEST)
-endif
-
+++ /dev/null
-class opnfv::jre_head {
- if $::osfamily == 'Debian' {
-
- case $::fuel_settings['role'] {
- /controller/: {
-
- package { 'openjdk-8-jre-headless' :
- ensure => installed,
- }
-
- }
- }
- }
-}
-
+++ /dev/null
-##############################################################################
-# Copyright (c) 2015 Ericsson AB and others.
-# stefan.k.berg@ericsson.com
-# jonas.bjurel@ericsson.com
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Apache License, Version 2.0
-# which accompanies this distribution, and is available at
-# http://www.apache.org/licenses/LICENSE-2.0
-##############################################################################
-
-TOP := $(shell pwd)
-include ../config.mk
-
-PACKAGE := libnss3
-VERSION := 3.17.4-0ubuntu0.14.04.1_amd64
-DEB_NAME := $(PACKAGE)_$(VERSION).deb
-
-.PHONY: all
-all: release/pool/main/$(DEB_NAME)
-
-release/pool/main/$(DEB_NAME):
-ifeq ($(LIBNSS_MAIN_REPO),)
- @echo "No config-spec target for Java, nothing to build"
-else
- @mkdir -p release/pool/main && \
- cd release/pool/main && \
- wget -N $(LIBNSS_MAIN_REPO)/$(DEB_NAME)
- @lintian release/pool/main/$(DEB_NAME)
-endif
-
-.PHONY: clean
-clean:
- @rm -rf release
- @rm -f $(DEB_DEST)/$(DEB_NAME)
-
-
-.PHONY: release
-release:release/pool/main/$(DEB_NAME)
-ifneq ($(LIBNSS_MAIN_REPO),)
- @cp release/pool/main/$(DEB_NAME) $(DEB_DEST)
- @cp -Rvp puppet/modules/* $(PUPPET_DEST)
-endif
+++ /dev/null
-##############################################################################
-# Copyright (c) 2015 Ericsson AB and others.
-# stefan.k.berg@ericsson.com
-# jonas.bjurel@ericsson.com
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Apache License, Version 2.0
-# which accompanies this distribution, and is available at
-# http://www.apache.org/licenses/LICENSE-2.0
-##############################################################################
-
-This directory adds the openjdk-8-jdk Java package and related puppet
-deployment manifest such that it gets built into the .iso image an deployed
-on the stack controller cluster.
-
-The f_java has the following structure:
-.
-+--------+----------+-----------+
- | | |
- puppet/ Makefile README
- | (this file)
- |
- |
- modules/
- |
- |
- |
- opnfv/
- |
- |
- |
- manifests/
- |
- |
- |
- java.pp
-
-Makefile:
-Invoked by the git root Makefile, it pulls the openjdk-8-jdk deb package
-from a propper mirror and pushes i together with the manifests to a fuel
-build artifact directory, such that it eventually gets built into the new
-fuel .iso
-
-java.pp:
-Controls the installation and configuration of java
+++ /dev/null
-class opnfv::libnss {
- if $::osfamily == 'Debian' {
- case $::fuel_settings['role'] {
- /controller/: {
- package { 'libnss3':
- ensure => installed,
- }
- }
- }
- }
-}
+++ /dev/null
-##############################################################################
-# Copyright (c) 2015 Ericsson AB and others.
-# stefan.k.berg@ericsson.com
-# jonas.bjurel@ericsson.com
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Apache License, Version 2.0
-# which accompanies this distribution, and is available at
-# http://www.apache.org/licenses/LICENSE-2.0
-##############################################################################
-
-In order to test the functionality without performing a full deployment, run "puppet apply" on the
-fake_init.pp which will call only the opnfv::java class.
+++ /dev/null
-##############################################################################
-# Copyright (c) 2015 Ericsson AB and others.
-# stefan.k.berg@ericsson.com
-# jonas.bjurel@ericsson.com
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Apache License, Version 2.0
-# which accompanies this distribution, and is available at
-# http://www.apache.org/licenses/LICENSE-2.0
-##############################################################################
-
-TOP := $(shell pwd)
-include ../config.mk
-
-PACKAGE := libpcsclite1
-VERSION := 1.8.10-1ubuntu1_amd64
-DEB_NAME := $(PACKAGE)_$(VERSION).deb
-
-.PHONY: all
-all: release/pool/main/$(DEB_NAME)
-
-release/pool/main/$(DEB_NAME):
-ifeq ($(LIBPCS_MAIN_REPO),)
- @echo "No config-spec target for Java, nothing to build"
-else
- @mkdir -p release/pool/main && \
- cd release/pool/main && \
- wget -N $(LIBPCS_MAIN_REPO)/$(DEB_NAME)
- @lintian release/pool/main/$(DEB_NAME)
-endif
-
-.PHONY: clean
-clean:
- @rm -rf release
- @rm -f $(DEB_DEST)/$(DEB_NAME)
-
-
-.PHONY: release
-release:release/pool/main/$(DEB_NAME)
-ifneq ($(LIBPCS_MAIN_REPO),)
- @cp release/pool/main/$(DEB_NAME) $(DEB_DEST)
- @cp -Rvp puppet/modules/* $(PUPPET_DEST)
-endif
+++ /dev/null
-class opnfv::libpcs {
- if $::osfamily == 'Debian' {
- case $::fuel_settings['role'] {
- /controller/: {
- package { 'libpcsclite1':
- ensure => installed,
- }
- }
- }
- }
-}
+++ /dev/null
-##############################################################################
-# Copyright (c) 2015 Ericsson AB and others.
-# stefan.k.berg@ericsson.com
-# jonas.bjurel@ericsson.com
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Apache License, Version 2.0
-# which accompanies this distribution, and is available at
-# http://www.apache.org/licenses/LICENSE-2.0
-##############################################################################
-
-TOP := $(shell pwd)
-include ../config.mk
-
-PACKAGE := libxtst6
-VERSION := 1.2.2-1_amd64
-DEB_NAME := $(PACKAGE)_$(VERSION).deb
-
-.PHONY: all
-all: release/pool/main/$(DEB_NAME)
-
-release/pool/main/$(DEB_NAME):
-ifeq ($(LIBXT_MAIN_REPO),)
- @echo "No config-spec target for Java, nothing to build"
-else
- @mkdir -p release/pool/main && \
- cd release/pool/main && \
- wget -N $(LIBXT_MAIN_REPO)/$(DEB_NAME)
- @lintian release/pool/main/$(DEB_NAME)
-endif
-
-.PHONY: clean
-clean:
- @rm -rf release
- @rm -f $(DEB_DEST)/$(DEB_NAME)
-
-
-.PHONY: release
-release:release/pool/main/$(DEB_NAME)
-ifneq ($(LIBXT_MAIN_REPO),)
- @cp release/pool/main/$(DEB_NAME) $(DEB_DEST)
- @cp -Rvp puppet/modules/* $(PUPPET_DEST)
-endif
+++ /dev/null
-class opnfv::libxt {
- if $::osfamily == 'Debian' {
- case $::fuel_settings['role'] {
- /controller/: {
- package { 'libxtst6':
- ensure => installed,
- }
- }
- }
- }
-}
--- /dev/null
+##############################################################################
+# Copyright (c) 2015 Ericsson AB and others.
+# stefan.k.berg@ericsson.com
+# jonas.bjurel@ericsson.com
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Apache License, Version 2.0
+# which accompanies this distribution, and is available at
+# http://www.apache.org/licenses/LICENSE-2.0
+##############################################################################
+
+TOP := $(shell pwd)
+BUILDTAG := loving_daniel
+
+# Edit this to match the GENESIS / OPNFV in your environment
+export OPNFV_PUPPET := /home/lmcdasm/MAR24/genesis/common/puppet-opnfv
+include ../config.mk
+
+.PHONY: all
+all:
+ @mkdir -p puppet/modules/opnfv/odl_docker
+ @rm -rf tmp
+ @mkdir -p tmp
+ @cp -Rvp ${OPNFV_PUPPET}/manifests/templates/dockerfile tmp/.
+ @docker build -t ${BUILDTAG} tmp/dockerfile/.
+ @docker save ${BUILDTAG} > puppet/modules/opnfv/odl_docker/odl_docker_image.tar
+ @wget ${DOCKER_REPO}/${DOCKER_TAG} -O puppet/modules/opnfv/odl_docker/docker-latest
+ @echo "OPFNV_PUPPET is: ${OPNFV_PUPPET}"
+ @cp -Rvp ${OPNFV_PUPPET}/manifests/templates/dockerfile/compute_scripts puppet/modules/opnfv
+
+.PHONY: clean
+clean:
+ @rm -rf tmp
+ @rm -rf release
+
+.PHONY: build-clean
+build-clean:
+ @rm -rf tmp
+ @rm -rf release
+ @rm -rf puppet/modules/opnfv/odl_docker/odl_docker_image.tar
+ @rm -rf puppet/modules/opnfv/odl_docker/docker-latest
+
+
+.PHONY: release
+release:
+ # Fetch PP from OPNFV Common
+ @cp -Rvp ${OPNFV_PUPPET}/common/puppet-opnfv/manifests/odl_docker.pp ${PUPPET_DEST}
+ @cp -Rvp puppet/modules/* $(PUPPET_DEST)
--- /dev/null
+####################################################################
+#
+# Dockerfile to build a ODL (Karaf) Docker Container
+#
+# Copyright daniel.smith@ericsson.com
+# License: Apache GPL
+#
+####################################################################
+
+
+#Set the base image - note: the current release of Karaf is using Jdk7 and alot of 12.04, so we will use it rather than 14.04 and backport a ton of stuff
+FROM ubuntu:12.04
+
+# Maintainer Info
+MAINTAINER Daniel Smith
+
+#Run apt-get update one start just to check for updates when building
+RUN echo "Updating APT"
+RUN apt-get update
+RUN echo "Adding wget"
+RUN apt-get install -y wget
+RUN apt-get install -y net-tools
+RUN apt-get install -y openjdk-7-jre
+RUN apt-get install -y openjdk-7-jdk
+RUN apt-get install -y openssh-server
+RUN apt-get install -y vim
+RUN apt-get install -y expect
+RUN apt-get install -y daemontools
+RUN mkdir -p /opt/odl_source
+RUN bash -c 'echo "export JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64" >> ~/.bashrc'
+
+
+#Now lets got and fetch the ODL distribution
+RUN echo "Fetching ODL"
+RUN wget https://nexus.opendaylight.org/content/groups/public/org/opendaylight/integration/distribution-karaf/0.2.2-Helium-SR2/distribution-karaf-0.2.2-Helium-SR2.tar.gz -O /opt/odl_source/distribution-karaf-0.2.2-Helium-SR2.tar.gz
+
+RUN echo "Untarring ODL inplace"
+RUN mkdir -p /opt/odl
+RUN tar zxvf /opt/odl_source/distribution-karaf-0.2.2-Helium-SR2.tar.gz -C /opt/odl
+
+RUN echo "Installing DLUX and other features into ODL"
+COPY tmp/dockerfile/container_scripts/start_odl_docker.sh /etc/init.d/start_odl_docker.sh
+COPY tmp/dockerfile/container_scripts/speak.sh /etc/init.d/speak.sh
+RUN chmod 777 /etc/init.d/start_odl_docker.sh
+RUN chmod 777 /etc/init.d/speak.sh
+
+
+# Expose the ports
+# PORTS FOR BASE SYSTEM AND DLUX
+EXPOSE 8101
+EXPOSE 6633
+EXPOSE 1099
+EXPOSE 43506
+EXPOSE 8181
+EXPOSE 8185
+EXPOSE 9000
+EXPOSE 39378
+EXPOSE 33714
+EXPOSE 44444
+EXPOSE 6653
+
+# PORTS FOR OVSDB AND ODL CONTROL
+EXPOSE 12001
+EXPOSE 6640
+EXPOSE 8080
+EXPOSE 7800
+EXPOSE 55130
+EXPOSE 52150
+EXPOSE 36826
+
+# set the ENTRYPOINT - An entry point allows us to run this container as an exectuable
+CMD ["/etc/init.d/start_odl_docker.sh"]
--- /dev/null
+#!/usr/bin/expect
+spawn /opt/odl/distribution-karaf-0.2.2-Helium-SR2/bin/client
+expect "root>"
+send "feature:list | grep -i odl-restconf\r"
+send "\r\r\r"
+expect "root>"
+send "logout\r"
+
--- /dev/null
+#!/usr/bin/expect
+# Ericsson Research Canada
+#
+# Author: Daniel Smith <daniel.smith@ericsson.com>
+#
+# Simple expect script to start up ODL client and load feature set for DLUX and OVSDB
+#
+# NOTE: THIS WILL BE REPLACED WITH A PROGRAMATIC METHOD SHORTLY
+
+spawn /opt/odl/distribution-karaf-0.2.2-Helium-SR2/bin/client
+expect "root>"
+send "feature:install odl-base-all odl-aaa-authn odl-restconf odl-nsf-all odl-adsal-northbound odl-mdsal-apidocs odl-ovsdb-openstack odl-ovsdb-northbound odl-dlux-core"
+send "\r\r\r"
+expect "root>"
+send "logout\r"
+
--- /dev/null
+#!/bin/bash
+# Ericsson Research Canada
+#
+# Author: Daniel Smith <daniel.smith@ericsson.com>
+#
+# Start up script for calling karaf / ODL inside a docker container.
+#
+# This script will also call a couple expect scripts to load the feature set that we want
+
+
+#ENV
+export JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64
+
+#MAIN
+echo "Starting up the da Sheilds..."
+/opt/odl/distribution-karaf-0.2.2-Helium-SR2/bin/karaf server &
+echo "Sleeping 5 bad hack"
+sleep 10
+echo "should see stuff listening now"
+netstat -na
+echo " should see proess running for karaf"
+ps -efa
+echo " Starting the packages we want"
+/etc/init.d/speak.sh
+echo "Printout the status - if its right, you should see 8181 appear now"
+netstat -na
+ps -efa
+
+
+
+## This is a loop that keeps our container going currently, prinout the "status of karaf" to the docker logs every minute
+## Cheap - but effective
+while true;
+do
+ echo "Checking status of ODL:"
+ /opt/odl/distribution-karaf-0.2.2-Helium-SR2/bin/status
+ sleep 60
+done
--- /dev/null
+class opnfv::odl_docker
+{
+ case $::fuel_settings['role'] {
+ /controller/: {
+
+ file { "/opt":
+ ensure => "directory",
+ }
+
+ file { "/opt/opnfv":
+ ensure => "directory",
+ owner => "root",
+ group => "root",
+ mode => 777,
+ }
+
+ file { "/opt/opnfv/odl":
+ ensure => "directory",
+ }
+
+ file { "/opt/opnfv/odl/odl_docker_image.tar":
+ ensure => present,
+ source => "/etc/puppet/modules/opnfv/odl_docker/odl_docker_image.tar",
+ mode => 750,
+ }
+
+ file { "/opt/opnfv/odl/docker-latest":
+ ensure => present,
+ source => "/etc/puppet/modules/opnfv/odl_docker/docker-latest",
+ mode => 750,
+ }
+
+ file { "/opt/opnfv/odl/start_odl_conatiner.sh":
+ ensure => present,
+ source => "/etc/puppet/modules/opnfv/scripts/start_odl_container.sh",
+ mode => 750,
+ }
+ }
+ }
+}
--- /dev/null
+#!/bin/bash
+# Ericsson Canada Inc.
+# Authoer: Daniel Smith
+#
+# A helper script to install and setup the ODL docker conatiner on the controller
+#
+#
+# Inputs: odl_docker_image.tar
+#
+# Usage: ./start_odl_docker.sh
+
+# ENVS
+source ~/.bashrc
+source ~/openrc
+
+# VARS
+
+# Switch for Dev mode - uses apt-get on control to cheat and get docker installed locally rather than from puppet source
+
+DEV=1
+
+# Switch for 1:1 port mapping of EXPOSED ports in Docker to the host, if set to 0, then random ports will be used - NOTE: this doesnt work for all web services X port on Host --> Y port in Container,
+# especially for SSL/HTTPS cases. Be aware.
+
+MATCH_PORT=1
+
+LOCALPATH=/opt/opnfv/odl_docker
+DOCKERBINNAME=docker-latest
+DOCKERIMAGENAME=odl_docker_image.tar
+DNS=8.8.8.8
+HOST_IP=`ifconfig br-fw-admin | grep -i "inet addr" | awk -F":" '{print $2}' | awk -F" " '{print $1}'`
+
+
+# Set this to "1" if you want to have your docker container startup into a shell
+
+
+ENABLE_SHELL=1
+
+
+echo " Fetching Docker "
+if [ "$DEV" -eq "1" ];
+# If testing Locally (on a control node) you can set DEV=1 to enable apt-get based install on the control node (not desired target, but good for testing).
+then
+ echo "Dev Mode - Fetching from Internet";
+ echo " this wont work in production builds";
+ apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 36A1D7869245C8950F966E92D8576A8BA88D21E9
+ mkdir -p $LOCALPATH
+ wget https://get.docker.com/builds/Linux/x86_64/docker-latest -O $LOCALPATH/$DOCKERBINNAME
+ wget http://ftp.us.debian.org/debian/pool/main/d/docker.io/docker.io_1.3.3~dfsg1-2_amd64.deb
+ chmod 777 $LOCALPATH/$DOCKERBINNAME
+ echo "done ";
+else
+ echo "Using Binaries delivered from Puppet"
+ echo "Starting Docker in Daemon mode"
+ chmod +x $LOCALPATH/$DOCKERBINNAME
+ $LOCALPATH/$DOCKERBINNAME -d &
+fi
+
+
+# We need to perform some cleanup of the Openstack Environment
+echo "TODO -- This should be automated in the Fuel deployment at some point"
+echo "However, the timing should come after basic tests are running, since this "
+echo " part will remove the subnet router association that is deployed automativally"
+echo " via fuel. Refer to the ODL + Openstack Integration Page "
+
+# Import the ODL container into docker
+
+echo "Importing ODL container into docker"
+$LOCALPATH/$DOCKERBINNAME load -i $LOCALPATH/$DOCKERIMAGENAME
+
+echo " starting up ODL - DLUX and Mapping Ports"
+if [ "$MATCH_PORT" -eq "1" ]
+then
+ echo "Starting up Docker..."
+ docker rm odl_docker
+
+if [ "$ENABLE_SHELL" -eq "1" ];
+then
+ echo "Starting Container in Interactive Mode (/bin/bash will be provided, you will need to run ./start_odl_docker.sh inside the container yourself)"
+ docker run --name odl_docker -p 8181:8181 -p 8185:8185 -p 9000:9000 -p 1099:1099 -p 8101:8101 -p 6633:6633 -p 43506:43506 -p 44444:44444 -p 6653:6653 -p 12001:12001 -p 6400:6400 -p 8080:8080 -p 7800:7800 -p 55130:55130 -p 52150:52150 -p 36826:26826 -i -d -t loving_daniel /bin/bash
+else
+ echo "Starting Conatiner in Daemon mode - no shell will be provided and docker attach will not provide shell)"
+ docker run --name odl_docker -p 8181:8181 -p 8185:8185 -p 9000:9000 -p 1099:1099 -p 8101:8101 -p 6633:6633 -p 43506:43506 -p 44444:44444 -p 6653:6653 -p 12001:12001 -p 6400:6400 -p 8080:8080 -p 7800:7800 -p 55130:55130 -p 52150:52150 -p 36826:26826 -i -d -t loving_daniel
+ echo "should see the process listed here in docker ps -a"
+ docker ps -a;
+ echo "Match Port enabled, you can reach the DLUX login at: "
+ echo "http://$HOST_IP:8181/dlux.index.html"
+fi
--- /dev/null
+#!/bin/bash
+CONTROL_HOST=172.17.0.3
+
+# ENV
+source ~/openrc
+
+
+
+# VARS
+ML2_CONF=/etc/neutron/plugins/ml2/ml2_conf.ini
+MODE=0
+
+
+# FUCNTIONS
+
+
+# Update ml2_conf.ini
+function update_ml2conf {
+ echo "Backing up and modifying ml2_conf.ini"
+ cp $ML2_CONF $ML2_CONF.bak
+ sed -i -e 's/mechanism_drivers =openvswitch/mechanism_drivers = opendaylight/g' $ML2_CONF
+#!/bin/bash
+CONTROL_HOST=172.17.0.3
+
+# ENV
+source ~/openrc
+
+
+
+# VARS
+ML2_CONF=/etc/neutron/plugins/ml2/ml2_conf.ini
+MODE=0
+
+
+# FUCNTIONS
+
+
+# Update ml2_conf.ini
+function update_ml2conf {
+ echo "Backing up and modifying ml2_conf.ini"
+ cp $ML2_CONF $ML2_CONF.bak
+ sed -i -e 's/mechanism_drivers =openvswitch/mechanism_drivers = opendaylight/g' $ML2_CONF
+ sed -i -e 's/tenant_network_types = flat,vlan,gre,vxlan/tenant_network_types = vxlan/g' $ML2_CONF
+ cat "[ml2_odl]" >> $ML2_CONF
+ cat "password = admin" >> $ML2_CONF
+ cat "username = admin" >> $ML2_CONF
+ cat "url = http://${CONTROL_HOST}:8080/controller/nb/v2/neutron" >> $ML2_CONF
+}
+
+function reset_neutrondb {
+ echo "Reseting DB"
+ mysql -e "drop database if exists neutron_ml2;"
+ mysql -e "create database neutron_ml2 character set utf8;"
+ mysql -e "grant all on neutron_ml2.* to 'neutron'@'%';"
+ neutron-db-manage --config-file /etc/neutron/neutron.conf --config-file /etc/neutron/plugin.ini upgrade head
+}
+
+function restart_neutron {
+ echo "Restarting Neutron Server"
+ service neutron-server restart
+ echo "Should see Neutron runing now"
+ service neutron-server status
+ echo "Shouldnt be any nets, but should work (return empty)"
+ neutron net-list
+}
+
+function stop_neutron {
+ echo "Stopping Neutron / OVS components"
+ service neutron-plugin-openvswitch-agent stop
+ if [ $MODE == "0" ]
+ then
+ service neutron-server stop
+ fi
+}
+
+
+
+function verify_ML2_working {
+ echo "checking that we can talk via ML2 properly"
+ curl -u admin:admin http://${CONTROL_HOST}:8080/controller/nb/v2/neutron/networks > /tmp/check_ml2
+ if grep "network" /tmp/check_ml2
+ then
+ echo "Success - ML2 to ODL is working"
+ else
+ echo "im sorry Jim, but its dead"
+ fi
+
+}
+
+
+function set_mode {
+ if df -k | grep glance
+ then
+ echo "Controller Mode"
+ MODE=0
+ else
+ echo "Compute Mode"
+ MODE=1
+ fi
+}
+
+function stop_ovs {
+ echo "Stopping OpenVSwitch"
+ service openvswitch-switch stop
+
+}
+
+function control_setup {
+ echo "do control stuff here"
+ echo "Reset Neutron DB"
+ #reset_neutrondb
+ echo "Restarting Neutron Components"
+ #restart_neutron
+ echo "Verifying ODL ML2 plugin is working"
+ verify_ML2_working
+
+}
+
+function compute_setup {
+ echo "do compute stuff here"
+ stop_neutron
+ verify_ML2_working
+}
+
+
+# MAIN
+echo "Starting to make call"
+#update_ml2conf
+echo "Check Mode"
+set_mode
+
+if [ $MODE == "0" ];
+then
+ echo "Calling control setup"
+ control_setup
+elif [ $MODE == "1" ];
+then
+ echo "Calling compute setup"
+ compute_setup
+
+else
+ echo "Something is bad - call for help"
+ exit
+fi
+
+
--- /dev/null
+#!/bin/bash
+# a "cheat" way to install docker on the controller
+# can only be used if you have a connecting out to the internet
+
+# Usage: ./install_docker.sh <ip of default route to remove> <ip of default gw to add>
+
+OLDGW=$1
+#!/bin/bash
+# a "cheat" way to install docker on the controller
+# can only be used if you have a connecting out to the internet
+
+# Usage: ./install_docker.sh <ip of default route to remove> <ip of default gw to add>
+
+OLDGW=$1
+NEWGW=$2
+IMAGEPATH=/opt/opnfv
+IMAGENAME=odl_docker_image.tar
+SOURCES=/etc/apt/sources.list
+
+
+if [ "$#" -ne 2]; then
+ echo "Two args not provided, will not touch networking"
+else
+
+ # Fix routes
+ echo "Fixing routes"
+ #DEBUG
+ netstat -rn
+
+ echo "delete old def route"
+ route delete default gw $1
+ echo "adding new def route"
+ route add default gw $2
+
+ echo " you should see a good nslookup now"
+ nslookup www.google.ca
+#!/bin/bash
+# a "cheat" way to install docker on the controller
+# can only be used if you have a connecting out to the internet
+
+# Usage: ./install_docker.sh <ip of default route to remove> <ip of default gw to add>
+
+OLDGW=$1
+NEWGW=$2
+IMAGEPATH=/opt/opnfv
+IMAGENAME=odl_docker_image.tar
+SOURCES=/etc/apt/sources.list
+
+
+if [ "$#" -ne 2]; then
+ echo "Two args not provided, will not touch networking"
+else
+
+ # Fix routes
+ echo "Fixing routes"
+ #DEBUG
+ netstat -rn
+
+ echo "delete old def route"
+ route delete default gw $1
+ echo "adding new def route"
+ route add default gw $2
+
+ echo " you should see a good nslookup now"
+ nslookup www.google.ca
+fi
+
+
+if egrep "mirrors.txt" $SOURCES
+then
+ echo "Sources was already updated, not touching"
+else
+ echo "adding the closests mirrors and docker mirror to the mix"
+ echo "deb mirror://mirrors.ubuntu.com/mirrors.txt precise main restricted universe multiverse" >> /etc/apt/sources.list
+ echo "deb mirror://mirrors.ubuntu.com/mirrors.txt precise-updates main restricted universe multiverse" >> /etc/apt/sources.list
+ echo "deb mirror://mirrors.ubuntu.com/mirrors.txt precise-backports main restricted universe multiverse" >> /etc/apt/sources.list
+ echo "deb mirror://mirrors.ubuntu.com/mirrors.txt precise-security main restricted universe multiverse" >> /etc/apt/sources.list
+ apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 36A1D7869245C8950F966E92D8576A8BA88D21E9
+ echo "deb https://get.docker.com/ubuntu docker main " > /etc/apt/sources.list.d/docker.list
+fi
+
+echo "Updating"
+apt-get update
+echo "Installing Docker"
+apt-get install -y lxc-docker
+
+echo "Loading ODL Docker Image"
+docker load -i $IMAGEPATH/$IMAGENAME
+
+
--- /dev/null
+#!/bin/bash
+
+
+
+ok .. so they created br-int
+
+so lets add a physical nic to it
+
+
+# First - Removal all the bridges you find
+
+for i in $(ovs-vsctl list-br)
+do
+ if [ "$i" == "br-int" ];
+ then
+ echo "skipped br-int"
+ elif [ "$i" == "br-prv"];
+ then
+ echo "skipped br-pr"
+ else
+ ovs-vsctl del-br $i
+ fi
+done
--- /dev/null
+#!/bin/bash
+# Ericsson Canada Inc.
+# Authoer: Daniel Smith
+#
+# A helper script to install and setup the ODL docker conatiner on the controller
+#
+#
+# Inputs: odl_docker_image.tar
+#
+# Usage: ./start_odl_docker.sh
+
+# ENVS
+source ~/.bashrc
+source ~/openrc
+
+# VARS
+
+# Switch for Dev mode - uses apt-get on control to cheat and get docker installed locally rather than from puppet source
+
+DEV=1
+
+# Switch for 1:1 port mapping of EXPOSED ports in Docker to the host, if set to 0, then random ports will be used - NOTE: this doesnt work for all web services X port on Host --> Y port in Container,
+# especially for SSL/HTTPS cases. Be aware.
+
+MATCH_PORT=1
+
+LOCALPATH=/opt/opnfv/odl_docker
+DOCKERBINNAME=docker-latest
+DOCKERIMAGENAME=odl_docker_image.tar
+DNS=8.8.8.8
+HOST_IP=`ifconfig br-fw-admin | grep -i "inet addr" | awk -F":" '{print $2}' | awk -F" " '{print $1}'`
+
+
+# Set this to "1" if you want to have your docker container startup into a shell
+
+
+ENABLE_SHELL=1
+
+
+echo " Fetching Docker "
+if [ "$DEV" -eq "1" ];
+# If testing Locally (on a control node) you can set DEV=1 to enable apt-get based install on the control node (not desired target, but good for testing).
+then
+ echo "Dev Mode - Fetching from Internet";
+ echo " this wont work in production builds";
+ apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 36A1D7869245C8950F966E92D8576A8BA88D21E9
+ mkdir -p $LOCALPATH
+ wget https://get.docker.com/builds/Linux/x86_64/docker-latest -O $LOCALPATH/$DOCKERBINNAME
+ wget http://ftp.us.debian.org/debian/pool/main/d/docker.io/docker.io_1.3.3~dfsg1-2_amd64.deb
+ chmod 777 $LOCALPATH/$DOCKERBINNAME
+ echo "done ";
+else
+ echo "Using Binaries delivered from Puppet"
+ echo "Starting Docker in Daemon mode"
+ chmod +x $LOCALPATH/$DOCKERBINNAME
+ $LOCALPATH/$DOCKERBINNAME -d &
+fi
+
+
+# We need to perform some cleanup of the Openstack Environment
+echo "TODO -- This should be automated in the Fuel deployment at some point"
+echo "However, the timing should come after basic tests are running, since this "
+echo " part will remove the subnet router association that is deployed automativally"
+echo " via fuel. Refer to the ODL + Openstack Integration Page "
+
+# Import the ODL container into docker
+
+echo "Importing ODL container into docker"
+$LOCALPATH/$DOCKERBINNAME load -i $LOCALPATH/$DOCKERIMAGENAME
+
+echo " starting up ODL - DLUX and Mapping Ports"
+if [ "$MATCH_PORT" -eq "1" ]
+then
+ echo "Starting up Docker..."
+ docker rm odl_docker
+
+if [ "$ENABLE_SHELL" -eq "1" ];
+then
+ echo "Starting Container in Interactive Mode (/bin/bash will be provided, you will need to run ./start_odl_docker.sh inside the container yourself)"
+ docker run --name odl_docker -p 8181:8181 -p 8185:8185 -p 9000:9000 -p 1099:1099 -p 8101:8101 -p 6633:6633 -p 43506:43506 -p 44444:44444 -p 6653:6653 -p 12001:12001 -p 6400:6400 -p 6640:6640 -p 8080:8080 -p 7800:7800 -p 55130:55130 -p 52150:52150 -p 36826:26826 -i -d -t loving_daniel /bin/bash
+else
+ echo "Starting Conatiner in Daemon mode - no shell will be provided and docker attach will not provide shell)"
+ docker run --name odl_docker -p 8181:8181 -p 8185:8185 -p 9000:9000 -p 1099:1099 -p 8101:8101 -p 6633:6633 -p 43506:43506 -p 44444:44444 -p 6653:6653 -p 12001:12001 -p 6400:6400 -p 6640:6640 -p 8080:8080 -p 7800:7800 -p 55130:55130 -p 52150:52150 -p 36826:26826 -i -d -t loving_daniel
+ echo "should see the process listed here in docker ps -a"
+ docker ps -a;
+ echo "Match Port enabled, you can reach the DLUX login at: "
+ echo "http://$HOST_IP:8181/dlux.index.html"
+fi
# Make sure all added packages are installed
include opnfv::add_packages
# Setup OpenDaylight
- include opnfv::odl
- include opnfv::java
- include opnfv::jre
- include opnfv::jre_head
- include opnfv::atk_wrap
- include opnfv::gif
- include opnfv::ca_cert
- include opnfv::comm_java
- include opnfv::libpcs
- include opnfv::libxt
- include opnfv::libnss
- include opnfv::defjre
+ include opnfv::odl_docker
}