From: Loic Dachary Date: Fri, 28 Aug 2015 14:03:02 +0000 (+0200) Subject: openstack: make git clone configurable X-Git-Tag: 1.1.0~833^2~3 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=a4f27bffaa049b7af0ff586ad9848d9d2278c572;p=teuthology.git openstack: make git clone configurable When teuthology-openstack clone theuthology for the purpose of creating the cluster, use the clone configuration value instead of a hardcoded value. Signed-off-by: Loic Dachary --- diff --git a/docs/siteconfig.rst b/docs/siteconfig.rst index 130ec99ec..6ae7f13c9 100644 --- a/docs/siteconfig.rst +++ b/docs/siteconfig.rst @@ -114,6 +114,12 @@ Here is a sample configuration with many of the options set and documented:: # openstack: + # The teuthology-openstack command will clone teuthology with + # this command for the purpose of deploying teuthology from + # scratch and run workers listening on the openstack tube + # + clone: git clone -b wip-6502-openstack-v3 http://github.com/dachary/teuthology + # The path to the user-data file used when creating a target. It can have # the {os_type} and {os_version} placeholders which are replaced with # the value of --os-type and --os-version. No instance of a give {os_type} diff --git a/teuthology/config.py b/teuthology/config.py index e7cfcc296..e456cc6c5 100644 --- a/teuthology/config.py +++ b/teuthology/config.py @@ -148,6 +148,7 @@ class TeuthologyConfig(YamlConfig): 'baseurl_template': 'http://{host}/{proj}-{pkg_type}-{dist}-{arch}-{flavor}/{uri}', 'teuthology_path': None, 'openstack': { + 'clone': 'git clone http://github.com/ceph/teuthology', 'user-data': 'teuthology/openstack/openstack-{os_type}-{os_version}-user-data.txt', 'ip': '1.1.1.1', 'machine': { diff --git a/teuthology/openstack/__init__.py b/teuthology/openstack/__init__.py index 6d2945cb9..a9a253f17 100644 --- a/teuthology/openstack/__init__.py +++ b/teuthology/openstack/__init__.py @@ -442,13 +442,16 @@ ssh access : ssh {identity}{username}@{ip} # logs in /usr/share/nginx/html upload = '--archive-upload ' + self.args.archive_upload else: upload = '' + clone = teuth_config.openstack['clone'] log.debug("OPENRC = " + openrc + " " + "TEUTHOLOGY_USERNAME = " + self.username + " " + + "CLONE_OPENSTACK = " + clone + " " + "UPLOAD = " + upload + " " + "NWORKERS = " + str(self.args.simultaneous_jobs)) content = (template. replace('OPENRC', openrc). replace('TEUTHOLOGY_USERNAME', self.username). + replace('CLONE_OPENSTACK', clone). replace('UPLOAD', upload). replace('NWORKERS', str(self.args.simultaneous_jobs))) open(path, 'w').write(content) diff --git a/teuthology/openstack/openstack-user-data.txt b/teuthology/openstack/openstack-user-data.txt index 437b10c5c..a0d471e02 100644 --- a/teuthology/openstack/openstack-user-data.txt +++ b/teuthology/openstack/openstack-user-data.txt @@ -9,7 +9,7 @@ packages: - git - rsync runcmd: - - su - -c '(set -x ; git clone -b wip-6502-openstack-v3 http://github.com/dachary/teuthology && cd teuthology && ./bootstrap install)' TEUTHOLOGY_USERNAME >> /tmp/init.out 2>&1 + - 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 - /etc/init.d/teuthology restart diff --git a/teuthology/openstack/setup-openstack.sh b/teuthology/openstack/setup-openstack.sh index 93ac375a0..0aea3302a 100755 --- a/teuthology/openstack/setup-openstack.sh +++ b/teuthology/openstack/setup-openstack.sh @@ -59,6 +59,7 @@ lab_domain: $labdomain max_job_time: 14400 # 4 hours teuthology_path: . openstack: + clone: git clone -b wip-6502-openstack-v3 http://github.com/dachary/teuthology user-data: teuthology/openstack/openstack-{os_type}-{os_version}-user-data.txt ip: $ip nameserver: $nameserver diff --git a/teuthology/openstack/test/test_openstack.py b/teuthology/openstack/test/test_openstack.py index 0884fb310..c9723b548 100644 --- a/teuthology/openstack/test/test_openstack.py +++ b/teuthology/openstack/test/test_openstack.py @@ -109,6 +109,7 @@ openstack keypair delete {key_name} || true assert "nworkers=" + str(args.simultaneous_jobs) in variables assert "username=" + teuthology.username in variables assert "upload=--archive-upload user@archive:/tmp" in variables + assert "upload=git clone" in variables assert os.environ['OS_AUTH_URL'] in variables out, err = capsys.readouterr() diff --git a/teuthology/openstack/test/user-data-test1.txt b/teuthology/openstack/test/user-data-test1.txt index b7d47de86..9889aa9f3 100644 --- a/teuthology/openstack/test/user-data-test1.txt +++ b/teuthology/openstack/test/user-data-test1.txt @@ -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" +final_message: "teuthology is up and running after $UPTIME seconds, substituded variables nworkers=NWORKERS openrc=OPENRC username=TEUTHOLOGY_USERNAME upload=UPLOAD clone=CLONE_OPENSTACK"