Skip to content

Commit

Permalink
only update the container health status each time at the very beginni…
Browse files Browse the repository at this point in the history
…ng of deploy agent starts
  • Loading branch information
liyaqin1 committed Sep 16, 2023
1 parent 6a3eed3 commit 27bceef
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions deploy-agent/deployd/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 27bceef

Please sign in to comment.