Provide possibility to build plugin with openjdk-8

Daniel Smith discover large resource consumption when SFC features are
enabled and openjdk-7 is used. Following his advice we want to add
option to use openjdk-8. Becuase this version is not offically available
in ubuntu 14.04, it needs to be included inside plugin. This can be achieved
by setting USE_JAVA8=true environment variable during plugin compilation:

  USE_JAVA8=true fpb --debug --build fuel-plugin-opendaylight

Change-Id: If1318c766b31ff9749bd3d75f8ee3c5ca6f89ffc
Signed-off-by: Michal Skalski <mskalski@mirantis.com>
This commit is contained in:
Michal Skalski 2016-02-13 01:48:00 +01:00
parent 2d2988b314
commit 6f68010acc
4 changed files with 26 additions and 47 deletions

View File

@ -85,6 +85,14 @@ Build options
It is possible to modify process of building plugin by setting environment variables. Look into [pre_build_hook file](pre_build_hook) for more details.
Dependencies
------------
OpenDaylight use Java Runtime Environment, required packages will be downloaded from ubuntu repositores.
Ubuntu trusty provides openjdk-7, export USE_JAVA8=true environment variable during plugin compilation to fetch
openjdk-8. JAVA8_URL variable points to the localization of openjdk-8 deb package, default value is defined in
[pre_build_hook file](pre_build_hook) file and can be overwritten by environment variable.
Testing
-------

View File

@ -15,20 +15,8 @@ class opendaylight::install (
$manage_l3_traffic = 'no'
}
$java_package = $operatingsystem ? {
'CentOS' => 'java-1.7.0-openjdk',
'Ubuntu' => 'openjdk-7-jre-headless',
}
package { 'java-jre':
ensure => installed,
name => $java_package,
}
package { 'opendaylight':
ensure => installed,
require => Package['java-jre'],
}
package {'opnfv-quagga':

View File

@ -1,26 +0,0 @@
http://archive.ubuntu.com/ubuntu/pool/main/liba/libasyncns/libasyncns0_0.8-4ubuntu2_amd64.deb
http://archive.ubuntu.com/ubuntu/pool/main/a/avahi/libavahi-common-data_0.6.31-4ubuntu1_amd64.deb
http://archive.ubuntu.com/ubuntu/pool/main/a/avahi/libavahi-common3_0.6.31-4ubuntu1_amd64.deb
http://archive.ubuntu.com/ubuntu/pool/main/a/avahi/libavahi-client3_0.6.31-4ubuntu1_amd64.deb
http://archive.ubuntu.com/ubuntu/pool/main/c/cups/libcups2_1.7.2-0ubuntu1.6_amd64.deb
http://archive.ubuntu.com/ubuntu/pool/main/libo/libogg/libogg0_1.3.1-1ubuntu1_amd64.deb
http://archive.ubuntu.com/ubuntu/pool/main/f/flac/libflac8_1.3.0-2ubuntu0.14.04.1_amd64.deb
http://archive.ubuntu.com/ubuntu/pool/main/f/fonts-dejavu/fonts-dejavu-core_2.34-1ubuntu1_all.deb
http://archive.ubuntu.com/ubuntu/pool/main/f/fontconfig/fontconfig-config_2.11.0-0ubuntu4.1_all.deb
http://archive.ubuntu.com/ubuntu/pool/main/f/fontconfig/libfontconfig1_2.11.0-0ubuntu4.1_amd64.deb
http://archive.ubuntu.com/ubuntu/pool/main/libj/libjpeg-turbo/libjpeg-turbo8_1.3.0-0ubuntu2_amd64.deb
http://archive.ubuntu.com/ubuntu/pool/main/l/lcms2/liblcms2-2_2.5-0ubuntu4_amd64.deb
http://archive.ubuntu.com/ubuntu/pool/main/n/nspr/libnspr4_4.10.10-0ubuntu0.14.04.1_amd64.deb
http://archive.ubuntu.com/ubuntu/pool/main/n/nss/libnss3-nssdb_3.19.2.1-0ubuntu0.14.04.1_all.deb
http://archive.ubuntu.com/ubuntu/pool/main/n/nss/libnss3_3.19.2.1-0ubuntu0.14.04.1_i386.deb
http://archive.ubuntu.com/ubuntu/pool/main/p/pcsc-lite/libpcsclite1_1.8.10-1ubuntu1_amd64.deb
http://archive.ubuntu.com/ubuntu/pool/main/libv/libvorbis/libvorbis0a_1.3.2-1.3ubuntu1_amd64.deb
http://archive.ubuntu.com/ubuntu/pool/main/libv/libvorbis/libvorbisenc2_1.3.2-1.3ubuntu1_amd64.deb
http://archive.ubuntu.com/ubuntu/pool/main/libs/libsndfile/libsndfile1_1.0.25-7ubuntu2_amd64.deb
http://archive.ubuntu.com/ubuntu/pool/main/p/pulseaudio/libpulse0_4.0-0ubuntu11.1_amd64.deb
http://archive.ubuntu.com/ubuntu/pool/main/c/ca-certificates-java/ca-certificates-java_20130815ubuntu1_all.deb
http://archive.ubuntu.com/ubuntu/pool/main/t/tzdata/tzdata_2015g-0ubuntu0.14.04_all.deb
http://archive.ubuntu.com/ubuntu/pool/main/t/tzdata/tzdata-java_2015g-0ubuntu0.14.04_all.deb
http://archive.ubuntu.com/ubuntu/pool/main/j/java-common/java-common_0.51_all.deb
http://archive.ubuntu.com/ubuntu/pool/main/libj/libjpeg8-empty/libjpeg8_8c-2ubuntu8_amd64.deb
http://archive.ubuntu.com/ubuntu/pool/main/o/openjdk-7/openjdk-7-jre-headless_7u91-2.6.3-0ubuntu0.14.04.1_amd64.deb

View File

@ -8,6 +8,7 @@ set -eux
# Where we can find odl karaf distribution tarball
# can be http(s) url or absolute path
ODL_TARBALL_LOCATION=${ODL_TARBALL_LOCATION:-https://nexus.opendaylight.org/content/repositories/staging/org/opendaylight/integration/distribution-karaf/0.4.0-Beryllium-RC1/distribution-karaf-0.4.0-Beryllium-RC1.tar.gz}
JAVA8_URL=${JAVA8_URL:-https://launchpad.net/~openjdk-r/+archive/ubuntu/ppa/+files/openjdk-8-jre-headless_8u72-b15-1~trusty1_amd64.deb}
#Verion number used in deb/rpm package
ODL_VERSION_NUMBER=${ODL_VERSION_NUMBER:-0.4.0}
@ -29,12 +30,18 @@ DIR="$(dirname `readlink -f $0`)"
TMP_DIR="${DIR}/tmp"
MODULES="${DIR}/deployment_scripts/puppet/modules"
# If true java and it dependencies will be part of the plugin.
# Useful for offline deployments.
INCLUDE_DEPENDENCIES=${INCLUDE_DEPENDENCIES:-false}
# If true openjdk-8 will be used
USE_JAVA8=${USE_JAVA8:-false}
if [ "$USE_JAVA8" = true ]
then
JAVA_VERSION="openjdk-8-jre-headless"
else
JAVA_VERSION="openjdk-7-jre-headless"
fi
function cleanup {
rm -rf "${TMP_DIR}"
sed -i -e "s/java-8-openjdk-amd64/java-7-openjdk-amd64/" "${DIR}/odl_package/ubuntu/opendaylight"
}
function download {
@ -63,13 +70,10 @@ function add_opnfv_quagga {
}
# Download packages required by ODL.
# List generated with commands:
# yumdownloader --urls --resolve java-1.7.0-openjdk
# apt-get --print-uris --yes install openjdk-7-jre-headless | grep ^\' | cut -d\' -f2 >downloads.list
function download_dependencies {
if [ "$INCLUDE_DEPENDENCIES" = true ]
if [ "$USE_JAVA8" = true ]
then
wget -N -i "${DIR}/odl_package/${1}/dependencies.txt"
wget -N "$JAVA8_URL"
fi
}
@ -83,7 +87,7 @@ function build_pkg {
;;
ubuntu)
pushd "${DIR}/repositories/${1}/"
fpm --force -s dir -t deb -m 'mskalski@mirantis.com' --version "${ODL_VERSION_NUMBER}" --description "${ODL_DESCRIPTION}" --prefix /opt/opendaylight --deb-upstart "${DIR}/odl_package/${1}/opendaylight" --after-install "${DIR}/odl_package/${1}/opendaylight-post" --name opendaylight -d "openjdk-7-jre-headless" -C "${TMP_DIR}/opendaylight_src"
fpm --force -s dir -t deb -m 'mskalski@mirantis.com' --version "${ODL_VERSION_NUMBER}" --description "${ODL_DESCRIPTION}" --prefix /opt/opendaylight --deb-upstart "${DIR}/odl_package/${1}/opendaylight" --after-install "${DIR}/odl_package/${1}/opendaylight-post" --name opendaylight -d "${JAVA_VERSION}" -C "${TMP_DIR}/opendaylight_src"
fpm --force -s python -t deb -m 'mskalski@mirantis.com' --python-install-lib /usr/lib/python2.7/dist-packages ${TMP_DIR}/networking_odl/setup.py
download_dependencies ${1}
popd
@ -97,6 +101,11 @@ command -v fpm >/dev/null 2>&1 || { echo >&2 "fpm ruby gem required but it's not
cleanup
if [ "$USE_JAVA8" = true ]
then
sed -i -e "s/java-7-openjdk-amd64/java-8-openjdk-amd64/" "${DIR}/odl_package/ubuntu/opendaylight"
fi
mkdir -p "${TMP_DIR}"
pushd $TMP_DIR