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

Do not block job from running on runner hooks #678

Merged
merged 1 commit into from
Sep 12, 2024
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
18 changes: 16 additions & 2 deletions runner_manager/bin/startup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,29 @@ function job_started {
echo "Running preliminary checks..."
# Check if apt, dnf, or yum is running
echo "Ensure no package manager is running"
local tries=0
while pgrep -x "apt" >/dev/null || pgrep -x "dnf" >/dev/null || pgrep -x "yum" >/dev/null; do
echo "Waiting for package manager to finish"
sleep 5
((tries++))
sleep "${tries}"
if [[ ${tries} -eq 10 ]]; then
echo "::warning::Package manager did not finish"
break
fi
done

# reset tries counter
tries=0
if [[ ! ${LABELS} =~ "no-docker" ]]; then
echo "Ensure docker is running"
while ! docker info >/dev/null 2>&1; do
echo "Waiting for docker to start"
sleep 5
((tries++))
sleep "${tries}"
if [[ ${tries} -eq 10 ]]; then
echo "::warning::Docker did not start"
break
fi
done
fi
# Run bash injected through runner group config
Expand Down
Loading