Rebase to fuel 9.0 and add vagrant based build and enhance some scripts 13/14413/1
authorGuo Ruijing <ruijing.guo@intel.com>
Fri, 20 May 2016 02:35:39 +0000 (10:35 +0800)
committerGuo Ruijing <ruijing.guo@intel.com>
Fri, 20 May 2016 06:33:48 +0000 (14:33 +0800)
Change-Id: Id3a38d662c330cd388c6509c9d6e90409c1da6e7
Signed-off-by: Guo Ruijing <ruijing.guo@intel.com>
.gitignore
fuel-plugin-vsperf/deployment_scripts/puppet/manifests/vsperf-install.pp
fuel-plugin-vsperf/deployment_tasks.yaml
fuel-plugin-vsperf/environment_config.yaml
fuel-plugin-vsperf/metadata.yaml
fuel-plugin-vsperf/node_roles.yaml
fuel-plugin-vsperf/pre_build_hook
fuel-plugin-vsperf/tasks.yaml
fuel-plugin-vsperf/vagrant/Vagrantfile [new file with mode: 0644]
fuel-plugin-vsperf/vagrant/build_fuel_plugin.sh [new file with mode: 0755]

index 1a23762..9d80343 100644 (file)
@@ -66,3 +66,4 @@ target/
 /src/qemu/qemu/
 /src_cuse/
 /src_vanilla/
+.vagrant
index bd38dbb..7d075ad 100644 (file)
@@ -1,11 +1,7 @@
 $fuel_settings = parseyaml(file('/etc/astute.yaml'))
 $master_ip = $::fuel_settings['master_ip']
 
-exec { "wget vsperf":
-          command => "wget http://$master_ip:8080/plugins/fuel-plugin-vsperf-1.0/repositories/ubuntu/vswitchperf.tgz -O /opt/vswitchperf.tgz",
-                        path   => "/usr/bin:/usr/sbin:/bin:/sbin",
-}
-exec { "untar vsperf":
-          command => "tar xf /opt/vswitchperf.tgz -C /opt",
-                        path   => "/usr/bin:/usr/sbin:/bin:/sbin",
+exec { "install vsperf":
+    command => "mkdir -p /opt/vswitchperf; curl http://$master_ip:8080/plugins/fuel-plugin-vsperf-1.0/repositories/ubuntu/vswitchperf.tgz | tar xzv -C /opt/vswitchperf",
+    path   => "/usr/bin:/usr/sbin:/bin:/sbin";
 }
index fe51488..02a7c56 100644 (file)
@@ -1 +1,19 @@
-[]
+- id: vsperf
+  type: group
+  role: [vsperf]
+  requires: [deploy_start]
+  required_for: [deploy_end]
+  tasks: [hiera, setup_repositories, fuel_pkgs, globals, tools, logging, vsperf_install]
+  parameters:
+    strategy:
+      type: parallel
+- id: vsperf_install
+  type: puppet
+  version: 2.0.0
+  groups: [vsperf]
+  required_for: [post_deployment_end]
+  requires: [post_deployment_start]
+  parameters:
+    puppet_manifest: puppet/manifests/vsperf-install.pp
+    puppet_modules: puppet/modules:/etc/puppet/modules
+    timeout: 720
index 1dd28b5..e69de29 100644 (file)
@@ -1,7 +0,0 @@
-attributes:
-  fuel-plugin-vsperf_text:
-    value: 'Set default value'
-    label: 'Text field'
-    description: 'Description for text field'
-    weight: 25
-    type: "text"
index 998a259..2b28fc5 100644 (file)
@@ -3,11 +3,11 @@ name: fuel-plugin-vsperf
 # Human-readable name for your plugin
 title: Enable VSPERF plugin
 # Plugin version
-version: '1.0.0'
+version: '1.0.9'
 # Description
 description: Deploy VSPERF code
 # Required fuel version
-fuel_version: ['8.0']
+fuel_version: ['9.0']
 # Specify license of your plugin
 licenses: ['Apache License Version 2.0']
 # Specify author or company name
@@ -21,10 +21,12 @@ groups: ['network']
 # The plugin is compatible with releases in the list
 releases:
   - os: ubuntu
-    version: liberty-8.0
+    version: mitaka-9.0
     mode: ['ha']
     deployment_scripts_path: deployment_scripts/
     repository_path: repositories/ubuntu
 
 # Version of plugin package
-package_version: '3.0.0'
+package_version: '4.0.0'
+
+is_hotpluggable: true
index 88b258a..0f4f835 100644 (file)
@@ -1,5 +1,5 @@
 vsperf:
-  name: "VSPERF node"
+  name: "VSPERF"
   description: "Install VSPERF on nodes with this role"
   has_primary: false                # whether has primary role or not
   public_ip_required: false         # whether requires public net or not
index 12517bc..b4da204 100755 (executable)
@@ -7,22 +7,14 @@
 
 set -eux
 
-VSPERF_REV=${VSPERF_REV:-stable/brahmaputra}
 BUILD_FOR=${BUILD_FOR:-ubuntu}
 DIR="$(dirname `readlink -f $0`)"
 
-INCLUDE_DEPENDENCIES=${INCLUDE_DEPENDENCIES:-true}
-
 function build_pkg {
   case $1 in
     ubuntu)
-      cd ${DIR}
-      rm -rf vswitchperf
-      git clone https://gerrit.opnfv.org/gerrit/vswitchperf
-      cd vswitchperf && git checkout ${VSPERF_REV} && cd ..
-      rm -rf vswitchperf/.git
-      tar cfvz ${DIR}/repositories/ubuntu/vswitchperf.tgz vswitchperf
-      rm -rf vswitchperf
+      cd ${DIR}/..
+      tar cfvz ${DIR}/repositories/ubuntu/vswitchperf.tgz . --exclude=vswitchperf.tgz
       ;;
     *) echo "Not supported system"; exit 1;;
   esac
@@ -32,5 +24,3 @@ for system in $BUILD_FOR
 do
   build_pkg $system
 done
-
-
index 0cc003e..fe51488 100644 (file)
@@ -1,7 +1 @@
-- role: ['compute']
-  stage: post_deployment/8998
-  type: puppet
-  parameters:
-    puppet_manifest: puppet/manifests/vsperf-install.pp
-    puppet_modules: puppet/modules:/etc/puppet/modules
-    timeout: 720
+[]
diff --git a/fuel-plugin-vsperf/vagrant/Vagrantfile b/fuel-plugin-vsperf/vagrant/Vagrantfile
new file mode 100644 (file)
index 0000000..d83ac4c
--- /dev/null
@@ -0,0 +1,21 @@
+# -*- mode: ruby -*-
+# vi: set ft=ruby :
+
+# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
+VAGRANTFILE_API_VERSION = "2"
+
+Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
+
+  config.vm.box = "trusty-server-cloudimg-amd64"
+  config.vm.box_url = "https://cloud-images.ubuntu.com/vagrant/trusty/current/trusty-server-cloudimg-amd64-vagrant-disk1.box"
+
+  config.vm.define "fuel" do | h |
+    h.vm.host_name = "fuel"
+    h.vm.provision :shell, :inline => "/vagrant/build_fuel_plugin.sh"
+    h.vm.synced_folder "../..", "/vswitchperf"
+    h.vm.provider :virtualbox do |v|
+      v.customize ["modifyvm", :id, "--memory", 4096]
+      v.customize ["modifyvm", :id, "--cpus", 4]
+    end
+  end
+end
diff --git a/fuel-plugin-vsperf/vagrant/build_fuel_plugin.sh b/fuel-plugin-vsperf/vagrant/build_fuel_plugin.sh
new file mode 100755 (executable)
index 0000000..77b6a33
--- /dev/null
@@ -0,0 +1,11 @@
+#!/bin/bash
+sudo apt-get update -y
+sudo apt-get install createrepo rpm dpkg-dev -y
+sudo apt-get install python-setuptools -y
+sudo apt-get install python-pip -y
+sudo easy_install pip
+sudo pip install fuel-plugin-builder
+sudo apt-get install ruby -y
+sudo gem install rubygems-update
+sudo gem install fpm
+fpb --debug --build /vswitchperf/fuel-plugin-vsperf