Migrate dsvm jobs to use GBP devstck plugin
Change-Id: I2c5ab78afeb1852723f5a2115737a0cbf489a844
(cherry picked from commit d469e4431f
)
This commit is contained in:
parent
28b302347a
commit
577b7b3b40
|
@ -0,0 +1,35 @@
|
|||
[[local|localrc]]
|
||||
DATABASE_PASSWORD=abc123
|
||||
ADMIN_PASSWORD=abc123
|
||||
MYSQL_PASSWORD=$DATABASE_PASSWORD
|
||||
RABBIT_PASSWORD=abc123
|
||||
SERVICE_PASSWORD=$ADMIN_PASSWORD
|
||||
SERVICE_TOKEN=abc123
|
||||
|
||||
# Using group-policy branches
|
||||
# ---------------------------
|
||||
|
||||
#GIT_BASE=${GIT_BASE:-git://git.openstack.org}
|
||||
|
||||
#GBPSERVICE_REPO=https://review.openstack.org/openstack/group-based-policy
|
||||
#GBPSERVICE_BRANCH=refs/changes/54/240954/47
|
||||
|
||||
#GBPCLIENT_REPO=https://review.openstack.org/openstack/python-group-based-policy-client
|
||||
#GBPCLIENT_BRANCH=refs/changes/55/435155/1
|
||||
|
||||
#GBPUI_REPO=https://review.openstack.org/openstack/group-based-policy-ui
|
||||
#GBPUI_BRANCH=refs/changes/02/136802/14
|
||||
|
||||
#GBPHEAT_REPO=
|
||||
#GBPHEAT_BRANCH=
|
||||
|
||||
LOG_COLOR=False
|
||||
DEST=/opt/stack/new
|
||||
SCREEN_LOGDIR=$DEST/logs/screen
|
||||
LOGFILE=$DEST/logs/stack.sh.log
|
||||
|
||||
SKIP_EXERCISES=volumes,trove,swift,sahara,euca,bundle,boot_from_volume,aggregates,zaqar,client-env,client-args,sec_groups,neutron-adv-test,floating_ips,horizon
|
||||
|
||||
enable_plugin group-based-policy https://github.com/openstack/group-based-policy.git master
|
||||
|
||||
ENABLE_GBP_GATE=True
|
|
@ -107,8 +107,13 @@ if is_service_enabled group-policy; then
|
|||
|
||||
elif [[ "$1" == "stack" && "$2" == "post-config" ]]; then
|
||||
echo_summary "Configuring $GBP"
|
||||
[[ $ENABLE_APIC_AIM_GATE = False ]] && gbp_configure_nova
|
||||
[[ $ENABLE_APIC_AIM_GATE = False ]] && gbp_configure_heat
|
||||
# REVIST Ideally, we should be configuring nova, heat and UI as well for GBP in the
|
||||
# GBP devstack gate job. However, contrary to the documentation, this block
|
||||
# of code is not being invoked by devstack after the nova, heat and
|
||||
# dashboard config files have been created. Once this is sorted out, the
|
||||
# ENABLE_GBP_GATE variable can be eliminated.
|
||||
[[ $ENABLE_GBP_GATE = False && $ENABLE_APIC_AIM_GATE = False ]] && gbp_configure_nova
|
||||
[[ $ENABLE_GBP_GATE = False && $ENABLE_APIC_AIM_GATE = False ]] && gbp_configure_heat
|
||||
gbp_configure_neutron
|
||||
|
||||
if [[ $ENABLE_NSX_POLICY = True ]]; then
|
||||
|
@ -130,11 +135,11 @@ if is_service_enabled group-policy; then
|
|||
[[ $ENABLE_NFP = True ]] && install_nfpgbpservice
|
||||
init_gbpservice
|
||||
[[ $ENABLE_NFP = True ]] && init_nfpgbpservice
|
||||
[[ $ENABLE_APIC_AIM_GATE = False ]] && install_gbpheat
|
||||
[[ $ENABLE_APIC_AIM_GATE = False ]] && install_gbpui
|
||||
[[ $ENABLE_GBP_GATE = False && $ENABLE_APIC_AIM_GATE = False ]] && install_gbpheat
|
||||
[[ $ENABLE_GBP_GATE = False && $ENABLE_APIC_AIM_GATE = False ]] && install_gbpui
|
||||
[[ $ENABLE_APIC_AIM = True || $ENABLE_APIC_AIM_GATE = True ]] && configure_apic_aim
|
||||
[[ $ENABLE_APIC_AIM_GATE = False ]] && stop_apache_server
|
||||
[[ $ENABLE_APIC_AIM_GATE = False ]] && start_apache_server
|
||||
[[ $ENABLE_GBP_GATE = False && $ENABLE_APIC_AIM_GATE = False ]] && stop_apache_server
|
||||
[[ $ENABLE_GBP_GATE = False && $ENABLE_APIC_AIM_GATE = False ]] && start_apache_server
|
||||
elif [[ "$1" == "stack" && "$2" == "extra" ]]; then
|
||||
echo_summary "Initializing $GBP"
|
||||
if [[ $ENABLE_NFP = True ]]; then
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
# Make sure the plugin name in local.conf is "group-based-policy", as in: enable_plugin group-based-policy <remote> <branch>
|
||||
source $DEST/group-based-policy/devstack/lib/group-based-policy
|
||||
|
||||
ENABLE_GBP_GATE=${ENABLE_GBP_GATE:-False}
|
||||
ENABLE_APIC_AIM=${ENABLE_APIC_AIM:-False}
|
||||
ENABLE_APIC_AIM_GATE=${ENABLE_APIC_AIM_GATE:-False}
|
||||
[[ $ENABLE_APIC_AIM = True ]] && source $DEST/group-based-policy/devstack/lib/apic_aim
|
||||
|
@ -15,7 +16,7 @@ ConfiguratorQcow2Image=${ConfiguratorQcow2Image:-build}
|
|||
|
||||
# Enable necessary Neutron plugins, including group_policy and ncp (L3
|
||||
# is set via ML2_L3_PLUGIN, so isn't listed here).
|
||||
Q_SERVICE_PLUGIN_CLASSES=group_policy,ncp
|
||||
_neutron_service_plugin_class_add "group_policy,ncp"
|
||||
|
||||
# Preferred git mirror
|
||||
GIT_BASE=${GIT_BASE:-https://git.openstack.org}
|
||||
|
|
|
@ -34,6 +34,8 @@ source $TOP_DIR/openrc demo demo
|
|||
# an error. It is also useful for following allowing as the install occurs.
|
||||
set -o xtrace
|
||||
|
||||
ACTIVE_TIMEOUT=120
|
||||
|
||||
function confirm_server_active {
|
||||
local VM_UUID=$1
|
||||
if ! timeout $ACTIVE_TIMEOUT sh -c "while ! nova show $VM_UUID | grep status | grep -q ACTIVE; do sleep 1; done"; then
|
||||
|
|
|
@ -42,7 +42,7 @@ if [ -z "$EXT_NET_ID" ] ; then
|
|||
EXT_SUBNET_ID=$(neutron subnet-create --ip_version 4 --gateway 172.16.73.1 --name public-subnet $EXT_NET_ID 172.16.73.0/24 | grep ' id ' | get_field 2)
|
||||
EXT_NET_TO_BE_CLEANED_UP=true
|
||||
else
|
||||
EXT_SUBNET_ID=$(neutron net-show $EXT_NET_ID | grep subnets | awk '{print $4}' )
|
||||
EXT_SUBNET_ID=$(neutron subnet-show public-subnet -c id | grep id | awk '{print $4}' )
|
||||
fi
|
||||
|
||||
die_if_not_set $LINENO EXT_SUBNET_ID "Failure creating external network"
|
||||
|
|
|
@ -69,7 +69,7 @@ set +o xtrace
|
|||
source $TOP_DIR/openrc admin admin
|
||||
set -o xtrace
|
||||
EXT_NET_ID=$(neutron net-create mgmt_out --router:external=True --shared | grep ' id ' | awk '{print $4}')
|
||||
EXT_SUBNET_ID=$(neutron subnet-create --ip_version 4 --gateway 172.16.73.1 --name public-subnet $EXT_NET_ID 172.16.73.0/24 | grep ' id ' | awk '{print $4}')
|
||||
EXT_SUBNET_ID=$(neutron subnet-create --ip_version 4 --gateway 172.16.73.1 --disable-dhcp --name gbp-public-subnet $EXT_NET_ID 172.16.73.0/24 | grep ' id ' | awk '{print $4}')
|
||||
openstack project list
|
||||
DEMO_PROJECT_ID=$(openstack project show demo | grep "[^a-zA-Z_\d]id[^a-zA-Z_\d]" | awk '{print $4}')
|
||||
|
||||
|
@ -98,7 +98,7 @@ die_if_not_set $LINENO PURGE_OUTPUT "Failure purging GBP resources"
|
|||
set +o xtrace
|
||||
source $TOP_DIR/openrc admin admin
|
||||
set -o xtrace
|
||||
neutron subnet-delete public-subnet
|
||||
neutron subnet-delete gbp-public-subnet
|
||||
neutron net-delete mgmt_out
|
||||
|
||||
check_residual_resources demo demo
|
||||
|
|
|
@ -13,22 +13,39 @@ GBP_FUNC_DIR=$GBP_DIR/gbpservice/tests/contrib/gbpfunctests
|
|||
|
||||
XTRACE=$(set +o | grep xtrace)
|
||||
|
||||
function prepare_gbp_devstack {
|
||||
function prepare_gbp_devstack_pre {
|
||||
cd $TOP_DIR
|
||||
sudo git checkout stable/ocata
|
||||
sudo cp $CONTRIB_DIR/devstack/local.conf $TOP_DIR/local.conf
|
||||
sudo cp $CONTRIB_DIR/functions-gbp $TOP_DIR/exercises/
|
||||
sudo cp $CONTRIB_DIR/devstack/exercises/*.sh $TOP_DIR/exercises/
|
||||
sudo cp $CONTRIB_DIR/devstack/lib/* $TOP_DIR/lib/
|
||||
sudo cp -r $CONTRIB_DIR/devstack/gbp-templates $TOP_DIR
|
||||
sudo sed -i 's/DEST=\/opt\/stack/DEST=\/opt\/stack\/new/g' $TOP_DIR/stackrc
|
||||
sudo sed -i 's/source $TOP_DIR\/lib\/neutron/source $TOP_DIR\/lib\/neutron\nsource $TOP_DIR\/lib\/gbp/g' $TOP_DIR/stack.sh
|
||||
sudo sed -i 's/# Extras Configuration/install_gbpclient\ninstall_gbpservice\ninit_gbpservice\n# Extras Configuration/g' $TOP_DIR/stack.sh
|
||||
sudo sed -i 's/create_neutron_initial_network//g' $TOP_DIR/stack.sh
|
||||
sudo sed -i 's/source $TOP_DIR\/lib\/neutron/source $TOP_DIR\/lib\/neutron\nsource $TOP_DIR\/lib\/neutron-legacy/g' $TOP_DIR/stack.sh
|
||||
}
|
||||
|
||||
function prepare_gbp_devstack_post {
|
||||
# The following should updated when master moves to a new release
|
||||
# We need to do the following since the infra job clones these repos and
|
||||
# checks out the master branch (as this is the master branch) and later
|
||||
# does not switch to the stable/ocata branch when installing devstack
|
||||
# since the repo is already present.
|
||||
# This can be worked around by changing the job description in
|
||||
# project-config to set BRANCH_OVERRIDE to use the stable/ocata branch
|
||||
sudo git --git-dir=/opt/stack/new/neutron/.git --work-tree=/opt/stack/new/neutron checkout stable/ocata
|
||||
sudo git --git-dir=/opt/stack/new/nova/.git --work-tree=/opt/stack/new/nova checkout stable/ocata
|
||||
sudo git --git-dir=/opt/stack/new/keystone/.git --work-tree=/opt/stack/new/keystone checkout stable/ocata
|
||||
sudo git --git-dir=/opt/stack/new/cinder/.git --work-tree=/opt/stack/new/cinder checkout stable/ocata
|
||||
sudo git --git-dir=/opt/stack/new/requirements/.git --work-tree=/opt/stack/new/requirements checkout stable/ocata
|
||||
|
||||
source $TOP_DIR/functions
|
||||
source $TOP_DIR/functions-common
|
||||
}
|
||||
|
||||
function prepare_gbp_devstack {
|
||||
prepare_gbp_devstack_pre
|
||||
sudo mv $GBP_DIR/devstack/local-gbp.conf $TOP_DIR/local.conf
|
||||
sudo cp -r $CONTRIB_DIR/devstack/gbp-templates $TOP_DIR
|
||||
sudo cp $CONTRIB_DIR/devstack/exercises/*.sh $TOP_DIR/exercises/
|
||||
prepare_gbp_devstack_post
|
||||
}
|
||||
|
||||
function prepare_nfp_devstack {
|
||||
cd $TOP_DIR
|
||||
sudo cp $CONTRIB_DIR/devstack/local-nfp.conf $TOP_DIR/local.conf
|
||||
|
@ -44,31 +61,14 @@ function prepare_nfp_devstack {
|
|||
}
|
||||
|
||||
function prepare_gbp_aim_devstack {
|
||||
cd $TOP_DIR
|
||||
sudo git checkout stable/ocata
|
||||
prepare_gbp_devstack_pre
|
||||
sudo cp $CONTRIB_DIR/devstack/local-aim.conf $TOP_DIR/local.conf
|
||||
sudo cp $CONTRIB_DIR/devstack/exercises-aim/gbp_aim.sh $TOP_DIR/exercises/
|
||||
sudo sed -i 's/DEST=\/opt\/stack/DEST=\/opt\/stack\/new/g' $TOP_DIR/stackrc
|
||||
sudo sed -i 's/source $TOP_DIR\/lib\/neutron/source $TOP_DIR\/lib\/neutron\nsource $TOP_DIR\/lib\/neutron-legacy/g' $TOP_DIR/stack.sh
|
||||
# Use the aim version of the shared PRS test
|
||||
sudo mv $GBP_FUNC_DIR/testcases/tc_gbp_prs_pr_shared_func.py.aim $GBP_FUNC_DIR/testcases/tc_gbp_prs_pr_shared_func.py
|
||||
sudo mv $GBP_FUNC_DIR/testcases/tc_gbp_prs_func.py.aim $GBP_FUNC_DIR/testcases/tc_gbp_prs_func.py
|
||||
# The following should updated when master moves to a new release
|
||||
# We need to do the following since the infra job clones these repos and
|
||||
# checks out the master branch (as this is the master branch) and later
|
||||
# does not switch to the stable/ocata branch when installing devstack
|
||||
# since the repo is already present.
|
||||
# This can be worked around by changing the job description in
|
||||
# project-config to set BRANCH_OVERRIDE to use the stable/ocata branch
|
||||
sudo git --git-dir=/opt/stack/new/neutron/.git --work-tree=/opt/stack/new/neutron checkout stable/ocata
|
||||
sudo git --git-dir=/opt/stack/new/nova/.git --work-tree=/opt/stack/new/nova checkout stable/ocata
|
||||
sudo git --git-dir=/opt/stack/new/keystone/.git --work-tree=/opt/stack/new/keystone checkout stable/ocata
|
||||
sudo git --git-dir=/opt/stack/new/cinder/.git --work-tree=/opt/stack/new/cinder checkout stable/ocata
|
||||
sudo git --git-dir=/opt/stack/new/requirements/.git --work-tree=/opt/stack/new/requirements checkout stable/ocata
|
||||
export ENABLED_SERVICES="key,rabbit,mysql"
|
||||
|
||||
source $TOP_DIR/functions
|
||||
source $TOP_DIR/functions-common
|
||||
prepare_gbp_devstack_post
|
||||
}
|
||||
|
||||
function source_creds {
|
||||
|
|
|
@ -12,6 +12,13 @@ sudo pip show neutron-lib
|
|||
sudo git --git-dir=/opt/stack/new/group-based-policy/.git --work-tree=/opt/stack/new/group-based-policy show --name-only
|
||||
sudo git --git-dir=/opt/stack/new/group-based-policy/.git --work-tree=/opt/stack/new/group-based-policy status
|
||||
|
||||
# The following is added to get past the error:
|
||||
# "publicURL endpoint for compute service in RegionOne region not found"
|
||||
# when trying to launch a VM in the exercise scripts
|
||||
sudo /bin/systemctl restart memcached
|
||||
|
||||
sudo chown -R stack:stack $TOP_DIR
|
||||
|
||||
# Run exercise scripts
|
||||
$TOP_DIR/exercise.sh
|
||||
exercises_exit_code=$?
|
||||
|
|
Loading…
Reference in New Issue