(address . bug-guix@gnu.org)
Hi,
Cuirass has a tendency to not notice when a build is finished, leaving
it in a "running" state.
The phenomenon can be observed by going to
https://ci.guix.gnu.org/status and look at builds that are running for
a suspiciously long time.
Typically the build log will indicate that it has finished, yet Cuirass
is patiently waiting...and not scheduling further builds.
Restarting the builds typically get things going again.
I wrote a nasty script to automatically restart builds that are running
for >1 hour, but it's not a sustainable solution:
#!/usr/bin/env python3
# Restart stuck builds.... TODO fix cuirass properly.
import requests
from bs4 import BeautifulSoup
import re
builds_page = "https://ci.guix.gnu.org/status"
builds_html = requests.get(builds_page).text
soup = BeautifulSoup(builds_html, "html5lib")
main = soup.find('main', {'id': 'content'})
table = main.find('table')
result = {}
for row in table.find_all('tr'):
data = row.find_all('td')
if len(data) > 0:
build_id = row.find('a').contents[0]
name = data[0].contents[0]
age = data[1].contents[0]
system = data[2].contents[0]
log = data[3]
result[build_id] = {'name': name, 'age': age, 'system': system}
age_re = re.compile("(\d+) (\w+) ago")
restart = []
for id in result.keys():
age = result[id]['age']
match = age_re.match(result[id]['age'])
if match is not None: # "seconds ago"
digits = match.group(1)
time_unit = match.group(2)
if time_unit == "hours":
restart.append(id)
elif time_unit == "minutes" and int(digits) > 60:
restart.append(id)
certificate_file = "/home/marius/tmp/mbakke.cert.pem"
certificate_key = "/home/marius/tmp/mbakke.key.pem"
import time
print(f"Found {len(restart)} stuck builds..!")
for id in restart:
print(f"Going to restart {result[id]['name']} ({id}, running since {result[id]['age']})...")
requests.get(f"https://ci.guix.gnu.org/admin/build/{id}/restart",
cert=(certificate_file, certificate_key))
time.sleep(3)
-----BEGIN PGP SIGNATURE-----
iIUEARYKAC0WIQRNTknu3zbaMQ2ddzTocYulkRQQdwUCY34XGw8cbWFyaXVzQGdu
dS5vcmcACgkQ6HGLpZEUEHcYCQD/WbYxZ+Mi1I4kYSCKqRmuVrucf7oVXlZwAyFT
KHhbOrQA/jUT3vZCpeiiSPWyxedXqYOBllkcvQXgmT3tj4RPcZMH
=pDj4
-----END PGP SIGNATURE-----