1 From: Florin Dumitrascu <florin.dumitrascu@enea.com>
2 Date: Thu, 17 Mar 2016 18:15:42 +0100
3 Subject: [PATCH] ODL leveldb, leveldbjni: Enable arm64 support.
5 ODL depends on a native library (leveldb).
7 ODL Beryllium and Boron versions are still using a native x86 version
8 of this library (wrapped in leveldbjni).
10 There is no upstream version of leveldbjni supporting arm64 leveldb,
11 so we need to compile it when deploying ODL.
12 This is done when running odl-install puppet manifest.
14 For more info about this ODL limitation, see [1].
16 [ Alexandru.Avadanii@enea.com ]
17 Remove JAVA8 changes after upstream rework.
18 Convert puppet patching to prebuilt DEB package, as part of [2].
19 Rebase for Fuel Newton.
21 [1] https://bugs.opendaylight.org/show_bug.cgi?id=3973
22 [2] https://jira.opnfv.org/browse/ARMBAND-114
24 Change-Id: Ia7abf375ffd122ff0ac7b12422f64526ff2c78fd
25 Signed-off-by: Florin Dumitrascu <florin.dumitrascu@enea.com>
26 Signed-off-by: Stanislaw Kardach <stanislaw.kardach@cavium.com>
27 Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
29 .../puppet/modules/opendaylight/manifests/init.pp | 8 +++++++
30 .../modules/opendaylight/manifests/install.pp | 7 ++++++
31 .../modules/opendaylight/manifests/leveldbjni.pp | 25 ++++++++++++++++++++++
32 3 files changed, 40 insertions(+)
33 create mode 100644 deployment_scripts/puppet/modules/opendaylight/manifests/leveldbjni.pp
35 diff --git a/deployment_scripts/puppet/modules/opendaylight/manifests/init.pp b/deployment_scripts/puppet/modules/opendaylight/manifests/init.pp
36 index 69cc23a..791ceba 100644
37 --- a/deployment_scripts/puppet/modules/opendaylight/manifests/init.pp
38 +++ b/deployment_scripts/puppet/modules/opendaylight/manifests/init.pp
39 @@ -9,4 +9,12 @@ class opendaylight {
40 $odl_mgmt_ips = values($odl_mgmt_ips_hash)
41 $odl_nodes_names = keys($odl_mgmt_ips_hash)
42 $node_internal_address = $odl_mgmt_ips_hash["node-${node_uid}"]
44 + $arch = $::architecture ? {
45 + 'aarch64' => $::osfamily ? {
46 + 'Debian' => 'arm64',
47 + default => 'aarch64',
49 + default => $::architecture,
52 diff --git a/deployment_scripts/puppet/modules/opendaylight/manifests/install.pp b/deployment_scripts/puppet/modules/opendaylight/manifests/install.pp
53 index 2c3d776..673ccb3 100644
54 --- a/deployment_scripts/puppet/modules/opendaylight/manifests/install.pp
55 +++ b/deployment_scripts/puppet/modules/opendaylight/manifests/install.pp
56 @@ -20,6 +20,12 @@ class opendaylight::install (
57 ensure => $odl_package,
60 + if ($::osfamily == 'Debian' and $::opendaylight::arch == 'arm64') {
61 + class { 'opendaylight::leveldbjni':
62 + require => Package['opendaylight'],
66 #Temporary solution until number of allowed open files
67 #will be fixed in main systemd service file
68 file {'/etc/systemd/system/opendaylight.service.d':
69 @@ -88,6 +94,7 @@ class opendaylight::install (
70 Package['opendaylight'] ->
73 + Class['opendaylight::leveldbjni'] ->
75 Service['opendaylight']
77 diff --git a/deployment_scripts/puppet/modules/opendaylight/manifests/leveldbjni.pp b/deployment_scripts/puppet/modules/opendaylight/manifests/leveldbjni.pp
79 index 0000000..0a20fa3
81 +++ b/deployment_scripts/puppet/modules/opendaylight/manifests/leveldbjni.pp
83 +# == Class opendaylight::leveldbjni
85 +# Manages patching of JNI for leveldb on arm64.
87 +# It fetches a prebuilt DEB package containing leveldbjni,
88 +# patched so that it's properly detected by maven on arm64 systems.
90 +# DEB: http://linux.enea.com/mos-repos/ubuntu/9.0/ \
91 +# pool/main/a/armband-odl-leveldb-fix/
92 +# JIRA: https://jira.opnfv.org/browse/ARMBAND-114
94 +class opendaylight::leveldbjni {
96 + 'Debian', 'Ubuntu': {}
98 + fail('Not supported on OS other than Debian based.')
102 + if ! defined(Package['armband-odl-leveldb-fix']) {
103 + package { 'armband-odl-leveldb-fix':
104 + ensure => 'present',