xci: Drop OPNFV_RELENG_DEV_PATH variable 47/47847/3
authorMarkos Chandras <mchandras@suse.de>
Mon, 27 Nov 2017 15:09:24 +0000 (15:09 +0000)
committerMarkos Chandras <mchandras@suse.de>
Wed, 29 Nov 2017 14:46:09 +0000 (14:46 +0000)
The OPNFV_RELENG_DEV_PATH variable was used to point to a releng-xci
development repository. However, people normally set the current
directory as the development one and they almost always want to
test the current code in XCI. Using an secondary releng-xci tree
as development repo is a very obscure case and it normally complicates
things. As such, let drop this option and always use the current
repository for development purposes.

Change-Id: If111bf29a32a5f6ea28694f191645af0c6a87abc
Signed-off-by: Markos Chandras <mchandras@suse.de>
Vagrantfile
docs/xci-user-guide.rst
xci/README.rst
xci/playbooks/configure-localhost.yml
xci/playbooks/configure-opnfvhost.yml
xci/playbooks/provision-vm-nodes.yml
xci/var/opnfv.yml
xci/xci-deploy.sh

index 58b6368..776d09b 100644 (file)
@@ -45,7 +45,6 @@ Vagrant.configure(2) do |config|
           export VM_MEMORY_SIZE=${VM_MEMORY_SIZE:-2048}
           export VM_DOMAIN_TYPE=qemu
           export PATH=$PATH:$HOME/.local/bin
-          export OPNFV_RELENG_DEV_PATH=/vagrant
           [[ ! -e ${HOME}/.ssh/id_rsa ]] && ssh-keygen -q -P '' -f ${HOME}/.ssh/id_rsa
           cd xci && ./xci-deploy.sh
       SHELL
@@ -81,7 +80,6 @@ Vagrant.configure(2) do |config|
           export VM_MEMORY_SIZE=${VM_MEMORY_SIZE:-2048}
           export VM_DOMAIN_TYPE=qemu
           export PATH=$PATH:$HOME/.local/bin
-          export OPNFV_RELENG_DEV_PATH=/vagrant
           [[ ! -e ${HOME}/.ssh/id_rsa ]] && ssh-keygen -q -P '' -f ${HOME}/.ssh/id_rsa
           cd xci && ./xci-deploy.sh
       SHELL
@@ -115,7 +113,6 @@ Vagrant.configure(2) do |config|
         export VM_MEMORY_SIZE=${VM_MEMORY_SIZE:-2048}
         export VM_DOMAIN_TYPE=qemu
         export PATH=$PATH:$HOME/.local/bin
-        export OPNFV_RELENG_DEV_PATH=/vagrant
         [[ ! -e ${HOME}/.ssh/id_rsa ]] && ssh-keygen -q -P '' -f ${HOME}/.ssh/id_rsa
         cd xci && ./xci-deploy.sh
       SHELL
@@ -143,7 +140,6 @@ Vagrant.configure(2) do |config|
         export VM_MEMORY_SIZE=${VM_MEMORY_SIZE:-2048}
         export VM_DOMAIN_TYPE=qemu
         export PATH=$PATH:$HOME/.local/bin
-        export OPNFV_RELENG_DEV_PATH=/vagrant
         # workaround for https://github.com/openSUSE/vagrant/pull/22
         sudo bash -c 'echo "127.0.0.1 localhost" >> /etc/hosts'
         [[ ! -e ${HOME}/.ssh/id_rsa ]] && ssh-keygen -q -P '' -f ${HOME}/.ssh/id_rsa
index 1132138..7a41125 100644 (file)
@@ -313,13 +313,6 @@ executing the script. The current user variables can be seen from
 `user-vars <https://git.opnfv.org/releng-xci/tree/xci/config/user-vars>`_
 file located in releng-xci repository.
 
-The variables can also be set directly within the file before executing
-the sandbox script. If you do this, you need to set ``$OPNFV_RELENG_DEV_PATH``
-environment variable where the releng-xci repo is located on your host which
-you modified the files in.
-
-| ``export OPNFV_RELENG_DEV_PATH=/path/to/releng-xci/``
-
 Pinned Versions
 ---------------
 
index 9ce293c..d7555d4 100644 (file)
@@ -203,7 +203,6 @@ on each run.
 
 To enable it, you need to export the different DEV_PATH vars:
 
-- export OPNFV_RELENG_DEV_PATH=/opt/releng-xci/
 - export OPENSTACK_BIFROST_DEV_PATH=/opt/bifrost/
 - export OPENSTACK_OSA_DEV_PATH=/opt/openstack-ansible/
 
@@ -226,8 +225,6 @@ dependent roles in ansible-role-requirements.yml file.
 If you run into this situation, then your best bet is to replace the XCI
 ansible-role-requirements.yml file with the upstream one from
 http://git.openstack.org/cgit/openstack/openstack-ansible/plain/ansible-role-requirements.yml.
-You also need to set OPNFV_RELENG_DEV_PATH as explained above in order for this file to be
-used throughout the deployment.
 
 ===========================================
 Limitations, Known Issues, and Improvements
index e242a7e..a083711 100644 (file)
         file: ../var/{{ ansible_os_family }}.yml
     - name: Synchronize local development releng-xci repository to XCI paths
       synchronize:
-        src: "{{ OPNFV_RELENG_DEV_PATH }}"
+        src: "{{ XCI_PATH }}"
         dest: "{{ OPNFV_RELENG_PATH }}"
         recursive: yes
         delete: yes
-      when:
-        - OPNFV_RELENG_DEV_PATH != ""
 
 - hosts: localhost
   connection: local
index fdf2178..893f7a3 100644 (file)
         file: ../var/{{ ansible_os_family }}.yml
     - name: Synchronize local development releng-xci repository to XCI paths
       synchronize:
-        src: "{{ OPNFV_RELENG_DEV_PATH }}"
+        src: "{{ XCI_PATH }}"
         dest: "{{ OPNFV_RELENG_PATH }}"
         recursive: yes
         delete: yes
-      when:
-        - OPNFV_RELENG_DEV_PATH != ""
     - name: Synchronize local development openstack-ansible repository to XCI paths
       synchronize:
         src: "{{ OPENSTACK_OSA_DEV_PATH }}"
index b9c1399..aa55f6c 100644 (file)
         - OPENSTACK_BIFROST_DEV_PATH != ""
     - name: Synchronize local development releng-xci repository to XCI paths
       synchronize:
-        src: "{{ OPNFV_RELENG_DEV_PATH }}"
+        src: "{{ XCI_PATH }}"
         dest: "{{ OPNFV_RELENG_PATH }}"
         recursive: yes
         delete: yes
-      when:
-        - OPNFV_RELENG_DEV_PATH != ""
     - name: Copy extra vars to releng-xci and bifrost
       synchronize:
         src: "{{ XCI_EXTRA_VARS_PATH }}"
index 5378d13..287f884 100644 (file)
@@ -10,7 +10,6 @@
 OPNFV_RELENG_GIT_URL: "{{ lookup('env','OPNFV_RELENG_GIT_URL') }}"
 OPNFV_RELENG_PATH: "{{ lookup('env','OPNFV_RELENG_PATH') }}"
 XCI_DEVEL_ROOT: "{{ lookup('env','XCI_DEVEL_ROOT') }}"
-OPNFV_RELENG_DEV_PATH: "{{ lookup('env','OPNFV_RELENG_DEV_PATH') }}"
 OPNFV_RELENG_VERSION: "{{ lookup('env','OPNFV_RELENG_VERSION') }}"
 OPENSTACK_BIFROST_GIT_URL: "{{ lookup('env','OPENSTACK_BIFROST_GIT_URL') }}"
 OPENSTACK_BIFROST_PATH: "{{ lookup('env','OPENSTACK_BIFROST_PATH') }}"
@@ -27,6 +26,7 @@ XCI_ANSIBLE_PIP_VERSION: "{{ lookup('env','XCI_ANSIBLE_PIP_VERSION') }}"
 XCI_FLAVOR: "{{ lookup('env','XCI_FLAVOR') }}"
 XCI_FLAVOR_ANSIBLE_FILE_PATH: "{{ lookup('env','XCI_FLAVOR_ANSIBLE_FILE_PATH') }}"
 XCI_LOOP: "{{ lookup('env','XCI_LOOP') }}"
+XCI_PATH: "{{ lookup('env', 'XCI_PATH') }}/"
 LOG_PATH: "{{ lookup('env','LOG_PATH') }}"
 OPNFV_HOST_IP: "{{ lookup('env','OPNFV_HOST_IP') }}"
 OPNFV_SSH_HOST_KEYS_PATH: "{{ lookup('env', 'OPNFV_SSH_HOST_KEYS_PATH') }}"
index a7435e7..3a4616c 100755 (executable)
@@ -50,15 +50,15 @@ fi
 #   override any of them.
 #-------------------------------------------------------------------------------
 # find where are we
-export XCI_PATH="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
+export XCI_PATH="$(git rev-parse --show-toplevel)"
 # source user vars
-source $XCI_PATH/config/user-vars
+source $XCI_PATH/xci/config/user-vars
 # source pinned versions
-source $XCI_PATH/config/pinned-versions
+source $XCI_PATH/xci/config/pinned-versions
 # source flavor configuration
-source "$XCI_PATH/config/${XCI_FLAVOR}-vars"
+source "$XCI_PATH/xci/config/${XCI_FLAVOR}-vars"
 # source xci configuration
-source $XCI_PATH/config/env-vars
+source $XCI_PATH/xci/config/env-vars
 
 if [[ -z $(echo $PATH | grep "$HOME/.local/bin")  ]]; then
     export PATH="$HOME/.local/bin:$PATH"
@@ -67,7 +67,7 @@ fi
 #-------------------------------------------------------------------------------
 # Sanitize local development environment variables
 #-------------------------------------------------------------------------------
-user_local_dev_vars=(OPNFV_RELENG_DEV_PATH OPENSTACK_OSA_DEV_PATH OPENSTACK_BIFROST_DEV_PATH)
+user_local_dev_vars=(OPENSTACK_OSA_DEV_PATH OPENSTACK_BIFROST_DEV_PATH)
 for local_user_var in ${user_local_dev_vars[@]}; do
     [[ -n ${!local_user_var:-} ]] && export $local_user_var=${!local_user_var%/}/
 done
@@ -136,15 +136,15 @@ fi
 #-------------------------------------------------------------------------------
 echo "Info: Cloning OPNFV scenario repositories"
 echo "-------------------------------------------------------------------------"
-cd $XCI_PATH/playbooks
+cd $XCI_PATH/xci/playbooks
 ansible-playbook ${XCI_ANSIBLE_VERBOSITY} -i inventory get-opnfv-scenario-requirements.yml
 echo "-------------------------------------------------------------------------"
 
 #-------------------------------------------------------------------------------
 # Get scenario variables overrides
 #-------------------------------------------------------------------------------
-if [[ -f $XCI_PATH/scenarios/${OPNFV_SCENARIO:-_no_scenario_}/xci_overrides ]]; then
-    source $XCI_PATH/scenarios/$OPNFV_SCENARIO/xci_overrides
+if [[ -f $XCI_PATH/xci/scenarios/${OPNFV_SCENARIO:-_no_scenario_}/xci_overrides ]]; then
+    source $XCI_PATH/xci/scenarios/$OPNFV_SCENARIO/xci_overrides
 fi
 
 #-------------------------------------------------------------------------------
@@ -161,9 +161,9 @@ echo "Info: Starting provisining VM nodes using openstack/bifrost"
 echo "-------------------------------------------------------------------------"
 # We are using sudo so we need to make sure that env_reset is not present
 sudo sed -i "s/^Defaults.*env_reset/#&/" /etc/sudoers
-cd $XCI_PATH/../bifrost/
+cd $XCI_PATH/bifrost/
 sudo -E bash ./scripts/destroy-env.sh
-cd $XCI_PATH/playbooks
+cd $XCI_PATH/xci/playbooks
 ansible-playbook ${XCI_ANSIBLE_VERBOSITY} -i inventory provision-vm-nodes.yml
 cd ${OPENSTACK_BIFROST_PATH}
 bash ./scripts/bifrost-provision.sh
@@ -184,7 +184,7 @@ echo
 
 echo "Info: Configuring localhost for openstack-ansible"
 echo "-----------------------------------------------------------------------"
-cd $XCI_PATH/playbooks
+cd $XCI_PATH/xci/playbooks
 ansible-playbook ${XCI_ANSIBLE_VERBOSITY} -i inventory configure-localhost.yml
 echo "-----------------------------------------------------------------------"
 echo "Info: Configured localhost host for openstack-ansible"
@@ -324,7 +324,7 @@ echo "Info: OpenStack installation is successfully completed!"
 #-------------------------------------------------------------------------------
 echo "Info: Openstack login details"
 echo "-----------------------------------------------------------------------"
-OS_USER_CONFIG=$XCI_PATH/file/$XCI_FLAVOR/openstack_user_config.yml
+OS_USER_CONFIG=$XCI_PATH/xci/file/$XCI_FLAVOR/openstack_user_config.yml
 python -c \
 "import yaml
 if '$XCI_FLAVOR' is 'aio':