Merge "Add a minimal DevStack job"

This commit is contained in:
Zuul 2018-11-08 18:04:01 +00:00 committed by Gerrit Code Review
commit a3f51f4d11
4 changed files with 88 additions and 42 deletions

View File

@ -8,6 +8,8 @@
- openstack-tox-linters - openstack-tox-linters
- openstack-tox-pep8 - openstack-tox-pep8
- stx-updates-pylint - stx-updates-pylint
- stx-devstack-update:
voting: false
gate: gate:
jobs: jobs:
- build-openstack-releasenotes - build-openstack-releasenotes
@ -26,3 +28,50 @@
- openstack/stx-config - openstack/stx-config
- openstack/stx-fault - openstack/stx-fault
- openstack/stx-integ - openstack/stx-integ
- job:
name: stx-devstack-update
parent: stx-devstack-base
timeout: 7800
required-projects:
- openstack/stx-fault
vars:
tox_envlist: functional
devstack_services:
# Cinder services
c-api: false
c-bak: false
c-sch: false
c-vol: false
cinder: false
# Glance services
g-api: false
g-reg: false
# Nova services
n-api: false
n-api-meta: false
n-cauth: false
n-cond: false
n-cpu: false
n-novnc: false
n-obj: false
n-sch: false
placement-api: false
# Neutron services
q-agt: true
q-dhcp: false
q-l3: false
q-meta: false
q-metering: false
q-svc: false
horizon: false
# StarlingX services
sw-patch: true
tsconfig: true
devstack_plugins:
stx-fault: git://git.starlingx.io/stx-fault
stx-update: git://git.starlingx.io/stx-update
devstack_localrc:
LIBS_FROM_GIT: keystone
files:
- ^devstack/.*

View File

@ -7,19 +7,15 @@
# #
# - ``functions`` file # - ``functions`` file
# - ``DEST``, ``DATA_DIR``, ``STACK_USER`` must be defined # - ``DEST``, ``DATA_DIR``, ``STACK_USER`` must be defined
# - ``SERVICE_{TENANT_NAME|PASSWORD}`` must be defined
# - ``SERVICE_HOST``
# - ``KEYSTONE_TOKEN_FORMAT`` must be defined
# ``stack.sh`` calls the entry points in this order: # ``stack.sh`` calls the entry points in this order:
# #
# - install_tsconfig # - install_update
# - install_XX # - configure_update
# - configure_XX # - init_update
# - init_XX # - start_update
# - start_XX # - stop_update
# - stop_XX # - cleanup_update
# - cleanup_XX
_XTRACE_STX_UPDATE=$(set +o | grep xtrace) _XTRACE_STX_UPDATE=$(set +o | grep xtrace)
set -o xtrace set -o xtrace
@ -30,27 +26,19 @@ set -o xtrace
STXUPDATE_REPO=${STXUPDATE_REPO:-${GIT_BASE}/openstack/stx-update.git} STXUPDATE_REPO=${STXUPDATE_REPO:-${GIT_BASE}/openstack/stx-update.git}
STXUPDATE_DIR=$DEST/stx-update STXUPDATE_DIR=$DEST/stx-update
STXUPDATE_BRANCH=${STXUPDATE_BRANCH:-master}
TSCONFIG_DIR=$STXUPDATE_DIR/tsconfig/
STX_PATCH_DIR=$STXUPDATE_DIR/cgcs-patch/ STX_PATCH_DIR=$STXUPDATE_DIR/cgcs-patch/
TSCONFIG_DIR=$STXUPDATE_DIR/tsconfig/
STX_BIN_DIR=$(get_python_exec_prefix) STX_BIN_DIR=$(get_python_exec_prefix)
PYTHON_SITE_DIR=$(python -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())") PYTHON_SITE_DIR=$(python -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")
function install_tsconfig { function install_sw_patch {
# no setup.cfg in tsconfig, so we can not use pip install -e
# setup_dev_lib "tsconfig"
pushd $TSCONFIG_DIR/tsconfig
sudo python setup.py install --root=/ --install-lib=$PYTHON_SITE_DIR --prefix=/usr --install-data=/usr/share --single-version-externally-managed
popd
sudo install -d -m 755 $STX_BIN_DIR
sudo install -p -D -m 700 $TSCONFIG_DIR/scripts/tsconfig $STX_BIN_DIR/tsconfig
}
function install_patch {
pushd $STX_PATCH_DIR/cgcs-patch pushd $STX_PATCH_DIR/cgcs-patch
sudo python setup.py install --root=/ --install-lib=$PYTHON_SITE_DIR --prefix=/usr --install-data=/usr/share --single-version-externally-managed sudo python setup.py install --root=/ --install-lib=$PYTHON_SITE_DIR --prefix=/usr --install-data=/usr/share --single-version-externally-managed
popd popd
local stx_patch_sbindir=/etc/sbin/
local stx_patch_sbindir=/usr/local/sbin/
local stx_patch_sysconfdir=/etc/ local stx_patch_sysconfdir=/etc/
sudo install -m 755 -d ${stx_patch_sbindir} sudo install -m 755 -d ${stx_patch_sbindir}
sudo install -m 755 -d ${stx_patch_sysconfdir}/bash_completion.d sudo install -m 755 -d ${stx_patch_sysconfdir}/bash_completion.d
@ -63,4 +51,22 @@ function install_patch {
sudo install -m 500 $STX_PATCH_DIR/bin/sw-patch-agent ${stx_patch_sbindir}/sw-patch-agent sudo install -m 500 $STX_PATCH_DIR/bin/sw-patch-agent ${stx_patch_sbindir}/sw-patch-agent
} }
function install_tsconfig {
# no setup.cfg in tsconfig, so we can not use pip install -e
# setup_dev_lib "tsconfig"
pushd $TSCONFIG_DIR/tsconfig
sudo python setup.py install --root=/ --install-lib=$PYTHON_SITE_DIR --prefix=/usr --install-data=/usr/share --single-version-externally-managed
popd
sudo install -d -m 755 $STX_BIN_DIR
sudo install -p -D -m 700 $TSCONFIG_DIR/scripts/tsconfig $STX_BIN_DIR/tsconfig
}
function install_update {
if is_service_enabled sw-patch; then
install_sw_patch
fi
if is_service_enabled tsconfig; then
install_tsconfig
fi
}
$_XTRACE_STX_UPDATE $_XTRACE_STX_UPDATE

View File

@ -3,29 +3,20 @@
# devstack/plugin.sh # devstack/plugin.sh
# Triggers stx_update specific functions to install and configure stx_update # Triggers stx_update specific functions to install and configure stx_update
# Dependencies:
#
# - ``functions`` file
# - ``DATA_DIR`` must be defined
# ``stack.sh`` calls the entry points in this order:
#
echo_summary "stx-update devstack plugin.sh called: $1/$2" echo_summary "stx-update devstack plugin.sh called: $1/$2"
source $DEST/stx-update/devstack/lib/stx-update
# check for service enabled # check for service enabled
if is_service_enabled stx-update; then if is_service_enabled stx-update; then
if [[ "$1" == "stack" && "$2" == "install" ]]; then if [[ "$1" == "stack" && "$2" == "install" ]]; then
# Perform installation of source # Perform installation of source
echo_summary "Installing stx-update" echo_summary "Install stx-update"
# install_update install_update
elif [[ "$1" == "stack" && "$2" == "post-config" ]]; then elif [[ "$1" == "stack" && "$2" == "post-config" ]]; then
# Configure after the other layer 1 and 2 services have been configured # Configure after the other layer 1 and 2 services have been configured
echo_summary "Configuring update" echo_summary "Configure stx-update"
elif [[ "$1" == "stack" && "$2" == "extra" ]]; then elif [[ "$1" == "stack" && "$2" == "extra" ]]; then
# Initialize and start the service # Initialize and start the service
echo_summary "Initializing and start stx-update" echo_summary "Initialize and start stx-update"
# init_update # init_update
# start_update # start_update
elif [[ "$1" == "stack" && "$2" == "test-config" ]]; then elif [[ "$1" == "stack" && "$2" == "test-config" ]]; then
@ -35,14 +26,12 @@ if is_service_enabled stx-update; then
if [[ "$1" == "unstack" ]]; then if [[ "$1" == "unstack" ]]; then
# Shut down services # Shut down services
echo_summary "Stop service" echo_summary "Stop stx-update services"
# stop_update # stop_update
:
fi fi
if [[ "$1" == "clean" ]]; then if [[ "$1" == "clean" ]]; then
echo_summary "Clean stx-update" echo_summary "Clean stx-update"
# cleanup_update # cleanup_update
:
fi fi
fi fi

View File

@ -7,6 +7,8 @@
STX_UPDATE_NAME=stx-update STX_UPDATE_NAME=stx-update
######### Plugin Specific ########## ######### Plugin Specific ##########
enable_service $STX_UPDATE_NAME tsconfig enable_service $STX_UPDATE_NAME
#define_plugin $STX_UPDATE_NAME #define_plugin $STX_UPDATE_NAME
#plugin_requires ???
# Initial source of lib script
source $DEST/stx-update/devstack/lib/stx-update