Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: only kill containers that are based on the solanalabs/rust* images #32292

Merged
merged 4 commits into from
Jun 29, 2023
Merged
Changes from 1 commit
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
18 changes: 11 additions & 7 deletions .buildkite/hooks/post-checkout
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,18 @@ source ci/env.sh
# previous CI job
#
(
containers=$(docker ps -q)
if [[ $(hostname) != metrics-main && $(hostname) != metrics-internal && -n $containers ]]; then
echo "+++ Killing stale docker containers"
docker ps
echo "+++ Killing stale docker containers"
while read -r line; do
id="$(echo "$line" | awk '{print $1}')"
image="$(echo "$line" | awk '{print $2}')"
yihau marked this conversation as resolved.
Show resolved Hide resolved

# shellcheck disable=SC2086 # Don't want to double quote $containers
docker kill $containers
fi
if [[ $image == *"solanalabs/rust"* ]]; then
yihau marked this conversation as resolved.
Show resolved Hide resolved
if docker kill "$id" >/dev/null; then
echo "kill $id $image"
fi
continue
fi
done < <(docker ps | tail -n +2)
)

# Processes from previously aborted CI jobs seem to loiter, unclear why as one
Expand Down