-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ui, deployments] Mirage Actively Deploying Job and Deployment Integration Tests #16888
Changes from all commits
9fa4cf1
b1c9030
607608c
0fb6a70
9bff305
84574c2
a907b52
258c237
50cf21e
2460213
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,6 +13,9 @@ | |
@label="View allocation" | ||
> | ||
{{#if (and (eq @status "running") (not @steady))}} | ||
{{#if (eq @canary "canary")}} | ||
<span class="alloc-canary-indicator" /> | ||
{{/if}} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Side-effect: we weren't showing the canary indicator for running, non-steady, ungrouped allocs. Now we are. |
||
<span class="alloc-health-indicator"> | ||
{{#if (eq @health "healthy")}} | ||
<FlightIcon @name="check" @color="white" /> | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -86,6 +86,76 @@ function smallCluster(server) { | |
type: 'service', | ||
activeDeployment: true, | ||
}); | ||
|
||
//#region Active Deployment | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. New default (small cluster) job to show off the deployment panel |
||
|
||
const activelyDeployingJobGroups = 2; | ||
const activelyDeployingTasksPerGroup = 100; | ||
|
||
const activelyDeployingJob = server.create('job', { | ||
createAllocations: true, | ||
groupTaskCount: activelyDeployingTasksPerGroup, | ||
shallow: true, | ||
resourceSpec: Array(activelyDeployingJobGroups).fill(['M: 257, C: 500']), | ||
noDeployments: true, // manually created below | ||
activeDeployment: true, | ||
allocStatusDistribution: { | ||
running: 0.6, | ||
failed: 0.05, | ||
unknown: 0.05, | ||
lost: 0, | ||
complete: 0, | ||
pending: 0.3, | ||
}, | ||
name: 'actively-deploying-job', | ||
id: 'actively-deploying-job', | ||
namespaceId: 'default', | ||
type: 'service', | ||
}); | ||
|
||
server.create('deployment', false, 'active', { | ||
jobId: activelyDeployingJob.id, | ||
groupDesiredTotal: activelyDeployingTasksPerGroup, | ||
versionNumber: 1, | ||
status: 'running', | ||
}); | ||
server.createList('allocation', 25, { | ||
jobId: activelyDeployingJob.id, | ||
jobVersion: 0, | ||
clientStatus: 'running', | ||
}); | ||
|
||
// Manipulate the above job to show a nice distribution of running, canary, etc. allocs | ||
let activelyDeployingJobAllocs = server.schema.allocations | ||
.all() | ||
.filter((a) => a.jobId === activelyDeployingJob.id); | ||
activelyDeployingJobAllocs.models | ||
.filter((a) => a.clientStatus === 'running') | ||
.slice(0, 10) | ||
.forEach((a) => | ||
a.update({ deploymentStatus: { Healthy: false, Canary: true } }) | ||
); | ||
activelyDeployingJobAllocs.models | ||
.filter((a) => a.clientStatus === 'running') | ||
.slice(10, 20) | ||
.forEach((a) => | ||
a.update({ deploymentStatus: { Healthy: true, Canary: true } }) | ||
); | ||
activelyDeployingJobAllocs.models | ||
.filter((a) => a.clientStatus === 'running') | ||
.slice(20, 65) | ||
.forEach((a) => | ||
a.update({ deploymentStatus: { Healthy: true, Canary: false } }) | ||
); | ||
activelyDeployingJobAllocs.models | ||
.filter((a) => a.clientStatus === 'pending') | ||
.slice(0, 10) | ||
.forEach((a) => | ||
a.update({ deploymentStatus: { Healthy: true, Canary: true } }) | ||
); | ||
|
||
//#endregion Active Deployment | ||
|
||
server.createList('allocFile', 5); | ||
server.create('allocFile', 'dir', { depth: 2 }); | ||
server.createList('csi-plugin', 2); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
question
: Where are you injecting this argument?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is injected in the nested
each-in
blocks of allocation-status-row.hbs:nomad/ui/app/components/job-status/allocation-status-row.hbs
Lines 11 to 18 in f64a0b5