Merge remote-tracking branch 'starlingx/master' into HEAD

Change-Id: Iac7558e44aa579b0b52708bb187b48c18ffdc071
Signed-off-by: Scott Little <scott.little@windriver.com>
This commit is contained in:
Scott Little 2019-02-06 11:34:43 -05:00
commit 6f8025c90c
7 changed files with 98 additions and 2 deletions

View File

@ -56,6 +56,9 @@ source_suffix = '.rst'
# The master toctree document.
master_doc = 'index'
# General information about the project.
project = 'stx-config'
# Release notes are version independent, no need to set version and release
release = ''
version = ''

View File

@ -1785,7 +1785,13 @@ def is_openstack_installed(dbapi):
""" Checks whether the OpenStack application is installed. """
try:
openstack_app = dbapi.kube_app_get(constants.HELM_APP_OPENSTACK)
if openstack_app.status == constants.APP_APPLY_SUCCESS:
# The application can be re-applied (either manually or as a result of
# a host unlock, so it will cycle through the APP_APPLY_IN_PROGRESS
# status and possibly the APP_APPLY_FAILURE status, but still be
# installed.
if openstack_app.status in [constants.APP_APPLY_SUCCESS,
constants.APP_APPLY_IN_PROGRESS,
constants.APP_APPLY_FAILURE]:
return True
else:
return False

View File

@ -1,3 +1,3 @@
SRC_DIR="worker-utils"
COPY_LIST="$SRC_DIR/LICENSE"
TIS_PATCH_VER=1
TIS_PATCH_VER=2

View File

@ -39,6 +39,7 @@ make install BINDIR=%{buildroot}%{local_bindir} \
%post
/bin/systemctl enable affine-platform.sh.service >/dev/null 2>&1
/bin/systemctl enable affine-tasks.service >/dev/null 2>&1
%clean
rm -rf $RPM_BUILD_ROOT
@ -53,3 +54,4 @@ rm -rf $RPM_BUILD_ROOT
%config(noreplace) %{local_etc_platform}/worker_reserved.conf
%{_unitdir}/affine-platform.sh.service
%{_unitdir}/affine-tasks.service

View File

@ -18,6 +18,7 @@ install:
install -d -m 755 $(PLATFORMCONFDIR)
install -d -m 755 $(SYSTEMDDIR)
install -p -D -m 755 affine-platform.sh $(INITDDIR)/affine-platform.sh
install -p -D -m 755 affine-tasks.sh $(INITDDIR)/affine-tasks.sh
install -p -D -m 755 cpumap_functions.sh $(INITDDIR)/cpumap_functions.sh
install -p -D -m 755 task_affinity_functions.sh $(INITDDIR)/task_affinity_functions.sh
install -p -D -m 755 ps-sched.sh $(BINDIR)/ps-sched.sh
@ -29,3 +30,4 @@ install:
install -p -D -m 755 worker_reserved.conf $(PLATFORMCONFDIR)/worker_reserved.conf
install -p -D -m 755 worker-goenabled.sh $(GOENABLEDDIR)/worker-goenabled.sh
install -p -D -m 664 affine-platform.sh.service $(SYSTEMDDIR)/affine-platform.sh.service
install -p -D -m 664 affine-tasks.service $(SYSTEMDDIR)/affine-tasks.service

View File

@ -0,0 +1,12 @@
[Unit]
Description=StarlingX Affine Tasks
After=syslog.service network.service dbus.service sw-patch.service affine-platform.sh.service
Before=kubelet.service
Requires=kubelet.service
[Service]
Type=oneshot
ExecStart=/etc/init.d/affine-tasks.sh start
[Install]
WantedBy=multi-user.target

View File

@ -0,0 +1,71 @@
#!/bin/bash
###############################################################################
# Copyright (c) 2019 Wind River Systems, Inc.
#
# SPDX-License-Identifier: Apache-2.0
#
###############################################################################
# This script will affine tasks to the platform cores of the host.
# This ensures that system processes are constrained to platform cores and will
# not run on cores with VMs/containers.
. /usr/bin/tsconfig
. /etc/init.d/task_affinity_functions.sh
log ()
{
logger -p local1.info -t affine_tasks $@
echo affine_tasks: "$@"
}
start ()
{
log "Starting affine_tasks. Reaffining tasks to platform cores..."
if [ ! -f ${INITIAL_CONFIG_COMPLETE_FLAG} ]; then
log "Initial Configuration incomplete. Skipping affining tasks."
exit 0
fi
affine_tasks_to_platform_cores
[[ $? -eq 0 ]] && log "Tasks re-affining done." || log "Tasks re-affining failed."
}
stop ()
{
log "Stopping affine_tasks..."
}
status()
{
:
}
reset()
{
:
}
case "$1" in
start)
start
;;
stop)
stop
;;
restart|force-reload|reload)
stop
start
;;
status)
status
;;
reset)
reset
;;
*)
echo "Usage: $0 {start|stop|force-reload|restart|reload|status|reset}"
exit 1
;;
esac
exit 0