Add worker parameter for GC (#18882)

1. Related back-end PR #18855

Signed-off-by: AllForNothing <sshijun@vmware.com>
This commit is contained in:
Shijun Sun 2023-07-04 10:36:39 +08:00 committed by GitHub
parent ef96c729c0
commit 1d2624eefc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
12 changed files with 63 additions and 8 deletions

View File

@ -20,3 +20,5 @@ export const YES: string = 'TAG_RETENTION.YES';
export const NO: string = 'TAG_RETENTION.NO'; export const NO: string = 'TAG_RETENTION.NO';
export const REFRESH_STATUS_TIME_DIFFERENCE: number = 5000; export const REFRESH_STATUS_TIME_DIFFERENCE: number = 5000;
export const WORKER_OPTIONS: number[] = [1, 2, 3, 4, 5];

View File

@ -50,6 +50,37 @@
[originCron]="originCron" [originCron]="originCron"
(inputvalue)="saveGcSchedule($event)"></cron-selection> (inputvalue)="saveGcSchedule($event)"></cron-selection>
</div> </div>
<div class="clr-row mb-1">
<div class="clr-col-2 flex-200 font-style">
{{ 'JOB_SERVICE_DASHBOARD.WORKERS' | translate
}}<clr-tooltip>
<clr-icon
clrTooltipTrigger
shape="info-circle"
size="24"></clr-icon>
<clr-tooltip-content
clrPosition="top-right"
clrSize="lg"
*clrIfOpen>
<span>{{ 'GC.WORKERS_TOOLTIP' | translate }}</span>
</clr-tooltip-content>
</clr-tooltip>
</div>
<div class="clr-col">
<div class="clr-select-wrapper">
<select
id="workers"
class="clr-select worker-select"
[(ngModel)]="workerNum">
<option
*ngFor="let item of workerOptions"
value="{{ item }}">
{{ item }}
</option>
</select>
</div>
</div>
</div>
<div class="clr-row"> <div class="clr-row">
<div class="clr-col-2 flex-200"></div> <div class="clr-col-2 flex-200"></div>
<div class="clr-col"> <div class="clr-col">

View File

@ -35,3 +35,7 @@
padding-left: .6rem; padding-left: .6rem;
padding-right: .6rem; padding-right: .6rem;
} }
.worker-select {
width: 4.5rem;
}

View File

@ -10,7 +10,9 @@ import { GcHistoryComponent } from './gc-history/gc-history.component';
import { import {
JOB_STATUS, JOB_STATUS,
REFRESH_STATUS_TIME_DIFFERENCE, REFRESH_STATUS_TIME_DIFFERENCE,
WORKER_OPTIONS,
} from '../../clearing-job-interfact'; } from '../../clearing-job-interfact';
import { clone } from '../../../../../shared/units/utils';
const ONE_MINUTE = 60000; const ONE_MINUTE = 60000;
@ -27,6 +29,8 @@ export class GcComponent implements OnInit, OnDestroy {
@ViewChild(CronScheduleComponent) @ViewChild(CronScheduleComponent)
cronScheduleComponent: CronScheduleComponent; cronScheduleComponent: CronScheduleComponent;
shouldDeleteUntagged: boolean; shouldDeleteUntagged: boolean;
workerNum: number = 1;
workerOptions: number[] = clone(WORKER_OPTIONS);
dryRunOnGoing: boolean = false; dryRunOnGoing: boolean = false;
lastCompletedTime: string; lastCompletedTime: string;
@ -116,8 +120,10 @@ export class GcComponent implements OnInit, OnDestroy {
this.shouldDeleteUntagged = JSON.parse( this.shouldDeleteUntagged = JSON.parse(
gcHistory.job_parameters gcHistory.job_parameters
).delete_untagged; ).delete_untagged;
this.workerNum = +JSON.parse(gcHistory.job_parameters).workers;
} else { } else {
this.shouldDeleteUntagged = false; this.shouldDeleteUntagged = false;
this.workerNum = 1;
} }
} }
@ -132,6 +138,7 @@ export class GcComponent implements OnInit, OnDestroy {
schedule: { schedule: {
parameters: { parameters: {
delete_untagged: this.shouldDeleteUntagged, delete_untagged: this.shouldDeleteUntagged,
workers: +this.workerNum,
dry_run: false, dry_run: false,
}, },
schedule: { schedule: {
@ -157,6 +164,7 @@ export class GcComponent implements OnInit, OnDestroy {
schedule: { schedule: {
parameters: { parameters: {
delete_untagged: this.shouldDeleteUntagged, delete_untagged: this.shouldDeleteUntagged,
workers: +this.workerNum,
dry_run: true, dry_run: true,
}, },
schedule: { schedule: {
@ -188,6 +196,7 @@ export class GcComponent implements OnInit, OnDestroy {
schedule: { schedule: {
parameters: { parameters: {
delete_untagged: this.shouldDeleteUntagged, delete_untagged: this.shouldDeleteUntagged,
workers: +this.workerNum,
dry_run: false, dry_run: false,
}, },
schedule: { schedule: {
@ -212,6 +221,7 @@ export class GcComponent implements OnInit, OnDestroy {
schedule: { schedule: {
parameters: { parameters: {
delete_untagged: this.shouldDeleteUntagged, delete_untagged: this.shouldDeleteUntagged,
workers: +this.workerNum,
dry_run: false, dry_run: false,
}, },
schedule: { schedule: {

View File

@ -1236,7 +1236,8 @@
"DELETE_BLOB_AND_MANIFEST": "{{blob}} blob(s) and {{manifest}} manifest(s) deleted", "DELETE_BLOB_AND_MANIFEST": "{{blob}} blob(s) and {{manifest}} manifest(s) deleted",
"DELETE_BLOB": "{{blob}} blob(s) deleted", "DELETE_BLOB": "{{blob}} blob(s) deleted",
"DELETE_MANIFEST": "{{manifest}} manifest(s) deleted", "DELETE_MANIFEST": "{{manifest}} manifest(s) deleted",
"FREE_UP_SIZE": "{{size}} space freed up" "FREE_UP_SIZE": "{{size}} space freed up",
"WORKERS_TOOLTIP": "Set the number of workers that can execute GC tasks in parallel, the default value is 1."
}, },
"RETAG": { "RETAG": {
"MSG_SUCCESS": "Artefakt erfolgreich kopiert", "MSG_SUCCESS": "Artefakt erfolgreich kopiert",

View File

@ -1237,7 +1237,8 @@
"DELETE_BLOB_AND_MANIFEST": "{{blob}} blob(s) and {{manifest}} manifest(s) deleted", "DELETE_BLOB_AND_MANIFEST": "{{blob}} blob(s) and {{manifest}} manifest(s) deleted",
"DELETE_BLOB": "{{blob}} blob(s) deleted", "DELETE_BLOB": "{{blob}} blob(s) deleted",
"DELETE_MANIFEST": "{{manifest}} manifest(s) deleted", "DELETE_MANIFEST": "{{manifest}} manifest(s) deleted",
"FREE_UP_SIZE": "{{size}} space freed up" "FREE_UP_SIZE": "{{size}} space freed up",
"WORKERS_TOOLTIP": "Set the number of workers that can execute GC tasks in parallel, the default value is 1."
}, },
"RETAG": { "RETAG": {
"MSG_SUCCESS": "Copy artifact successfully", "MSG_SUCCESS": "Copy artifact successfully",

View File

@ -1233,7 +1233,8 @@
"DELETE_BLOB_AND_MANIFEST": "{{blob}} blob(s) and {{manifest}} manifest(s) deleted", "DELETE_BLOB_AND_MANIFEST": "{{blob}} blob(s) and {{manifest}} manifest(s) deleted",
"DELETE_BLOB": "{{blob}} blob(s) deleted", "DELETE_BLOB": "{{blob}} blob(s) deleted",
"DELETE_MANIFEST": "{{manifest}} manifest(s) deleted", "DELETE_MANIFEST": "{{manifest}} manifest(s) deleted",
"FREE_UP_SIZE": "{{size}} space freed up" "FREE_UP_SIZE": "{{size}} space freed up",
"WORKERS_TOOLTIP": "Set the number of workers that can execute GC tasks in parallel, the default value is 1."
}, },
"RETAG": { "RETAG": {
"MSG_SUCCESS": "Copy artifact successfully", "MSG_SUCCESS": "Copy artifact successfully",

View File

@ -1203,7 +1203,8 @@
"DELETE_BLOB_AND_MANIFEST": "{{blob}} blob(s) and {{manifest}} manifest(s) deleted", "DELETE_BLOB_AND_MANIFEST": "{{blob}} blob(s) and {{manifest}} manifest(s) deleted",
"DELETE_BLOB": "{{blob}} blob(s) deleted", "DELETE_BLOB": "{{blob}} blob(s) deleted",
"DELETE_MANIFEST": "{{manifest}} manifest(s) deleted", "DELETE_MANIFEST": "{{manifest}} manifest(s) deleted",
"FREE_UP_SIZE": "{{size}} space freed up" "FREE_UP_SIZE": "{{size}} space freed up",
"WORKERS_TOOLTIP": "Set the number of workers that can execute GC tasks in parallel, the default value is 1."
}, },
"RETAG": { "RETAG": {
"MSG_SUCCESS": "Artefact copié", "MSG_SUCCESS": "Artefact copié",

View File

@ -1233,7 +1233,8 @@
"DELETE_BLOB_AND_MANIFEST": "{{blob}} blob(s) and {{manifest}} manifest(s) deleted", "DELETE_BLOB_AND_MANIFEST": "{{blob}} blob(s) and {{manifest}} manifest(s) deleted",
"DELETE_BLOB": "{{blob}} blob(s) deleted", "DELETE_BLOB": "{{blob}} blob(s) deleted",
"DELETE_MANIFEST": "{{manifest}} manifest(s) deleted", "DELETE_MANIFEST": "{{manifest}} manifest(s) deleted",
"FREE_UP_SIZE": "{{size}} space freed up" "FREE_UP_SIZE": "{{size}} space freed up",
"WORKERS_TOOLTIP": "Set the number of workers that can execute GC tasks in parallel, the default value is 1."
}, },
"RETAG": { "RETAG": {
"MSG_SUCCESS": "Artefato copiado com sucesso", "MSG_SUCCESS": "Artefato copiado com sucesso",

View File

@ -1236,7 +1236,8 @@
"DELETE_BLOB_AND_MANIFEST": "{{blob}} blob(s) and {{manifest}} manifest(s) deleted", "DELETE_BLOB_AND_MANIFEST": "{{blob}} blob(s) and {{manifest}} manifest(s) deleted",
"DELETE_BLOB": "{{blob}} blob(s) deleted", "DELETE_BLOB": "{{blob}} blob(s) deleted",
"DELETE_MANIFEST": "{{manifest}} manifest(s) deleted", "DELETE_MANIFEST": "{{manifest}} manifest(s) deleted",
"FREE_UP_SIZE": "{{size}} space freed up" "FREE_UP_SIZE": "{{size}} space freed up",
"WORKERS_TOOLTIP": "Set the number of workers that can execute GC tasks in parallel, the default value is 1."
}, },
"RETAG": { "RETAG": {
"MSG_SUCCESS": "Copy artifact successfully", "MSG_SUCCESS": "Copy artifact successfully",

View File

@ -1233,7 +1233,8 @@
"DELETE_BLOB_AND_MANIFEST": "{{blob}}个 blob(s) 和 {{manifest}}个 manifest(s) 已删除", "DELETE_BLOB_AND_MANIFEST": "{{blob}}个 blob(s) 和 {{manifest}}个 manifest(s) 已删除",
"DELETE_BLOB": "{{blob}}个 blob(s) 已删除", "DELETE_BLOB": "{{blob}}个 blob(s) 已删除",
"DELETE_MANIFEST": "{{manifest}}个 manifest(s) 已删除", "DELETE_MANIFEST": "{{manifest}}个 manifest(s) 已删除",
"FREE_UP_SIZE": "{{size}}的空间已清理" "FREE_UP_SIZE": "{{size}}的空间已清理",
"WORKERS_TOOLTIP": "设置可并行执行垃圾回收任务的工作者数量默认值为1。"
}, },
"RETAG": { "RETAG": {
"MSG_SUCCESS": "Artifact 拷贝成功", "MSG_SUCCESS": "Artifact 拷贝成功",

View File

@ -1225,7 +1225,8 @@
"DELETE_BLOB_AND_MANIFEST": "{{blob}} blob(s) and {{manifest}} manifest(s) deleted", "DELETE_BLOB_AND_MANIFEST": "{{blob}} blob(s) and {{manifest}} manifest(s) deleted",
"DELETE_BLOB": "{{blob}} blob(s) deleted", "DELETE_BLOB": "{{blob}} blob(s) deleted",
"DELETE_MANIFEST": "{{manifest}} manifest(s) deleted", "DELETE_MANIFEST": "{{manifest}} manifest(s) deleted",
"FREE_UP_SIZE": "{{size}} space freed up" "FREE_UP_SIZE": "{{size}} space freed up",
"WORKERS_TOOLTIP": "Set the number of workers that can execute GC tasks in parallel, the default value is 1."
}, },
"RETAG": { "RETAG": {
"MSG_SUCCESS": "Artifact 複製成功", "MSG_SUCCESS": "Artifact 複製成功",