Adding Heat template for staging StorPerf master node 89/3089/1
authormbeierl <mark.beierl@emc.com>
Fri, 6 Nov 2015 02:22:54 +0000 (21:22 -0500)
committermbeierl <mark.beierl@emc.com>
Fri, 6 Nov 2015 02:23:49 +0000 (21:23 -0500)
Change-Id: I1e55290013f31272952f23869a02d68ca08cd4a7
JIRA: STORPERF-12
Signed-off-by: mbeierl <mark.beierl@emc.com>
ci/daily.sh
ci/merge.sh
ci/storperf-master.yaml [new file with mode: 0644]
ci/verify.sh
storperf/main.py
storperf/resources/ssh/storperf_rsa [new file with mode: 0644]
storperf/resources/ssh/storperf_rsa.pub [new file with mode: 0644]

index 06bd986..0cc5977 100755 (executable)
@@ -1,2 +1,36 @@
-#!/bin/bash
+#!/bin/bash -x
+##############################################################################
+# Copyright (c) 2015 EMC 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
+##############################################################################
+
+if [ -f ~/jenkins-os.rc ]
+then
+    . ~/jenkins-os.rc
+fi
+
+if [ -z $WORKSPACE ]
+then
+    WORKSPACE=`pwd`
+fi
+
+function stage_base_os_in_glance {
+
+   export OS_IMAGE_API_VERSION=1
+
+    glance image-list | grep "$1"
+    if [ $? -eq 1 ]
+    then
+        curl -s -o $WORKSPACE/$1.qcow2 https://cloud-images.ubuntu.com/releases/15.10/release/ubuntu-15.10-server-cloudimg-amd64-disk1.img
+        glance image-create --name="$1" --disk-format=qcow2 --container-format=bare < $WORKSPACE/$1.qcow2
+    fi
+
+}
+
+stage_base_os_in_glance ubuntu-server
+
 exit 0
index 06bd986..bd1d3fe 100755 (executable)
@@ -1,2 +1,11 @@
 #!/bin/bash
-exit 0
+##############################################################################
+# Copyright (c) 2015 EMC 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
+##############################################################################
+
+PYTHONPATH="`pwd`/storperf":"`pwd`/tests" nosetests --with-xunit .
diff --git a/ci/storperf-master.yaml b/ci/storperf-master.yaml
new file mode 100644 (file)
index 0000000..1bc84f5
--- /dev/null
@@ -0,0 +1,117 @@
+heat_template_version: 2013-05-23
+
+parameters:
+  flavor:
+    type: string
+    default: m1.small
+  image:
+    type: string
+    default: ubuntu-server
+  key_name:
+    type: string
+  public_net_id:
+    type: string
+    default: public
+  username:
+    type: string
+    default: storperf
+
+resources:
+  storperf_manager:
+    type: "OS::Nova::Server"
+    properties:
+      name: storperf-manager
+      image: { get_param: image }
+      flavor: { get_param: flavor }
+      key_name: { get_param: key_name }
+      networks:
+        - port: { get_resource: storperf_manager_port }
+      user_data: { get_resource: storperf_manager_config }
+      user_data_format: RAW
+
+  storperf_manager_config:
+    type: "OS::Heat::CloudConfig"
+    properties:
+      cloud_config:
+        users:
+        - name: { get_param: username }
+          groups: users
+          shell: /bin/bash
+          sudo: "ALL=(ALL) NOPASSWD:ALL"
+          ssh_authorized_keys:
+          - ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDEbnDiqZ8RjQJJzJPf074J41XlYED+zYBzaUZ5UkkUquXzymyUmoWaFBXJP+XPu4Ns44U/S8614+JxGk96tjUdJlIjL0Ag8HP6KLtTNCabucKcEASpgJIVWqJvE3E9upZLIEiTGsF8I8S67T2qq1J1uvtxyeZmyjm7NMamjyFXE53dhR2EHqSutyKK1CK74NkRY9wr3qWUIt35kLdKSVSfrr4gOOicDALbIRu77skHIvrjt+wK1VWphBdMg6ytuq5mIE6pjWAU3Gwl4aTxOU0z43ARzCLq8HVf8s/dKjYMj8plNqaIfceMbaEUqpNHv/xbvtGNG7N0aB/a4pkUQL07
+        - default
+        package_update: true
+        package_upgrade: true
+        packages:
+        - fio
+        - python
+        - rsync
+        - graphite-carbon
+        - graphite-web
+        - apache2
+        - libapache2-mod-wsgi
+        - curl
+
+  storperf_manager_port:
+    type: "OS::Neutron::Port"
+    properties:
+      network_id: { get_resource: storperf_agent_net }
+      security_groups:
+        - { get_resource: storperf_security_group }
+
+  storperf_manager_ip:
+    type: "OS::Neutron::FloatingIP"
+    properties:
+      floating_network_id: { get_param: public_net_id }
+      port_id: { get_resource: storperf_manager_port }
+
+  storperf_agent_net:
+    type: "OS::Neutron::Net"
+    properties:
+      name: storperf-agent-network
+
+  storperf_agent_subnet:
+    type: "OS::Neutron::Subnet"
+    properties:
+      name: StorPerf-Agent-Subnet
+      network_id: { get_resource: storperf_agent_net }
+      cidr: 192.168.101.0/24
+      gateway_ip: 192.168.101.1
+      enable_dhcp: true
+      allocation_pools:
+        - start: "192.168.101.2"
+          end: "192.168.101.250"
+
+  storperf_security_group:
+    type: OS::Neutron::SecurityGroup
+    properties:
+      description: Neutron security group rules
+      name: storperf_security_group
+      rules:
+      - remote_ip_prefix: 0.0.0.0/0
+        protocol: tcp
+        direction: ingress
+      - remote_ip_prefix: 0.0.0.0/0
+        protocol: icmp
+        direction: ingress
+
+  router:
+    type: OS::Neutron::Router
+
+  router_gateway:
+    type: OS::Neutron::RouterGateway
+    properties:
+      router_id: { get_resource: router }
+      network_id: { get_param: public_net_id }
+
+  router_interface:
+    type: OS::Neutron::RouterInterface
+    properties:
+      router_id: { get_resource: router }
+      subnet_id: { get_resource: storperf_agent_subnet }
+
+outputs:
+  public_ip:
+    description: Floating IP address in public network
+    value: { get_attr: [ storperf_manager_ip, floating_ip_address ] }
index 06bd986..333a05c 100755 (executable)
@@ -1,2 +1,11 @@
 #!/bin/bash
+##############################################################################
+# Copyright (c) 2015 EMC 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
+##############################################################################
+
 exit 0
index f5e5581..a40d656 100644 (file)
@@ -85,9 +85,5 @@ def main(argv=None):
     invoker.register(event)
     invoker.execute(simple_args)
 
-
-
-logging.config.fileConfig('logging.ini')
-
 if __name__ == "__main__":
     sys.exit(main())
diff --git a/storperf/resources/ssh/storperf_rsa b/storperf/resources/ssh/storperf_rsa
new file mode 100644 (file)
index 0000000..fb8c714
--- /dev/null
@@ -0,0 +1,27 @@
+-----BEGIN RSA PRIVATE KEY-----
+MIIEpQIBAAKCAQEAxG5w4qmfEY0CScyT39O+CeNV5WBA/s2Ac2lGeVJJFKrl88ps
+lJqFmhQVyT/lz7uDbOOFP0vOtePicRpPerY1HSZSIy9AIPBz+ii7UzQmm7nCnBAE
+qYCSFVqibxNxPbqWSyBIkxrBfCPEuu09qqtSdbr7ccnmZso5uzTGpo8hVxOd3YUd
+hB6krrciitQiu+DZEWPcK96llCLd+ZC3SklUn66+IDjonAwC2yEbu+7JByL647fs
+CtVVqYQXTIOsrbquZiBOqY1gFNxsJeGk8TlNM+NwEcwi6vB1X/LP3So2DI/KZTam
+iH3HjG2hFKqTR7/8W77RjRuzdGgf2uKZFEC9OwIDAQABAoIBAQC7J6byrz5Z0Io/
+mmXCOtK0RSAQHfePTml2jPWSnm32/SV/dHyj0d49gamISBNEK5r64oSQXEAlWWzk
+6naTqotMrLhRwbFOMQuva6OfkO7ALOtZGoH2pgOJyQM+5b1dXSvZhHbhgfqbttC4
+cVXyCK3WckMklYOqqD79OTmUdIcFmILoYuMbIuMBtPukLgOel0wwTboegqDGg3aq
+Kmnq+Y79Z2FG2Xn1NGllSCLPMAKJpODNW1E1H8JqvV7gmC/SUItRsvcLSg6pr2vB
+eRhjLlczpnOK9pzHoul/qe6GR9RG/FoWl9c5uVeq3OFxqUQplwmxNVTQ+vJplJM5
+WFbsDZRhAoGBAPw5cpa2d4AuPxFJPnsrlhAAxtK/+Jl1Hi/1ioA5lggSe55xHdvP
+dxeh4XJ8u4jnjCDdrmqHF0K578DoaCCRz9UT7P2JV2QCECPQgCvpkgEG344ovHwA
+VI2j6+m1zKA6yJ2BEr/t3pvDrjoOtBHZaPMdJBHi53YleZvecxDlODT5AoGBAMdf
+MDP6np1Jr/3NTJSYcFQGeqNA3S++aNVJAM+rsQk8rZLttvyiinIK+NUgMbGVMtsH
++t4HbJrCpX4cLzmDKDuRXGK8z4n3/jyjID7WDRPm5te+yqD2Zrv6oAal4DoxlGYj
+EHftbWKwGwgktWKQbdV+7R0ZHwNgPK3cn3twnrTTAoGAIrDsF9qk+RZjSkdetqY6
+D51ru1T4JnM7YbFOCXDiN94C7rn0N2WDpdZ4Ib0SNjRSy7px4OkPw/e7CDdvCvvD
+MDV7ZSvcvz6hZaup1WBc2pNNcEoeEpghCRJAwnZk3Kz5JuC36XoYIih58DZRghr7
+GmUpruQcnd1tqoigHvTIFFECgYEAk67dJAPHrrdA2H5U9dWdj4BlI70Omykuup8j
+LLH/p9n8sVPJMoasiyG5hRYd+W+NhlX47LMPLex1bl8uVCnliYp5puI50feTqhMj
+9afVdCKcaL/5lRYwr5pNI9+Ho1PKm4Xp0wxa9LmCrJuUiPh3g6hLuDw9juCg0iEV
+OfkIduUCgYEA+924bfPhC7mNURBsQHaGSqlRbCX1KmU8EnmMJuVsPW8N9mN3/KU9
+0QFulljh1QNiByK5Iq4J0Q62OFbb1k8POB0ensZwfdIX/QoyhWGXz+DoUOLSDY6N
+tlIG1mTYJCltc1rajPAtKdLv/PZeJS6NWp1y6T23IVQ08+HzCfxYwRA=
+-----END RSA PRIVATE KEY-----
diff --git a/storperf/resources/ssh/storperf_rsa.pub b/storperf/resources/ssh/storperf_rsa.pub
new file mode 100644 (file)
index 0000000..cdc8cb4
--- /dev/null
@@ -0,0 +1 @@
+ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDEbnDiqZ8RjQJJzJPf074J41XlYED+zYBzaUZ5UkkUquXzymyUmoWaFBXJP+XPu4Ns44U/S8614+JxGk96tjUdJlIjL0Ag8HP6KLtTNCabucKcEASpgJIVWqJvE3E9upZLIEiTGsF8I8S67T2qq1J1uvtxyeZmyjm7NMamjyFXE53dhR2EHqSutyKK1CK74NkRY9wr3qWUIt35kLdKSVSfrr4gOOicDALbIRu77skHIvrjt+wK1VWphBdMg6ytuq5mIE6pjWAU3Gwl4aTxOU0z43ARzCLq8HVf8s/dKjYMj8plNqaIfceMbaEUqpNHv/xbvtGNG7N0aB/a4pkUQL07 jenkins@storperf-openstack