debian: Manage /etc/platform/worker_resource.conf

Install the /etc/platform/worker_resource.conf based
on personaility type. The worker_resource.conf should
be installed on AIO/worker and worker types. But not
on controller only or storage types.

Test Plan
PASSED Build worker-utils package
PASSED Build ISO
PASSED Start a controller and check to make
       sure that the /etc/platform/worker_reserved.conf
       is not present.
PASSED Start a worker and check to make
       sure that the /etc/platform/worker_reserved.conf
       is present.
PASSED Install AIO and unlock host.
PASSED Install Standard installation and unlock host.

Story: 2009968
Task: 46980

Depends-On: https://review.opendev.org/c/starlingx/utilities/+/866496

Signed-off-by: Charles Short <charles.short@windriver.com>
Change-Id: I32f0a841e55bb2d45b005407f99ed6430b60bf48
This commit is contained in:
Charles Short 2022-12-02 13:18:04 -05:00
parent e1ecb6a005
commit 52e7b9d979
2 changed files with 17 additions and 1 deletions

View File

@ -2392,7 +2392,10 @@ if [ "${aio}" = true ] ; then
elif [ ${RESERVEDMEM} -gt 8192 ]; then
RESERVEDMEM=8192
fi
# Normally we would set personality based files later
# But we need to copy worker_reserved.conf now since it needs to be modified for AIO
cp /usr/share/worker-utils/config/worker_reserved.conf /etc/platform/worker_reserved.conf
ilog "${SYSTEM_TYPE__AIO} Reserved Memory: ${RESERVEDMEM}"
sed -i -e "s#\(WORKER_BASE_RESERVED\)=.*#\1=(\"node0:${RESERVEDMEM}MB:1\" \"node1:2000MB:0\" \"node2:2000MB:0\" \"node3:2000MB:0\")#g" /etc/platform/worker_reserved.conf
worker_reserved=$(grep WORKER_BASE_RESERVED /etc/platform/worker_reserved.conf)
@ -2404,6 +2407,11 @@ if [ "${aio}" = true ] ; then
worker_cpu_list=$(grep WORKER_CPU_LIST /etc/platform/worker_reserved.conf)
ilog "${SYSTEM_TYPE__AIO} '${worker_cpu_list}'"
elif [ "${worker}" = true ] ; then
# Keep logic contained and copy worker_reserved.conf now since we need
# to do the copy for AIO above
ilog "Enable worker_reserved.conf for ${TRAIT__WORKER}"
cp /usr/share/worker-utils/config/worker_reserved.conf /etc/platform/worker_reserved.conf
fi
true

View File

@ -2552,7 +2552,10 @@ if [ "${aio}" = true ] ; then
RESERVEDMEM=8192
fi
# Normally we would set personality based files later
# But we need to copy worker_reserved.conf now since it needs to be modified for AIO
ilog "${SYSTEM_TYPE__AIO} Reserved Memory: ${RESERVEDMEM}"
cp /usr/share/worker-utils/config/worker_reserved.conf /etc/platform/worker_reserved.conf
sed -i -e "s#\(WORKER_BASE_RESERVED\)=.*#\1=(\"node0:${RESERVEDMEM}MB:1\" \"node1:2000MB:0\" \"node2:2000MB:0\" \"node3:2000MB:0\")#g" /etc/platform/worker_reserved.conf
worker_reserved=$(grep WORKER_BASE_RESERVED /etc/platform/worker_reserved.conf)
ilog "${SYSTEM_TYPE__AIO} '${worker_reserved}'"
@ -2563,6 +2566,11 @@ if [ "${aio}" = true ] ; then
worker_cpu_list=$(grep WORKER_CPU_LIST /etc/platform/worker_reserved.conf)
ilog "${SYSTEM_TYPE__AIO} '${worker_cpu_list}'"
elif [ "${worker}" = true ] ; then
# Keep logic contained and copy worker_reserved.conf now since we need
# to do the copy for AIO above
ilog "Enable worker_reserved.conf for ${TRAIT__WORKER}"
cp /usr/share/worker-utils/config/worker_reserved.conf /etc/platform/worker_reserved.conf
fi
true