diff options
Diffstat (limited to 'build')
-rw-r--r-- | build/Makefile | 3 | ||||
-rw-r--r-- | build/bash_completion_apex | 56 | ||||
-rwxr-xr-x | build/build_ovs_nsh.sh | 22 | ||||
-rw-r--r-- | build/nics-template.yaml.jinja2 | 36 | ||||
-rwxr-xr-x | build/overcloud-full.sh | 39 | ||||
-rwxr-xr-x | build/overcloud-onos.sh | 8 | ||||
-rwxr-xr-x | build/overcloud-opendaylight-sfc.sh | 11 | ||||
-rw-r--r-- | build/rpm_specs/opnfv-apex-common.spec | 6 | ||||
-rw-r--r-- | build/set_perf_images.sh | 1 | ||||
-rwxr-xr-x | build/undercloud.sh | 2 | ||||
-rw-r--r-- | build/variables.sh | 12 |
11 files changed, 159 insertions, 37 deletions
diff --git a/build/Makefile b/build/Makefile index 7374215e..479d09bc 100644 --- a/build/Makefile +++ b/build/Makefile @@ -19,9 +19,6 @@ export RPMODL = $(shell pwd)/noarch/opnfv-apex-$(RPMVERS)-$(shell echo ${RELEASE export RPMONO = $(shell pwd)/noarch/opnfv-apex-onos-$(RPMVERS)-$(shell echo ${RELEASE} | tr -d '_-').noarch.rpm export RPMSFC = $(shell pwd)/noarch/opnfv-apex-opendaylight-sfc-$(RPMVERS)-$(shell echo ${RELEASE} | tr -d '_-').noarch.rpm -all_networks="admin_network private_network storage_network external_network api_network" - - .PHONY: all all: iso diff --git a/build/bash_completion_apex b/build/bash_completion_apex new file mode 100644 index 00000000..b3c963e3 --- /dev/null +++ b/build/bash_completion_apex @@ -0,0 +1,56 @@ +# bash/zsh completion support for OPNFV Apex +############################################################################## +# Copyright (c) 2016 Dan Radez (Red Hat) and others. +# +# 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 +############################################################################## + +# Pieces of this script are derived from the git bash completion script + +___main () { + local cur prev opts + COMPREPLY=() + cur="${COMP_WORDS[COMP_CWORD]}" + prev="${COMP_WORDS[COMP_CWORD-1]}" + opts=" -h $(${COMP_WORDS[0]} -h | grep -Eo '^ [^ ]+')" + if [[ ! $opts =~ $prev ]]; then + COMPREPLY=($(compgen -W "${opts}" -- ${cur})) + fi +} + +# these functions are setup like this in the thought that +# deploy and util will eventually diverge from each other +# for now they can use the same main logic so it's just +# abstracted to another function +__deploy_main () { + ___main +} + + +__util_main () { + ___main +} + + +__apex_func_wrap () { + local cur words cword prev + _get_comp_words_by_ref -n =: cur words cword prev + $1 +} + +# Setup function for bash completion +__apex_complete () { + local wrapper="__apex_wrap${2}" + eval "$wrapper () { __apex_func_wrap $2 ; }" + complete -o bashdefault -o default -o nospace -F $wrapper $1 2>/dev/null \ + || complete -o default -o nospace -F $wrapper $1 +} + +# run completion setup +__apex_complete ./deploy.sh __deploy_main +__apex_complete opnfv-deploy __deploy_main +__apex_complete ./util.sh __util_main +__apex_complete opnfv-util __util_main diff --git a/build/build_ovs_nsh.sh b/build/build_ovs_nsh.sh new file mode 100755 index 00000000..834df5bb --- /dev/null +++ b/build/build_ovs_nsh.sh @@ -0,0 +1,22 @@ +#!/usr/bin/env bash +############################################################################## +# Copyright (c) 2016 Tim Rozet (Red Hat) and others. +# +# 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 +############################################################################## +set -e + +yum -y install rpm-build autoconf automake libtool systemd-units openssl openssl-devel python python-twisted-core python-zope-interface python-six desktop-file-utils groff graphviz procps-ng libcap-ng libcap-ng-devel PyQt4 selinux-policy-devel kernel-devel kernel-headers kernel-tools +./boot.sh +libtoolize --force +aclocal +autoheader +automake --force-missing --add-missing +autoconf +./configure +yum -y install rpmdevtools +make rpm-fedora RPMBUILD_OPT="\"-D kversion `rpm -q kernel | rpmdev-sort | tail -n -1 | sed 's/^kernel-//'`\" --without check" +make rpm-fedora-kmod RPMBUILD_OPT="\"-D kversion `rpm -q kernel | rpmdev-sort | tail -n -1 | sed 's/^kernel-//'`\"" diff --git a/build/nics-template.yaml.jinja2 b/build/nics-template.yaml.jinja2 index 0680a26f..ee830114 100644 --- a/build/nics-template.yaml.jinja2 +++ b/build/nics-template.yaml.jinja2 @@ -85,16 +85,16 @@ resources: os_net_config: network_config: - - {%- if vlans['private_network'] is number or vlans['storage_network'] is number or vlans['api_network'] is number or vlans['public_network'] is number %} + {%- if nets['tenant']['nic_mapping'][role]['vlan'] is number or nets['storage']['nic_mapping'][role]['vlan'] is number or nets['api']['nic_mapping'][role]['vlan'] is number or nets['external'][0]['nic_mapping'][role]['vlan'] is number %} type: ovs_bridge name: {get_input: bridge_name} members: - type: interface - name: {{ nics[role]['admin_network'] }} + name: {{ nets[role]['admin']['members'][0] }} # force the MAC address of the bridge to this interface primary: true - {%- if 'public_network' in enabled_networks and vlans['public_network'] is number %} + {%- if nets['external'][0]['enabled'] and nets['external'][0]['nic_mapping'][role]['vlan'] is number %} - type: vlan vlan_id: {get_param: ExternalNetworkVlanID} @@ -106,7 +106,7 @@ resources: default: true next_hop: {get_param: ExternalInterfaceDefaultRoute} {%- endif %} - {%- if 'private_network' in enabled_networks and vlans['private_network'] is number %} + {%- if nets['tenant']['enabled'] and nets['tenant']['nic_mapping'][role]['vlan'] is number %} - type: vlan vlan_id: {get_param: TenantNetworkVlanID} @@ -114,7 +114,7 @@ resources: - ip_netmask: {get_param: TenantIpSubnet} {%- endif %} - {%- if 'storage_network' in enabled_networks and vlans['storage_network'] is number %} + {%- if nets['storage']['enabled'] and nets['storage']['nic_mapping'][role]['vlan'] is number %} - type: vlan vlan_id: {get_param: StorageNetworkVlanID} @@ -122,7 +122,7 @@ resources: - ip_netmask: {get_param: StorageIpSubnet} {%- endif %} - {%- if 'api_network' in enabled_networks and vlans['api_network'] is number %} + {%- if nets['api']['enabled'] and nets['api']['nic_mapping'][role]['vlan'] is number %} - type: vlan vlan_id: {get_param: InternalApiNetworkVlanID} @@ -132,7 +132,7 @@ resources: {%- endif %} {%- else %} type: interface - name: {{ nics[role]['admin_network'] }} + name: {{ nets['admin']['nic_mapping'][role]['members'][0] }} {%- endif %} use_dhcp: false dns_servers: {get_param: DnsServers} @@ -153,7 +153,7 @@ resources: next_hop: {get_param: ControlPlaneDefaultRoute} {%- endif %} - {%- if 'private_network' in enabled_networks and vlans['private_network'] == 'native' %} + {%- if nets['tenant']['enabled'] and nets['tenant']['nic_mapping'][role]['vlan'] == 'native' %} {%- if ovs_dpdk_bridge == 'br-phy' and role == 'compute' %} - type: ovs_bridge @@ -165,7 +165,7 @@ resources: members: - type: interface - name: {{ nics[role]['private_network'] }} + name: {{ nets['tenant']['nic_mapping'][role]['members'][0] }} # force the MAC address of the bridge to this interface primary: true - @@ -175,17 +175,17 @@ resources: {%- else %} - type: interface - name: {{ nics[role]['private_network'] }} + name: {{ nets['tenant']['nic_mapping'][role]['members'][0] }} use_dhcp: false addresses: - ip_netmask: {get_param: TenantIpSubnet} {%- endif %} {%- endif %} - {%- if 'public_network' in enabled_networks and external_net_type == 'interface' and vlans['public_network'] == 'native' %} + {%- if nets['external'][0]['enabled'] and external_net_type == 'interface' and nets['external'][0]['nic_mapping'][role]['vlan'] == 'native' %} - type: interface - name: {{ nics[role]['public_network'] }} + name: {{ nets['external'][0]['nic_mapping'][role]['members'][0] }} {%- if role == 'controller' %} dns_servers: {get_param: DnsServers} {%- endif %} @@ -200,7 +200,7 @@ resources: {%- endif %} ip_netmask: 0.0.0.0/0 next_hop: {get_param: ExternalInterfaceDefaultRoute} - {%- elif 'public_network' in enabled_networks and external_net_type == 'br-ex' and vlans['public_network'] == 'native' %} + {%- elif nets['external'][0]['enabled'] and external_net_type == 'br-ex' and nets['external'][0]['nic_mapping'][role]['vlan'] == 'native' %} - type: ovs_bridge name: {get_input: bridge_name} @@ -208,7 +208,7 @@ resources: members: - type: interface - name: {{ nics[role]['public_network'] }} + name: {{ nets['external'][0]['nic_mapping'][role]['members'][0] }} # force the MAC address of the bridge to this interface primary: true {%- if role == 'controller' %} @@ -223,19 +223,19 @@ resources: next_hop: {get_param: ExternalInterfaceDefaultRoute} {%- endif %} {%- endif %} - {%- if 'storage_network' in enabled_networks and vlans['storage_network'] == 'native' %} + {%- if nets['storage']['enabled'] and nets['storage']['nic_mapping'][role]['vlan'] == 'native' %} - type: interface - name: {{ nics[role]['storage_network'] }} + name: {{ nets['storage']['nic_mapping'][role]['members'][0] }} use_dhcp: false addresses: - ip_netmask: {get_param: StorageIpSubnet} {%- endif %} - {%- if 'api_network' in enabled_networks and vlans['api_network'] == 'native' %} + {%- if nets['api']['enabled'] and nets['api']['nic_mapping'][role]['vlan'] == 'native' %} - type: interface - name: {{ nics[role]['api_network'] }} + name: {{ nets['api']['nic_mapping'][role]['members'][0] }} use_dhcp: false addresses: - diff --git a/build/overcloud-full.sh b/build/overcloud-full.sh index 21667070..88f96851 100755 --- a/build/overcloud-full.sh +++ b/build/overcloud-full.sh @@ -154,5 +154,44 @@ LIBGUESTFS_BACKEND=direct virt-customize \ --upload ../puppet-neutron/manifests/plugins/ml2/networking-vpp.pp:/etc/puppet/modules/neutron/manifests/plugins/ml2/ \ -a overcloud-full_build.qcow2 +rm -rf ovs_nsh_patches +rm -rf ovs +git clone https://github.com/yyang13/ovs_nsh_patches.git +git clone https://github.com/openvswitch/ovs.git +pushd ovs > /dev/null +git reset --hard 7d433ae57ebb90cd68e8fa948a096f619ac4e2d8 +cp ../ovs_nsh_patches/*.patch ./ +# Hack for build servers that have no git config +git config user.email "apex@opnfv.com" +git config user.name "apex" +git am *.patch +popd > /dev/null +tar czf ovs.tar.gz ovs + +# Required packages to redirect stdin with virt-customize +virt_pkg_str="./$libguestfs_pkg " +wget $virt_uri_base/$libguestfs_pkg +for package in ${virt_pkgs[@]}; do + wget "$virt_uri_base/$package" + virt_pkg_str+=" ./$package" +done + +if ! sudo yum -y install ${virt_pkg_str}; then + if [ "$(rpm -q libguestfs)" != "$(rpm -qpf $libguestfs_pkg)" ]; then + echo "ERROR: Failed to update libguestfs" + exit 1 + fi +fi + + + +# BUILD NSH OVS +LIBGUESTFS_BACKEND=direct virt-customize \ + --upload ../build_ovs_nsh.sh:/root/ \ + --upload ovs.tar.gz:/root/ \ + --run-command "cd /root/ && tar xzf ovs.tar.gz" \ + --run-command "cd /root/ovs && /root/build_ovs_nsh.sh" \ + -a overcloud-full_build.qcow2 + mv -f overcloud-full_build.qcow2 overcloud-full.qcow2 popd > /dev/null diff --git a/build/overcloud-onos.sh b/build/overcloud-onos.sh index 7b5e3df7..b695983a 100755 --- a/build/overcloud-onos.sh +++ b/build/overcloud-onos.sh @@ -19,12 +19,8 @@ cp -f overcloud-full.qcow2 overcloud-full-onos_build.qcow2 ####################################### # upgrade ovs into ovs 2.5.90 with NSH function -curl -L -O ${onos_ovs_uri}/${onos_ovs_pkg} -tar -xzf ${onos_ovs_pkg} -LIBGUESTFS_BACKEND=direct virt-customize --upload ${ovs_kmod_rpm_name}:/root/ \ - --run-command "yum install -y /root/${ovs_kmod_rpm_name}" \ - --upload ${ovs_rpm_name}:/root/ \ - --run-command "yum upgrade -y /root/${ovs_rpm_name}" \ +LIBGUESTFS_BACKEND=direct virt-customize --run-command "yum install -y /root/ovs/rpm/rpmbuild/RPMS/x86_64/${ovs_kmod_rpm_name}" \ + --run-command "yum upgrade -y /root/ovs/rpm/rpmbuild/RPMS/x86_64/${ovs_rpm_name}" \ -a overcloud-full-onos_build.qcow2 diff --git a/build/overcloud-opendaylight-sfc.sh b/build/overcloud-opendaylight-sfc.sh index 612f483d..444d284a 100755 --- a/build/overcloud-opendaylight-sfc.sh +++ b/build/overcloud-opendaylight-sfc.sh @@ -19,15 +19,8 @@ pushd images > /dev/null cp -f overcloud-full-opendaylight.qcow2 overcloud-full-opendaylight-sfc_build.qcow2 # upgrade ovs into ovs 2.5.90 with NSH function -if ! [[ -f "$ovs_rpm_name" && -f "$ovs_kmod_rpm_name" ]]; then - curl -L -O ${onos_ovs_uri}/${onos_ovs_pkg} - tar -xzf ${onos_ovs_pkg} -fi - -LIBGUESTFS_BACKEND=direct virt-customize --upload ${ovs_kmod_rpm_name}:/root/ \ - --run-command "yum install -y /root/${ovs_kmod_rpm_name}" \ - --upload ${ovs_rpm_name}:/root/ \ - --run-command "yum upgrade -y /root/${ovs_rpm_name}" \ +LIBGUESTFS_BACKEND=direct virt-customize --run-command "yum install -y /root/ovs/rpm/rpmbuild/RPMS/x86_64/${ovs_kmod_rpm_name}" \ + --run-command "yum upgrade -y /root/ovs/rpm/rpmbuild/RPMS/x86_64/${ovs_rpm_name}" \ -a overcloud-full-opendaylight-sfc_build.qcow2 mv overcloud-full-opendaylight-sfc_build.qcow2 overcloud-full-opendaylight-sfc.qcow2 diff --git a/build/rpm_specs/opnfv-apex-common.spec b/build/rpm_specs/opnfv-apex-common.spec index 159f236b..6ad5782f 100644 --- a/build/rpm_specs/opnfv-apex-common.spec +++ b/build/rpm_specs/opnfv-apex-common.spec @@ -33,6 +33,9 @@ install ci/deploy.sh %{buildroot}%{_bindir}/opnfv-deploy install ci/clean.sh %{buildroot}%{_bindir}/opnfv-clean install ci/util.sh %{buildroot}%{_bindir}/opnfv-util +mkdir -p %{buildroot}%{_sysconfdir}/bash_completion.d/ +install build/bash_completion_apex %{buildroot}%{_sysconfdir}/bash_completion.d/apex + mkdir -p %{buildroot}%{_sysconfdir}/opnfv-apex/ install config/deploy/os-nosdn-nofeature-noha.yaml %{buildroot}%{_sysconfdir}/opnfv-apex/os-nosdn-nofeature-noha.yaml install config/deploy/os-nosdn-fdio-noha.yaml %{buildroot}%{_sysconfdir}/opnfv-apex/os-nosdn-fdio-noha.yaml @@ -105,6 +108,7 @@ install config/inventory/pod_example_settings.yaml %{buildroot}%{_docdir}/opnfv/ %{python3_sitelib}/apex/ %{_var}/opt/opnfv/lib/installer/onos/onos_gw_mac_update.sh %{_var}/opt/opnfv/lib/installer/domain.xml +%{_sysconfdir}/bash_completion.d/apex %{_sysconfdir}/opnfv-apex/os-nosdn-nofeature-noha.yaml %{_sysconfdir}/opnfv-apex/os-nosdn-fdio-noha.yaml %{_sysconfdir}/opnfv-apex/os-nosdn-ovs-noha.yaml @@ -132,6 +136,8 @@ install config/inventory/pod_example_settings.yaml %{buildroot}%{_docdir}/opnfv/ %doc %{_docdir}/opnfv/inventory.yaml.example %changelog +* Fri Sep 16 2016 Dan Radez <dradez@redhat.com> - 3.0-13 +- adding bash completion script * Tue Aug 30 2016 Tim Rozet <trozet@redhat.com> - 3.0-12 - Add clean library. * Mon Aug 1 2016 Tim Rozet <trozet@redhat.com> - 3.0-11 diff --git a/build/set_perf_images.sh b/build/set_perf_images.sh index 0025cc75..d91c20ec 100644 --- a/build/set_perf_images.sh +++ b/build/set_perf_images.sh @@ -19,6 +19,7 @@ for ROLE in $@; do KERNEL=$(glance image-show overcloud-full | grep 'kernel_id' | cut -d '|' -f 3 | xargs) RAMDISK_ID=$(glance image-show ${RAMDISK} | grep id | awk {'print $4'}) glance image-create --name $ROLE-overcloud-full --disk-format qcow2 --file $ROLE-overcloud-full.qcow2 --container-format bare --property ramdisk_id=$RAMDISK_ID --property kernel_id=$KERNEL --is-public True + rm -f $ROLE-overcloud-full.qcow2 fi if [ "$ROLE" == "Controller" ]; then diff --git a/build/undercloud.sh b/build/undercloud.sh index a4d008ee..3cc56009 100755 --- a/build/undercloud.sh +++ b/build/undercloud.sh @@ -62,7 +62,7 @@ LIBGUESTFS_BACKEND=direct virt-customize \ # Add custom IPA to allow kernel params wget https://raw.githubusercontent.com/trozet/ironic-python-agent/opnfv_kernel/ironic_python_agent/extensions/image.py -python3.4 -c 'import py_compile; py_compile.compile("image.py", cfile="image.pyc")' +python3 -c 'import py_compile; py_compile.compile("image.py", cfile="image.pyc")' # Add performance image scripts LIBGUESTFS_BACKEND=direct virt-customize --upload ../build_perf_image.sh:/home/stack \ diff --git a/build/variables.sh b/build/variables.sh index 990ac836..0308580d 100644 --- a/build/variables.sh +++ b/build/variables.sh @@ -39,3 +39,15 @@ honeycomb_pkg='honeycomb-1.0.0-1609.noarch.rpm' ovs_rpm_name=openvswitch-2.5.90-1.el7.centos.x86_64.rpm ovs_kmod_rpm_name=openvswitch-kmod-2.5.90-1.el7.centos.x86_64.rpm + +virt_uri_base=https://people.redhat.com/~rjones/libguestfs-RHEL-7.3-preview +libguestfs_pkg='libguestfs-1.32.7-3.el7.x86_64.rpm' +virt_pkgs=( +'libguestfs-tools-1.32.7-3.el7.noarch.rpm' +'libguestfs-tools-c-1.32.7-3.el7.x86_64.rpm' +'supermin-5.1.16-4.el7.x86_64.rpm' +'supermin5-5.1.16-4.el7.x86_64.rpm' +'supermin-helper-5.1.16-4.el7.x86_64.rpm' +'perl-Sys-Guestfs-1.32.7-3.el7.x86_64.rpm' +'python-libguestfs-1.32.7-3.el7.x86_64.rpm' +) |