Skip to content

Commit 3dba901

Browse files
authored
Merge pull request #3 from NVIDIA/fix_tuning
fix(tuning): don't error when no service configmaps are created
2 parents dd134df + 08fcb68 commit 3dba901

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

tuning/skyhook_dir/update_settings.sh

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -88,17 +88,18 @@ if [ -f ${SKYHOOK_DIR}/configmaps/ulimit.conf ]; then
8888
done
8989
fi
9090

91-
# Loop through all service files and add them as drop-ins
92-
for f in ${SKYHOOK_DIR}/configmaps/service_*.conf; do
93-
service_name=$(basename ${f} | cut -f 2 -d _ | cut -f 1 -d .)
94-
echo "-------------------------"
95-
echo "Updating ${service_name} settings"
96-
echo "-------------------------"
97-
mkdir -p /etc/systemd/system/${service_name}.service.d
98-
cp ${f} /etc/systemd/system/${service_name}.service.d/999-${package_name}-tuning.conf
99-
done
91+
if [ $(ls ${SKYHOOK_DIR}/configmaps | grep -c service_.*.conf) -eq 0 ]; then
92+
# Loop through all service files and add them as drop-ins
93+
for f in ${SKYHOOK_DIR}/configmaps/service_*.conf; do
94+
service_name=$(basename ${f} | cut -f 2 -d _ | cut -f 1 -d .)
95+
echo "-------------------------"
96+
echo "Updating ${service_name} settings"
97+
echo "-------------------------"
98+
mkdir -p /etc/systemd/system/${service_name}.service.d
99+
cp ${f} /etc/systemd/system/${service_name}.service.d/999-${package_name}-tuning.conf
100+
done
101+
100102

101-
if [ -z $(ls ${SKYHOOK_DIR}/configmaps/service_*.conf) ]; then
102103
echo "-------------------------"
103104
echo "Reloading systemd"
104105
echo "-------------------------"

0 commit comments

Comments
 (0)