Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
OpenDAS
vllm_cscc
Commits
3132290a
Unverified
Commit
3132290a
authored
May 30, 2025
by
Carol Zheng
Committed by
GitHub
May 30, 2025
Browse files
[TPU][CI/CD] Clean up docker for TPU tests. (#18926)
Signed-off-by:
Carol Zheng
<
cazheng@google.com
>
parent
1aa2f81b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
4 deletions
+35
-4
.buildkite/scripts/hardware_ci/run-tpu-v1-test.sh
.buildkite/scripts/hardware_ci/run-tpu-v1-test.sh
+35
-4
No files found.
.buildkite/scripts/hardware_ci/run-tpu-v1-test.sh
View file @
3132290a
...
@@ -2,15 +2,46 @@
...
@@ -2,15 +2,46 @@
set
-xu
set
-xu
# Build the docker image.
docker build
-f
docker/Dockerfile.tpu
-t
vllm-tpu
.
# Set up cleanup.
remove_docker_container
()
{
remove_docker_container
()
{
docker
rm
-f
tpu-test
||
true
;
}
docker
rm
-f
tpu-test
||
true
;
docker
rm
-f
vllm-tpu
||
true
;
}
trap
remove_docker_container EXIT
trap
remove_docker_container EXIT
# Remove the container that might not be cleaned up in the previous run.
# Remove the container that might not be cleaned up in the previous run.
remove_docker_container
remove_docker_container
# Build the docker image.
docker build
-f
docker/Dockerfile.tpu
-t
vllm-tpu
.
# Set up cleanup.
cleanup_docker
()
{
# Get Docker's root directory
docker_root
=
$(
docker info
-f
'{{.DockerRootDir}}'
)
if
[
-z
"
$docker_root
"
]
;
then
echo
"Failed to determine Docker root directory."
exit
1
fi
echo
"Docker root directory:
$docker_root
"
# Check disk usage of the filesystem where Docker's root directory is located
disk_usage
=
$(
df
"
$docker_root
"
|
tail
-1
|
awk
'{print $5}'
|
sed
's/%//'
)
# Define the threshold
threshold
=
70
if
[
"
$disk_usage
"
-gt
"
$threshold
"
]
;
then
echo
"Disk usage is above
$threshold
%. Cleaning up Docker images and volumes..."
# Remove dangling images (those that are not tagged and not used by any container)
docker image prune
-f
# Remove unused volumes / force the system prune for old images as well.
docker volume prune
-f
&&
docker system prune
--force
--filter
"until=72h"
--all
echo
"Docker images and volumes cleanup completed."
else
echo
"Disk usage is below
$threshold
%. No cleanup needed."
fi
}
cleanup_docker
# For HF_TOKEN.
# For HF_TOKEN.
source
/etc/environment
source
/etc/environment
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment