Add grenade job

Depends-On: https://review.openstack.org/632404
Change-Id: I54b191faf9c2ddedfd574121f59bf7cc45faa90f
This commit is contained in:
zhurong 2019-01-22 13:51:42 +08:00
parent 4397025f56
commit f2ade017d4
7 changed files with 261 additions and 0 deletions

View File

@ -15,6 +15,7 @@
- murano-rally-task
- murano-tempest-api
- murano-tempest-cfapi
- murano-grenade
gate:
queue: murano
jobs:
@ -109,3 +110,27 @@
devstack_services:
murano-cfapi: true
tempest_test_regex: service_broker
- job:
name: murano-grenade
parent: legacy-dsvm-base
timeout: 10800
voting: false
run: playbooks/legacy/grenade-devstack-murano/run.yaml
post-run: playbooks/legacy/grenade-devstack-murano/post.yaml
irrelevant-files:
- ^(test-|)requirements.txt$
- ^setup.cfg$
- ^doc/.*$
- ^.*\.rst$
- ^releasenotes/.*$
- ^murano/tests/.*$
required-projects:
- openstack-dev/grenade
- openstack-infra/devstack-gate
- openstack/heat
- openstack/murano
- openstack/murano-dashboard
- openstack/python-heatclient
- openstack/python-muranoclient
- openstack/murano-tempest-plugin

50
devstack/upgrade/resources.sh Executable file
View File

@ -0,0 +1,50 @@
#!/bin/bash
set -o errexit
source $GRENADE_DIR/grenaderc
source $GRENADE_DIR/functions
source $TOP_DIR/openrc admin demo
set -o xtrace
function create {
# add later
:
}
function verify_noapi {
# currently no good way
:
}
function verify {
# add later
:
}
function destroy {
# add later
:
}
# Dispatcher
case $1 in
"create")
create
;;
"verify_noapi")
verify_noapi
;;
"verify")
verify
;;
"destroy")
destroy
;;
"force_destroy")
set +o errexit
destroy
;;
esac

11
devstack/upgrade/settings Normal file
View File

@ -0,0 +1,11 @@
register_project_for_upgrade murano
register_db_to_save murano
devstack_localrc base enable_plugin murano https://git.openstack.org/openstack/murano
devstack_localrc target enable_plugin murano https://git.openstack.org/openstack/murano
devstack_localrc base enable_service murano-api murano-engine
devstack_localrc target enable_service murano-api murano-engine
BASE_RUN_SMOKE=False
TARGET_RUN_SMOKE=False

23
devstack/upgrade/shutdown.sh Executable file
View File

@ -0,0 +1,23 @@
#!/bin/bash
set -o errexit
source $GRENADE_DIR/grenaderc
source $GRENADE_DIR/functions
# We need base DevStack functions for this
source $BASE_DEVSTACK_DIR/functions
source $BASE_DEVSTACK_DIR/stackrc # needed for status directory
source $BASE_DEVSTACK_DIR/lib/tls
source $BASE_DEVSTACK_DIR/lib/apache
MURANO_DEVSTACK_DIR=$(dirname $(dirname $0))
source $MURANO_DEVSTACK_DIR/settings
source $MURANO_DEVSTACK_DIR/plugin.sh
set -o xtrace
stop_murano
# sanity check that service is actually down
ensure_services_stopped murano-api murano-engine

70
devstack/upgrade/upgrade.sh Executable file
View File

@ -0,0 +1,70 @@
#!/usr/bin/env bash
# ``upgrade-murano``
echo "*********************************************************************"
echo "Begin $0"
echo "*********************************************************************"
# Clean up any resources that may be in use
cleanup() {
set +o errexit
echo "********************************************************************"
echo "ERROR: Abort $0"
echo "********************************************************************"
# Kill ourselves to signal any calling process
trap 2; kill -2 $$
}
trap cleanup SIGHUP SIGINT SIGTERM
# Keep track of the grenade directory
RUN_DIR=$(cd $(dirname "$0") && pwd)
# Source params
source $GRENADE_DIR/grenaderc
# Import common functions
source $GRENADE_DIR/functions
# This script exits on an error so that errors don't compound and you see
# only the first error that occurred.
set -o errexit
# Upgrade murano
# ==============
# Get functions from current DevStack
source $TARGET_DEVSTACK_DIR/stackrc
source $TARGET_DEVSTACK_DIR/lib/apache
source $TARGET_DEVSTACK_DIR/lib/tls
source $(dirname $(dirname $BASH_SOURCE))/settings
source $(dirname $(dirname $BASH_SOURCE))/plugin.sh
# Print the commands being run so that we can see the command that triggers
# an error. It is also useful for following allowing as the install occurs.
set -o xtrace
# Save current config files for posterity
[[ -d $SAVE_DIR/etc.murano ]] || cp -pr $MURANO_CONF_DIR $SAVE_DIR/etc.murano
# Install the target murano
install_murano
# calls upgrade-murano for specific release
upgrade_project murano $RUN_DIR $BASE_DEVSTACK_BRANCH $TARGET_DEVSTACK_BRANCH
# Migrate the database
murano-db-manage upgrade || die $LINO "DB migration error"
start_murano
# Don't succeed unless the services come up
ensure_services_started murano-api murano-engine
set +o xtrace
echo "*********************************************************************"
echo "SUCCESS: End $0"
echo "*********************************************************************"

View File

@ -0,0 +1,15 @@
- hosts: primary
tasks:
- name: Copy files from {{ ansible_user_dir }}/workspace/ on node
synchronize:
src: '{{ ansible_user_dir }}/workspace/'
dest: '{{ zuul.executor.log_root }}'
mode: pull
copy_links: true
verify_host: true
rsync_opts:
- --include=/logs/**
- --include=*/
- --exclude=*
- --prune-empty-dirs

View File

@ -0,0 +1,67 @@
- hosts: all
name: legacy-grenade-dsvm-watcher
tasks:
- name: Ensure legacy workspace directory
file:
path: '{{ ansible_user_dir }}/workspace'
state: directory
- shell:
cmd: |
set -e
set -x
cat > clonemap.yaml << EOF
clonemap:
- name: openstack-infra/devstack-gate
dest: devstack-gate
EOF
/usr/zuul-env/bin/zuul-cloner -m clonemap.yaml --cache-dir /opt/git \
git://git.openstack.org \
openstack-infra/devstack-gate
executable: /bin/bash
chdir: '{{ ansible_user_dir }}/workspace'
environment: '{{ zuul | zuul_legacy_vars }}'
- shell:
cmd: |
set -e
set -x
cat << 'EOF' >>"/tmp/dg-local.conf"
[[local|localrc]]
TEMPEST_PLUGINS='/opt/stack/new/murano-tempest-plugin'
enable_plugin heat git://git.openstack.org/openstack/heat
EOF
executable: /bin/bash
chdir: '{{ ansible_user_dir }}/workspace'
environment: '{{ zuul | zuul_legacy_vars }}'
- shell:
cmd: |
set -e
set -x
export PYTHONUNBUFFERED=true
export DEVSTACK_GATE_TEMPEST_NOTESTS=1
export DEVSTACK_GATE_NEUTRON=1
export PROJECTS="openstack-dev/grenade $PROJECTS"
export PROJECTS="openstack/heat $PROJECTS"
export PROJECTS="openstack/python-heatclient $PROJECTS"
export PROJECTS="openstack/murano $PROJECTS"
export PROJECTS="openstack/murano-dashboard $PROJECTS"
export PROJECTS="openstack/python-muranoclient $PROJECTS"
export PROJECTS="openstack/murano-tempest-plugin $PROJECTS"
export BRANCH_OVERRIDE=default
export GRENADE_PLUGINRC="enable_grenade_plugin murano https://git.openstack.org/openstack/murano"
export DEVSTACK_GATE_GRENADE=pullup
if [ "$BRANCH_OVERRIDE" != "default" ] ; then
export OVERRIDE_ZUUL_BRANCH=$BRANCH_OVERRIDE
fi
cp devstack-gate/devstack-vm-gate-wrap.sh ./safe-devstack-vm-gate-wrap.sh
./safe-devstack-vm-gate-wrap.sh
executable: /bin/bash
chdir: '{{ ansible_user_dir }}/workspace'
environment: '{{ zuul | zuul_legacy_vars }}'