Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
podman-on-slurm
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ljelonek-public
podman-on-slurm
Commits
a26a830e
Commit
a26a830e
authored
1 month ago
by
Lukas Jelonek
Browse files
Options
Downloads
Patches
Plain Diff
Add script to cleanup podman on a single cluster node
parents
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
scripts/podman-cleanup
+21
-0
21 additions, 0 deletions
scripts/podman-cleanup
with
21 additions
and
0 deletions
scripts/podman-cleanup
0 → 100644
+
21
−
0
View file @
a26a830e
#!/bin/bash
#
# This script removes unused resources for podman on cluster nodes in the bcf slurm cluster.
# It assumes that the podman run directory is located at /tmp/podman-run-${UID}. It will delete
# unused images, stopped containers, unused volumes and the podman run directory.
#
set
-eo
pipefail
PODMAN_DIR
=
/tmp/podman-run-
${
UID
}
if
[[
-e
$PODMAN_DIR
]]
then
echo
"Podman found on
$(
hostname
)
"
RUNNING_COUNT
=
$(
podman ps
--noheading
|
wc
-l
)
podman system prune
-a
-f
if
[[
$RUNNING_COUNT
-gt
0
]]
then
echo
"You still have
${
RUNNING_COUNT
}
jobs running on
$(
hostname
)
"
else
rm
-rf
$PODMAN_DIR
fi
fi
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment