github.com/hernad/nomad@v1.6.112/ui/app/components/job-status/panel/deploying.hbs (about)

     1  {{!
     2    Copyright (c) HashiCorp, Inc.
     3    SPDX-License-Identifier: MPL-2.0
     4  ~}}
     5  
     6  <div class="job-status-panel boxed-section active-deployment" data-test-job-status-panel>
     7    <div class="boxed-section-head hds-foreground-primary">
     8      <div class="boxed-section-row"
     9        {{did-insert (action this.establishOldAllocBlockIDs)}}
    10        >
    11          <h2>Status:
    12            <Hds::Badge @text="Deploying {{@job.latestDeployment.shortId}}" @color="highlight" @type="filled" />
    13          </h2>
    14          <div class="pull-right">
    15            {{#if @job.latestDeployment.isRunning}}
    16              <Hds::Button
    17                data-test-fail
    18                {{on "click" (perform this.fail)}}
    19                disabled={{this.fail.isRunning}}
    20                @color="critical"
    21                @text="Fail Deployment"
    22                {{keyboard-shortcut
    23                  label="Fail Deployment"
    24                  pattern=(array "f" "a" "i" "l")
    25                  action=(perform this.fail)
    26                }}
    27              />
    28            {{/if}}
    29          </div>
    30        </div>
    31      </div>
    32      <div class="boxed-section-body {{if @job.latestDeployment.requiresPromotion "requires-promotion"}}">
    33        {{#if @job.latestDeployment.requiresPromotion}}
    34          <div class="canary-promotion-alert">
    35            {{#if this.canariesHealthy}}
    36              <Hds::Alert @type="inline" @color="warning" as |A|>
    37                <A.Title>Deployment requires promotion</A.Title>
    38                <A.Description>Your deployment requires manual promotion — all canary allocations have passed their health checks.</A.Description>
    39                <A.Button
    40                  {{keyboard-shortcut
    41                    pattern=(array "p" "r" "o" "m" "o" "t" "e")
    42                    action=(action (perform this.promote))
    43                  }}
    44                  data-test-promote-canary @text="Promote Canary" @color="primary" {{on "click" (perform this.promote)}} />
    45              </Hds::Alert>
    46            {{else}}
    47              {{#if this.someCanariesHaveFailed}}
    48                <Hds::Alert @type="inline" @color="critical" as |A|>
    49                  <A.Title>Some Canaries have failed</A.Title>
    50                  <A.Description>Your canary allocations have failed their health checks. Please have a look at the error logs and task events for the allocations in question.</A.Description>
    51                </Hds::Alert>
    52              {{else}}
    53                <Hds::Alert @type="inline" @color="neutral" as |A|>
    54                  <A.Title>Checking Canary health</A.Title>
    55                  {{#if this.deploymentIsAutoPromoted}}
    56                    <A.Description>Your canary allocations are being placed and health-checked. If they pass, they will be automatically promoted and your deployment will continue.</A.Description>
    57                  {{else}}
    58                    <A.Description>Your job requires manual promotion, and your canary allocations are being placed and health-checked.</A.Description>
    59                  {{/if}}
    60                </Hds::Alert>
    61              {{/if}}
    62            {{/if}}
    63          </div>
    64        {{/if}}
    65  
    66        <div class="deployment-allocations">
    67          {{#if this.oldVersionAllocBlockIDs.length}}
    68            <h4 class="title is-5 previous-allocations-heading" data-test-old-allocation-tally>
    69              <span>
    70                Previous allocations: {{#if this.oldVersionAllocBlocks.running}}{{this.oldRunningHealthyAllocBlocks.length}} running{{/if}}
    71              </span>
    72  
    73              <section class="versions">
    74                <ul>
    75                  {{#each this.oldVersions as |versionObj|}}
    76                    <li>
    77                      <LinkTo data-version={{versionObj.version}} @route="jobs.job.allocations" @model={{@job}} @query={{hash version=(concat '[' versionObj.version ']')    status=(concat '["running", "pending", "failed"]')         }}>
    78                        {{#if (eq versionObj.version "unknown")}}
    79                          <Hds::Badge @text="unknown" class="version-label" @type="inverted" />
    80                        {{else}}
    81                          <Hds::Badge @text={{concat "v" versionObj.version}} class="version-label" @type="inverted" />
    82                        {{/if}}
    83                        <Hds::Badge @text={{versionObj.allocations.length}} class="version-count" />
    84                      </LinkTo>
    85                    </li>
    86                  {{/each}}
    87                </ul>
    88              </section>
    89            </h4>
    90            <div class="previous-allocations">
    91              <JobStatus::AllocationStatusRow @allocBlocks={{this.oldVersionAllocBlocks}} @steady={{true}} />
    92            </div>
    93            <div class="legend-and-summary" data-test-previous-allocations-legend>
    94              <legend>
    95                <span class="legend-item {{if (eq (get this.oldRunningHealthyAllocBlocks "length") 0) "faded"}}">
    96                  <span class="represented-allocation running"></span>
    97                  <span class="count">{{get this.oldRunningHealthyAllocBlocks "length"}} Running</span>
    98                </span>
    99                <span class="legend-item {{if (eq (get this.oldCompleteHealthyAllocBlocks "length") 0) "faded"}}">
   100                  <span class="represented-allocation complete"></span>
   101                  <span class="count">{{get this.oldCompleteHealthyAllocBlocks "length"}} Complete</span>
   102                </span>
   103              </legend>
   104            </div>
   105  
   106          {{/if}}
   107  
   108          <h4 class="title is-5" data-test-new-allocation-tally><span>New allocations: {{this.newRunningHealthyAllocBlocks.length}}/{{this.totalAllocs}} running and healthy</span>
   109            <span class="versions">
   110            <LinkTo data-version={{@job.version}} @route="jobs.job.allocations" @model={{@job}} @query={{hash version=(concat '[' @job.version ']')}}>
   111              <Hds::Badge @text={{concat "v" @job.version}} @type="inverted" class="version-label" />
   112            </LinkTo>
   113            </span>
   114          </h4>
   115          <div class="new-allocations">
   116            <JobStatus::AllocationStatusRow @allocBlocks={{this.newVersionAllocBlocks}} />
   117          </div>
   118        </div>
   119  
   120        <div class="legend-and-summary" data-test-new-allocations-legend>
   121  
   122          {{!-- Legend by Status, then by Health, then by Canary --}}
   123          <legend>
   124            {{#each-in this.newAllocsByStatus as |status count|}}
   125              <ConditionalLinkTo
   126                @condition={{and (not (eq status "unplaced")) (gt count 0)}}
   127                @route="jobs.job.allocations"
   128                @model={{@job}}
   129                @query={{hash status=(concat '["' status '"]') version=(concat '[' this.job.latestDeployment.versionNumber ']')}}
   130                @class="legend-item {{if (eq count 0) "faded"}}"
   131                @label="View {{status}} allocations"
   132              >
   133                <span class="represented-allocation {{status}}"></span>
   134                <span class="count">{{count}} {{capitalize status}}</span>
   135              </ConditionalLinkTo>
   136            {{/each-in}}
   137  
   138            {{#each-in this.newAllocsByHealth as |health count|}}
   139              <span class="legend-item {{if (eq count 0) "faded"}}">
   140                <span class="represented-allocation legend-example {{health}}">
   141                  <span class="alloc-health-indicator">
   142                    {{#if (eq health "healthy")}}
   143                      <FlightIcon @name="check" @color="#25ba81" />
   144                    {{else if (eq health "unhealthy")}}
   145                      <FlightIcon @name="x" @color="#c84034" />
   146                    {{else}}
   147                      <FlightIcon @name="running" @color="black" class="not-animated" />
   148                    {{/if}}
   149                  </span>
   150                </span>
   151                <span class="count">{{count}} {{humanize health}}</span>
   152              </span>
   153            {{/each-in}}
   154  
   155            <span class="legend-item {{if (eq this.newAllocsByCanary.canary 0) "faded"}}">
   156              <span class="represented-allocation legend-example canary">
   157                <span class="alloc-canary-indicator" />
   158              </span>
   159              <span class="count">{{this.newAllocsByCanary.canary}} Canary</span>
   160            </span>
   161  
   162          </legend>
   163  
   164          <JobStatus::FailedOrLost
   165            @rescheduledAllocs={{this.rescheduledAllocs}}
   166            @restartedAllocs={{this.restartedAllocs}}
   167            @job={{@job}}
   168            @supportsRescheduling={{true}}
   169          />
   170  
   171        </div>
   172  
   173        <div class="history-and-params">
   174          <JobStatus::DeploymentHistory @deployment={{@job.latestDeployment}} />
   175          <JobStatus::UpdateParams @job={{@job}} />
   176        </div>
   177  
   178      </div>
   179  </div>