Skip to content
This repository has been archived by the owner on Jun 28, 2024. It is now read-only.

nydus: add var directory cleanup #5788

Merged
merged 1 commit into from
Oct 24, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions integration/kubernetes/cleanup_env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,17 @@ main () {
[ "${container_engine}" == "docker" ] && restart_docker_service
registry_server_teardown

# Remove created nydus snapshots
for i in `sudo ctr -n k8s.io snapshot --snapshotter nydus list | grep -v KEY | cut -d' ' -f1 || true`; do
sudo ctr -n k8s.io snapshot --snapshotter nydus rm $i
done

info "Stop ${CRI_RUNTIME} service"
sudo systemctl stop "${CRI_RUNTIME}"

# Cleanup nydus process, directories and binaries
sudo kill -9 $(pidof "containerd-nydus-grpc") || true
sudo rm -rf "/var/lib/containerd-nydus" || true
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ryansavino, as part of the cleanup, I'd also add:

for i in `sudo ctr -n k8s.io snapshot --snapshotter nydus list | grep -v KEY | cut -d' ' -f1`; do sudo ctr -n k8s.io snapshot --snapshotter nydus rm $i; done

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! I have added this.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, last "request" / "suggestion", can you make sure we don't fail on that command?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure thing. Also, I moved the nydus snapshot cleanup to right before the CRI_RUNTIME stop call. In case this might cause any issues.

sudo rm -f "/usr/local/bin/nydus-overlayfs"
sudo rm -f "/usr/local/bin/nydus-image"

Expand Down
Loading