Skip to content

Commit 9746966

Browse files
CamelronRedent0r
authored andcommitted
node-builder: Build and install debug configuration for pod sandboxing
For ease of debugging, install a configuration-clh-debug.toml for pod sandboxing as we do in Conf pods. Signed-off-by: Cameron Baird <cameronbaird@microsoft.com>
1 parent a102565 commit 9746966

File tree

4 files changed

+16
-19
lines changed

4 files changed

+16
-19
lines changed

tools/osbuilder/node-builder/azure-linux/clean.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,11 @@ source "${common_file}"
1818

1919
pushd "${repo_dir}"
2020

21+
echo "Clean debug shim config"
22+
pushd src/runtime/config/
23+
rm -f "${SHIM_DBG_CONFIG_FILE_NAME}"
24+
popd
25+
2126
echo "Clean runtime build"
2227
pushd src/runtime/
2328
make clean SKIP_GO_VERSION_CHECK=1
@@ -40,11 +45,6 @@ echo "Clean IGVM tool installation"
4045

4146
if [ "${CONF_PODS}" == "yes" ]; then
4247

43-
echo "Clean SNP debug shim config"
44-
pushd src/runtime/config/
45-
rm -f "${SHIM_DBG_CONFIG_FILE_NAME}"
46-
popd
47-
4848
echo "Clean tardev-snapshotter tarfs driver build"
4949
pushd src/tarfs
5050
set_uvm_kernel_vars

tools/osbuilder/node-builder/azure-linux/common.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ else
3939
SHIM_CONFIG_PATH="${INSTALL_PATH_PREFIX}/share/defaults/kata-containers"
4040
SHIM_CONFIG_FILE_NAME="configuration-clh.toml"
4141
SHIM_CONFIG_INST_FILE_NAME="configuration.toml"
42+
SHIM_DBG_CONFIG_FILE_NAME="configuration-clh-debug.toml"
43+
SHIM_DBG_CONFIG_INST_FILE_NAME="${SHIM_DBG_CONFIG_FILE_NAME}"
4244
DEBUGGING_BINARIES_PATH="${INSTALL_PATH_PREFIX}/local/bin"
4345
SHIM_BINARIES_PATH="${INSTALL_PATH_PREFIX}/local/bin"
4446
SHIM_BINARY_NAME="containerd-shim-kata-v2"

tools/osbuilder/node-builder/azure-linux/package_build.sh

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -77,13 +77,14 @@ fi
7777
popd
7878

7979
pushd src/runtime/config/
80-
if [ "${CONF_PODS}" == "yes" ]; then
80+
echo "Creating shim debug configuration"
81+
cp "${SHIM_CONFIG_FILE_NAME}" "${SHIM_DBG_CONFIG_FILE_NAME}"
82+
sed -i '/^#enable_debug =/s|^#||g' "${SHIM_DBG_CONFIG_FILE_NAME}"
83+
sed -i '/^#debug_console_enabled =/s|^#||g' "${SHIM_DBG_CONFIG_FILE_NAME}"
8184

82-
echo "Creating SNP shim debug configuration"
83-
cp "${SHIM_CONFIG_FILE_NAME}" "${SHIM_DBG_CONFIG_FILE_NAME}"
85+
if [ "${CONF_PODS}" == "yes" ]; then
86+
echo "Adding debug igvm to SNP shim debug configuration"
8487
sed -i "s|${IGVM_FILE_NAME}|${IGVM_DBG_FILE_NAME}|g" "${SHIM_DBG_CONFIG_FILE_NAME}"
85-
sed -i '/^#enable_debug =/s|^#||g' "${SHIM_DBG_CONFIG_FILE_NAME}"
86-
sed -i '/^#debug_console_enabled =/s|^#||g' "${SHIM_DBG_CONFIG_FILE_NAME}"
8788
fi
8889
popd
8990

tools/osbuilder/node-builder/azure-linux/package_install.sh

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,6 @@ if [ "${CONF_PODS}" == "yes" ]; then
3939
mkdir -p ${PREFIX}/usr/lib/systemd/system/
4040
cp -a --backup=numbered src/tardev-snapshotter/tardev-snapshotter.service ${PREFIX}/usr/lib/systemd/system/
4141

42-
if [ "${SHIM_REDEPLOY_CONFIG}" == "yes" ]; then
43-
echo "Installing SNP shim debug configuration"
44-
cp -a --backup=numbered src/runtime/config/"${SHIM_DBG_CONFIG_FILE_NAME}" "${PREFIX}/${SHIM_CONFIG_PATH}"/"${SHIM_DBG_CONFIG_INST_FILE_NAME}"
45-
else
46-
echo "Skipping installation of SNP shim debug configuration"
47-
fi
48-
4942
echo "Enabling and starting snapshotter service"
5043
if [ "${START_SERVICES}" == "yes" ]; then
5144
systemctl enable tardev-snapshotter && systemctl daemon-reload && systemctl restart tardev-snapshotter
@@ -64,12 +57,13 @@ cp -a --backup=numbered src/runtime/containerd-shim-kata-v2 "${PREFIX}/${SHIM_BI
6457
if [ "${SHIM_REDEPLOY_CONFIG}" == "yes" ]; then
6558
echo "Installing shim configuration"
6659
cp -a --backup=numbered src/runtime/config/"${SHIM_CONFIG_FILE_NAME}" "${PREFIX}/${SHIM_CONFIG_PATH}/${SHIM_CONFIG_INST_FILE_NAME}"
60+
cp -a --backup=numbered src/runtime/config/"${SHIM_DBG_CONFIG_FILE_NAME}" "${PREFIX}/${SHIM_CONFIG_PATH}/${SHIM_DBG_CONFIG_INST_FILE_NAME}"
6761

68-
if [ "${CONF_PODS}" == "yes" ] && [ "${SHIM_USE_DEBUG_CONFIG}" == "yes" ]; then
62+
if [ "${SHIM_USE_DEBUG_CONFIG}" == "yes" ]; then
6963
# We simply override the release config with the debug config,
7064
# which is probably fine when debugging. Not symlinking as that
7165
# would create cycles the next time this script is called.
72-
echo "Overriding shim configuration with SNP debug configuration"
66+
echo "Overriding shim configuration with debug configuration"
7367
cp -a --backup=numbered src/runtime/config/"${SHIM_DBG_CONFIG_FILE_NAME}" "${PREFIX}/${SHIM_CONFIG_PATH}/${SHIM_CONFIG_INST_FILE_NAME}"
7468
fi
7569
else

0 commit comments

Comments
 (0)