]> git-server-git.apps.pok.os.sepia.ceph.com Git - teuthology.git/commitdiff
openstack: install ceph-workbench
authorLoic Dachary <ldachary@redhat.com>
Sat, 19 Dec 2015 16:42:27 +0000 (17:42 +0100)
committerKyr Shatskyy <kyrylo.shatskyy@suse.com>
Mon, 14 Oct 2019 14:47:01 +0000 (16:47 +0200)
Signed-off-by: Loic Dachary <loic@dachary.org>
Conflicts:
teuthology/openstack/__init__.py

scripts/openstack.py
teuthology/openstack/__init__.py
teuthology/openstack/openstack-user-data.txt
teuthology/openstack/setup-openstack.sh
teuthology/openstack/test/test_openstack.py
teuthology/openstack/test/user-data-test1.txt

index 6d0d3592b707467a952a29e3699bf15b2c51d90b..68e91adbf1ac28910e522bbc3a1f42ea45e04586 100644 (file)
@@ -217,6 +217,15 @@ def get_openstack_parser():
         help="use this teuthology branch instead of master",
         default=os.getenv('TEUTH_BRANCH', 'master'),
     )
+    parser.add_argument(
+        '--ceph-workbench-git-url',
+        help="git clone url for ceph-workbench",
+    )
+    parser.add_argument(
+        '--ceph-workbench-branch',
+        help="use this ceph-workbench branch instead of master",
+        default='master',
+    )
     parser.add_argument(
         '--upload',
         action='store_true', default=False,
index 616497b76ba7a3b0df853f6e223f134e743e76e7..c3dffb496e938809bc8045568cd792d06c9fed45 100644 (file)
@@ -728,6 +728,8 @@ class TeuthologyOpenStack(OpenStack):
                                     '--suite-branch',
                                     '--ceph-repo',
                                     '--ceph',
+                                    '--ceph-workbench-branch',
+                                    '--ceph-workbench-git-url',
                                     '--archive-upload',
                                     '--archive-upload-url',
                                     '--key-name',
@@ -933,16 +935,24 @@ ssh access           : ssh {identity}{username}@{ip} # logs in /usr/share/nginx/
             clone = ("git clone -b {branch} {url}".format(
                 branch=self.args.teuthology_branch,
                 url=self.args.teuthology_git_url))
+        ceph_workbench = ''
+        if self.args.ceph_workbench_git_url:
+            ceph_workbench += (" --ceph-workbench-branch " +
+                               self.args.ceph_workbench_branch)
+            ceph_workbench += (" --ceph-workbench-git-url " +
+                               self.args.ceph_workbench_git_url)
         log.debug("OPENRC = " + openrc + " " +
                   "TEUTHOLOGY_USERNAME = " + self.username + " " +
                   "CLONE_OPENSTACK = " + clone + " " +
                   "UPLOAD = " + upload + " " +
+                  "CEPH_WORKBENCH = " + ceph_workbench + " " +
                   "NWORKERS = " + str(self.args.simultaneous_jobs))
         content = (template.
                    replace('OPENRC', openrc).
                    replace('TEUTHOLOGY_USERNAME', self.username).
                    replace('CLONE_OPENSTACK', clone).
                    replace('UPLOAD', upload).
+                   replace('CEPH_WORKBENCH', ceph_workbench).
                    replace('NWORKERS', str(self.args.simultaneous_jobs)))
         open(path, 'w').write(content)
         log.debug("get_user_data: " + content + " written to " + path)
index 1317c648980c911754d62a397cc55f98ea1cee65..f537e86b9ff282efb7ddff3e168d13af95217582 100644 (file)
@@ -12,6 +12,6 @@ packages:
 runcmd:
  - su - -c '(set -x ; CLONE_OPENSTACK && cd teuthology && ./bootstrap install)' TEUTHOLOGY_USERNAME >> /tmp/init.out 2>&1
  - echo 'export OPENRC' | tee /home/TEUTHOLOGY_USERNAME/openrc.sh
- - su - -c '(set -x ; source openrc.sh ; cd teuthology ; source virtualenv/bin/activate ; openstack keypair delete teuthology || true ; teuthology/openstack/setup-openstack.sh --nworkers NWORKERS UPLOAD --setup-all)' TEUTHOLOGY_USERNAME >> /tmp/init.out 2>&1
+ - su - -c '(set -x ; source openrc.sh ; cd teuthology ; source virtualenv/bin/activate ; openstack keypair delete teuthology || true ; teuthology/openstack/setup-openstack.sh --nworkers NWORKERS UPLOAD CEPH_WORKBENCH --setup-all)' TEUTHOLOGY_USERNAME >> /tmp/init.out 2>&1
  - /etc/init.d/teuthology restart
 final_message: "teuthology is up and running after $UPTIME seconds"
index 9089a9edc4204d5c6cf8cb157ae8a9d97c6c1b18..3be3cc65da581d414ba1193ffb4182bcb80c0f94 100755 (executable)
@@ -287,6 +287,23 @@ function remove_crontab() {
     crontab -r
 }
 
+function setup_ceph_workbench() {
+    local url=$1
+    local branch=$2
+
+    (
+        cd $HOME
+        source teuthology/virtualenv/bin/activate
+        if test "$url" ; then
+            git clone -b $branch $url
+            cd ceph-workbench
+            python setup.py install
+        else
+            pip install ceph-workbench
+        fi
+    )
+}
+
 function get_or_create_keypair() {
     local keypair=$1
 
@@ -452,8 +469,11 @@ function main() {
     local flavor_select
     local keypair=teuthology
     local archive_upload
+    local ceph_workbench_git_url
+    local ceph_workbench_branch
 
     local do_setup_keypair=false
+    local do_ceph_workbench=false
     local do_create_config=false
     local do_setup_dnsmasq=false
     local do_install_packages=false
@@ -490,6 +510,14 @@ function main() {
                 shift
                 archive_upload=$1
                 ;;
+            --ceph-workbench-git-url)
+                shift
+                ceph_workbench_git_url=$1
+                ;;
+            --ceph-workbench-branch)
+                shift
+                ceph_workbench_branch=$1
+                ;;
             --install)
                 do_install_packages=true
                 ;;
@@ -499,6 +527,9 @@ function main() {
             --setup-keypair)
                 do_setup_keypair=true
                 ;;
+            --setup-ceph-workbench)
+                do_ceph_workbench=true
+                ;;
             --setup-dnsmasq)
                 do_setup_dnsmasq=true
                 ;;
@@ -513,6 +544,7 @@ function main() {
                 ;;
             --setup-all)
                 do_install_packages=true
+                do_ceph_workbench=true
                 do_create_config=true
                 do_setup_keypair=true
                 do_setup_dnsmasq=true
@@ -568,6 +600,10 @@ function main() {
         setup_crontab || return 1
     fi
 
+    if $do_ceph_workbench ; then
+        setup_ceph_workbench $ceph_workbench_git_url $ceph_workbench_branch || return 1
+    fi
+
     if $do_setup_keypair ; then
         get_or_create_keypair $keypair || return 1
     fi
index 1cf0b9df8b40990ea31776c1d10e5e945ef872a1..c1d0214347a3cec303541a9460ea01336e621f15 100644 (file)
@@ -1639,6 +1639,8 @@ openstack keypair delete {key_name} || true
         argv = (self.options +
                 ['--teuthology-git-url', 'TEUTHOLOGY_URL',
                  '--teuthology-branch', 'TEUTHOLOGY_BRANCH',
+                 '--ceph-workbench-git-url', 'CEPH_WORKBENCH_URL',
+                 '--ceph-workbench-branch', 'CEPH_WORKBENCH_BRANCH',
                  '--upload',
                  '--archive-upload', archive_upload] +
                 teuthology_argv)
@@ -1659,6 +1661,9 @@ openstack keypair delete {key_name} || true
         assert "nworkers=" + str(args.simultaneous_jobs) in l
         assert "username=" + teuthology.username in l
         assert "upload=--archive-upload user@archive:/tmp" in l
+        assert ("ceph_workbench="
+                " --ceph-workbench-branch CEPH_WORKBENCH_BRANCH"
+                " --ceph-workbench-git-url CEPH_WORKBENCH_URL") in l
         assert "clone=git clone -b TEUTHOLOGY_BRANCH TEUTHOLOGY_URL" in l
         assert os.environ['OS_AUTH_URL'] in l
         assert " ".join(teuthology_argv) in l
index 9889aa9f35c50c7018dee36ad3dc2d3c98a21b43..4e3e466c2157a281f9998b76a7a7be81fe1b7b16 100644 (file)
@@ -2,4 +2,4 @@
 system_info:
   default_user:
     name: ubuntu
-final_message: "teuthology is up and running after $UPTIME seconds, substituded variables nworkers=NWORKERS openrc=OPENRC username=TEUTHOLOGY_USERNAME upload=UPLOAD clone=CLONE_OPENSTACK"
+final_message: "teuthology is up and running after $UPTIME seconds, substituded variables nworkers=NWORKERS openrc=OPENRC username=TEUTHOLOGY_USERNAME upload=UPLOAD ceph_workbench=CEPH_WORKBENCH clone=CLONE_OPENSTACK"