Skip to content

Commit 5c5ad98

Browse files
committed
[Test] In test_pyxis, when run on Ubuntu24.04, disable kernel setting 'apparmor_restrict_unprivileged_userns' to prevent permission denied errors blocking Enroot execution.
This is required only on Ubuntu24.04 as the restriction was introduced in Ubuntu23. See https://ubuntu.com/blog/ubuntu-23-10-restricted-unprivileged-user-namespaces
1 parent e5bfbd0 commit 5c5ad98

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

tests/integration-tests/tests/pyxis/test_pyxis/test_pyxis/compute_node_start.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,12 @@ PYXIS_RUNTIME_DIR="/run/pyxis"
2222

2323
sudo mkdir -p $PYXIS_RUNTIME_DIR
2424
sudo chmod 1777 $PYXIS_RUNTIME_DIR
25+
26+
# In Ubuntu24.04 Apparmor blocks the creation of unprivileged user namespaces,
27+
# which is required by Enroot. So to run Enroot, it is required to disable this restriction.
28+
# See https://ubuntu.com/blog/ubuntu-23-10-restricted-unprivileged-user-namespaces
29+
source /etc/os-release
30+
if [ "${ID}${VERSION_ID}" == "ubuntu24.04" ]; then
31+
echo "kernel.apparmor_restrict_unprivileged_userns = 0" | sudo tee /etc/sysctl.d/99-pcluster-disable-apparmor-restrict-unprivileged-userns.conf
32+
sudo sysctl --system
33+
fi

0 commit comments

Comments
 (0)