From 27bceef7a21f980c3effe122de213692eaeccbd0 Mon Sep 17 00:00:00 2001 From: YaqinLi Date: Sat, 16 Sep 2023 01:04:44 +0000 Subject: [PATCH] only update the container health status each time at the very beginning of deploy agent starts --- deploy-agent/deployd/agent.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/deploy-agent/deployd/agent.py b/deploy-agent/deployd/agent.py index 0c513df8d7..955eb58ad1 100644 --- a/deploy-agent/deployd/agent.py +++ b/deploy-agent/deployd/agent.py @@ -120,6 +120,12 @@ def serve_build(self): if not self._executor: self._executor = Executor(callback=PingServer(self), config=self._config) # start to ping server to get the latest deploy goal + for status in self._envs.values(): + # for each container, we check the health status + cmd = ['docker', 'inspect', status.report.envName] + output = subprocess.run(cmd, check=True, stdout=subprocess.PIPE).stdout + result = json.loads(output) + status.report.extraInfo = result[0].get("State").get("Health") self._response = self._client.send_reports(self._envs) if self._response: