Repair monitor cluster upgrade without blocking K1 package configuration
This commit is contained in:
@@ -30,11 +30,27 @@ fi
|
||||
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-remove \
|
||||
"$mc_release_dir/timescaledb-2-loader-postgresql-16_2.29.2~ubuntu24.04-1615_amd64.deb" \
|
||||
"$mc_release_dir/timescaledb-2-oss-postgresql-16_2.29.2~ubuntu24.04-1615_amd64.deb" \
|
||||
"$mc_release_dir/mission-core-node_0.8.15_amd64.deb" \
|
||||
"$mc_release_dir/mission-core-node_0.8.16_amd64.deb" \
|
||||
"$mc_release_dir/mission-core-xgrids-k1_0.1.14_amd64.deb"
|
||||
systemctl is-active --quiet mission-core-node.service
|
||||
systemctl is-active --quiet mission-core-k1.service
|
||||
systemctl is-active --quiet postgresql@16-ndc-monitor.service
|
||||
runuser -u mission-core-node -- /usr/bin/python3 - <<'K1CHECK'
|
||||
import http.client,json,socket,time
|
||||
deadline=time.monotonic()+20
|
||||
while True:
|
||||
c=http.client.HTTPConnection('k1',timeout=3)
|
||||
c.sock=socket.socket(socket.AF_UNIX);c.sock.settimeout(3)
|
||||
try:
|
||||
c.sock.connect('/run/mission-core-k1/driver.sock')
|
||||
c.request('GET','/status');r=c.getresponse();v=json.load(r)
|
||||
if r.status==200 and v.get('available') is True:break
|
||||
except (OSError, ValueError, http.client.HTTPException):pass
|
||||
finally:c.close()
|
||||
if time.monotonic()>deadline:raise SystemExit('K1 enrollment service did not become ready')
|
||||
time.sleep(1)
|
||||
print('K1 enrollment service: ready')
|
||||
K1CHECK
|
||||
systemctl is-active --quiet postgresql@16-ndcmonitor.service
|
||||
systemctl is-active --quiet mission-core-node-monitor.service
|
||||
runuser -u mission-core-monitor -- /usr/bin/python3 - <<'PY'
|
||||
import http.client,json,socket,time
|
||||
@@ -53,4 +69,4 @@ while True:
|
||||
time.sleep(1)
|
||||
print('Local telemetry: ready')
|
||||
PY
|
||||
printf '%s\n' 'Mission Core Node R18: package and local archive checks passed.'
|
||||
printf '%s\n' 'Mission Core Node R19: package and local archive checks passed.'
|
||||
|
||||
Reference in New Issue
Block a user