summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGeorg Kunz <georg.kunz@ericsson.com>2016-12-10 16:35:49 +0100
committerGeorg Kunz <georg.kunz@ericsson.com>2016-12-13 11:18:58 +0100
commit28850f28aaa80cc71563f4c4698af70da6334f03 (patch)
treed6dc9b90c534a53e8112414f0334c5b80205b17c
parentc62b63e6f4b2560dcc673206faee74706fd9e7bc (diff)
Basic CI integration for Gluon
This first iteration of OPNFV CI integration targets a daily build of an installable RPM package based on the lastest Gluon upstream master branch. Change-Id: I6ad0b339284e58e566eb85a3bcf981b52ba372b8 Signed-off-by: Georg Kunz <georg.kunz@ericsson.com>
-rw-r--r--build/Makefile6
-rw-r--r--build/rpm_specs/gluon.spec85
-rwxr-xr-xci/build-gluon-packages.sh12
3 files changed, 67 insertions, 36 deletions
diff --git a/build/Makefile b/build/Makefile
index 9e5e8dd..0ba8be8 100644
--- a/build/Makefile
+++ b/build/Makefile
@@ -1,8 +1,10 @@
+OPNFV_RELEASE=$(shell echo $(shell date -u +"%Y%m%d"))
GLUON_REPO=https://github.com/openstack/gluon.git
GLUON_BRANCH=master
-GLUON_VER=0.0.1
+GLUON_VER=$(shell grep Version $(shell pwd)/rpm_specs/gluon.spec | head -n 1 | awk '{ print $$2 }')
+GLUON_REL=$(shell grep 'define release' $(shell pwd)/rpm_specs/gluon.spec | head -n 1 | awk '{ print $$3 }')_$(OPNFV_RELEASE)
GLUON_TAR=gluon.tar.gz
-GLUON_RPM=noarch/gluon-$(GLUON_VER)-1.noarch.rpm
+GLUON_RPM=noarch/gluon-$(GLUON_VER)-$(GLUON_REL).noarch.rpm
.PHONY: all
diff --git a/build/rpm_specs/gluon.spec b/build/rpm_specs/gluon.spec
index f64640f..946d415 100644
--- a/build/rpm_specs/gluon.spec
+++ b/build/rpm_specs/gluon.spec
@@ -1,35 +1,42 @@
%define release 1
%define _sharedstatedir /var/lib
-
-Summary: OpenStack Gluon Framework
-Name: gluon
-Version: 0.0.1
-Release: %{release}%{?git}%{?dist}
-
-License: Apache 2.0
-Group: Applications/Internet
-Source0: gluon.tar.gz
-Url: https://github.com/openstack/gluon
-BuildArch: noarch
-
-Vendor: OpenStack <openstack-dev@lists.openstack.org>
-Packager: Georg Kunz <georg.kunz@ericsson.com>
-
-Requires: python-pbr
-Requires: python-click
-Requires: python-six
-Requires: python-requests
-Requires: python-yaml
-Requires: python-sqlalchemy
-Requires: python2-babel
-Requires: python2-oslo-db
-Requires: python2-oslo-config
-Requires: python2-oslo-versionedobjects
-Requires: python2-oslo-log
-Requires: python2-oslo-utils
-Requires: python2-oslo-i18n
-Requires: python2-wsme
-Requires: pytz
+%define build_timestamp %(date +"%Y%m%d")
+
+Summary: OpenStack Gluon Framework
+Name: gluon
+Version: 0.0.1
+Release: %{release}_%{build_timestamp}
+
+License: Apache 2.0
+Group: Applications/Internet
+Source0: gluon.tar.gz
+Url: https://github.com/openstack/gluon
+BuildArch: noarch
+
+#BuildRequires: systemd
+
+Vendor: OpenStack <openstack-dev@lists.openstack.org>
+Packager: Georg Kunz <georg.kunz@ericsson.com>
+
+Requires: python-pbr
+Requires: python-click
+Requires: python-six
+Requires: python-requests
+Requires: python-yaml
+Requires: python-sqlalchemy
+Requires: python2-babel
+Requires: python2-oslo-db
+Requires: python2-oslo-config
+Requires: python2-oslo-versionedobjects
+Requires: python2-oslo-log
+Requires: python2-oslo-utils
+Requires: python2-oslo-i18n
+Requires: python2-wsme
+Requires: pytz
+
+Requires(post): systemd
+Requires(preun): systemd
+Requires(postun): systemd
%description
OpenStack Gluon framework for NFV networking
@@ -76,6 +83,15 @@ if ! getent passwd proton >/dev/null; then
fi
exit 0
+%post
+%systemd_post openstack-proton-server
+systemctl start openstack-proton-server
+
+%preun
+%systemd_preun openstack-proton-server
+
+%postun
+%systemd_postun_with_restart openstack-proton-server
%clean
rm -rf %{buildroot}
@@ -83,7 +99,8 @@ rm -rf %{buildroot}
%files -f INSTALLED_FILES
%defattr(-,root,root)
%attr(644,root,root) /usr/lib/systemd/system/openstack-proton-server.service
-%attr(640,proton,root) /etc/proton/proton.conf
-%attr(750,proton,root) /var/log/proton
-%attr(750,proton,root) /var/run/proton
-%attr(755,proton,root) /var/lib/proton
+%dir %attr(700,proton,root) %{_sysconfdir}/proton
+%attr(640,proton,root) %{_sysconfdir}/proton/proton.conf
+%dir %attr(750,proton,root) %{_localstatedir}/log/proton
+%dir %attr(750,proton,root) %{_localstatedir}/run/proton
+%dir %attr(755,proton,root) %{_sharedstatedir}/proton
diff --git a/ci/build-gluon-packages.sh b/ci/build-gluon-packages.sh
new file mode 100755
index 0000000..b35b5b8
--- /dev/null
+++ b/ci/build-gluon-packages.sh
@@ -0,0 +1,12 @@
+#!/bin/bash
+set -o errexit
+set -o nounset
+set -o pipefail
+
+echo "Running make to build Gluon packages..."
+
+pushd ../build
+make
+popd
+
+echo "make finished"
nses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. */ #ifndef _PROX_PORT_CFG_H #define _PROX_PORT_CFG_H #include <rte_pci.h> #include <rte_ether.h> #include <rte_ethdev.h> #include <rte_version.h> #if RTE_VERSION >= RTE_VERSION_NUM(17,11,0,0) #include <rte_bus_pci.h> #endif #include <rte_pci.h> #include "prox_compat.h" #include "prox_globals.h" enum addr_type {PROX_PORT_MAC_HW, PROX_PORT_MAC_SET, PROX_PORT_MAC_RAND}; #define IPV4_CKSUM 1 #define UDP_CKSUM 2 #define NB_MCAST_ADDR 16 struct prox_port_cfg { struct rte_mempool *pool[32]; /* Rx/Tx mempool */ size_t pool_size[32]; uint8_t promiscuous; uint8_t lsc_set_explicitely; /* Explicitly enable/disable lsc */ uint8_t lsc_val; uint8_t active; int socket; uint16_t max_rxq; /* max number of Tx queues */ uint16_t max_txq; /* max number of Tx queues */ uint16_t n_rxq; /* number of used Rx queues */ uint16_t n_txq; /* number of used Tx queues */ uint32_t n_rxd; uint32_t n_txd; uint8_t link_up; uint32_t link_speed; uint32_t max_link_speed; uint32_t mtu; enum addr_type type; prox_rte_ether_addr eth_addr; /* port MAC address */ char name[MAX_NAME_SIZE]; char short_name[MAX_NAME_SIZE]; char driver_name[MAX_NAME_SIZE]; char rx_ring[MAX_NAME_SIZE]; char tx_ring[MAX_NAME_SIZE]; char pci_addr[32]; struct rte_eth_conf port_conf; struct rte_eth_rxconf rx_conf; struct rte_eth_txconf tx_conf; uint64_t requested_rx_offload; uint64_t requested_tx_offload; uint64_t disabled_tx_offload; struct rte_eth_dev_info dev_info; struct { int tx_offload_cksum; } capabilities; uint32_t max_rx_pkt_len; uint32_t min_rx_bufsize; uint16_t min_rx_desc; uint16_t max_rx_desc; uint16_t min_tx_desc; uint16_t max_tx_desc; uint32_t nb_mc_addr; prox_rte_ether_addr mc_addr[NB_MCAST_ADDR]; }; extern rte_atomic32_t lsc; int prox_nb_active_ports(void); int prox_last_port_active(void); extern struct prox_port_cfg prox_port_cfg[]; void init_rte_dev(int use_dummy_devices); uint8_t init_rte_ring_dev(void); void init_port_addr(void); void init_port_all(void); void close_ports_atexit(void); struct rte_mempool; void prox_pktmbuf_init(struct rte_mempool *mp, void *opaque_arg, void *_m, unsigned i); void prox_pktmbuf_reinit(void *arg, void *start, void *end, uint32_t idx); int port_is_active(uint8_t port_id); #endif /* __PROX_PORT_CFG_H_ */