Skip to content

Commit b942a40

Browse files
committed
Fix containerd path naming consistency and sed regex
- Use consistent naming: containerd/data-root for both paths - Fix sed regex: use \? instead of \? to match optional # - Minimal changes: just sed commands without extra logic - Addresses feedback from PR #914
1 parent 8c5c3de commit b942a40

File tree

1 file changed

+1
-18
lines changed
  • 1.architectures/5.sagemaker-hyperpod/LifecycleScripts/base-config/utils

1 file changed

+1
-18
lines changed

1.architectures/5.sagemaker-hyperpod/LifecycleScripts/base-config/utils/install_docker.sh

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,6 @@ sudo usermod -aG docker ubuntu
6666
# See: https://github.com/aws-samples/awsome-distributed-training/issues/127
6767
#
6868
# Docker workdir doesn't like Lustre. Tried with storage driver overlay2, fuse-overlayfs, & vfs.
69-
# Also, containerd ships with a commented root in its default config; we need to ensure an
70-
# uncommented root that points to the fast local volume.
7169
if [[ $(mount | grep /opt/sagemaker) ]]; then
7270
cat <<EOL >> /etc/docker/daemon.json
7371
{
@@ -79,10 +77,6 @@ EOL
7977
's|^\[Service\]$|[Service]\nEnvironment="DOCKER_TMPDIR=/opt/sagemaker/docker/tmp"|' \
8078
/usr/lib/systemd/system/docker.service
8179

82-
# Ensure containerd config exists and point its root to /opt/sagemaker
83-
if [[ ! -f /etc/containerd/config.toml ]]; then
84-
containerd config default | sudo tee /etc/containerd/config.toml >/dev/null
85-
fi
8680
sudo sed -i -e 's|^#\?root *=.*|root = "/opt/sagemaker/containerd/data-root"|' \
8781
/etc/containerd/config.toml
8882
elif [[ $(mount | grep /opt/dlami/nvme) ]]; then
@@ -96,20 +90,9 @@ EOL
9690
's|^\[Service\]$|[Service]\nEnvironment="DOCKER_TMPDIR=/opt/dlami/nvme/docker/tmp"|' \
9791
/usr/lib/systemd/system/docker.service
9892

99-
# Ensure containerd config exists and point its root to /opt/dlami/nvme
100-
if [[ ! -f /etc/containerd/config.toml ]]; then
101-
containerd config default | sudo tee /etc/containerd/config.toml >/dev/null
102-
fi
103-
sudo sed -i \
104-
-e 's|^#\?root *=.*|root = "/opt/dlami/nvme/docker/containerd"|' \
93+
sudo sed -i -e 's|^#\?root *=.*|root = "/opt/dlami/nvme/containerd/data-root"|' \
10594
/etc/containerd/config.toml
10695
fi
10796

10897
systemctl daemon-reload
10998
systemctl restart docker
110-
111-
echo "
112-
###################################
113-
# END: install docker
114-
###################################
115-
"

0 commit comments

Comments
 (0)