File tree Expand file tree Collapse file tree 3 files changed +33
-8
lines changed Expand file tree Collapse file tree 3 files changed +33
-8
lines changed Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ # Copyright 2025 The gVisor Authors.
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # http://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ clear_docker_containers () {
18
+ # Kill any running containers (clear state), except for "bootstrap".
19
+ for id_and_name in $( docker ps --format=' {{.ID}}/{{.Names}}' ) ; do
20
+ if [[ " $( echo " $id_and_name " | cut -d' /' -f2-) " == ' bootstrap' ]]; then
21
+ continue
22
+ fi
23
+ timeout --kill-after=10s --preserve-status 30s \
24
+ docker container kill " $( echo " $id_and_name " | cut -d' /' -f1) "
25
+ done
26
+ }
Original file line number Diff line number Diff line change 1
1
set -x
2
2
3
+ source .buildkite/hooks/libhook
4
+
3
5
# Clear any downloaded credentials.
4
6
rm -f repo.key
5
7
@@ -70,14 +72,7 @@ if test "${BUILDKITE_COMMAND_EXIT_STATUS}" -ne "0"; then
70
72
sudo rm -rf "${HOME}/go"
71
73
fi
72
74
73
- # Kill any running containers (clear state), except for "bootstrap".
74
- for id_and_name in $(docker ps --format='{{.ID}}/{{.Names}}'); do
75
- if [[ "$(echo "$id_and_name" | cut -d'/' -f2-)" == 'bootstrap' ]]; then
76
- continue
77
- fi
78
- timeout --kill-after=10s --preserve-status 8s \
79
- docker container kill "$(echo "$id_and_name" | cut -d'/' -f1)"
80
- done
75
+ clear_docker_containers
81
76
82
77
set -euo pipefail
83
78
Original file line number Diff line number Diff line change 1
1
set -euo pipefail
2
2
3
+ source .buildkite/hooks/libhook
4
+
5
+ clear_docker_containers
6
+
3
7
# Use a per-day bazel remote cache. As the cache object's TTL expires, they are
4
8
# deleted on an ongoing basis. Such partial deletion can break the cache state.
5
9
# Using per day cache will ensure that builds triggered on a certain day have
You can’t perform that action at this time.
0 commit comments