Quickstart transition: replace toci_gate_test.sh
This change modifies the way CI jobs are handled. Current toci_gate_test.sh is renamed to toci_gate_test-orig.sh, and its content will not be changed. toci_gate_test-oooq.sh is added, with toci_gate_test.sh modified to be a link to it. This new script will drive jobs to be launched using quickstart, it will work initially as additional layer with backwards compatibility to old script that will run jobs with tripleo.sh. The old set of playbooks specific to toci is copied (not moved) from the experimental scripts, and the toci-quickstart dir, containing configurations for quickstart specific to tripleo ci is added. Script toci_quickstart.sh will be the new single runner for every job which configuration is assembled through toci_gate_test-oooq.sh script To transition a job to quickstart, the only thing needed is to change the job name to contain "featureset" keyword. Make sure that the correspondent featureset file and nodes configuration exist. Change-Id: Ieb181db13e63e046bffc2c65120c2c24177488c5
This commit is contained in:
parent
e8844568c2
commit
ab7914d28d
40
toci-quickstart/config/collect-logs.yml
Normal file
40
toci-quickstart/config/collect-logs.yml
Normal file
@ -0,0 +1,40 @@
|
||||
# Collect logs settings
|
||||
|
||||
# artcl_tar_gz: true
|
||||
artcl_gzip_only: true
|
||||
artcl_txt_rename: true
|
||||
artcl_publish: true
|
||||
artcl_rsync_logs: false
|
||||
artcl_collect_list:
|
||||
- /etc/
|
||||
- /var/log/
|
||||
- /home/jenkins/.instack/install-undercloud.log
|
||||
- /home/jenkins/stackrc
|
||||
- /home/jenkins/overcloudrc
|
||||
- /home/jenkins/*.log
|
||||
- /home/jenkins/*.txt
|
||||
- /home/jenkins/*.json
|
||||
- /home/jenkins/*.conf
|
||||
- /home/jenkins/*.yml
|
||||
- /home/jenkins/*.yaml
|
||||
- /home/jenkins/*.sh
|
||||
- /home/jenkins/deploy-overcloudrc
|
||||
- /home/jenkins/network-environment.yaml
|
||||
- /home/jenkins/skip_file
|
||||
- /home/jenkins/tempest/*.xml
|
||||
- /home/jenkins/tempest/*.html
|
||||
- /home/jenkins/tempest/*.log
|
||||
- /home/jenkins/tempest/*.sh
|
||||
- /home/jenkins/tempest/etc/*.conf
|
||||
- /home/jenkins/local_tht/
|
||||
- /usr/share/openstack-tripleo-heat-templates/
|
||||
- /tmp/*.yml
|
||||
- /tmp/*.yaml
|
||||
artcl_exclude_list:
|
||||
- /etc/udev/hwdb.bin
|
||||
- /etc/puppet/modules
|
||||
- /etc/project-config
|
||||
- /etc/services
|
||||
- /etc/selinux/targeted
|
||||
- /etc/pki/ca-trust/extracted
|
||||
- /etc/alternatives
|
17
toci-quickstart/config/testenv/multinode.yml
Normal file
17
toci-quickstart/config/testenv/multinode.yml
Normal file
@ -0,0 +1,17 @@
|
||||
# TRIPLEO-CI environment settings
|
||||
undercloud_user: jenkins
|
||||
non_root_user: jenkins
|
||||
extra_args: >
|
||||
-e {{ tripleo_root }}/tripleo-ci/test-environments/worker-config.yaml
|
||||
-e /usr/share/openstack-tripleo-heat-templates/environments/debug.yaml
|
||||
--compute-scale 0
|
||||
--overcloud-ssh-user {{ lookup('env','USER') }}
|
||||
|
||||
toci_vxlan_networking: true
|
||||
toci_vxlan_networking_multinode: true
|
||||
hostname_correction: true # workaround restriction on toci images
|
||||
|
||||
# environment settings, not TRIPLEO-CI specific
|
||||
undercloud_local_interface: "br-ex" # related to osinfra network configuration
|
||||
flavor_args: ""
|
||||
undercloud_conf_extras: "net_config_override = /opt/stack/new/tripleo-ci/undercloud-configs/net-config-multinode.json.template"
|
11
toci-quickstart/config/testenv/osinfra_hosts
Normal file
11
toci-quickstart/config/testenv/osinfra_hosts
Normal file
@ -0,0 +1,11 @@
|
||||
localhost ansible_connection=local
|
||||
|
||||
127.0.0.2 ansible_host=127.0.0.2 ansible_user=jenkins ansible_private_key_file=/home/jenkins/.ssh/id_rsa undercloud_ip=127.0.0.2
|
||||
|
||||
undercloud ansible_host=127.0.0.2 ansible_user=jenkins ansible_private_key_file=/home/jenkins/.ssh/id_rsa undercloud_ip=127.0.0.2
|
||||
|
||||
[virthost]
|
||||
127.0.0.2
|
||||
|
||||
[undercloud]
|
||||
undercloud
|
40
toci-quickstart/config/testenv/ovb.yml
Normal file
40
toci-quickstart/config/testenv/ovb.yml
Normal file
@ -0,0 +1,40 @@
|
||||
multinode_mode: false
|
||||
undercloud_user: jenkins
|
||||
non_root_user: jenkins
|
||||
ssh_user: jenkins
|
||||
enable_vbmc: false
|
||||
gating_repo_enabled: true
|
||||
|
||||
step_adjust_mtu: true
|
||||
mtu: 1350
|
||||
external_interface: eth2
|
||||
external_interface_ip: 10.0.0.1
|
||||
external_interface_netmask: 255.255.255.0
|
||||
external_interface_hwaddr: fa:16:3e:79:e8:04
|
||||
overcloud_dns_servers: [8.8.8.8, 8.8.4.4]
|
||||
undercloud_hieradata_override_file: ~/quickstart-hieradata-overrides.yaml
|
||||
|
||||
flavor_args: ""
|
||||
|
||||
float_base: "{% if network_isolation|bool %}10.0.0{% else %}192.168.24{% endif %}"
|
||||
floating_ip_cidr: "{{ float_base}}.0/24"
|
||||
public_net_pool_start: "{{ float_base}}.150"
|
||||
public_net_pool_end: "{{ float_base}}.250"
|
||||
public_net_gateway: "{{ float_base}}.1"
|
||||
|
||||
|
||||
regular_interfaces:
|
||||
- eth0
|
||||
- eth1
|
||||
netiso_interface:
|
||||
- eth2
|
||||
mtu_interface: "{% if network_isolation|bool %}{{ regular_interfaces + netiso_interface }}
|
||||
{% else %}{{ regular_interfaces }}
|
||||
{% endif %}"
|
||||
|
||||
|
||||
# Without this wildcard, the deployment will fail with "no valid host found"
|
||||
# since nova will try to find defined flavors in the capabilities of the node
|
||||
# and nothing currently is configured to modify those.
|
||||
#extra_args: " --control-flavor baremetal --compute-flavor baremetal --ceph-storage-flavor baremetal"
|
||||
|
11
toci-quickstart/config/testenv/ovb_hosts
Normal file
11
toci-quickstart/config/testenv/ovb_hosts
Normal file
@ -0,0 +1,11 @@
|
||||
localhost ansible_connection=local
|
||||
|
||||
127.0.0.2 ansible_host=127.0.0.2 ansible_user=jenkins ansible_private_key_file=/home/jenkins/.ssh/id_rsa undercloud_ip=127.0.0.2
|
||||
|
||||
undercloud ansible_host=undercloud ansible_user=jenkins ansible_private_key_file=/home/jenkins/.ssh/id_rsa undercloud_ip=127.0.0.2
|
||||
|
||||
[virthost]
|
||||
127.0.0.2
|
||||
|
||||
[undercloud]
|
||||
undercloud
|
87
toci-quickstart/playbooks/build-install-playbook.yml
Normal file
87
toci-quickstart/playbooks/build-install-playbook.yml
Normal file
@ -0,0 +1,87 @@
|
||||
- name: Run DLRN gate role and create repo
|
||||
hosts: undercloud
|
||||
vars:
|
||||
artg_compressed_gating_repo: "/home/jenkins/gating_repo.tar.gz"
|
||||
ansible_user: jenkins
|
||||
ansible_user_dir: /home/jenkins/
|
||||
artg_repos_dir: "{{ tripleo_root}}"
|
||||
|
||||
roles:
|
||||
- build-test-packages
|
||||
|
||||
# Install repo on live undercloud and overcloud image
|
||||
- name: Clone the gated DLRN repos and trigger rpm injection
|
||||
hosts: undercloud
|
||||
vars:
|
||||
artg_compressed_gating_repo: "/home/jenkins/gating_repo.tar.gz"
|
||||
ansible_user: jenkins
|
||||
ansible_user_dir: /home/jenkins/
|
||||
tasks:
|
||||
- stat: path="{{ artg_compressed_gating_repo }}"
|
||||
register: gating_repo_file
|
||||
|
||||
- environment:
|
||||
LIBGUESTFS_BACKEND: direct
|
||||
LIBVIRT_DEFAULT_URI: 'qemu:///session'
|
||||
block:
|
||||
|
||||
- name: Create the undercloud live injection script
|
||||
template:
|
||||
src: "{{ tripleo_root }}/tripleo-quickstart/roles/libvirt/setup/undercloud/templates/inject_gating_repo.sh.j2"
|
||||
dest: "{{ working_dir }}/inject_gating_repo.sh"
|
||||
|
||||
- name: Copy repo file to /tmp/
|
||||
command: cp -f "{{ artg_compressed_gating_repo }}" /tmp/gating_repo.tar.gz
|
||||
|
||||
- stat: path="{{ working_dir }}/overcloud-full.qcow2"
|
||||
register: overcloud_full_img
|
||||
|
||||
- name: Install virt-customize if not installed
|
||||
yum: name=libguestfs-tools-c state=latest
|
||||
become: true
|
||||
when:
|
||||
- overcloud_full_img.stat.exists
|
||||
- not multinode_mode
|
||||
|
||||
- name: Inject the gating repo to overcloud image on live undercloud
|
||||
command: >
|
||||
virt-customize -a {{ working_dir }}/overcloud-full.qcow2
|
||||
--upload /tmp/gating_repo.tar.gz:/tmp/gating_repo.tar.gz
|
||||
--run '{{ working_dir }}/inject_gating_repo.sh'
|
||||
when:
|
||||
- overcloud_full_img.stat.exists
|
||||
- not multinode_mode
|
||||
|
||||
- name: Run gating repo on live undercloud
|
||||
shell: >
|
||||
bash {{ working_dir }}/inject_gating_repo.sh > {{ working_dir }}/inject_repo.log
|
||||
become: true
|
||||
when: gating_repo_file.stat.exists
|
||||
|
||||
- name: Install built packages on multinode subnodes
|
||||
hosts: overcloud
|
||||
vars:
|
||||
artg_compressed_gating_repo: "/home/jenkins/gating_repo.tar.gz"
|
||||
ansible_user: jenkins
|
||||
ansible_user_dir: /home/jenkins/
|
||||
tasks:
|
||||
- stat: path="{{ artg_compressed_gating_repo }}"
|
||||
register: gating_repo_file
|
||||
delegate_to: undercloud
|
||||
|
||||
- when:
|
||||
- gating_repo_file.stat.exists
|
||||
- multinode_mode|bool
|
||||
block:
|
||||
- name: Copy repo file to /tmp/
|
||||
copy: src="{{ artg_compressed_gating_repo }}" dest=/tmp/gating_repo.tar.gz
|
||||
|
||||
- name: Create the undercloud live injection script
|
||||
template:
|
||||
src: "{{ tripleo_root }}/tripleo-quickstart/roles/libvirt/setup/undercloud/templates/inject_gating_repo.sh.j2"
|
||||
dest: "/tmp/inject_gating_repo.sh"
|
||||
|
||||
- name: Run gating repo on live undercloud
|
||||
shell: >
|
||||
bash /tmp/inject_gating_repo.sh > /var/log/inject_repo.log
|
||||
become: true
|
79
toci-quickstart/playbooks/containers_minimal.yml
Normal file
79
toci-quickstart/playbooks/containers_minimal.yml
Normal file
@ -0,0 +1,79 @@
|
||||
# set the working_dir on the undercloud
|
||||
working_dir: /home/jenkins
|
||||
|
||||
# Define a single controller node and a single compute node.
|
||||
overcloud_nodes:
|
||||
- name: control_0
|
||||
flavor: control
|
||||
|
||||
- name: compute_0
|
||||
flavor: compute
|
||||
|
||||
# Tell tripleo how we want things done.
|
||||
# Note: The order of the templates and arguments passed to heat matters.
|
||||
|
||||
extra_args: >-
|
||||
--ntp-server pool.ntp.org
|
||||
|
||||
network_isolation: true
|
||||
enable_pacemaker: false
|
||||
overcloud_ipv6: false
|
||||
containerized_overcloud: true
|
||||
|
||||
# This enables TLS for the undercloud which will also make haproxy bind to the
|
||||
# configured public-vip and admin-vip.
|
||||
undercloud_generate_service_certificate: false
|
||||
|
||||
# This enables the deployment of the overcloud with SSL.
|
||||
ssl_overcloud: false
|
||||
|
||||
# If `run_tempest` is `true`, run tempests tests, otherwise do not
|
||||
# run them.
|
||||
tempest_config: false
|
||||
test_ping: true
|
||||
run_tempest: false
|
||||
tempest_workers: 4
|
||||
|
||||
# Config for custom tripleo-heat-templates
|
||||
#overcloud_templates_path: /usr/share/openstack-tripleo-heat-templates
|
||||
#overcloud_templates_repo: https://git.openstack.org/openstack/tripleo-heat-templates
|
||||
# use templates_branch when not testing with an unmerged review
|
||||
#overcloud_templates_branch: master
|
||||
# use templates_refspec when testing with an unmerged review
|
||||
#overcloud_templates_refspec:
|
||||
|
||||
# Config for custom tripleo-common
|
||||
#overcloud_tripleo_common_path: /home/jenkins/tripleo-common
|
||||
#overcloud_tripleo_common_repo: https://git.openstack.org/openstack/tripleo-common
|
||||
# use overcloud_tripleo_common _branch when not testing with an unmerged review
|
||||
#overcloud_tripleo_common_branch: master
|
||||
# use overcloud_tripleo_common_refspec when testing with an unmerged review
|
||||
#overcloud_tripleo_common_refspec:
|
||||
|
||||
|
||||
# options below direct automatic doc generation by tripleo-collect-logs
|
||||
artcl_gen_docs: true
|
||||
artcl_create_docs_payload:
|
||||
included_deployment_scripts:
|
||||
- undercloud-install
|
||||
- overcloud-custom-tht-script
|
||||
- overcloud-prep-containers
|
||||
- overcloud-prep-flavors
|
||||
- overcloud-prep-images
|
||||
- overcloud-prep-network
|
||||
- overcloud-deploy
|
||||
- overcloud-deploy-post
|
||||
- overcloud-validate
|
||||
included_static_docs:
|
||||
- env-setup-virt
|
||||
table_of_contents:
|
||||
- env-setup-virt
|
||||
- undercloud-install
|
||||
- overcloud-custom-tht-script
|
||||
- overcloud-prep-containers
|
||||
- overcloud-prep-flavors
|
||||
- overcloud-prep-images
|
||||
- overcloud-prep-network
|
||||
- overcloud-deploy
|
||||
- overcloud-deploy-post
|
||||
- overcloud-validate
|
10
toci-quickstart/playbooks/get_images-playbook.yml
Normal file
10
toci-quickstart/playbooks/get_images-playbook.yml
Normal file
@ -0,0 +1,10 @@
|
||||
---
|
||||
# TODO(sshnaidm): remove tripleo.sh and use ansible build image role
|
||||
- name: Get images for quickstart
|
||||
hosts: undercloud
|
||||
gather_facts: no
|
||||
tasks:
|
||||
- name: Prepare images for stable branch
|
||||
shell: >
|
||||
STABLE_RELEASE='{{ lookup('env', 'STABLE_RELEASE') }}' {{tripleo_root}}/tripleo-ci/scripts/tripleo.sh --overcloud-images 2>&1 | sudo dd of=/var/log/image_build.txt;
|
||||
when: "'{{ lookup('env', 'STABLE_RELEASE') }}'"
|
87
toci-quickstart/playbooks/multinode.yml
Normal file
87
toci-quickstart/playbooks/multinode.yml
Normal file
@ -0,0 +1,87 @@
|
||||
---
|
||||
- include: quickstart.yml
|
||||
|
||||
- name: Add the overcloud nodes to the generated inventory
|
||||
hosts: undercloud
|
||||
gather_facts: yes
|
||||
tags:
|
||||
- overcloud-deploy
|
||||
vars:
|
||||
inventory: multinode
|
||||
roles:
|
||||
- tripleo-inventory
|
||||
|
||||
- include: build-install-playbook.yml
|
||||
tags:
|
||||
- build
|
||||
|
||||
- name: Create configs on subnodes
|
||||
hosts: overcloud
|
||||
roles:
|
||||
- repo-setup
|
||||
tasks:
|
||||
- name: Create a clean hosts file on subnodes
|
||||
copy:
|
||||
dest: /etc/hosts
|
||||
content: |
|
||||
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
|
||||
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
|
||||
become: true
|
||||
tags:
|
||||
- undercloud-setup
|
||||
|
||||
- name: Prepare the undercloud for installation
|
||||
hosts: undercloud
|
||||
roles:
|
||||
- undercloud-setup
|
||||
tags:
|
||||
- undercloud-setup
|
||||
environment:
|
||||
WORKSPACE: "{{ lookup('env','WORKSPACE') }}"
|
||||
SSH_OPTIONS: "-o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o LogLevel=Verbose -o PasswordAuthentication=no -o ConnectionAttempts=32 -l jenkins"
|
||||
|
||||
- name: Install the undercloud
|
||||
hosts: undercloud
|
||||
roles:
|
||||
- undercloud-deploy
|
||||
|
||||
- name: Validate the undercloud
|
||||
hosts: undercloud
|
||||
roles:
|
||||
- validate-undercloud
|
||||
|
||||
- name: Run overcloud prep roles
|
||||
hosts: undercloud
|
||||
gather_facts: no
|
||||
roles:
|
||||
- { role: overcloud-prep-images, step_overcloud_image: false, step_glance_upload: true, step_register: false }
|
||||
|
||||
- name: Deploy the overcloud
|
||||
hosts: undercloud
|
||||
gather_facts: no
|
||||
roles:
|
||||
- overcloud-deploy
|
||||
environment:
|
||||
TRIPLEO_ROOT: "{{ lookup('env','TRIPLEO_ROOT') }}"
|
||||
|
||||
- name: Check the result of the deployment
|
||||
hosts: localhost
|
||||
tags:
|
||||
- overcloud-deploy
|
||||
tasks:
|
||||
- name: ensure the deployment result has been read into memory
|
||||
include_vars: "{{ local_working_dir }}/overcloud_deployment_result.json"
|
||||
|
||||
# overcloud_deploy_result = ["failed", "passed"]
|
||||
- name: did the deployment pass or fail?
|
||||
debug: var=overcloud_deploy_result
|
||||
failed_when: overcloud_deploy_result == "failed"
|
||||
|
||||
# Validate the deployment
|
||||
- name: validate the overcloud
|
||||
hosts: undercloud
|
||||
tags:
|
||||
- overcloud-validate
|
||||
gather_facts: no
|
||||
roles:
|
||||
- { role: validate-simple, when: test_ping|bool }
|
122
toci-quickstart/playbooks/ovb.yml
Normal file
122
toci-quickstart/playbooks/ovb.yml
Normal file
@ -0,0 +1,122 @@
|
||||
---
|
||||
- name: Add the undercloud node to the generated inventory
|
||||
hosts: localhost
|
||||
gather_facts: yes
|
||||
tags:
|
||||
- undercloud-scripts
|
||||
roles:
|
||||
- tripleo-inventory
|
||||
|
||||
- include: tripleo-ci-setup-playbook.yml
|
||||
# TODO(sshnaidm): to create a separate role for this in quickstart-extras
|
||||
- include: build-install-playbook.yml
|
||||
|
||||
# Deploy the undercloud
|
||||
- name: Install undercloud
|
||||
hosts: undercloud
|
||||
gather_facts: no
|
||||
roles:
|
||||
- undercloud-deploy
|
||||
|
||||
- include: post-undercloud-playbook.yml
|
||||
tags:
|
||||
- post-undercloud
|
||||
|
||||
- include: get_images-playbook.yml
|
||||
tags:
|
||||
- image-build
|
||||
|
||||
- name: Prepare configuration files for the overcloud deployment
|
||||
hosts: undercloud
|
||||
gather_facts: no
|
||||
roles:
|
||||
- overcloud-prep-config
|
||||
|
||||
- name: Perpare the baremetal overcloud
|
||||
hosts: undercloud
|
||||
gather_facts: no
|
||||
roles:
|
||||
- baremetal-prep-overcloud
|
||||
|
||||
# Prepare the overcloud for a containerized deployment
|
||||
- name: Prepare overcloud containers
|
||||
hosts: undercloud
|
||||
gather_facts: no
|
||||
roles:
|
||||
- { role: overcloud-prep-containers, when: containerized_overcloud|default(false) }
|
||||
|
||||
# Prepare the overcloud images for deployment
|
||||
- name: Prepare the overcloud images for deployment
|
||||
hosts: undercloud
|
||||
gather_facts: no
|
||||
roles:
|
||||
- overcloud-prep-images
|
||||
|
||||
- name: Remove big image
|
||||
hosts: undercloud
|
||||
gather_facts: no
|
||||
tasks:
|
||||
- name: Remove overcloud-full.qcow2
|
||||
file: path=~/overcloud-full.qcow2 state=absent
|
||||
|
||||
# Prepare the undercloud networks for the overcloud deployment
|
||||
- name: Prepare the undercloud networks for the overcloud deployment
|
||||
hosts: undercloud
|
||||
gather_facts: no
|
||||
roles:
|
||||
- overcloud-prep-network
|
||||
|
||||
- name: Prepare the SSL Configuration for the overcloud deployment
|
||||
hosts: undercloud
|
||||
gather_facts: no
|
||||
roles:
|
||||
- { role: overcloud-ssl, when: ssl_overcloud|bool }
|
||||
|
||||
# Deploy the overcloud
|
||||
- name: Deploy the overcloud
|
||||
hosts: undercloud
|
||||
gather_facts: yes
|
||||
roles:
|
||||
- overcloud-deploy
|
||||
|
||||
- name: Add the overcloud nodes to the generated inventory
|
||||
hosts: undercloud
|
||||
gather_facts: yes
|
||||
tags:
|
||||
- overcloud-deploy
|
||||
vars:
|
||||
inventory: all
|
||||
roles:
|
||||
- tripleo-inventory
|
||||
|
||||
# Check the results of the deployment, note after inventory has executed
|
||||
- name: Check the result of the deployment
|
||||
hosts: localhost
|
||||
tags:
|
||||
- overcloud-deploy
|
||||
tasks:
|
||||
- name: ensure the deployment result has been read into memory
|
||||
include_vars: "{{ local_working_dir }}/overcloud_deployment_result.json"
|
||||
|
||||
# overcloud_deploy_result = ["failed", "passed"]
|
||||
- name: did the deployment pass or fail?
|
||||
debug: var=overcloud_deploy_result
|
||||
failed_when: overcloud_deploy_result == "failed"
|
||||
|
||||
# Validate the deployment
|
||||
- name: validate the overcloud
|
||||
hosts: undercloud
|
||||
tags:
|
||||
- overcloud-validate
|
||||
gather_facts: no
|
||||
roles:
|
||||
- { role: validate-simple, when: test_ping|bool }
|
||||
|
||||
# Execute tempest against the overcloud deployment
|
||||
- name: Execute tempest against the overcloud
|
||||
hosts: undercloud
|
||||
tags:
|
||||
- overcloud-validate
|
||||
gather_facts: no
|
||||
roles:
|
||||
- { role: validate-tempest, when: run_tempest|bool }
|
38
toci-quickstart/playbooks/post-undercloud-playbook.yml
Normal file
38
toci-quickstart/playbooks/post-undercloud-playbook.yml
Normal file
@ -0,0 +1,38 @@
|
||||
# Post undercloud specific tasks
|
||||
# TODO(sshnaidm): to include everything into one bash script(?)
|
||||
- name: Post undercloud specific tasks
|
||||
hosts: undercloud
|
||||
gather_facts: no
|
||||
tasks:
|
||||
- name: Delete /tmp/eth2.cfg file
|
||||
file: dest=/tmp/eth2.cfg state=absent
|
||||
- name: Create /tmp/eth2.cfg file
|
||||
blockinfile:
|
||||
dest: /tmp/eth2.cfg
|
||||
content: |
|
||||
network_config:
|
||||
- type: interface
|
||||
name: eth2
|
||||
use_dhcp: false
|
||||
addresses:
|
||||
- ip_netmask: 10.0.0.1/24
|
||||
- ip_netmask: 2001:db8:fd00:1000::1/64
|
||||
create: yes
|
||||
|
||||
- name: Add eth2 interface from /tmp/eth2.cfg
|
||||
command: os-net-config -c /tmp/eth2.cfg -v
|
||||
become: true
|
||||
when: network_isolation|bool
|
||||
|
||||
- name: Remove redundant hosts from instackenv.json
|
||||
shell: >
|
||||
cp ~/instackenv.json ~/instackenv.json.backup;
|
||||
cat ~/instackenv.json | jq '{"nodes": .nodes[:{{ lookup('env', 'NODECOUNT') }}]}' > /tmp/instackenv1.json &&
|
||||
mv /tmp/instackenv1.json ~/instackenv.json;
|
||||
|
||||
- name: Install ipmitool if not installed
|
||||
yum: name=ipmitool state=latest
|
||||
become: true
|
||||
|
||||
- name: Set user permissions for ~/.cache for building images
|
||||
shell: sudo chown -R $USER ~/.cache || true
|
@ -0,0 +1,2 @@
|
||||
ironic::drivers::deploy::http_port: 3816
|
||||
ironic::drivers::ssh::libvirt_uri: 'qemu:///session'
|
54
toci-quickstart/playbooks/tripleo-ci-setup-playbook.yml
Normal file
54
toci-quickstart/playbooks/tripleo-ci-setup-playbook.yml
Normal file
@ -0,0 +1,54 @@
|
||||
---
|
||||
# TODO(sshnaidm): to ansibilize this playbook
|
||||
- name: Local setup for quickstart
|
||||
hosts: localhost
|
||||
connection: local
|
||||
tasks:
|
||||
- name: Host setup
|
||||
shell: >
|
||||
sudo hostnamectl set-hostname undercloud;
|
||||
echo 'undercloud' | sudo dd of=/etc/hostname;
|
||||
echo "127.0.0.1 $(hostname) $(hostname).openstacklocal" | sudo tee -a /etc/hosts;
|
||||
echo "127.0.0.2 undercloud undercloud.openstacklocal" | sudo tee -a /etc/hosts;
|
||||
if [ ! -e ${HOME}/.ssh/id_rsa.pub ] ; then
|
||||
if [[ -e ${HOME}/.ssh/id_rsa ]]; then
|
||||
ssh-keygen -y -f ${HOME}/.ssh/id_rsa > ${HOME}/.ssh/id_rsa.pub;
|
||||
else
|
||||
ssh-keygen -N "" -f ${HOME}/.ssh/id_rsa;
|
||||
fi
|
||||
fi;
|
||||
cat ~/.ssh/id_rsa.pub | sudo tee -a /root/.ssh/authorized_keys | tee -a ~/.ssh/authorized_keys;
|
||||
|
||||
sudo yum remove -y puppet hiera puppetlabs-release rdo-release;
|
||||
sudo rm -rf /etc/puppet /etc/hiera.yaml;
|
||||
sudo cp {{tripleo_root}}/tripleo-ci/test-environments/overcloud-cacert.pem /etc/pki/ca-trust/source/anchors/;
|
||||
sudo update-ca-trust extract;
|
||||
cp -f {{ lookup('env', 'TE_DATAFILE') }} ~/instackenv.json;
|
||||
{{tripleo_root}}/tripleo-ci/scripts/tripleo.sh --repo-setup;
|
||||
sudo yum reinstall -y python-requests || sudo yum install -y python-requests;
|
||||
sudo yum install -y python-tripleoclient libguestfs-xfs libguestfs-tools-c;
|
||||
tags:
|
||||
- local
|
||||
|
||||
# TODO(sshnaidm): to move this to settings(?)
|
||||
- name: Prepare environment for quickstart
|
||||
hosts: undercloud
|
||||
gather_facts: no
|
||||
tasks:
|
||||
- name: Here comes any undercloud setup which is required for quickstart to run
|
||||
debug: msg="Here comes any setup which is required for quickstart to run"
|
||||
|
||||
- name: Add hiera overriding file
|
||||
template:
|
||||
src: "{{tripleo_root}}/tripleo-ci/scripts/quickstart/quickstart-hieradata-overrides.yaml.j2"
|
||||
dest: ~/quickstart-hieradata-overrides.yaml
|
||||
|
||||
- name: Get images for quickstart
|
||||
hosts: undercloud
|
||||
gather_facts: no
|
||||
tasks:
|
||||
- name: Prepare images
|
||||
shell: >
|
||||
source {{tripleo_root}}/tripleo-ci/scripts/common_functions.sh;
|
||||
prepare_images_oooq
|
||||
when: "not '{{ lookup('env', 'STABLE_RELEASE') }}'"
|
215
toci_gate_test-oooq.sh
Executable file
215
toci_gate_test-oooq.sh
Executable file
@ -0,0 +1,215 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
source $(dirname $0)/scripts/common_vars.bash
|
||||
|
||||
# Maintain compatibility with the old jobtypes
|
||||
if [[ ! $TOCI_JOBTYPE =~ "featureset" ]]; then
|
||||
echo "WARNING: USING OLD DEPLOYMENT METHOD. THE OLD DEPLOYMENT METHOD THAT USES tripleo.sh WILL BE DEPRECATED IN THE QUEENS CYCLE"
|
||||
echo "TO USE THE NEW DEPLOYMENT METHOD WITH QUICKSTART, SETUP A FEATURESET FILE AND ADD featuresetXXX TO THE JOB TYPE"
|
||||
exec $TRIPLEO_ROOT/tripleo-ci/toci_gate_test-orig.sh
|
||||
fi
|
||||
|
||||
set -eux
|
||||
export PS4='+(${BASH_SOURCE}:${LINENO}): ${FUNCNAME[0]:+${FUNCNAME[0]}(): }'
|
||||
|
||||
# this sets
|
||||
# NODEPOOL_PROVIDER (e.g tripleo-test-cloud-rh1)
|
||||
# NODEPOOL_CLOUD (e.g.tripleo-test-cloud-rh1)
|
||||
# NODEPOOL_REGION (e.g. regionOne)
|
||||
# NODEPOOL_AZ
|
||||
source /etc/nodepool/provider
|
||||
|
||||
# source variables common across all the scripts.
|
||||
|
||||
# set up distribution mirrors in openstack
|
||||
NODEPOOL_MIRROR_HOST=${NODEPOOL_MIRROR_HOST:-mirror.$NODEPOOL_REGION.$NODEPOOL_CLOUD.openstack.org}
|
||||
NODEPOOL_MIRROR_HOST=$(echo $NODEPOOL_MIRROR_HOST|tr '[:upper:]' '[:lower:]')
|
||||
export CENTOS_MIRROR=http://$NODEPOOL_MIRROR_HOST/centos
|
||||
export EPEL_MIRROR=http://$NODEPOOL_MIRROR_HOST/epel
|
||||
|
||||
# host setup
|
||||
if [ $NODEPOOL_CLOUD == 'tripleo-test-cloud-rh1' ]; then
|
||||
source $(dirname $0)/scripts/rh2.env
|
||||
|
||||
# In order to save space remove the cached git repositories, at this point in
|
||||
# CI the ones we are interested in have been cloned to /opt/stack/new. We
|
||||
# can also remove some distro images cached on the images.
|
||||
sudo rm -rf /opt/git /opt/stack/cache/files/mysql.qcow2 /opt/stack/cache/files/ubuntu-12.04-x86_64.tar.gz
|
||||
fi
|
||||
|
||||
# Clean any cached yum metadata, it maybe stale
|
||||
sudo rm /etc/yum.repos.d/epel*
|
||||
sudo yum clean all
|
||||
|
||||
# Install additional packages
|
||||
sudo yum install -y \
|
||||
qemu-img # used by multinode to create empty image
|
||||
|
||||
# NOTE(pabelanger): Current hack to make centos-7 dib work.
|
||||
# TODO(pabelanger): Why is python-requests installed from pip?
|
||||
sudo rm -rf /usr/lib/python2.7/site-packages/requests
|
||||
|
||||
# JOB_NAME used to be available from jenkins, we need to create it ourselves until
|
||||
# we remove our reliance on it.
|
||||
# FIXME: JOB_NAME IS USED IN CACHE UPLOAD AND PROMOTION,
|
||||
# IF WE CHANGE THE JOB NAME, WE MUST UPDATE upload.cgi in mirror server
|
||||
if [[ -z "${JOB_NAME-}" ]]; then
|
||||
JOB_NAME=${WORKSPACE%/}
|
||||
export JOB_NAME=${JOB_NAME##*/}
|
||||
fi
|
||||
|
||||
# Sets whether or not this job will upload images.
|
||||
export CACHEUPLOAD=0
|
||||
# Stores OVB undercloud instance id
|
||||
export UCINSTANCEID="null"
|
||||
# Define file with set of features to test
|
||||
export FEATURESET_FILE=""
|
||||
export FEATURESET_CONF=""
|
||||
# Define file with nodes topology
|
||||
export NODES_FILE=""
|
||||
# Indentifies which playbook to run
|
||||
export PLAYBOOK=""
|
||||
# Set the number of overcloud nodes
|
||||
export NODECOUNT=0
|
||||
# Sets the undercloud hostname
|
||||
export UNDERCLOUD=""
|
||||
# Select the tags to run
|
||||
export TAGS=all
|
||||
# Identify in which environment we're deploying
|
||||
export ENVIRONMENT=""
|
||||
# Set the overcloud controller hosts for multinode
|
||||
export CONTROLLER_HOSTS=
|
||||
export SUBNODES_SSH_KEY=
|
||||
OVERCLOUD_DEPLOY_TIMEOUT=$((DEVSTACK_GATE_TIMEOUT-90))
|
||||
TIMEOUT_SECS=$((DEVSTACK_GATE_TIMEOUT*60))
|
||||
export EXTRA_VARS="--extra-vars deploy_timeout=$OVERCLOUD_DEPLOY_TIMEOUT"
|
||||
export NODES_ARGS=""
|
||||
export COLLECT_CONF="$TRIPLEO_ROOT/tripleo-ci/toci-quickstart/config/collect-logs.yml"
|
||||
|
||||
|
||||
# Assemble quickstart configuration based on job type keywords
|
||||
for JOB_TYPE_PART in $(sed 's/-/ /g' <<< "${TOCI_JOBTYPE:-}") ; do
|
||||
case $JOB_TYPE_PART in
|
||||
featureset*)
|
||||
FEATURESET_FILE="config/general_config/$JOB_TYPE_PART.yml"
|
||||
FEATURESET_CONF="$FEATURESET_CONF --config $FEATURESET_FILE"
|
||||
;;
|
||||
ovb)
|
||||
OVB=1
|
||||
ENVIRONMENT="ovb"
|
||||
UCINSTANCEID=$(http_proxy= curl http://169.254.169.254/openstack/2015-10-15/meta_data.json | python -c 'import json, sys; print json.load(sys.stdin)["uuid"]')
|
||||
PLAYBOOK="ovb.yml"
|
||||
EXTRA_VARS="$EXTRA_VARS --extra-vars @$TRIPLEO_ROOT/tripleo-ci/toci-quickstart/config/testenv/ovb.yml"
|
||||
UNDERCLOUD="undercloud"
|
||||
;;
|
||||
multinode)
|
||||
SUBNODES_SSH_KEY=/etc/nodepool/id_rsa
|
||||
ENVIRONMENT="osinfra"
|
||||
PLAYBOOK="multinode.yml"
|
||||
FEATURESET_CONF="
|
||||
--extra-vars @config/general_config/featureset-multinode-common.yml
|
||||
$FEATURESET_CONF
|
||||
"
|
||||
EXTRA_VARS="$EXTRA_VARS --extra-vars @$TRIPLEO_ROOT/tripleo-ci/toci-quickstart/config/testenv/multinode.yml"
|
||||
UNDERCLOUD="127.0.0.2"
|
||||
TAGS="build,undercloud-setup,undercloud-scripts,undercloud-install,undercloud-post-install,overcloud-scripts,overcloud-deploy,overcloud-validate"
|
||||
CONTROLLER_HOSTS=$(sed -n 1,1p /etc/nodepool/sub_nodes)
|
||||
;;
|
||||
singlenode)
|
||||
ENVIRONMENT="osinfra"
|
||||
UNDERCLOUD="127.0.0.2"
|
||||
PLAYBOOK="multinode.yml"
|
||||
FEATURESET_CONF="
|
||||
--extra-vars @config/general_config/featureset-multinode-common.yml
|
||||
$FEATURESET_CONF
|
||||
"
|
||||
EXTRA_VARS="$EXTRA_VARS --extra-vars @$TRIPLEO_ROOT/tripleo-ci/toci-quickstart/config/testenv/multinode.yml"
|
||||
TAGS="build,undercloud-setup,undercloud-scripts,undercloud-install,undercloud-validate"
|
||||
;;
|
||||
periodic)
|
||||
ALLOW_PROMOTE=1
|
||||
;;
|
||||
gate)
|
||||
;;
|
||||
*)
|
||||
# the rest should be node configuration
|
||||
NODES_FILE="config/nodes/$JOB_TYPE_PART.yml"
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
sudo pip install shyaml
|
||||
if [[ ! -z $NODES_FILE ]]; then
|
||||
pushd $TRIPLEO_ROOT/tripleo-quickstart
|
||||
NODECOUNT=$(shyaml get-value node_count < $NODES_FILE)
|
||||
popd
|
||||
NODES_ARGS="--extra-vars @$NODES_FILE"
|
||||
fi
|
||||
|
||||
|
||||
pushd $TRIPLEO_ROOT/tripleo-ci
|
||||
if [ -z "${TE_DATAFILE:-}" -a "$ENVIRONMENT" = "ovb" ] ; then
|
||||
|
||||
export GEARDSERVER=${TEBROKERIP-192.168.1.1}
|
||||
# NOTE(pabelanger): We need gear for testenv, but this really should be
|
||||
# handled by tox.
|
||||
sudo pip install gear
|
||||
# Kill the whole job if it doesn't get a testenv in 20 minutes as it likely will timout in zuul
|
||||
( sleep 1200 ; [ ! -e /tmp/toci.started ] && sudo kill -9 $$ ) &
|
||||
|
||||
# We only support multi-nic at the moment
|
||||
NETISO_ENV="multi-nic"
|
||||
|
||||
# provision env in rh cloud, then start quickstart
|
||||
./testenv-client -b $GEARDSERVER:4730 -t $TIMEOUT_SECS \
|
||||
--envsize $NODECOUNT --ucinstance $UCINSTANCEID \
|
||||
--net-iso $NETISO_ENV -- ./toci_quickstart.sh
|
||||
else
|
||||
# multinode preparation
|
||||
# Clear out any puppet modules on the node placed their by infra configuration
|
||||
sudo rm -rf /etc/puppet/modules/*
|
||||
|
||||
# Copy nodepool keys to jenkins user
|
||||
sudo cp /etc/nodepool/id_rsa* $HOME/.ssh/
|
||||
sudo chown $USER:$USER $HOME/.ssh/id_rsa*
|
||||
chmod 0600 $HOME/.ssh/id_rsa*
|
||||
# pre-ansible requirement
|
||||
sudo mkdir -p /root/.ssh/
|
||||
cat $HOME/.ssh/id_rsa.pub >> ${HOME}/.ssh/authorized_keys
|
||||
sudo cp ${HOME}/.ssh/authorized_keys /root/.ssh/
|
||||
sudo chmod 0600 /root/.ssh/authorized_keys
|
||||
sudo chown root:root /root/.ssh/authorized_keys
|
||||
# everything below here *MUST* be translated to a role ASAP
|
||||
# empty image to fool overcloud deployment
|
||||
qemu-img create -f qcow2 /home/jenkins/overcloud-full.qcow2 1G
|
||||
|
||||
# multinode bootstrap script
|
||||
export BOOTSTRAP_SUBNODES_MINIMAL=0
|
||||
if [[ -z $STABLE_RELEASE || "$STABLE_RELEASE" = "ocata" ]]; then
|
||||
BOOTSTRAP_SUBNODES_MINIMAL=1
|
||||
fi
|
||||
$TRIPLEO_ROOT/tripleo-ci/scripts/tripleo.sh \
|
||||
--bootstrap-subnodes \
|
||||
2>&1 | sudo dd of=/var/log/bootstrap-subnodes.log \
|
||||
|| (tail -n 50 /var/log/bootstrap-subnodes.log && false)
|
||||
|
||||
# create logs dir (check if collect-logs doesn't already do this)
|
||||
mkdir -p $WORKSPACE/logs
|
||||
|
||||
# set no_proxy variable
|
||||
export IP_DEVICE=${IP_DEVICE:-"eth0"}
|
||||
MY_IP=$(ip addr show dev $IP_DEVICE | awk '/inet / {gsub("/.*", "") ; print $2}')
|
||||
MY_IP_eth1=$(ip addr show dev eth1 | awk '/inet / {gsub("/.*", "") ; print $2}') || MY_IP_eth1=""
|
||||
|
||||
export http_proxy=""
|
||||
undercloud_net_range="192.168.24."
|
||||
undercloud_services_ip=$undercloud_net_range"1"
|
||||
undercloud_haproxy_public_ip=$undercloud_net_range"2"
|
||||
undercloud_haproxy_admin_ip=$undercloud_net_range"3"
|
||||
export no_proxy=$undercloud_services_ip,$undercloud_haproxy_public_ip,$undercloud_haproxy_admin_ip,$MY_IP,$MY_IP_eth1
|
||||
|
||||
# finally, run quickstart
|
||||
./toci_quickstart.sh
|
||||
fi
|
||||
|
||||
echo "Run completed"
|
414
toci_gate_test-orig.sh
Executable file
414
toci_gate_test-orig.sh
Executable file
@ -0,0 +1,414 @@
|
||||
#!/usr/bin/env bash
|
||||
set -eux
|
||||
export PS4='+(${BASH_SOURCE}:${LINENO}): ${FUNCNAME[0]:+${FUNCNAME[0]}(): }'
|
||||
# Mirrors
|
||||
# NOTE(pabelanger): We have access to AFS mirrors, lets use them.
|
||||
source /etc/nodepool/provider
|
||||
|
||||
source $(dirname $0)/scripts/common_vars.bash
|
||||
NODEPOOL_MIRROR_HOST=${NODEPOOL_MIRROR_HOST:-mirror.$NODEPOOL_REGION.$NODEPOOL_CLOUD.openstack.org}
|
||||
NODEPOOL_MIRROR_HOST=$(echo $NODEPOOL_MIRROR_HOST|tr '[:upper:]' '[:lower:]')
|
||||
export CENTOS_MIRROR=http://$NODEPOOL_MIRROR_HOST/centos
|
||||
export EPEL_MIRROR=http://$NODEPOOL_MIRROR_HOST/epel
|
||||
|
||||
if [ $NODEPOOL_CLOUD == 'tripleo-test-cloud-rh1' ]; then
|
||||
source $(dirname $0)/scripts/rh2.env
|
||||
|
||||
# In order to save space remove the cached git repositories, at this point in
|
||||
# CI the ones we are interested in have been cloned to /opt/stack/new. We
|
||||
# can also remove some distro images cached on the images.
|
||||
sudo rm -rf /opt/git /opt/stack/cache/files/mysql.qcow2 /opt/stack/cache/files/ubuntu-12.04-x86_64.tar.gz
|
||||
fi
|
||||
|
||||
# Clean any cached yum metadata, it maybe stale
|
||||
sudo yum clean all
|
||||
|
||||
# NOTE(pabelanger): Current hack to make centos-7 dib work.
|
||||
# TODO(pabelanger): Why is python-requests installed from pip?
|
||||
sudo rm -rf /usr/lib/python2.7/site-packages/requests
|
||||
|
||||
# Remove metrics from a previous run
|
||||
rm -f /tmp/metric-start-times /tmp/metrics-data
|
||||
|
||||
# JOB_NAME used to be available from jenkins, we need to create it ourselves until
|
||||
# we remove our reliance on it.
|
||||
if [[ -z "${JOB_NAME-}" ]]; then
|
||||
JOB_NAME=${WORKSPACE%/}
|
||||
export JOB_NAME=${JOB_NAME##*/}
|
||||
fi
|
||||
|
||||
# cd to toci directory so relative paths work
|
||||
cd $(dirname $0)
|
||||
|
||||
# Only define $http_proxy if it is unset (use "-" instead of ":-" in the
|
||||
# parameter expansion). This will allow an external script to override using a
|
||||
# proxy by setting export http_proxy=""
|
||||
export http_proxy=${http_proxy-"http://192.168.1.100:3128/"}
|
||||
|
||||
export GEARDSERVER=${TEBROKERIP-192.168.1.1}
|
||||
export MIRRORSERVER=${MIRRORIP-192.168.1.101}
|
||||
|
||||
export CACHEUPLOAD=0
|
||||
export INTROSPECT=0
|
||||
export NODECOUNT=2
|
||||
export PACEMAKER=0
|
||||
export UNDERCLOUD_MAJOR_UPGRADE=0
|
||||
export OVERCLOUD_MAJOR_UPGRADE=0
|
||||
export MAJOR_UPGRADE=0
|
||||
export UPGRADE_RELEASE=
|
||||
export UPGRADE_ENV=
|
||||
# Whether or not we deploy an Overcloud
|
||||
export OVERCLOUD=1
|
||||
# NOTE(bnemec): At this time, the undercloud install + image build is taking from
|
||||
# 1 hour to 1 hour and 15 minutes on the jobs I checked. The devstack gate timeout
|
||||
# is 170 minutes, so subtracting 90 should leave us an hour and 20 minutes for
|
||||
# the deploy. Hopefully that's enough, while still leaving some cushion to come
|
||||
# in under the gate timeout so we can collect logs.
|
||||
OVERCLOUD_DEPLOY_TIMEOUT=$((DEVSTACK_GATE_TIMEOUT-90))
|
||||
export OVERCLOUD_SSH_USER=${OVERCLOUD_SSH_USER:-"jenkins"}
|
||||
export OVERCLOUD_DEPLOY_ARGS=${OVERCLOUD_DEPLOY_ARGS:-""}
|
||||
export OVERCLOUD_DEPLOY_ARGS="$OVERCLOUD_DEPLOY_ARGS --libvirt-type=qemu -t $OVERCLOUD_DEPLOY_TIMEOUT -e /usr/share/openstack-tripleo-heat-templates/environments/debug.yaml"
|
||||
export OVERCLOUD_UPDATE_ARGS=
|
||||
export OVERCLOUD_PINGTEST_ARGS="--skip-pingtest-cleanup"
|
||||
export UNDERCLOUD_SSL=0
|
||||
export UNDERCLOUD_HEAT_CONVERGENCE=0
|
||||
export UNDERCLOUD_IDEMPOTENT=0
|
||||
export UNDERCLOUD_SANITY_CHECK=0
|
||||
export TRIPLEO_SH_ARGS=
|
||||
export NETISO_V4=0
|
||||
export NETISO_V6=0
|
||||
export RUN_PING_TEST=1
|
||||
export RUN_TEMPEST_TESTS=0
|
||||
export OVB=0
|
||||
export UCINSTANCEID=NULL
|
||||
export TOCIRUNNER="./toci_instack_ovb.sh"
|
||||
export MULTINODE=0
|
||||
export OVERCLOUD_ROLES=""
|
||||
# Whether or not we run TripleO using OpenStack Infra nodes
|
||||
export OSINFRA=0
|
||||
export CONTROLLER_HOSTS=
|
||||
export COMPUTE_HOSTS=
|
||||
export SUBNODES_SSH_KEY=
|
||||
export TEST_OVERCLOUD_DELETE=0
|
||||
export OOOQ=0
|
||||
export DEPLOY_OVB_EXTRA_NODE=0
|
||||
export CONTAINERS=0
|
||||
export CA_SERVER=0
|
||||
export UNDERCLOUD_TELEMETRY=0
|
||||
export UNDERCLOUD_UI=0
|
||||
export UNDERCLOUD_VALIDATIONS=0
|
||||
export UNDERCLOUD_CONTAINERS=0
|
||||
export PREDICTABLE_PLACEMENT=0
|
||||
export OPSTOOLS_REPO_ENABLED=0
|
||||
export POSTCI=1
|
||||
export BOOTSTRAP_SUBNODES_MINIMAL=1
|
||||
|
||||
if [[ $TOCI_JOBTYPE =~ upgrades ]]; then
|
||||
# We deploy a master Undercloud and an Overcloud with the
|
||||
# previous release. The pingtest is disable because it won't
|
||||
# work with the few services deployed.
|
||||
if [ "$STABLE_RELEASE" = "ocata" ]; then
|
||||
UPGRADE_RELEASE=newton
|
||||
elif [ -z $STABLE_RELEASE ]; then
|
||||
UPGRADE_RELEASE=ocata
|
||||
fi
|
||||
fi
|
||||
|
||||
if [[ $TOCI_JOBTYPE =~ scenario ]]; then
|
||||
export MULTINODE_ENV_NAME=${TOCI_JOBTYPE#periodic-}
|
||||
|
||||
# enable opstools repository for scenario001
|
||||
if [[ "$MULTINODE_ENV_NAME" =~ scenario001-multinode ]]; then
|
||||
OPSTOOLS_REPO_ENABLED=1
|
||||
fi
|
||||
|
||||
export MULTINODE_ENV_NAME=${MULTINODE_ENV_NAME%-upgrades}
|
||||
if [[ "$TOCI_JOBTYPE" =~ upgrades ]]; then
|
||||
MULTINODE_ENV_PATH=$TRIPLEO_ROOT/$UPGRADE_RELEASE/usr/share/openstack-tripleo-heat-templates/ci/environments/$MULTINODE_ENV_NAME.yaml
|
||||
else
|
||||
MULTINODE_ENV_PATH=/usr/share/openstack-tripleo-heat-templates/ci/environments/$MULTINODE_ENV_NAME.yaml
|
||||
fi
|
||||
else
|
||||
export MULTINODE_ENV_NAME='multinode'
|
||||
MULTINODE_ENV_PATH=/usr/share/openstack-tripleo-heat-templates/ci/environments/$MULTINODE_ENV_NAME.yaml
|
||||
fi
|
||||
if [[ "$TOCI_JOBTYPE" =~ "periodic" && "$TOCI_JOBTYPE" =~ "-ha" ]]; then
|
||||
TEST_OVERCLOUD_DELETE=1
|
||||
elif [[ "$TOCI_JOBTYPE" =~ "periodic" && "$TOCI_JOBTYPE" =~ "-nonha" ]]; then
|
||||
UNDERCLOUD_IDEMPOTENT=1
|
||||
fi
|
||||
|
||||
# Test version of ssh package for bug https://bugzilla.redhat.com/show_bug.cgi?id=1415218
|
||||
http_proxy= wget -P /tmp -T 60 --tries=3 --progress=dot:mega http://66.187.229.139/test/openssh-6.6.1p1-33.el7.x86_64.rpm
|
||||
http_proxy= wget -P /tmp -T 60 --tries=3 --progress=dot:mega http://66.187.229.139/test/openssh-server-6.6.1p1-33.el7.x86_64.rpm
|
||||
sudo rpm -ivh --force /tmp/openssh-6.6.1p1-33.el7.x86_64.rpm /tmp/openssh-server-6.6.1p1-33.el7.x86_64.rpm
|
||||
|
||||
# start dstat early
|
||||
# TODO add it to the gate image building
|
||||
sudo yum install -y dstat nmap-ncat #nc is for metrics
|
||||
mkdir -p "$WORKSPACE/logs"
|
||||
dstat -tcmndrylpg --top-cpu-adv --top-io-adv --nocolor | tee --append $WORKSPACE/logs/dstat.log > /dev/null &
|
||||
disown
|
||||
|
||||
# Switch defaults based on the job name
|
||||
for JOB_TYPE_PART in $(sed 's/-/ /g' <<< "${TOCI_JOBTYPE:-}") ; do
|
||||
case $JOB_TYPE_PART in
|
||||
updates)
|
||||
if [[ "$TOCI_JOBTYPE" =~ 'ovb-updates' ]] ; then
|
||||
NODECOUNT=3
|
||||
if [[ "${STABLE_RELEASE}" =~ ^mitaka$ ]] ; then
|
||||
ENDPOINT_LIST_LOCATION=$TRIPLEO_ROOT/tripleo-ci/test-environments
|
||||
CA_ENVIRONMENT_FILE=inject-trust-anchor-ipv6.yaml
|
||||
else
|
||||
ENDPOINT_LIST_LOCATION=/usr/share/openstack-tripleo-heat-templates/environments
|
||||
CA_ENVIRONMENT_FILE=inject-trust-anchor-hiera-ipv6.yaml
|
||||
fi
|
||||
OVERCLOUD_DEPLOY_ARGS="
|
||||
$OVERCLOUD_DEPLOY_ARGS
|
||||
-e /usr/share/openstack-tripleo-heat-templates/environments/puppet-pacemaker.yaml
|
||||
-e /usr/share/openstack-tripleo-heat-templates/environments/network-isolation-v6.yaml
|
||||
-e $TRIPLEO_ROOT/tripleo-ci/test-environments/ipv6-network-templates/network-environment.yaml
|
||||
-e $TRIPLEO_ROOT/tripleo-ci/test-environments/net-iso.yaml
|
||||
-e $TRIPLEO_ROOT/tripleo-ci/test-environments/enable-tls-ipv6.yaml
|
||||
-e $ENDPOINT_LIST_LOCATION/tls-endpoints-public-ip.yaml
|
||||
-e $TRIPLEO_ROOT/tripleo-ci/test-environments/$CA_ENVIRONMENT_FILE
|
||||
--ceph-storage-scale 1
|
||||
-e /usr/share/openstack-tripleo-heat-templates/environments/storage-environment.yaml
|
||||
"
|
||||
OVERCLOUD_UPDATE_ARGS="-e /usr/share/openstack-tripleo-heat-templates/overcloud-resource-registry-puppet.yaml $OVERCLOUD_DEPLOY_ARGS"
|
||||
NETISO_V6=1
|
||||
PACEMAKER=1
|
||||
elif [[ "$TOCI_JOBTYPE" =~ 'nonha-multinode-updates' ]] ; then
|
||||
OVERCLOUD_UPDATE_ARGS="-e /usr/share/openstack-tripleo-heat-templates/overcloud-resource-registry-puppet.yaml $OVERCLOUD_DEPLOY_ARGS"
|
||||
fi
|
||||
;;
|
||||
upgrades)
|
||||
MAJOR_UPGRADE=1
|
||||
if [ $TOCI_JOBTYPE == 'undercloud-upgrades' ] ; then
|
||||
# We want to start by installing an Undercloud
|
||||
# from the previous stable release.
|
||||
if [ "$STABLE_RELEASE" = "ocata" ]; then
|
||||
STABLE_RELEASE=newton
|
||||
elif [ "$STABLE_RELEASE" = "newton" ]; then
|
||||
STABLE_RELEASE=mitaka
|
||||
elif [ -z $STABLE_RELEASE ]; then
|
||||
#TODO(emilien) switch to pike when released
|
||||
STABLE_RELEASE=ocata
|
||||
fi
|
||||
UNDERCLOUD_MAJOR_UPGRADE=1
|
||||
export UNDERCLOUD_SANITY_CHECK=1
|
||||
fi
|
||||
if [[ $TOCI_JOBTYPE =~ 'multinode-upgrades' ]] ; then
|
||||
OVERCLOUD_MAJOR_UPGRADE=1
|
||||
# We still bootstrap subnodes manually for multinode-upgrades
|
||||
# because we are deploying Newton initially.
|
||||
BOOTSTRAP_SUBNODES_MINIMAL=0
|
||||
UNDERCLOUD_SSL=0
|
||||
export UNDERCLOUD_SANITY_CHECK=0
|
||||
if [[ $TOCI_JOBTYPE == 'multinode-upgrades' ]] ; then
|
||||
export UPGRADE_ENV=/usr/share/openstack-tripleo-heat-templates/ci/environments/multinode_major_upgrade.yaml
|
||||
else
|
||||
export UPGRADE_ENV=/usr/share/openstack-tripleo-heat-templates/ci/environments/$MULTINODE_ENV_NAME.yaml
|
||||
fi
|
||||
OVERCLOUD_DEPLOY_ARGS="$OVERCLOUD_DEPLOY_ARGS --libvirt-type=qemu -t $OVERCLOUD_DEPLOY_TIMEOUT -r $TRIPLEO_ROOT/tripleo-ci/test-environments/upgrade_roles_data.yaml --overcloud-ssh-user $OVERCLOUD_SSH_USER --validation-errors-nonfatal"
|
||||
fi
|
||||
;;
|
||||
ha)
|
||||
NODECOUNT=4
|
||||
# In ci our overcloud nodes don't have access to an external netwrok
|
||||
# --ntp-server is here to make the deploy command happy, the ci env
|
||||
# is on virt so the clocks should be in sync without it.
|
||||
OVERCLOUD_DEPLOY_ARGS="$OVERCLOUD_DEPLOY_ARGS --control-scale 3 --ntp-server 0.centos.pool.ntp.org -e /usr/share/openstack-tripleo-heat-templates/environments/puppet-pacemaker.yaml -e /usr/share/openstack-tripleo-heat-templates/environments/network-isolation.yaml -e $TRIPLEO_ROOT/tripleo-ci/test-environments/network-templates/network-environment.yaml -e $TRIPLEO_ROOT/tripleo-ci/test-environments/net-iso.yaml"
|
||||
NETISO_V4=1
|
||||
PACEMAKER=1
|
||||
PREDICTABLE_PLACEMENT=1
|
||||
;;
|
||||
nonha)
|
||||
if [[ "${STABLE_RELEASE}" = "mitaka" ]] ; then
|
||||
ENDPOINT_LIST_LOCATION=$TRIPLEO_ROOT/tripleo-ci/test-environments
|
||||
CA_ENVIRONMENT_FILE=inject-trust-anchor.yaml
|
||||
else
|
||||
ENDPOINT_LIST_LOCATION=/usr/share/openstack-tripleo-heat-templates/environments
|
||||
CA_ENVIRONMENT_FILE=inject-trust-anchor-hiera.yaml
|
||||
fi
|
||||
OVERCLOUD_DEPLOY_ARGS="$OVERCLOUD_DEPLOY_ARGS -e $TRIPLEO_ROOT/tripleo-ci/test-environments/enable-tls.yaml -e $ENDPOINT_LIST_LOCATION/tls-endpoints-public-ip.yaml -e $TRIPLEO_ROOT/tripleo-ci/test-environments/$CA_ENVIRONMENT_FILE --ceph-storage-scale 1 -e /usr/share/openstack-tripleo-heat-templates/environments/storage-environment.yaml"
|
||||
INTROSPECT=1
|
||||
NODECOUNT=3
|
||||
UNDERCLOUD_SSL=1
|
||||
UNDERCLOUD_TELEMETRY=1
|
||||
UNDERCLOUD_UI=1
|
||||
UNDERCLOUD_VALIDATIONS=1
|
||||
;;
|
||||
containers)
|
||||
CONTAINERS=1
|
||||
UNDERCLOUD_CONTAINERS=1
|
||||
OVERCLOUD_DEPLOY_ARGS="$OVERCLOUD_DEPLOY_ARGS \
|
||||
-e /usr/share/openstack-tripleo-heat-templates/environments/docker.yaml \
|
||||
-e /usr/share/openstack-tripleo-heat-templates/environments/docker-network.yaml \
|
||||
-e ~/containers-default-parameters.yaml"
|
||||
;;
|
||||
ovb)
|
||||
OVB=1
|
||||
|
||||
# The test env broker needs to know the instanceid of the this node so it can attach it to the provisioning network
|
||||
UCINSTANCEID=$(http_proxy= curl http://169.254.169.254/openstack/2015-10-15/meta_data.json | python -c 'import json, sys; print json.load(sys.stdin)["uuid"]')
|
||||
;;
|
||||
ipv6)
|
||||
NETISO_V4=0
|
||||
NETISO_V6=1
|
||||
OVERCLOUD_DEPLOY_ARGS="$OVERCLOUD_DEPLOY_ARGS -e /usr/share/openstack-tripleo-heat-templates/environments/network-isolation-v6.yaml -e $TRIPLEO_ROOT/tripleo-ci/test-environments/ipv6-network-templates/network-environment.yaml"
|
||||
;;
|
||||
convergence)
|
||||
UNDERCLOUD_HEAT_CONVERGENCE=1
|
||||
;;
|
||||
multinode)
|
||||
MULTINODE=1
|
||||
TOCIRUNNER="./toci_instack_osinfra.sh"
|
||||
OSINFRA=1
|
||||
UNDERCLOUD_SSL=0
|
||||
INTROSPECT=0
|
||||
SUBNODES_SSH_KEY=/etc/nodepool/id_rsa
|
||||
OVERCLOUD_DEPLOY_ARGS="--libvirt-type=qemu -t $OVERCLOUD_DEPLOY_TIMEOUT"
|
||||
|
||||
if [[ "$TOCI_JOBTYPE" =~ "3nodes" ]]; then
|
||||
NODECOUNT=2
|
||||
PACEMAKER=1
|
||||
OVERCLOUD_ROLES="ControllerApi Controller"
|
||||
export ControllerApi_hosts=$(sed -n 1,1p /etc/nodepool/sub_nodes)
|
||||
export Controller_hosts=$(sed -n 2,2p /etc/nodepool/sub_nodes)
|
||||
OVERCLOUD_DEPLOY_ARGS="$OVERCLOUD_DEPLOY_ARGS -e /usr/share/openstack-tripleo-heat-templates/environments/puppet-pacemaker.yaml -e /usr/share/openstack-tripleo-heat-templates/environments/deployed-server-environment.yaml -e $TRIPLEO_ROOT/tripleo-ci/test-environments/multinode-3nodes.yaml --compute-scale 0 --overcloud-ssh-user $OVERCLOUD_SSH_USER --validation-errors-nonfatal -r /usr/share/openstack-tripleo-heat-templates/ci/environments/multinode-3nodes.yaml"
|
||||
else
|
||||
NODECOUNT=1
|
||||
CONTROLLER_HOSTS=$(sed -n 1,1p /etc/nodepool/sub_nodes)
|
||||
OVERCLOUD_DEPLOY_ARGS="$OVERCLOUD_DEPLOY_ARGS -e /usr/share/openstack-tripleo-heat-templates/environments/deployed-server-environment.yaml -e $MULTINODE_ENV_PATH --compute-scale 0 --overcloud-ssh-user $OVERCLOUD_SSH_USER --validation-errors-nonfatal"
|
||||
fi
|
||||
|
||||
if [ "$STABLE_RELEASE" = "newton" ]; then
|
||||
BOOTSTRAP_SUBNODES_MINIMAL=0
|
||||
else
|
||||
BOOTSTRAP_SUBNODES_MINIMAL=1
|
||||
OVERCLOUD_DEPLOY_ARGS="$OVERCLOUD_DEPLOY_ARGS -e /usr/share/openstack-tripleo-heat-templates/environments/deployed-server-bootstrap-environment-centos.yaml "
|
||||
fi
|
||||
;;
|
||||
undercloud)
|
||||
TOCIRUNNER="./toci_instack_osinfra.sh"
|
||||
NODECOUNT=0
|
||||
OVERCLOUD=0
|
||||
OSINFRA=1
|
||||
RUN_PING_TEST=0
|
||||
UNDERCLOUD_SSL=0
|
||||
INTROSPECT=0
|
||||
UNDERCLOUD_SSL=1
|
||||
UNDERCLOUD_TELEMETRY=1
|
||||
UNDERCLOUD_UI=1
|
||||
UNDERCLOUD_VALIDATIONS=1
|
||||
export UNDERCLOUD_SANITY_CHECK=1
|
||||
;;
|
||||
periodic)
|
||||
export DELOREAN_REPO_URL=http://trunk.rdoproject.org/centos7/consistent
|
||||
CACHEUPLOAD=1
|
||||
OVERCLOUD_PINGTEST_ARGS=
|
||||
;;
|
||||
mitaka)
|
||||
# This is handled in tripleo.sh (it always uses centos7-$STABLE_RELEASE/current)
|
||||
# where $STABLE_RELEASE is derived in toci_instack.sh
|
||||
unset DELOREAN_REPO_URL
|
||||
;;
|
||||
tempest)
|
||||
export RUN_TEMPEST_TESTS=1
|
||||
export RUN_PING_TEST=0
|
||||
;;
|
||||
oooq)
|
||||
export OOOQ=1
|
||||
if [[ "$TOCI_JOBTYPE" =~ "multinode" ]]; then
|
||||
TOCIRUNNER="./toci_instack_oooq_multinode.sh"
|
||||
else
|
||||
TOCIRUNNER="./toci_instack_oooq.sh"
|
||||
fi
|
||||
PREDICTABLE_PLACEMENT=0
|
||||
POSTCI=0
|
||||
;;
|
||||
fakeha)
|
||||
NODECOUNT=2
|
||||
# In ci our overcloud nodes don't have access to an external network
|
||||
# --ntp-server is here to make the deploy command happy, the ci env
|
||||
# is on virt so the clocks should be in sync without it.
|
||||
OVERCLOUD_DEPLOY_ARGS="$OVERCLOUD_DEPLOY_ARGS --control-scale 1 --ntp-server 0.centos.pool.ntp.org -e /usr/share/openstack-tripleo-heat-templates/environments/puppet-pacemaker.yaml -e /usr/share/openstack-tripleo-heat-templates/environments/network-isolation.yaml -e $TRIPLEO_ROOT/tripleo-ci/test-environments/network-templates/network-environment.yaml -e $TRIPLEO_ROOT/tripleo-ci/test-environments/net-iso.yaml"
|
||||
NETISO_V4=1
|
||||
PACEMAKER=1
|
||||
;;
|
||||
caserver)
|
||||
OVERCLOUD_DEPLOY_ARGS="$OVERCLOUD_DEPLOY_ARGS -e /usr/share/openstack-tripleo-heat-templates/environments/services/haproxy-public-tls-certmonger.yaml -e /usr/share/openstack-tripleo-heat-templates/environments/tls-everywhere-endpoints-dns.yaml -e /usr/share/openstack-tripleo-heat-templates/environments/enable-internal-tls.yaml"
|
||||
# This is created in scripts/deploy.sh as part of the CA_SERVER
|
||||
# section
|
||||
OVERCLOUD_DEPLOY_ARGS="$OVERCLOUD_DEPLOY_ARGS -e $TRIPLEO_ROOT/cloud-names.yaml"
|
||||
CA_SERVER=1
|
||||
DEPLOY_OVB_EXTRA_NODE=1
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
if [[ $PREDICTABLE_PLACEMENT == 1 ]]; then
|
||||
OVERCLOUD_DEPLOY_ARGS="$OVERCLOUD_DEPLOY_ARGS -e $TRIPLEO_ROOT/tripleo-ci/test-environments/ips-from-pool-all.yaml -e $TRIPLEO_ROOT/tripleo-ci/test-environments/hostname-map.yaml -e $TRIPLEO_ROOT/tripleo-ci/test-environments/scheduler-hints.yaml"
|
||||
fi
|
||||
# Limit worker counts to avoid overloading our limited resources
|
||||
if [[ "${STABLE_RELEASE}" = "mitaka" ]] ; then
|
||||
OVERCLOUD_DEPLOY_ARGS="$OVERCLOUD_DEPLOY_ARGS -e $TRIPLEO_ROOT/tripleo-ci/test-environments/worker-config-mitaka-and-below.yaml"
|
||||
elif [[ "${OVERCLOUD_MAJOR_UPGRADE}" == "1" ]]; then
|
||||
OVERCLOUD_DEPLOY_ARGS="$OVERCLOUD_DEPLOY_ARGS -e /usr/share/openstack-tripleo-heat-templates/environments/low-memory-usage.yaml"
|
||||
else
|
||||
OVERCLOUD_DEPLOY_ARGS="$OVERCLOUD_DEPLOY_ARGS -e $TRIPLEO_ROOT/tripleo-ci/test-environments/worker-config.yaml -e /usr/share/openstack-tripleo-heat-templates/environments/low-memory-usage.yaml"
|
||||
fi
|
||||
# If we're running an update job, regenerate the args to reflect the above changes
|
||||
if [ -n "$OVERCLOUD_UPDATE_ARGS" ]; then
|
||||
OVERCLOUD_UPDATE_ARGS="-e /usr/share/openstack-tripleo-heat-templates/overcloud-resource-registry-puppet.yaml $OVERCLOUD_DEPLOY_ARGS"
|
||||
fi
|
||||
|
||||
TIMEOUT_SECS=$((DEVSTACK_GATE_TIMEOUT*60))
|
||||
# ./testenv-client kill everything in its own process group it it hits a timeout
|
||||
# run it in a separate group to avoid getting killed along with it
|
||||
set -m
|
||||
|
||||
# install moreutils for timestamping postci.log with ts
|
||||
# This comes from epel, so we need to install it before removing that repo
|
||||
sudo yum install -y moreutils
|
||||
|
||||
# Ensure epel-release is not installed
|
||||
sudo yum erase -y epel-release || :
|
||||
|
||||
if [ "$DEPLOY_OVB_EXTRA_NODE" = '1' ]; then
|
||||
# This is usually done in the undercloud install, but we need it at this
|
||||
# point since we want access to the extra node
|
||||
ssh-keygen -t rsa -N '' -f ~/.ssh/id_rsa
|
||||
SSH_KEY="$(cat ~/.ssh/id_rsa.pub)"
|
||||
TEST_ENV_EXTRA_ARGS=("--create-undercloud" "--ssh-key" "$SSH_KEY")
|
||||
else
|
||||
TEST_ENV_EXTRA_ARGS=()
|
||||
fi
|
||||
|
||||
source $TRIPLEO_ROOT/tripleo-ci/scripts/metrics.bash
|
||||
start_metric "tripleo.testenv.${TOCI_JOBTYPE}.wait.seconds"
|
||||
if [ -z "${TE_DATAFILE:-}" -a "$OSINFRA" = "0" ] ; then
|
||||
# NOTE(pabelanger): We need gear for testenv, but this really should be
|
||||
# handled by tox.
|
||||
sudo pip install gear
|
||||
# Kill the whole job if it doesn't get a testenv in 20 minutes as it likely will timout in zuul
|
||||
( sleep 1200 ; [ ! -e /tmp/toci.started ] && sudo kill -9 $$ ) &
|
||||
|
||||
# TODO(bnemec): Add jobs that use public-bond
|
||||
NETISO_ENV="none"
|
||||
if [ $NETISO_V4 -eq 1 -o $NETISO_V6 -eq 1 ]; then
|
||||
NETISO_ENV="multi-nic"
|
||||
fi
|
||||
if [ ${#TEST_ENV_EXTRA_ARGS[@]} -eq 0 ]; then
|
||||
./testenv-client -b $GEARDSERVER:4730 -t $TIMEOUT_SECS \
|
||||
--envsize $NODECOUNT --ucinstance $UCINSTANCEID \
|
||||
--net-iso $NETISO_ENV -- $TOCIRUNNER
|
||||
else
|
||||
./testenv-client -b $GEARDSERVER:4730 -t $TIMEOUT_SECS \
|
||||
--envsize $NODECOUNT --ucinstance $UCINSTANCEID \
|
||||
--net-iso $NETISO_ENV "${TEST_ENV_EXTRA_ARGS[@]}" -- $TOCIRUNNER
|
||||
fi
|
||||
else
|
||||
$TOCIRUNNER
|
||||
fi
|
@ -1,414 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
set -eux
|
||||
export PS4='+(${BASH_SOURCE}:${LINENO}): ${FUNCNAME[0]:+${FUNCNAME[0]}(): }'
|
||||
# Mirrors
|
||||
# NOTE(pabelanger): We have access to AFS mirrors, lets use them.
|
||||
source /etc/nodepool/provider
|
||||
|
||||
source $(dirname $0)/scripts/common_vars.bash
|
||||
NODEPOOL_MIRROR_HOST=${NODEPOOL_MIRROR_HOST:-mirror.$NODEPOOL_REGION.$NODEPOOL_CLOUD.openstack.org}
|
||||
NODEPOOL_MIRROR_HOST=$(echo $NODEPOOL_MIRROR_HOST|tr '[:upper:]' '[:lower:]')
|
||||
export CENTOS_MIRROR=http://$NODEPOOL_MIRROR_HOST/centos
|
||||
export EPEL_MIRROR=http://$NODEPOOL_MIRROR_HOST/epel
|
||||
|
||||
if [ $NODEPOOL_CLOUD == 'tripleo-test-cloud-rh1' ]; then
|
||||
source $(dirname $0)/scripts/rh2.env
|
||||
|
||||
# In order to save space remove the cached git repositories, at this point in
|
||||
# CI the ones we are interested in have been cloned to /opt/stack/new. We
|
||||
# can also remove some distro images cached on the images.
|
||||
sudo rm -rf /opt/git /opt/stack/cache/files/mysql.qcow2 /opt/stack/cache/files/ubuntu-12.04-x86_64.tar.gz
|
||||
fi
|
||||
|
||||
# Clean any cached yum metadata, it maybe stale
|
||||
sudo yum clean all
|
||||
|
||||
# NOTE(pabelanger): Current hack to make centos-7 dib work.
|
||||
# TODO(pabelanger): Why is python-requests installed from pip?
|
||||
sudo rm -rf /usr/lib/python2.7/site-packages/requests
|
||||
|
||||
# Remove metrics from a previous run
|
||||
rm -f /tmp/metric-start-times /tmp/metrics-data
|
||||
|
||||
# JOB_NAME used to be available from jenkins, we need to create it ourselves until
|
||||
# we remove our reliance on it.
|
||||
if [[ -z "${JOB_NAME-}" ]]; then
|
||||
JOB_NAME=${WORKSPACE%/}
|
||||
export JOB_NAME=${JOB_NAME##*/}
|
||||
fi
|
||||
|
||||
# cd to toci directory so relative paths work
|
||||
cd $(dirname $0)
|
||||
|
||||
# Only define $http_proxy if it is unset (use "-" instead of ":-" in the
|
||||
# parameter expansion). This will allow an external script to override using a
|
||||
# proxy by setting export http_proxy=""
|
||||
export http_proxy=${http_proxy-"http://192.168.1.100:3128/"}
|
||||
|
||||
export GEARDSERVER=${TEBROKERIP-192.168.1.1}
|
||||
export MIRRORSERVER=${MIRRORIP-192.168.1.101}
|
||||
|
||||
export CACHEUPLOAD=0
|
||||
export INTROSPECT=0
|
||||
export NODECOUNT=2
|
||||
export PACEMAKER=0
|
||||
export UNDERCLOUD_MAJOR_UPGRADE=0
|
||||
export OVERCLOUD_MAJOR_UPGRADE=0
|
||||
export MAJOR_UPGRADE=0
|
||||
export UPGRADE_RELEASE=
|
||||
export UPGRADE_ENV=
|
||||
# Whether or not we deploy an Overcloud
|
||||
export OVERCLOUD=1
|
||||
# NOTE(bnemec): At this time, the undercloud install + image build is taking from
|
||||
# 1 hour to 1 hour and 15 minutes on the jobs I checked. The devstack gate timeout
|
||||
# is 170 minutes, so subtracting 90 should leave us an hour and 20 minutes for
|
||||
# the deploy. Hopefully that's enough, while still leaving some cushion to come
|
||||
# in under the gate timeout so we can collect logs.
|
||||
OVERCLOUD_DEPLOY_TIMEOUT=$((DEVSTACK_GATE_TIMEOUT-90))
|
||||
export OVERCLOUD_SSH_USER=${OVERCLOUD_SSH_USER:-"jenkins"}
|
||||
export OVERCLOUD_DEPLOY_ARGS=${OVERCLOUD_DEPLOY_ARGS:-""}
|
||||
export OVERCLOUD_DEPLOY_ARGS="$OVERCLOUD_DEPLOY_ARGS --libvirt-type=qemu -t $OVERCLOUD_DEPLOY_TIMEOUT -e /usr/share/openstack-tripleo-heat-templates/environments/debug.yaml"
|
||||
export OVERCLOUD_UPDATE_ARGS=
|
||||
export OVERCLOUD_PINGTEST_ARGS="--skip-pingtest-cleanup"
|
||||
export UNDERCLOUD_SSL=0
|
||||
export UNDERCLOUD_HEAT_CONVERGENCE=0
|
||||
export UNDERCLOUD_IDEMPOTENT=0
|
||||
export UNDERCLOUD_SANITY_CHECK=0
|
||||
export TRIPLEO_SH_ARGS=
|
||||
export NETISO_V4=0
|
||||
export NETISO_V6=0
|
||||
export RUN_PING_TEST=1
|
||||
export RUN_TEMPEST_TESTS=0
|
||||
export OVB=0
|
||||
export UCINSTANCEID=NULL
|
||||
export TOCIRUNNER="./toci_instack_ovb.sh"
|
||||
export MULTINODE=0
|
||||
export OVERCLOUD_ROLES=""
|
||||
# Whether or not we run TripleO using OpenStack Infra nodes
|
||||
export OSINFRA=0
|
||||
export CONTROLLER_HOSTS=
|
||||
export COMPUTE_HOSTS=
|
||||
export SUBNODES_SSH_KEY=
|
||||
export TEST_OVERCLOUD_DELETE=0
|
||||
export OOOQ=0
|
||||
export DEPLOY_OVB_EXTRA_NODE=0
|
||||
export CONTAINERS=0
|
||||
export CA_SERVER=0
|
||||
export UNDERCLOUD_TELEMETRY=0
|
||||
export UNDERCLOUD_UI=0
|
||||
export UNDERCLOUD_VALIDATIONS=0
|
||||
export UNDERCLOUD_CONTAINERS=0
|
||||
export PREDICTABLE_PLACEMENT=0
|
||||
export OPSTOOLS_REPO_ENABLED=0
|
||||
export POSTCI=1
|
||||
export BOOTSTRAP_SUBNODES_MINIMAL=1
|
||||
|
||||
if [[ $TOCI_JOBTYPE =~ upgrades ]]; then
|
||||
# We deploy a master Undercloud and an Overcloud with the
|
||||
# previous release. The pingtest is disable because it won't
|
||||
# work with the few services deployed.
|
||||
if [ "$STABLE_RELEASE" = "ocata" ]; then
|
||||
UPGRADE_RELEASE=newton
|
||||
elif [ -z $STABLE_RELEASE ]; then
|
||||
UPGRADE_RELEASE=ocata
|
||||
fi
|
||||
fi
|
||||
|
||||
if [[ $TOCI_JOBTYPE =~ scenario ]]; then
|
||||
export MULTINODE_ENV_NAME=${TOCI_JOBTYPE#periodic-}
|
||||
|
||||
# enable opstools repository for scenario001
|
||||
if [[ "$MULTINODE_ENV_NAME" =~ scenario001-multinode ]]; then
|
||||
OPSTOOLS_REPO_ENABLED=1
|
||||
fi
|
||||
|
||||
export MULTINODE_ENV_NAME=${MULTINODE_ENV_NAME%-upgrades}
|
||||
if [[ "$TOCI_JOBTYPE" =~ upgrades ]]; then
|
||||
MULTINODE_ENV_PATH=$TRIPLEO_ROOT/$UPGRADE_RELEASE/usr/share/openstack-tripleo-heat-templates/ci/environments/$MULTINODE_ENV_NAME.yaml
|
||||
else
|
||||
MULTINODE_ENV_PATH=/usr/share/openstack-tripleo-heat-templates/ci/environments/$MULTINODE_ENV_NAME.yaml
|
||||
fi
|
||||
else
|
||||
export MULTINODE_ENV_NAME='multinode'
|
||||
MULTINODE_ENV_PATH=/usr/share/openstack-tripleo-heat-templates/ci/environments/$MULTINODE_ENV_NAME.yaml
|
||||
fi
|
||||
if [[ "$TOCI_JOBTYPE" =~ "periodic" && "$TOCI_JOBTYPE" =~ "-ha" ]]; then
|
||||
TEST_OVERCLOUD_DELETE=1
|
||||
elif [[ "$TOCI_JOBTYPE" =~ "periodic" && "$TOCI_JOBTYPE" =~ "-nonha" ]]; then
|
||||
UNDERCLOUD_IDEMPOTENT=1
|
||||
fi
|
||||
|
||||
# Test version of ssh package for bug https://bugzilla.redhat.com/show_bug.cgi?id=1415218
|
||||
http_proxy= wget -P /tmp -T 60 --tries=3 --progress=dot:mega http://66.187.229.139/test/openssh-6.6.1p1-33.el7.x86_64.rpm
|
||||
http_proxy= wget -P /tmp -T 60 --tries=3 --progress=dot:mega http://66.187.229.139/test/openssh-server-6.6.1p1-33.el7.x86_64.rpm
|
||||
sudo rpm -ivh --force /tmp/openssh-6.6.1p1-33.el7.x86_64.rpm /tmp/openssh-server-6.6.1p1-33.el7.x86_64.rpm
|
||||
|
||||
# start dstat early
|
||||
# TODO add it to the gate image building
|
||||
sudo yum install -y dstat nmap-ncat #nc is for metrics
|
||||
mkdir -p "$WORKSPACE/logs"
|
||||
dstat -tcmndrylpg --top-cpu-adv --top-io-adv --nocolor | tee --append $WORKSPACE/logs/dstat.log > /dev/null &
|
||||
disown
|
||||
|
||||
# Switch defaults based on the job name
|
||||
for JOB_TYPE_PART in $(sed 's/-/ /g' <<< "${TOCI_JOBTYPE:-}") ; do
|
||||
case $JOB_TYPE_PART in
|
||||
updates)
|
||||
if [[ "$TOCI_JOBTYPE" =~ 'ovb-updates' ]] ; then
|
||||
NODECOUNT=3
|
||||
if [[ "${STABLE_RELEASE}" =~ ^mitaka$ ]] ; then
|
||||
ENDPOINT_LIST_LOCATION=$TRIPLEO_ROOT/tripleo-ci/test-environments
|
||||
CA_ENVIRONMENT_FILE=inject-trust-anchor-ipv6.yaml
|
||||
else
|
||||
ENDPOINT_LIST_LOCATION=/usr/share/openstack-tripleo-heat-templates/environments
|
||||
CA_ENVIRONMENT_FILE=inject-trust-anchor-hiera-ipv6.yaml
|
||||
fi
|
||||
OVERCLOUD_DEPLOY_ARGS="
|
||||
$OVERCLOUD_DEPLOY_ARGS
|
||||
-e /usr/share/openstack-tripleo-heat-templates/environments/puppet-pacemaker.yaml
|
||||
-e /usr/share/openstack-tripleo-heat-templates/environments/network-isolation-v6.yaml
|
||||
-e $TRIPLEO_ROOT/tripleo-ci/test-environments/ipv6-network-templates/network-environment.yaml
|
||||
-e $TRIPLEO_ROOT/tripleo-ci/test-environments/net-iso.yaml
|
||||
-e $TRIPLEO_ROOT/tripleo-ci/test-environments/enable-tls-ipv6.yaml
|
||||
-e $ENDPOINT_LIST_LOCATION/tls-endpoints-public-ip.yaml
|
||||
-e $TRIPLEO_ROOT/tripleo-ci/test-environments/$CA_ENVIRONMENT_FILE
|
||||
--ceph-storage-scale 1
|
||||
-e /usr/share/openstack-tripleo-heat-templates/environments/storage-environment.yaml
|
||||
"
|
||||
OVERCLOUD_UPDATE_ARGS="-e /usr/share/openstack-tripleo-heat-templates/overcloud-resource-registry-puppet.yaml $OVERCLOUD_DEPLOY_ARGS"
|
||||
NETISO_V6=1
|
||||
PACEMAKER=1
|
||||
elif [[ "$TOCI_JOBTYPE" =~ 'nonha-multinode-updates' ]] ; then
|
||||
OVERCLOUD_UPDATE_ARGS="-e /usr/share/openstack-tripleo-heat-templates/overcloud-resource-registry-puppet.yaml $OVERCLOUD_DEPLOY_ARGS"
|
||||
fi
|
||||
;;
|
||||
upgrades)
|
||||
MAJOR_UPGRADE=1
|
||||
if [ $TOCI_JOBTYPE == 'undercloud-upgrades' ] ; then
|
||||
# We want to start by installing an Undercloud
|
||||
# from the previous stable release.
|
||||
if [ "$STABLE_RELEASE" = "ocata" ]; then
|
||||
STABLE_RELEASE=newton
|
||||
elif [ "$STABLE_RELEASE" = "newton" ]; then
|
||||
STABLE_RELEASE=mitaka
|
||||
elif [ -z $STABLE_RELEASE ]; then
|
||||
#TODO(emilien) switch to pike when released
|
||||
STABLE_RELEASE=ocata
|
||||
fi
|
||||
UNDERCLOUD_MAJOR_UPGRADE=1
|
||||
export UNDERCLOUD_SANITY_CHECK=1
|
||||
fi
|
||||
if [[ $TOCI_JOBTYPE =~ 'multinode-upgrades' ]] ; then
|
||||
OVERCLOUD_MAJOR_UPGRADE=1
|
||||
# We still bootstrap subnodes manually for multinode-upgrades
|
||||
# because we are deploying Newton initially.
|
||||
BOOTSTRAP_SUBNODES_MINIMAL=0
|
||||
UNDERCLOUD_SSL=0
|
||||
export UNDERCLOUD_SANITY_CHECK=0
|
||||
if [[ $TOCI_JOBTYPE == 'multinode-upgrades' ]] ; then
|
||||
export UPGRADE_ENV=/usr/share/openstack-tripleo-heat-templates/ci/environments/multinode_major_upgrade.yaml
|
||||
else
|
||||
export UPGRADE_ENV=/usr/share/openstack-tripleo-heat-templates/ci/environments/$MULTINODE_ENV_NAME.yaml
|
||||
fi
|
||||
OVERCLOUD_DEPLOY_ARGS="$OVERCLOUD_DEPLOY_ARGS --libvirt-type=qemu -t $OVERCLOUD_DEPLOY_TIMEOUT -r $TRIPLEO_ROOT/tripleo-ci/test-environments/upgrade_roles_data.yaml --overcloud-ssh-user $OVERCLOUD_SSH_USER --validation-errors-nonfatal"
|
||||
fi
|
||||
;;
|
||||
ha)
|
||||
NODECOUNT=4
|
||||
# In ci our overcloud nodes don't have access to an external netwrok
|
||||
# --ntp-server is here to make the deploy command happy, the ci env
|
||||
# is on virt so the clocks should be in sync without it.
|
||||
OVERCLOUD_DEPLOY_ARGS="$OVERCLOUD_DEPLOY_ARGS --control-scale 3 --ntp-server 0.centos.pool.ntp.org -e /usr/share/openstack-tripleo-heat-templates/environments/puppet-pacemaker.yaml -e /usr/share/openstack-tripleo-heat-templates/environments/network-isolation.yaml -e $TRIPLEO_ROOT/tripleo-ci/test-environments/network-templates/network-environment.yaml -e $TRIPLEO_ROOT/tripleo-ci/test-environments/net-iso.yaml"
|
||||
NETISO_V4=1
|
||||
PACEMAKER=1
|
||||
PREDICTABLE_PLACEMENT=1
|
||||
;;
|
||||
nonha)
|
||||
if [[ "${STABLE_RELEASE}" = "mitaka" ]] ; then
|
||||
ENDPOINT_LIST_LOCATION=$TRIPLEO_ROOT/tripleo-ci/test-environments
|
||||
CA_ENVIRONMENT_FILE=inject-trust-anchor.yaml
|
||||
else
|
||||
ENDPOINT_LIST_LOCATION=/usr/share/openstack-tripleo-heat-templates/environments
|
||||
CA_ENVIRONMENT_FILE=inject-trust-anchor-hiera.yaml
|
||||
fi
|
||||
OVERCLOUD_DEPLOY_ARGS="$OVERCLOUD_DEPLOY_ARGS -e $TRIPLEO_ROOT/tripleo-ci/test-environments/enable-tls.yaml -e $ENDPOINT_LIST_LOCATION/tls-endpoints-public-ip.yaml -e $TRIPLEO_ROOT/tripleo-ci/test-environments/$CA_ENVIRONMENT_FILE --ceph-storage-scale 1 -e /usr/share/openstack-tripleo-heat-templates/environments/storage-environment.yaml"
|
||||
INTROSPECT=1
|
||||
NODECOUNT=3
|
||||
UNDERCLOUD_SSL=1
|
||||
UNDERCLOUD_TELEMETRY=1
|
||||
UNDERCLOUD_UI=1
|
||||
UNDERCLOUD_VALIDATIONS=1
|
||||
;;
|
||||
containers)
|
||||
CONTAINERS=1
|
||||
UNDERCLOUD_CONTAINERS=1
|
||||
OVERCLOUD_DEPLOY_ARGS="$OVERCLOUD_DEPLOY_ARGS \
|
||||
-e /usr/share/openstack-tripleo-heat-templates/environments/docker.yaml \
|
||||
-e /usr/share/openstack-tripleo-heat-templates/environments/docker-network.yaml \
|
||||
-e ~/containers-default-parameters.yaml"
|
||||
;;
|
||||
ovb)
|
||||
OVB=1
|
||||
|
||||
# The test env broker needs to know the instanceid of the this node so it can attach it to the provisioning network
|
||||
UCINSTANCEID=$(http_proxy= curl http://169.254.169.254/openstack/2015-10-15/meta_data.json | python -c 'import json, sys; print json.load(sys.stdin)["uuid"]')
|
||||
;;
|
||||
ipv6)
|
||||
NETISO_V4=0
|
||||
NETISO_V6=1
|
||||
OVERCLOUD_DEPLOY_ARGS="$OVERCLOUD_DEPLOY_ARGS -e /usr/share/openstack-tripleo-heat-templates/environments/network-isolation-v6.yaml -e $TRIPLEO_ROOT/tripleo-ci/test-environments/ipv6-network-templates/network-environment.yaml"
|
||||
;;
|
||||
convergence)
|
||||
UNDERCLOUD_HEAT_CONVERGENCE=1
|
||||
;;
|
||||
multinode)
|
||||
MULTINODE=1
|
||||
TOCIRUNNER="./toci_instack_osinfra.sh"
|
||||
OSINFRA=1
|
||||
UNDERCLOUD_SSL=0
|
||||
INTROSPECT=0
|
||||
SUBNODES_SSH_KEY=/etc/nodepool/id_rsa
|
||||
OVERCLOUD_DEPLOY_ARGS="--libvirt-type=qemu -t $OVERCLOUD_DEPLOY_TIMEOUT"
|
||||
|
||||
if [[ "$TOCI_JOBTYPE" =~ "3nodes" ]]; then
|
||||
NODECOUNT=2
|
||||
PACEMAKER=1
|
||||
OVERCLOUD_ROLES="ControllerApi Controller"
|
||||
export ControllerApi_hosts=$(sed -n 1,1p /etc/nodepool/sub_nodes)
|
||||
export Controller_hosts=$(sed -n 2,2p /etc/nodepool/sub_nodes)
|
||||
OVERCLOUD_DEPLOY_ARGS="$OVERCLOUD_DEPLOY_ARGS -e /usr/share/openstack-tripleo-heat-templates/environments/puppet-pacemaker.yaml -e /usr/share/openstack-tripleo-heat-templates/environments/deployed-server-environment.yaml -e $TRIPLEO_ROOT/tripleo-ci/test-environments/multinode-3nodes.yaml --compute-scale 0 --overcloud-ssh-user $OVERCLOUD_SSH_USER --validation-errors-nonfatal -r /usr/share/openstack-tripleo-heat-templates/ci/environments/multinode-3nodes.yaml"
|
||||
else
|
||||
NODECOUNT=1
|
||||
CONTROLLER_HOSTS=$(sed -n 1,1p /etc/nodepool/sub_nodes)
|
||||
OVERCLOUD_DEPLOY_ARGS="$OVERCLOUD_DEPLOY_ARGS -e /usr/share/openstack-tripleo-heat-templates/environments/deployed-server-environment.yaml -e $MULTINODE_ENV_PATH --compute-scale 0 --overcloud-ssh-user $OVERCLOUD_SSH_USER --validation-errors-nonfatal"
|
||||
fi
|
||||
|
||||
if [ "$STABLE_RELEASE" = "newton" ]; then
|
||||
BOOTSTRAP_SUBNODES_MINIMAL=0
|
||||
else
|
||||
BOOTSTRAP_SUBNODES_MINIMAL=1
|
||||
OVERCLOUD_DEPLOY_ARGS="$OVERCLOUD_DEPLOY_ARGS -e /usr/share/openstack-tripleo-heat-templates/environments/deployed-server-bootstrap-environment-centos.yaml "
|
||||
fi
|
||||
;;
|
||||
undercloud)
|
||||
TOCIRUNNER="./toci_instack_osinfra.sh"
|
||||
NODECOUNT=0
|
||||
OVERCLOUD=0
|
||||
OSINFRA=1
|
||||
RUN_PING_TEST=0
|
||||
UNDERCLOUD_SSL=0
|
||||
INTROSPECT=0
|
||||
UNDERCLOUD_SSL=1
|
||||
UNDERCLOUD_TELEMETRY=1
|
||||
UNDERCLOUD_UI=1
|
||||
UNDERCLOUD_VALIDATIONS=1
|
||||
export UNDERCLOUD_SANITY_CHECK=1
|
||||
;;
|
||||
periodic)
|
||||
export DELOREAN_REPO_URL=http://trunk.rdoproject.org/centos7/consistent
|
||||
CACHEUPLOAD=1
|
||||
OVERCLOUD_PINGTEST_ARGS=
|
||||
;;
|
||||
mitaka)
|
||||
# This is handled in tripleo.sh (it always uses centos7-$STABLE_RELEASE/current)
|
||||
# where $STABLE_RELEASE is derived in toci_instack.sh
|
||||
unset DELOREAN_REPO_URL
|
||||
;;
|
||||
tempest)
|
||||
export RUN_TEMPEST_TESTS=1
|
||||
export RUN_PING_TEST=0
|
||||
;;
|
||||
oooq)
|
||||
export OOOQ=1
|
||||
if [[ "$TOCI_JOBTYPE" =~ "multinode" ]]; then
|
||||
TOCIRUNNER="./toci_instack_oooq_multinode.sh"
|
||||
else
|
||||
TOCIRUNNER="./toci_instack_oooq.sh"
|
||||
fi
|
||||
PREDICTABLE_PLACEMENT=0
|
||||
POSTCI=0
|
||||
;;
|
||||
fakeha)
|
||||
NODECOUNT=2
|
||||
# In ci our overcloud nodes don't have access to an external network
|
||||
# --ntp-server is here to make the deploy command happy, the ci env
|
||||
# is on virt so the clocks should be in sync without it.
|
||||
OVERCLOUD_DEPLOY_ARGS="$OVERCLOUD_DEPLOY_ARGS --control-scale 1 --ntp-server 0.centos.pool.ntp.org -e /usr/share/openstack-tripleo-heat-templates/environments/puppet-pacemaker.yaml -e /usr/share/openstack-tripleo-heat-templates/environments/network-isolation.yaml -e $TRIPLEO_ROOT/tripleo-ci/test-environments/network-templates/network-environment.yaml -e $TRIPLEO_ROOT/tripleo-ci/test-environments/net-iso.yaml"
|
||||
NETISO_V4=1
|
||||
PACEMAKER=1
|
||||
;;
|
||||
caserver)
|
||||
OVERCLOUD_DEPLOY_ARGS="$OVERCLOUD_DEPLOY_ARGS -e /usr/share/openstack-tripleo-heat-templates/environments/services/haproxy-public-tls-certmonger.yaml -e /usr/share/openstack-tripleo-heat-templates/environments/tls-everywhere-endpoints-dns.yaml -e /usr/share/openstack-tripleo-heat-templates/environments/enable-internal-tls.yaml"
|
||||
# This is created in scripts/deploy.sh as part of the CA_SERVER
|
||||
# section
|
||||
OVERCLOUD_DEPLOY_ARGS="$OVERCLOUD_DEPLOY_ARGS -e $TRIPLEO_ROOT/cloud-names.yaml"
|
||||
CA_SERVER=1
|
||||
DEPLOY_OVB_EXTRA_NODE=1
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
if [[ $PREDICTABLE_PLACEMENT == 1 ]]; then
|
||||
OVERCLOUD_DEPLOY_ARGS="$OVERCLOUD_DEPLOY_ARGS -e $TRIPLEO_ROOT/tripleo-ci/test-environments/ips-from-pool-all.yaml -e $TRIPLEO_ROOT/tripleo-ci/test-environments/hostname-map.yaml -e $TRIPLEO_ROOT/tripleo-ci/test-environments/scheduler-hints.yaml"
|
||||
fi
|
||||
# Limit worker counts to avoid overloading our limited resources
|
||||
if [[ "${STABLE_RELEASE}" = "mitaka" ]] ; then
|
||||
OVERCLOUD_DEPLOY_ARGS="$OVERCLOUD_DEPLOY_ARGS -e $TRIPLEO_ROOT/tripleo-ci/test-environments/worker-config-mitaka-and-below.yaml"
|
||||
elif [[ "${OVERCLOUD_MAJOR_UPGRADE}" == "1" ]]; then
|
||||
OVERCLOUD_DEPLOY_ARGS="$OVERCLOUD_DEPLOY_ARGS -e /usr/share/openstack-tripleo-heat-templates/environments/low-memory-usage.yaml"
|
||||
else
|
||||
OVERCLOUD_DEPLOY_ARGS="$OVERCLOUD_DEPLOY_ARGS -e $TRIPLEO_ROOT/tripleo-ci/test-environments/worker-config.yaml -e /usr/share/openstack-tripleo-heat-templates/environments/low-memory-usage.yaml"
|
||||
fi
|
||||
# If we're running an update job, regenerate the args to reflect the above changes
|
||||
if [ -n "$OVERCLOUD_UPDATE_ARGS" ]; then
|
||||
OVERCLOUD_UPDATE_ARGS="-e /usr/share/openstack-tripleo-heat-templates/overcloud-resource-registry-puppet.yaml $OVERCLOUD_DEPLOY_ARGS"
|
||||
fi
|
||||
|
||||
TIMEOUT_SECS=$((DEVSTACK_GATE_TIMEOUT*60))
|
||||
# ./testenv-client kill everything in its own process group it it hits a timeout
|
||||
# run it in a separate group to avoid getting killed along with it
|
||||
set -m
|
||||
|
||||
# install moreutils for timestamping postci.log with ts
|
||||
# This comes from epel, so we need to install it before removing that repo
|
||||
sudo yum install -y moreutils
|
||||
|
||||
# Ensure epel-release is not installed
|
||||
sudo yum erase -y epel-release || :
|
||||
|
||||
if [ "$DEPLOY_OVB_EXTRA_NODE" = '1' ]; then
|
||||
# This is usually done in the undercloud install, but we need it at this
|
||||
# point since we want access to the extra node
|
||||
ssh-keygen -t rsa -N '' -f ~/.ssh/id_rsa
|
||||
SSH_KEY="$(cat ~/.ssh/id_rsa.pub)"
|
||||
TEST_ENV_EXTRA_ARGS=("--create-undercloud" "--ssh-key" "$SSH_KEY")
|
||||
else
|
||||
TEST_ENV_EXTRA_ARGS=()
|
||||
fi
|
||||
|
||||
source $TRIPLEO_ROOT/tripleo-ci/scripts/metrics.bash
|
||||
start_metric "tripleo.testenv.${TOCI_JOBTYPE}.wait.seconds"
|
||||
if [ -z "${TE_DATAFILE:-}" -a "$OSINFRA" = "0" ] ; then
|
||||
# NOTE(pabelanger): We need gear for testenv, but this really should be
|
||||
# handled by tox.
|
||||
sudo pip install gear
|
||||
# Kill the whole job if it doesn't get a testenv in 20 minutes as it likely will timout in zuul
|
||||
( sleep 1200 ; [ ! -e /tmp/toci.started ] && sudo kill -9 $$ ) &
|
||||
|
||||
# TODO(bnemec): Add jobs that use public-bond
|
||||
NETISO_ENV="none"
|
||||
if [ $NETISO_V4 -eq 1 -o $NETISO_V6 -eq 1 ]; then
|
||||
NETISO_ENV="multi-nic"
|
||||
fi
|
||||
if [ ${#TEST_ENV_EXTRA_ARGS[@]} -eq 0 ]; then
|
||||
./testenv-client -b $GEARDSERVER:4730 -t $TIMEOUT_SECS \
|
||||
--envsize $NODECOUNT --ucinstance $UCINSTANCEID \
|
||||
--net-iso $NETISO_ENV -- $TOCIRUNNER
|
||||
else
|
||||
./testenv-client -b $GEARDSERVER:4730 -t $TIMEOUT_SECS \
|
||||
--envsize $NODECOUNT --ucinstance $UCINSTANCEID \
|
||||
--net-iso $NETISO_ENV "${TEST_ENV_EXTRA_ARGS[@]}" -- $TOCIRUNNER
|
||||
fi
|
||||
else
|
||||
$TOCIRUNNER
|
||||
fi
|
1
toci_gate_test.sh
Symbolic link
1
toci_gate_test.sh
Symbolic link
@ -0,0 +1 @@
|
||||
toci_gate_test-oooq.sh
|
85
toci_quickstart.sh
Executable file
85
toci_quickstart.sh
Executable file
@ -0,0 +1,85 @@
|
||||
#!/usr/bin/env bash
|
||||
set -eux
|
||||
set -o pipefail
|
||||
export ANSIBLE_NOCOLOR=1
|
||||
|
||||
LOCAL_WORKING_DIR="$WORKSPACE/.quickstart"
|
||||
WORKING_DIR="$HOME"
|
||||
LOGS_DIR=$WORKSPACE/logs
|
||||
QUICKSTART_INSTALL_TIMEOUT=$((DEVSTACK_GATE_TIMEOUT-10))
|
||||
|
||||
|
||||
## Signal to toci_gate_test.sh we've started by
|
||||
touch /tmp/toci.started
|
||||
|
||||
export DEFAULT_ARGS="
|
||||
--no-clone
|
||||
--working-dir $LOCAL_WORKING_DIR
|
||||
--retain-inventory
|
||||
--ansible-debug
|
||||
--teardown none
|
||||
--extra-vars tripleo_root=$TRIPLEO_ROOT
|
||||
--extra-vars working_dir=$WORKING_DIR
|
||||
--extra-vars validation_args='--validation-errors-nonfatal'
|
||||
--release tripleo-ci/${STABLE_RELEASE:-master}
|
||||
"
|
||||
|
||||
# --install-deps arguments installs deps and then quits, no other arguments are
|
||||
# processed.
|
||||
QUICKSTART_PREPARE_CMD="
|
||||
./quickstart.sh
|
||||
--install-deps
|
||||
"
|
||||
|
||||
QUICKSTART_INSTALL_CMD="
|
||||
./quickstart.sh
|
||||
--bootstrap
|
||||
--tags $TAGS
|
||||
$DEFAULT_ARGS
|
||||
$NODES_ARGS
|
||||
$FEATURESET_CONF
|
||||
$EXTRA_VARS
|
||||
--playbook $PLAYBOOK
|
||||
$UNDERCLOUD
|
||||
"
|
||||
|
||||
QUICKSTART_COLLECTLOGS_CMD="
|
||||
./quickstart.sh
|
||||
$DEFAULT_ARGS
|
||||
$EXTRA_VARS
|
||||
--extra-vars @$COLLECT_CONF
|
||||
--tags all
|
||||
$NODES_ARGS
|
||||
$FEATURESET_CONF
|
||||
--playbook collect-logs.yml
|
||||
--extra-vars artcl_collect_dir=$LOGS_DIR
|
||||
$UNDERCLOUD
|
||||
"
|
||||
mkdir -p $LOCAL_WORKING_DIR
|
||||
# TODO(gcerami) parametrize hosts
|
||||
cp $TRIPLEO_ROOT/tripleo-ci/toci-quickstart/config/testenv/${ENVIRONMENT}_hosts $LOCAL_WORKING_DIR/hosts
|
||||
cp $TRIPLEO_ROOT/tripleo-ci/toci-quickstart/playbooks/* $TRIPLEO_ROOT/tripleo-quickstart/playbooks/
|
||||
|
||||
pushd $TRIPLEO_ROOT/tripleo-quickstart/
|
||||
|
||||
$QUICKSTART_PREPARE_CMD
|
||||
|
||||
# Save time for log collection
|
||||
/usr/bin/timeout --preserve-status ${QUICKSTART_INSTALL_TIMEOUT}m $QUICKSTART_INSTALL_CMD \
|
||||
2>&1 | tee $LOGS_DIR/quickstart_install.log && exit_value=0 || exit_value=$?
|
||||
|
||||
## LOGS COLLECTION
|
||||
|
||||
# workaround to stop collecting same host twice
|
||||
sed -i 's/hosts: all:!localhost/hosts: all:!localhost:!127.0.0.2/' $LOCAL_WORKING_DIR/playbooks/collect-logs.yml || true
|
||||
|
||||
$QUICKSTART_COLLECTLOGS_CMD \
|
||||
> $LOGS_DIR/quickstart_collect_logs.log || \
|
||||
echo "WARNING: quickstart collect-logs failed, check quickstart_collectlogs.log for details"
|
||||
|
||||
export ARA_DATABASE="sqlite:///$LOCAL_WORKING_DIR/ara.sqlite"
|
||||
$LOCAL_WORKING_DIR/bin/ara generate $LOGS_DIR/ara || true
|
||||
popd
|
||||
|
||||
echo 'Quickstart completed.'
|
||||
exit $exit_value
|
Loading…
Reference in New Issue
Block a user