diff options
author | Fatih Degirmenci <fatih.degirmenci@ericsson.com> | 2017-03-22 23:04:54 +0100 |
---|---|---|
committer | Fatih Degirmenci <fatih.degirmenci@ericsson.com> | 2017-03-22 23:41:39 +0100 |
commit | 50f3ebc5230a8864ca30548855ccc232c881fb2e (patch) | |
tree | 68918060e1e80fbcca8518e05630fcc89e8ffa0e | |
parent | 34e12d9aa0e7cc9baeba6de454fbce00ae627aea (diff) |
xci: Make it possible to select component versions
By replacing the branch with version, we now can specify sha1s
per project; opnfv/releng, openstack-ansible, and bifrost.
If nothing is specified manually (or via promotion), the defaults
will be set to branches, master and stable/ocata.
Change also includes further logging.
Change-Id: Iae0f8cc60391caeb0f2735610050007014374a70
Signed-off-by: Fatih Degirmenci <fatih.degirmenci@ericsson.com>
-rw-r--r-- | jjb/xci/xci-daily-jobs.yml | 38 | ||||
-rwxr-xr-x | jjb/xci/xci-deploy.sh | 39 | ||||
-rwxr-xr-x | jjb/xci/xci-provision.sh | 40 | ||||
-rwxr-xr-x | prototypes/bifrost/scripts/osa-bifrost-deployment.sh | 6 | ||||
-rw-r--r-- | prototypes/openstack-ansible/playbooks/configure-xcimaster.yml | 17 | ||||
-rw-r--r-- | prototypes/openstack-ansible/var/ubuntu.yml | 2 |
6 files changed, 112 insertions, 30 deletions
diff --git a/jjb/xci/xci-daily-jobs.yml b/jjb/xci/xci-daily-jobs.yml index ce2e4f382..bee84cb23 100644 --- a/jjb/xci/xci-daily-jobs.yml +++ b/jjb/xci/xci-daily-jobs.yml @@ -3,15 +3,22 @@ #-------------------------------- # BRANCH ANCHORS #-------------------------------- +# the versions stated here default to branches which then later +# on used for checking out the branches, pulling in head of the branch. +# but they also allow us to state sha1 so instead of checking out the +# branches, we can check out sha1 if we want to use locked/specific +# sha1 or manually enter sha1. master: &master stream: master - openstack-branch: '{stream}' - opnfv-branch: 'master' + openstack-osa-version: '{stream}' + openstack-bifrost-version: '{stream}' + opnfv-releng-version: 'master' gs-pathname: '' ocata: &ocata stream: ocata - openstack-branch: 'stable/{stream}' - opnfv-branch: 'master' + openstack-osa-version: 'stable/{stream}' + openstack-bifrost-version: 'stable/{stream}' + opnfv-releng-version: 'master' gs-pathname: '/{stream}' #-------------------------------- # scenarios @@ -87,6 +94,18 @@ parameters: - string: + name: OPENSTACK_OSA_VERSION + default: '{openstack-osa-version}' + - string: + name: OPENSTACK_BIFROST_VERSION + default: '{openstack-osa-version}' + - string: + name: OPNFV_RELENG_VERSION + default: '{opnfv-releng-version}' + - string: + name: USE_PROMOTED_VERSIONS + default: 'true' + - string: name: DEPLOY_SCENARIO default: '{scenario}' - label: @@ -151,11 +170,14 @@ parameters: - string: - name: OPENSTACK_BRANCH - default: '{openstack-branch}' + name: OPENSTACK_OSA_VERSION + default: '{openstack-osa-version}' + - string: + name: OPENSTACK_BIFROST_VERSION + default: '{openstack-osa-version}' - string: - name: OPNFV_BRANCH - default: '{opnfv-branch}' + name: OPNFV_RELENG_VERSION + default: '{opnfv-releng-version}' - string: name: USE_PROMOTED_VERSIONS default: 'true' diff --git a/jjb/xci/xci-deploy.sh b/jjb/xci/xci-deploy.sh index dae67cf84..87f9ec8db 100755 --- a/jjb/xci/xci-deploy.sh +++ b/jjb/xci/xci-deploy.sh @@ -46,18 +46,32 @@ fix_ownership # openstack-ansible enables strict host key checking by default export ANSIBLE_HOST_KEY_CHECKING=False +# ensure the versions to checkout are set +export OPENSTACK_OSA_VERSION=${OPENSTACK_OSA_VERSION:-master} +export OPNFV_RELENG_VERSION=${OPNFV_RELENG_VERSION:-master} + +# log some info +echo -e "\n" +echo "***********************************************************************" +echo "* *" +echo "* Deploy OpenStack *" +echo "* *" +echo " openstack-ansible version: $OPENSTACK_OSA_VERSION" +echo " releng version: $OPNFV_RELENG_VERSION" +echo "* *" +echo "***********************************************************************" +echo -e "\n" +# clone releng repo +sudo git clone --quiet https://gerrit.opnfv.org/gerrit/releng /opt/releng +cd /opt/releng && sudo git checkout --quiet $OPNFV_RELENG_VERSION +echo "xci: using openstack-ansible commit" +git show --oneline -s --pretty=format:'%h - %s (%cr) <%an>' + # display the nodes +echo "xci: OpenStack nodes" cd /opt/bifrost source env-vars ironic node-list -virsh list - -# ensure the branches to use are set -export OPNFV_BRANCH=${OPNFV_BRANCH:-master} -export OPENSTACK_BRANCH=${OPENSTACK_BRANCH:-master} - -# clone releng repo -sudo git clone -b $OPNFV_BRANCH https://gerrit.opnfv.org/gerrit/releng /opt/releng # this script will be reused for promoting openstack-ansible versions and using # promoted openstack-ansible versions as part of xci daily. @@ -68,3 +82,12 @@ fi cd /opt/releng/prototypes/openstack-ansible/scripts sudo -E ./osa-deploy.sh + +# log some info +echo -e "\n" +echo "***********************************************************************" +echo "* *" +echo "* OpenStack deployment is completed! *" +echo "* *" +echo "***********************************************************************" +echo -e "\n" diff --git a/jjb/xci/xci-provision.sh b/jjb/xci/xci-provision.sh index e474093b8..a1ba78bf0 100755 --- a/jjb/xci/xci-provision.sh +++ b/jjb/xci/xci-provision.sh @@ -43,11 +43,32 @@ sudo /bin/rm -rf /opt/bifrost /opt/openstack-ansible /opt/stack /opt/releng /opt # Fix up permissions fix_ownership -# ensure the branches to use are set -export OPENSTACK_BRANCH=${OPENSTACK_BRANCH:-master} -export OPNFV_BRANCH=${OPNFV_BRANCH:-master} -sudo git clone -b $OPENSTACK_BRANCH https://git.openstack.org/openstack/bifrost /opt/bifrost -sudo git clone -b $OPNFV_BRANCH https://gerrit.opnfv.org/gerrit/releng /opt/releng +# ensure the versions to checkout are set +export OPENSTACK_BIFROST_VERSION=${OPENSTACK_BIFROST_VERSION:-master} +export OPNFV_RELENG_VERSION=${OPNFV_RELENG_VERSION:-master} + +# log some info +echo -e "\n" +echo "***********************************************************************" +echo "* *" +echo "* Provision OpenStack Nodes *" +echo "* *" +echo " bifrost version: $OPENSTACK_BIFROST_VERSION" +echo " releng version: $OPNFV_RELENG_VERSION" +echo "* *" +echo "***********************************************************************" +echo -e "\n" + +# clone the repos and checkout the versions +sudo git clone --quiet https://git.openstack.org/openstack/bifrost /opt/bifrost +cd /opt/bifrost && sudo git checkout --quiet $OPENSTACK_BIFROST_VERSION +echo "xci: using bifrost commit" +git show --oneline -s --pretty=format:'%h - %s (%cr) <%an>' + +sudo git clone --quiet https://gerrit.opnfv.org/gerrit/releng /opt/releng +cd /opt/releng && sudo git checkout --quiet $OPNFV_RELENG_VERSION +echo "xci: using releng commit" +git show --oneline -s --pretty=format:'%h - %s (%cr) <%an>' # this script will be reused for promoting bifrost versions and using # promoted bifrost versions as part of xci daily. @@ -72,3 +93,12 @@ cd /opt/bifrost source env-vars ironic node-list virsh list + +# log some info +echo -e "\n" +echo "***********************************************************************" +echo "* *" +echo "* OpenStack nodes are provisioned! *" +echo "* *" +echo "***********************************************************************" +echo -e "\n" diff --git a/prototypes/bifrost/scripts/osa-bifrost-deployment.sh b/prototypes/bifrost/scripts/osa-bifrost-deployment.sh index 33ad10887..fb66ae9e3 100755 --- a/prototypes/bifrost/scripts/osa-bifrost-deployment.sh +++ b/prototypes/bifrost/scripts/osa-bifrost-deployment.sh @@ -20,11 +20,9 @@ USE_VENV="false" BUILD_IMAGE=true PROVISION_WAIT_TIMEOUT=${PROVISION_WAIT_TIMEOUT:-3600} -# ensure the branch is set -export OPENSTACK_BRANCH=${OPENSTACK_BRANCH:-master} - # ensure the right inventory files is used based on branch -if [ $OPENSTACK_BRANCH = "master" ]; then +CURRENT_BIFROST_BRANCH=$(git rev-parse --abbrev-ref HEAD) +if [ $CURRENT_BIFROST_BRANCH = "master" ]; then export BIFROST_INVENTORY_SOURCE=${BIFROST_INVENTORY_SOURCE:-'/tmp/baremetal.json'} else export BIFROST_INVENTORY_SOURCE=${BIFROST_INVENTORY_SOURCE:-'/tmp/baremetal.csv'} diff --git a/prototypes/openstack-ansible/playbooks/configure-xcimaster.yml b/prototypes/openstack-ansible/playbooks/configure-xcimaster.yml index b6c79a418..fbbde640c 100644 --- a/prototypes/openstack-ansible/playbooks/configure-xcimaster.yml +++ b/prototypes/openstack-ansible/playbooks/configure-xcimaster.yml @@ -10,10 +10,19 @@ creates: /root/.ssh/id_rsa - name: fetch public key fetch: src="/root/.ssh/id_rsa.pub" dest="/" - - name: remove the directory - shell: "rm -rf {{OSA_PATH}} {{OSA_ETC_PATH}}" - - name: git openstack ansible - shell: "git clone {{OSA_URL}} {{OSA_PATH}} -b {{OPENSTACK_BRANCH}}" + - name: remove openstack-ansible directories + file: + path={{ item }} + state=absent + recurse=no + with_items: + - "{{OSA_PATH}}" + - "{{OSA_ETC_PATH}}" + - name: clone openstack-ansible + git: + repo: "{{OSA_URL}}" + dest: "{{OSA_PATH}}" + version: "{{OPENSTACK_OSA_VERSION}}" - name: copy opnfv-setup-openstack.yml to /opt/openstack-ansible/playbooks copy: src: ../file/opnfv-setup-openstack.yml diff --git a/prototypes/openstack-ansible/var/ubuntu.yml b/prototypes/openstack-ansible/var/ubuntu.yml index 321a7c4e5..eb595beaa 100644 --- a/prototypes/openstack-ansible/var/ubuntu.yml +++ b/prototypes/openstack-ansible/var/ubuntu.yml @@ -2,7 +2,7 @@ OSA_URL: https://git.openstack.org/openstack/openstack-ansible OSA_PATH: /opt/openstack-ansible OSA_ETC_PATH: /etc/openstack_deploy -OPENSTACK_BRANCH: "{{ lookup('env','OPENSTACK_BRANCH') }}" +OPENSTACK_OSA_VERSION: "{{ lookup('env','OPENSTACK_OSA_VERSION') }}" XCIMASTER_IP: 192.168.122.2 host_info: {'xcimaster':{'MGMT_IP': '172.29.236.10','VLAN_IP': '192.168.122.2', 'STORAGE_IP': '172.29.244.10'},'controller00':{'MGMT_IP': '172.29.236.11','VLAN_IP': '192.168.122.3', 'STORAGE_IP': '172.29.244.11'},'controller01':{'MGMT_IP': '172.29.236.12','VLAN_IP': '192.168.122.4', 'STORAGE_IP': '172.29.244.12'},'controller02':{'MGMT_IP': '172.29.236.13','VLAN_IP': '192.168.122.5', 'STORAGE_IP': '172.29.240.13'},'compute00':{'MGMT_IP': '172.29.236.14','VLAN_IP': '192.168.122.6','VLAN_IP_SECOND': '173.29.241.1','VXLAN_IP': '172.29.240.14', 'STORAGE_IP': '172.29.244.14'},'compute01':{'MGMT_IP': '172.29.236.15','VLAN_IP': '192.168.122.7','VLAN_IP_SECOND': '173.29.241.2','VXLAN_IP': '172.29.240.15', 'STORAGE_IP': '172.29.244.15'}} |