From 58753d1aeb98c27faca463f91c0a36ef73a7c78f Mon Sep 17 00:00:00 2001 From: Ian Roquebert <72234714+gzpcho@users.noreply.github.com> Date: Thu, 23 May 2024 00:53:52 +0000 Subject: [PATCH 1/8] Refactor `agent_simulator.py` --- deploy-board/tools/agent_simulator.py | 79 +++++++++++++-------------- 1 file changed, 38 insertions(+), 41 deletions(-) diff --git a/deploy-board/tools/agent_simulator.py b/deploy-board/tools/agent_simulator.py index 4756cb833b..2bde03ab01 100644 --- a/deploy-board/tools/agent_simulator.py +++ b/deploy-board/tools/agent_simulator.py @@ -1,83 +1,80 @@ +#!/usr/bin/env python3 # Copyright 2016 Pinterest, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at -# +# # http://www.apache.org/licenses/LICENSE-2.0 -# +# # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. - # -*- coding: utf-8 -*- -''' Simulate l00 hosts to ping server constantly. If group name match the env + +""" Simulate l00 hosts to ping server constantly. If group name match the env capacity config and there is active deploy, it will simulate the full deploy cycle as well. -''' -import commons +""" +from commons import REQUEST +from deploy_board.webapp.helpers import systems_helper import argparse import time import threading states = {} -systems_helper = commons.get_system_helper() +HOST_COUNT = 100 -def ping(i, groups): - host = "host-888-%d" % i - ip = "%d.%d.%d.%d" % (i, i, i, i) +def ping(i: str, groups: list): + host = f"host-888-{i}" + ip = f"{i}.{i}.{i}.{i}" reports = {} while True: pingRequest = {} - pingRequest['hostId'] = host - pingRequest['hostName'] = host - pingRequest['hostIp'] = ip - pingRequest['groups'] = groups - pingRequest['reports'] = list(reports.values()) + pingRequest["hostId"] = host + pingRequest["hostName"] = host + pingRequest["hostIp"] = ip + pingRequest["groups"] = groups + pingRequest["reports"] = list(reports.values()) try: - pingResponse = systems_helper.ping(commons.REQUEST, pingRequest) + pingResponse = systems_helper.ping(REQUEST, pingRequest) except Exception as e: - print(e.message) + print(e) continue - if pingResponse.get('opCode') == 'NOOP': + if pingResponse.get("opCode") == "NOOP": continue - else: - print("%s :-> %s:%s" % (host, - pingResponse.get('opCode'), - pingResponse.get('deployGoal').get('deployStage'))) - goal = pingResponse.get('deployGoal') + print( + f"{host} :-> {pingResponse.get('opCode')}:{pingResponse.get('deployGoal').get('deployStage')}" + ) + goal = pingResponse.get("deployGoal") report = {} - report['envId'] = goal.get('envId') - report['deployId'] = goal.get('deployId') - report['agentStatus'] = 'SUCCEEDED' - report['deployStage'] = goal.get('deployStage') - reports[goal.get('envId')] = report + report["envId"] = goal.get("envId") + report["deployId"] = goal.get("deployId") + report["agentStatus"] = "SUCCEEDED" + report["deployStage"] = goal.get("deployStage") + reports[goal.get("envId")] = report -def main(): - parser = argparse.ArgumentParser(description='Simulate 100 hosts to ping server constantly') - parser.add_argument('-g', '--group', type=str, help='Group name', required=True) +if __name__ == "__main__": + parser = argparse.ArgumentParser( + description="Simulate 100 hosts to ping server constantly" + ) + parser.add_argument("-g", "--group", type=str, help="Group name", required=True) args = parser.parse_args() groups = [args.group] - for i in range(100): - host = "host-sim-%d" % i - states[host] = False + for i in range(HOST_COUNT): + states[f"host-sim-{i}"] = False - for i in range(100): - t = threading.Thread(target=ping, args=(i, groups)) - t.daemon = True + for i in range(HOST_COUNT): + t = threading.Thread(target=ping, args=(i, groups), daemon=True) t.start() while True: time.sleep(5) continue - - -if __name__ == "__main__": - main() From bb1a578e0418a8f22ea86026c2a46a1c09a53422 Mon Sep 17 00:00:00 2001 From: Ian Roquebert <72234714+gzpcho@users.noreply.github.com> Date: Thu, 23 May 2024 00:56:24 +0000 Subject: [PATCH 2/8] Use .html extension for `deploy_progress.tmpl` --- .../templates/deploys/deploy_progress.tmpl | 286 ------------------ .../templates/environs/env_landing.html | 2 +- deploy-board/deploy_board/webapp/env_views.py | 18 +- 3 files changed, 10 insertions(+), 296 deletions(-) delete mode 100644 deploy-board/deploy_board/templates/deploys/deploy_progress.tmpl diff --git a/deploy-board/deploy_board/templates/deploys/deploy_progress.tmpl b/deploy-board/deploy_board/templates/deploys/deploy_progress.tmpl deleted file mode 100644 index 5e67cc4742..0000000000 --- a/deploy-board/deploy_board/templates/deploys/deploy_progress.tmpl +++ /dev/null @@ -1,286 +0,0 @@ -{% load utils %} -{% load static %} -{% with deploy=report.currentDeployStat.deploy build=report.currentDeployStat.build tag=report.currentDeployStat.buildTag %} -{% include "deploys/deploy_progress_summary.tmpl" %} - -{% if report.showMode != "simple" %} -
-
-

Hosts

-
-
-
- {% for agentStat in report.agentStats %} - {% if report.account == primaryAccount %} - {% if not agentStat.agent.accountId or agentStat.agent.accountId == primaryAccount or agentStat.agent.accountId == "null" %} - - {% if report.showMode != "compact" %} - {{ agentStat.agent.hostName }} - {% endif %} - {% if report.showMode == "containerStatus" %} - {% include "deploys/_container_status.html" with healthStatus=agentStat.agent.containerHealthStatus %} - {% else %} - - {% endif %} - {% endif %} - - {% elif report.account == subAccount %} - {% if agentStat.agent.accountId and agentStat.agent.accountId == subAccount %} - - {% if report.showMode != "compact" %} - {{ agentStat.agent.hostName }} - {% endif %} - {% if report.showMode == "containerStatus" %} - {% include "deploys/_container_status.html" with healthStatus=agentStat.agent.containerHealthStatus %} - {% else %} - - {% endif %} - {% endif %} - - {% elif report.account == "others" %} - {% if agentStat.agent.accountId and agentStat.agent.accountId != subAccount and agentStat.agent.accountId != primaryAccount and agentStat.agent.accountId != "null" %} - - {% if report.showMode != "compact" %} - {{ agentStat.agent.hostName }} - {% endif %} - {% if report.showMode == "containerStatus" %} - {% include "deploys/_container_status.html" with healthStatus=agentStat.agent.containerHealthStatus %} - {% else %} - - {% endif %} - {% endif %} - - {% elif report.account == "all" %} - - {% if report.showMode != "compact" %} - {{ agentStat.agent.hostName }} - {% endif %} - {% if report.showMode == "containerStatus" %} - {% include "deploys/_container_status.html" with healthStatus=agentStat.agent.containerHealthStatus %} - {% else %} - - {% endif %} - - {% endif %} - {% endfor %} - -

- - Failed Hosts - - - All Details - - - Sub Account Hosts - -
-
-
-{% endif %} - -{% if report.firstTimeAgentStats %} -
- - - - - - -
- - New Hosts - - - - {% for agentStat in report.firstTimeAgentStats %} - - {% if report.showMode == "complete" %} - {{ agentStat.agent.hostName }} - {% endif %} - - {% if report.showMode == "containerStatus" %} - {% include "deploys/_container_status.html" with healthStatus=agentStat.agent.containerHealthStatus %} - {% endif %} - - {% endfor %} - - - - - {{ report.firstTimeAgentStats|length }} - - -
-
-{% endif %} - -
- - - - {% for key, value in report.currentDeployStat.stageDistMap.items %} - {% if display_stopping_hosts == "true" or key != "STOPPING" and key != "STOPPED" %} - - {% endif %} - {% endfor %} - - - - - {% for key, value in report.currentDeployStat.stageDistMap.items %} - {% if display_stopping_hosts == "true" or key != "STOPPING" and key != "STOPPED" %} - - {% endif %} - {% endfor %} - - - - {% for deployStat in report.deprecatedDeployStats %} - - - {% for key, value in deployStat.stageDistMap.items %} - {% if display_stopping_hosts == "true" or key != "STOPPING" and key != "STOPPED" %} - - {% endif %} - {% endfor %} - - - {% endfor %} -
- - {{ key }} - - Total
- - Current({{ build.commitShort }}) - - - - - {{ value }} - - - - - {{ report.currentDeployStat.total }} - -
- - Previous({{ deployStat.build.commitShort }}) - - - - - {{ value }} - - - - - {{ deployStat.total }} - -
-
- -{% if report.provisioningHosts %} -
- - - - - - -
- - New Hosts - - - {% for host in report.provisioningHosts %} - - {{ host.hostName }} - - - {% endfor %} - - - {{ report.provisioningHosts | length }} - -
-
-{% endif %} - -{% if report.missingHosts %} -
- - - - - - -
- - Unknown Hosts - - - {% for host in report.missingHosts %} - - {{ host }} - - {% endfor %} - - - {{ report.missingHosts|length }} - -
-
-{% endif %} - -
- - Total Hosts: {{ report|reportTotal }} - -
-{% endwith %} - - diff --git a/deploy-board/deploy_board/templates/environs/env_landing.html b/deploy-board/deploy_board/templates/environs/env_landing.html index f8b09ea53c..f87a1eaa65 100644 --- a/deploy-board/deploy_board/templates/environs/env_landing.html +++ b/deploy-board/deploy_board/templates/environs/env_landing.html @@ -513,7 +513,7 @@

- {% include "deploys/deploy_progress.tmpl" %} + {% include "deploys/deploy_progress.html" %}
{% include "deploys/deploy_add_ons.tmpl" %} diff --git a/deploy-board/deploy_board/webapp/env_views.py b/deploy-board/deploy_board/webapp/env_views.py index e09f787b88..ebeef6332a 100644 --- a/deploy-board/deploy_board/webapp/env_views.py +++ b/deploy-board/deploy_board/webapp/env_views.py @@ -248,7 +248,7 @@ def update_deploy_progress(request, name, stage): "accounts": accounts, } - html = render_to_string('deploys/deploy_progress.tmpl', context) + html = render_to_string('deploys/deploy_progress.html', context) response = HttpResponse(html) @@ -628,7 +628,7 @@ def _get_last_cluster_refresh_status(request, env): return replace_summaries["clusterRollingUpdateStatuses"][0] except: return None - + def _is_cluster_auto_refresh_enabled(request, env): try: cluster_name = get_cluster_name(request, env.get('envName'), env.get('stageName'), env=env) @@ -1140,9 +1140,9 @@ def remove_stage(request, name, stage): return response -def get_pipeline_url_from_build_info(build): +def get_pipeline_url_from_build_info(build): if build['publishInfo'] and re.findall("https://[\w\d\-\.]*/job/[\w\d\-\.]*/[\d]*(/)?", build['publishInfo']): - return re.sub("/[\d]*(/)?$", '', build['publishInfo']) + return re.sub("/[\d]*(/)?$", '', build['publishInfo']) if build['publishInfo'] and re.findall("https://[\w\d\-\.]*/job/[\w\d\-\.]*/?", build['publishInfo']): return build['publishInfo'] return False @@ -1154,18 +1154,18 @@ def get_builds(request, name, stage): if env_promote['type'] == 'AUTO' and env_promote['predStage'] and \ env_promote['predStage'] == environs_helper.BUILD_STAGE: show_lock = True - + if 'buildName' not in env and not env['buildName']: html = render_to_string('builds/simple_builds.tmpl', { "builds": [], - "env": env, + "env": env, "show_lock": show_lock, }) return HttpResponse(html) current_publish_date = 0 - build_deploy_pipeline_url = False - + build_deploy_pipeline_url = False + if 'deployId' in env and env['deployId']: deploy = deploys_helper.get(request, env['deployId']) build = builds_helper.get_build(request, deploy['buildId']) @@ -1196,7 +1196,7 @@ def get_builds(request, name, stage): html = render_to_string('builds/simple_builds.tmpl', { "builds": new_builds, "build_deploy_pipeline_url" : build_deploy_pipeline_url, - "current_publish_date": current_publish_date, + "current_publish_date": current_publish_date, "env": env, "show_lock": show_lock, }) From 0aee49c867c470dc97a93f00d2fa4b91de33e246 Mon Sep 17 00:00:00 2001 From: Ian Roquebert <72234714+gzpcho@users.noreply.github.com> Date: Thu, 23 May 2024 01:07:04 +0000 Subject: [PATCH 3/8] Reorganize components in host panel --- .../templates/deploys/deploy_progress.html | 293 ++++++++++++++++++ 1 file changed, 293 insertions(+) create mode 100644 deploy-board/deploy_board/templates/deploys/deploy_progress.html diff --git a/deploy-board/deploy_board/templates/deploys/deploy_progress.html b/deploy-board/deploy_board/templates/deploys/deploy_progress.html new file mode 100644 index 0000000000..7b5b14244d --- /dev/null +++ b/deploy-board/deploy_board/templates/deploys/deploy_progress.html @@ -0,0 +1,293 @@ +{% load utils %} +{% load static %} +{% with deploy=report.currentDeployStat.deploy build=report.currentDeployStat.build tag=report.currentDeployStat.buildTag %} + {% include "deploys/deploy_progress_summary.tmpl" %} + {% if report.showMode != "simple" %} +
+
+

Hosts

+
+
+
+
+ + + + {% for key, value in report.currentDeployStat.stageDistMap.items %} + {% if display_stopping_hosts == "true" or key != "STOPPING" and key != "STOPPED" %} + + {% endif %} + {% endfor %} + + + + + {% for key, value in report.currentDeployStat.stageDistMap.items %} + {% if display_stopping_hosts == "true" or key != "STOPPING" and key != "STOPPED" %} + + {% endif %} + {% endfor %} + + + {% for deployStat in report.deprecatedDeployStats %} + + + {% for key, value in deployStat.stageDistMap.items %} + {% if display_stopping_hosts == "true" or key != "STOPPING" and key != "STOPPED" %} + + {% endif %} + {% endfor %} + + + {% endfor %} +
+ + {{ key }} + + + Total +
+ + Current({{ build.commitShort }}) + + + + {{ value }} + + + + {{ report.currentDeployStat.total }} + +
+ + Previous({{ deployStat.build.commitShort }}) + + + + {{ value }} + + + + {{ deployStat.total }} + +
+
+
+ +
+ {% if report.firstTimeAgentStats %} + + {% endif %} + {% if report.provisioningHosts %} +
+ + + + + + +
+ + New Hosts + + + {% for host in report.provisioningHosts %} + + {{ host.hostName }} + + + {% endfor %} + + + {{ report.provisioningHosts | length }} + +
+
+ {% endif %} + {% if report.missingHosts %} +
+ + + + + + +
+ + Unknown Hosts + + + {% for host in report.missingHosts %} + + {{ host }} + + {% endfor %} + + + {{ report.missingHosts|length }} + +
+
+ {% endif %} +
+ {% for agentStat in report.agentStats %} + {% if report.account == primaryAccount %} + {% if not agentStat.agent.accountId or agentStat.agent.accountId == primaryAccount or agentStat.agent.accountId == "null" %} + + {% if report.showMode != "compact" %}{{ agentStat.agent.hostName }}{% endif %} + {% if report.showMode == "containerStatus" %} + {% include "deploys/_container_status.html" with healthStatus=agentStat.agent.containerHealthStatus %} + {% else %} + + {% endif %} + {% endif %} + + {% elif report.account == subAccount %} + {% if agentStat.agent.accountId and agentStat.agent.accountId == subAccount %} + + {% if report.showMode != "compact" %}{{ agentStat.agent.hostName }}{% endif %} + {% if report.showMode == "containerStatus" %} + {% include "deploys/_container_status.html" with healthStatus=agentStat.agent.containerHealthStatus %} + {% else %} + + {% endif %} + {% endif %} + + {% elif report.account == "others" %} + {% if agentStat.agent.accountId and agentStat.agent.accountId != subAccount and agentStat.agent.accountId != primaryAccount and agentStat.agent.accountId != "null" %} + + {% if report.showMode != "compact" %}{{ agentStat.agent.hostName }}{% endif %} + {% if report.showMode == "containerStatus" %} + {% include "deploys/_container_status.html" with healthStatus=agentStat.agent.containerHealthStatus %} + {% else %} + + {% endif %} + {% endif %} + + {% elif report.account == "all" %} + + {% if report.showMode != "compact" %}{{ agentStat.agent.hostName }}{% endif %} + {% if report.showMode == "containerStatus" %} + {% include "deploys/_container_status.html" with healthStatus=agentStat.agent.containerHealthStatus %} + {% else %} + + {% endif %} + + {% endif %} + {% endfor %} +
+
+
+ {% endif %} +{% endwith %} + From f47c33a983a1f929d40f75df8a0eb88976bfa5e9 Mon Sep 17 00:00:00 2001 From: Ian Roquebert <72234714+gzpcho@users.noreply.github.com> Date: Thu, 23 May 2024 04:47:11 +0000 Subject: [PATCH 4/8] Add `deploy_stage_summary.html` --- .../deploys/deploy_stage_summary.html | 91 +++++++++++++++++++ 1 file changed, 91 insertions(+) create mode 100644 deploy-board/deploy_board/templates/deploys/deploy_stage_summary.html diff --git a/deploy-board/deploy_board/templates/deploys/deploy_stage_summary.html b/deploy-board/deploy_board/templates/deploys/deploy_stage_summary.html new file mode 100644 index 0000000000..91b0727a24 --- /dev/null +++ b/deploy-board/deploy_board/templates/deploys/deploy_stage_summary.html @@ -0,0 +1,91 @@ +{% load utils %} +{% load static %} +
+
+ + + + + {% for key, value in report.currentDeployStat.stageDistMap.items %} + {% if display_stopping_hosts == "true" or key != "STOPPING" and key != "STOPPED" %} + + {% endif %} + {% endfor %} + + + + + + + {% for key, value in report.currentDeployStat.stageDistMap.items %} + {% if display_stopping_hosts == "true" or key != "STOPPING" and key != "STOPPED" %} + + {% endif %} + {% endfor %} + + + {% for deployStat in report.deprecatedDeployStats %} + + + {% for key, value in deployStat.stageDistMap.items %} + {% if display_stopping_hosts == "true" or key != "STOPPING" and key != "STOPPED" %} + + {% endif %} + {% endfor %} + + + + {% endfor %} +
+ + {{ key }} + + + + Total + +
+ + Current({{ build.commitShort }}) + + + + {{ value }} + + + + {{ report.currentDeployStat.total }} + +
+ + Previous({{ deployStat.build.commitShort }}) + + + + {{ value }} + + + + {{ deployStat.total }} + +
+
+
From d5d563523f952552f1cdabeb4adac1101f99fa30 Mon Sep 17 00:00:00 2001 From: Ian Roquebert <72234714+gzpcho@users.noreply.github.com> Date: Thu, 23 May 2024 04:48:22 +0000 Subject: [PATCH 5/8] Use more collapsibles in host panel --- .../templates/deploys/deploy_progress.html | 396 +++++++----------- 1 file changed, 159 insertions(+), 237 deletions(-) diff --git a/deploy-board/deploy_board/templates/deploys/deploy_progress.html b/deploy-board/deploy_board/templates/deploys/deploy_progress.html index 7b5b14244d..581ff247d2 100644 --- a/deploy-board/deploy_board/templates/deploys/deploy_progress.html +++ b/deploy-board/deploy_board/templates/deploys/deploy_progress.html @@ -8,92 +8,7 @@

Hosts

-
-
- - - - {% for key, value in report.currentDeployStat.stageDistMap.items %} - {% if display_stopping_hosts == "true" or key != "STOPPING" and key != "STOPPED" %} - - {% endif %} - {% endfor %} - - - - - {% for key, value in report.currentDeployStat.stageDistMap.items %} - {% if display_stopping_hosts == "true" or key != "STOPPING" and key != "STOPPED" %} - - {% endif %} - {% endfor %} - - - {% for deployStat in report.deprecatedDeployStats %} - - - {% for key, value in deployStat.stageDistMap.items %} - {% if display_stopping_hosts == "true" or key != "STOPPING" and key != "STOPPED" %} - - {% endif %} - {% endfor %} - - - {% endfor %} -
- - {{ key }} - - - Total -
- - Current({{ build.commitShort }}) - - - - {{ value }} - - - - {{ report.currentDeployStat.total }} - -
- - Previous({{ deployStat.build.commitShort }}) - - - - {{ value }} - - - - {{ deployStat.total }} - -
-
-
+ {% include "deploys/deploy_stage_summary.html" with report=report build=report.currentDeployStat.build show_stopping_hosts=show_stopping_hosts %}

Sub Account Hosts -
{% if report.firstTimeAgentStats %} -
- - - - - - -
- - New Hosts - - - - {% for agentStat in report.firstTimeAgentStats %} - - {% if report.showMode == "complete" %}{{ agentStat.agent.hostName }}{% endif %} - - {% if report.showMode == "containerStatus" %} - {% include "deploys/_container_status.html" with healthStatus=agentStat.agent.containerHealthStatus %} - {% endif %} - - {% endfor %} - - - - {{ report.firstTimeAgentStats|length }} - -
+
+ +
{% endif %} {% if report.provisioningHosts %} -
- - - - - - -
- - New Hosts - - - {% for host in report.provisioningHosts %} - - {{ host.hostName }} - - - {% endfor %} - +
+ title="Click to see more details">{{ report.provisioningHosts | length }} + + +
+
+ {% for host in report.provisioningHosts %} + + {{ host.hostName }} + + + {% endfor %} +
{% endif %} {% if report.missingHosts %} -
- - - - - - -
- - Unknown Hosts - - - {% for host in report.missingHosts %} - - {{ host }} - - {% endfor %} - - + +
+
+ {% for host in report.missingHosts %} + + {{ host }} -
-
- {% endif %} -
- {% for agentStat in report.agentStats %} - {% if report.account == primaryAccount %} - {% if not agentStat.agent.accountId or agentStat.agent.accountId == primaryAccount or agentStat.agent.accountId == "null" %} - - {% if report.showMode != "compact" %}{{ agentStat.agent.hostName }}{% endif %} - {% if report.showMode == "containerStatus" %} - {% include "deploys/_container_status.html" with healthStatus=agentStat.agent.containerHealthStatus %} - {% else %} - - {% endif %} - {% endif %} - - {% elif report.account == subAccount %} - {% if agentStat.agent.accountId and agentStat.agent.accountId == subAccount %} - - {% if report.showMode != "compact" %}{{ agentStat.agent.hostName }}{% endif %} - {% if report.showMode == "containerStatus" %} - {% include "deploys/_container_status.html" with healthStatus=agentStat.agent.containerHealthStatus %} - {% else %} - - {% endif %} - {% endif %} - - {% elif report.account == "others" %} - {% if agentStat.agent.accountId and agentStat.agent.accountId != subAccount and agentStat.agent.accountId != primaryAccount and agentStat.agent.accountId != "null" %} - - {% if report.showMode != "compact" %}{{ agentStat.agent.hostName }}{% endif %} - {% if report.showMode == "containerStatus" %} - {% include "deploys/_container_status.html" with healthStatus=agentStat.agent.containerHealthStatus %} - {% else %} - - {% endif %} - {% endif %} - - {% elif report.account == "all" %} - - {% if report.showMode != "compact" %}{{ agentStat.agent.hostName }}{% endif %} - {% if report.showMode == "containerStatus" %} - {% include "deploys/_container_status.html" with healthStatus=agentStat.agent.containerHealthStatus %} - {% else %} - - {% endif %} - + {% endfor %} +
{% endif %} - {% endfor %} +
+ {% for agentStat in report.agentStats %} + {% if report.account == primaryAccount %} + {% if not agentStat.agent.accountId or agentStat.agent.accountId == primaryAccount or agentStat.agent.accountId == "null" %} + + {% if report.showMode != "compact" %}{{ agentStat.agent.hostName }}{% endif %} + {% if report.showMode == "containerStatus" %} + {% include "deploys/_container_status.html" with healthStatus=agentStat.agent.containerHealthStatus %} + {% else %} + + {% endif %} + {% endif %} + + {% elif report.account == subAccount %} + {% if agentStat.agent.accountId and agentStat.agent.accountId == subAccount %} + + {% if report.showMode != "compact" %}{{ agentStat.agent.hostName }}{% endif %} + {% if report.showMode == "containerStatus" %} + {% include "deploys/_container_status.html" with healthStatus=agentStat.agent.containerHealthStatus %} + {% else %} + + {% endif %} + {% endif %} + + {% elif report.account == "others" %} + {% if agentStat.agent.accountId and agentStat.agent.accountId != subAccount and agentStat.agent.accountId != primaryAccount and agentStat.agent.accountId != "null" %} + + {% if report.showMode != "compact" %}{{ agentStat.agent.hostName }}{% endif %} + {% if report.showMode == "containerStatus" %} + {% include "deploys/_container_status.html" with healthStatus=agentStat.agent.containerHealthStatus %} + {% else %} + + {% endif %} + {% endif %} + + {% elif report.account == "all" %} + + {% if report.showMode != "compact" %}{{ agentStat.agent.hostName }}{% endif %} + {% if report.showMode == "containerStatus" %} + {% include "deploys/_container_status.html" with healthStatus=agentStat.agent.containerHealthStatus %} + {% else %} + + {% endif %} + + {% endif %} + {% endfor %} +
+ {% endif %} {% endwith %} From a5eb124a1d0f6fc3b3e173b35fcc4cba5c100365 Mon Sep 17 00:00:00 2001 From: Ian Roquebert <72234714+gzpcho@users.noreply.github.com> Date: Thu, 23 May 2024 05:16:14 +0000 Subject: [PATCH 6/8] Remove extraneuous elements --- .../templates/deploys/deploy_progress.html | 2 +- .../deploys/deploy_stage_summary.html | 138 +++++++++--------- 2 files changed, 69 insertions(+), 71 deletions(-) diff --git a/deploy-board/deploy_board/templates/deploys/deploy_progress.html b/deploy-board/deploy_board/templates/deploys/deploy_progress.html index 581ff247d2..dce4190e56 100644 --- a/deploy-board/deploy_board/templates/deploys/deploy_progress.html +++ b/deploy-board/deploy_board/templates/deploys/deploy_progress.html @@ -75,7 +75,7 @@

{% endif %} {% if report.provisioningHosts %}
-
+

-
- - - - - {% for key, value in report.currentDeployStat.stageDistMap.items %} - {% if display_stopping_hosts == "true" or key != "STOPPING" and key != "STOPPED" %} - - {% endif %} - {% endfor %} - - - - +
+
- - {{ key }} - - - - Total - -
+ + + + {% for key, value in report.currentDeployStat.stageDistMap.items %} + {% if display_stopping_hosts == "true" or key != "STOPPING" and key != "STOPPED" %} + + {% endif %} + {% endfor %} + + + + + + + {% for key, value in report.currentDeployStat.stageDistMap.items %} + {% if display_stopping_hosts == "true" or key != "STOPPING" and key != "STOPPED" %} + + {% endif %} + {% endfor %} + + + {% for deployStat in report.deprecatedDeployStats %} - {% for key, value in report.currentDeployStat.stageDistMap.items %} + {% for key, value in deployStat.stageDistMap.items %} {% if display_stopping_hosts == "true" or key != "STOPPING" and key != "STOPPED" %} - - {% for deployStat in report.deprecatedDeployStats %} - - - {% for key, value in deployStat.stageDistMap.items %} - {% if display_stopping_hosts == "true" or key != "STOPPING" and key != "STOPPED" %} - - {% endif %} - {% endfor %} - - - - {% endfor %} -
+ + {{ key }} + + + + Total + +
+ + Current({{ build.commitShort }}) + + + + {{ value }} + + + + {{ report.currentDeployStat.total }} + +
- - Current({{ build.commitShort }}) - + + Previous({{ deployStat.build.commitShort }}) + + - {{ value }} @@ -48,44 +78,12 @@ {{ report.currentDeployStat.total }} + href="/env/{{ report.envName }}/{{ report.stageName }}/{{ deployStat.deploy.id }}/hosts/" + title="Click to see more details">{{ deployStat.total }}
- - Previous({{ deployStat.build.commitShort }}) - - - - {{ value }} - - - - {{ deployStat.total }} - -
-
+ + {% endfor %} +

From 7f0af6be8b56a7d5e0f3748a900f038a5f72df95 Mon Sep 17 00:00:00 2001 From: Ian Roquebert <72234714+gzpcho@users.noreply.github.com> Date: Thu, 23 May 2024 05:18:18 +0000 Subject: [PATCH 7/8] Move host buttons to host panel heading --- .../deploy_board/templates/deploys/deploy_progress.html | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/deploy-board/deploy_board/templates/deploys/deploy_progress.html b/deploy-board/deploy_board/templates/deploys/deploy_progress.html index dce4190e56..7cd1779c7c 100644 --- a/deploy-board/deploy_board/templates/deploys/deploy_progress.html +++ b/deploy-board/deploy_board/templates/deploys/deploy_progress.html @@ -6,10 +6,7 @@

Sub Account Hosts + +
+ {% include "deploys/deploy_stage_summary.html" with report=report build=report.currentDeployStat.build show_stopping_hosts=show_stopping_hosts %} {% if report.firstTimeAgentStats %}
From f119da5fbb8f9d2a3cc19c0caf75b45081f74b4f Mon Sep 17 00:00:00 2001 From: Ian Roquebert <72234714+gzpcho@users.noreply.github.com> Date: Thu, 23 May 2024 08:16:52 +0000 Subject: [PATCH 8/8] Fix provisioning hosts collapsible not working on click --- .../templates/deploys/deploy_progress.html | 28 ++++++++++--------- .../templates/environs/env_landing.html | 2 +- 2 files changed, 16 insertions(+), 14 deletions(-) diff --git a/deploy-board/deploy_board/templates/deploys/deploy_progress.html b/deploy-board/deploy_board/templates/deploys/deploy_progress.html index 7cd1779c7c..6e1a681152 100644 --- a/deploy-board/deploy_board/templates/deploys/deploy_progress.html +++ b/deploy-board/deploy_board/templates/deploys/deploy_progress.html @@ -75,11 +75,11 @@

{% endif %} {% if report.provisioningHosts %}
-
+ -
- {% for host in report.provisioningHosts %} - - {{ host.hostName }} - - - {% endfor %} +
+
+ {% for host in report.provisioningHosts %} + + {{ host.hostName }} + + + {% endfor %} +
{% endif %} @@ -132,7 +134,7 @@

-
+
{% for host in report.missingHosts %} Resume Confirm

Warning! {{ env.envName }}/{{ env.stageName }} is managed by Pindeploy. Deployments should be done from this pipeline. - Creating a deployment from other sources will disable PinDeploy management on the pipeline. + Creating a deployment from other sources will disable PinDeploy management on the pipeline. Only do so in case of emergency.
{% endif %}