Skip to content

Commit 98e1616

Browse files
authored
Merge pull request #233 from Vafilor/feat/nodepool
fix: wrong nodepool manifest value used
2 parents 6fd2a5f + 7a9d492 commit 98e1616

File tree

6 files changed

+35
-34
lines changed

6 files changed

+35
-34
lines changed

src/api/api/labelService.service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ export class LabelServiceService {
285285
responseType = 'text';
286286
}
287287

288-
return this.httpClient.get<GetLabelsResponse>(`${this.configuration.basePath}/apis/v1beta1/labels/${encodeURIComponent(String(namespace))}/${encodeURIComponent(String(resource))}/labels`,
288+
return this.httpClient.get<GetLabelsResponse>(`${this.configuration.basePath}/apis/v1beta1/${encodeURIComponent(String(namespace))}/${encodeURIComponent(String(resource))}/labels`,
289289
{
290290
params: queryParameters,
291291
responseType: <any>responseType,

src/app/parameters/models.ts

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,17 @@
1-
import { Parameter } from "../../api";
1+
import { Parameter } from '../../api';
22

33
export class ParameterUtils {
44
/**
55
* Goes through the template of a Parameter, which includes display name, options, etc, and the actual
66
* used value of a parameter, which includes name and value, and combines them into a parameter with all of the information.
7-
*
8-
* @param values
9-
* @param templates
107
*/
11-
public static combineValueAndTemplate(values: Parameter[], templates: Parameter[]): Parameter[]
12-
{
13-
let result = new Array<Parameter>();
8+
public static combineValueAndTemplate(values: Parameter[], templates: Parameter[]): Parameter[] {
9+
const result = new Array<Parameter>();
1410

15-
for(const template of templates) {
16-
let resultParameter = template;
11+
for (const template of templates) {
12+
const resultParameter = template;
1713
const valueParameter = values.find((val: Parameter) => val.name === template.name);
18-
if(valueParameter) {
14+
if (valueParameter) {
1915
resultParameter.value = valueParameter.value;
2016
}
2117

src/app/workflow-template-select/workflow-template-select.component.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ export class WorkflowTemplateSelectComponent implements OnInit {
4242
name: 'Model training',
4343
manifest: `arguments:
4444
parameters:
45-
45+
4646
# following are a list of parameters that might change based on user response.
4747
# some of these parameters are prefixed with cvat- to denote that they are special parameters and will be automatically populated by CVAT.
4848
# you can change the names, but changing names of special parameters might break the workflow.
@@ -233,7 +233,7 @@ volumeClaimTemplates:
233233
name: 'Ensemble inference',
234234
manifest: `arguments:
235235
parameters:
236-
236+
237237
# Following are a list of parameters that might change based on user response.
238238
# some of these parameters are prefixed with cvat- to denote that they are special parameters and will be automatically populated by CVAT.
239239
# you can change the names, but changing names of special parameters might break the workflow.

src/app/workflow-template/workflow-template-create/workflow-template-create.component.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,8 @@ export class WorkflowTemplateCreateComponent implements OnInit, OnDestroy, CanCo
147147
this.manifestChanged = false;
148148

149149
this.state = 'creating';
150-
const manifestText = this.manifestDagEditor.manifestTextCurrent;
150+
const manifestText = this.manifestDagEditor.rawManifest;
151+
151152
this.workflowTemplateServiceService
152153
.createWorkflowTemplate(this.namespace, {
153154
name: templateName,

src/app/workflow-template/workflow-template-edit/workflow-template-edit.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ export class WorkflowTemplateEditComponent implements OnInit, CanComponentDeacti
181181
return;
182182
}
183183

184-
const manifestText = this.manifestDagEditor.manifestTextCurrent;
184+
const manifestText = this.manifestDagEditor.rawManifest;
185185

186186
this.saving = true;
187187

src/app/workflow/workflow-execute-dialog/workflow-execute-dialog.component.ts

Lines changed: 23 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import { CronWorkflowFormatter } from '../../cron-workflow/models';
77
import * as yaml from 'js-yaml';
88
import { Alert } from '../../alert/alert';
99
import { AppRouter } from '../../router/app-router.service';
10+
import { ParameterUtils } from '../../parameters/models';
1011

1112
export interface WorkflowExecuteDialogData {
1213
namespace: string;
@@ -24,16 +25,6 @@ type WorkflowExecutionState = 'loading' | 'ready' | 'creating';
2425
styleUrls: ['./workflow-execute-dialog.component.scss']
2526
})
2627
export class WorkflowExecuteDialogComponent implements OnInit, OnDestroy {
27-
state: WorkflowExecutionState = 'loading';
28-
29-
alert: Alert;
30-
namespace = '';
31-
workflowTemplates: WorkflowTemplate[] = [];
32-
33-
selectedWorkflowTemplateUid = '';
34-
35-
// tslint:disable-next-line:variable-name
36-
private _selectedTemplate: WorkflowTemplate;
3728
set selectedTemplate(value: WorkflowTemplate) {
3829
this.selectedWorkflowTemplateUid = value.uid;
3930
this._selectedTemplate = value;
@@ -44,18 +35,10 @@ export class WorkflowExecuteDialogComponent implements OnInit, OnDestroy {
4435
this.parameters = [];
4536
}
4637
}
47-
4838
get selectedTemplate(): WorkflowTemplate {
4939
return this._selectedTemplate;
5040
}
5141

52-
@ViewChild(FormComponent, {static: false}) form: FormComponent;
53-
54-
showCron = false;
55-
parameters: Array<Parameter> = [];
56-
labels = new Array<KeyValue>();
57-
schedulingText: string = CronWorkflowFormatter.toYamlString({}, true);
58-
5942
constructor(
6043
private appRouter: AppRouter,
6144
private workflowTemplateSerivce: WorkflowTemplateServiceService,
@@ -81,9 +64,26 @@ export class WorkflowExecuteDialogComponent implements OnInit, OnDestroy {
8164

8265
// Parameters are set after setting workflow template to override any parameters it has
8366
if (data.parameters) {
84-
this.parameters = data.parameters;
67+
this.updateParameterValues(data.parameters);
8568
}
8669
}
70+
state: WorkflowExecutionState = 'loading';
71+
72+
alert: Alert;
73+
namespace = '';
74+
workflowTemplates: WorkflowTemplate[] = [];
75+
76+
selectedWorkflowTemplateUid = '';
77+
78+
@ViewChild(FormComponent, {static: false}) form: FormComponent;
79+
80+
showCron = false;
81+
parameters: Array<Parameter> = [];
82+
labels = new Array<KeyValue>();
83+
schedulingText: string = CronWorkflowFormatter.toYamlString({}, true);
84+
85+
// tslint:disable-next-line:variable-name
86+
private _selectedTemplate: WorkflowTemplate;
8787

8888
public static pluckParameters(manifest) {
8989
const res = yaml.safeLoad(manifest);
@@ -100,6 +100,10 @@ export class WorkflowExecuteDialogComponent implements OnInit, OnDestroy {
100100
return parameters;
101101
}
102102

103+
updateParameterValues(parameters: Parameter[]) {
104+
this.parameters = ParameterUtils.combineValueAndTemplate(parameters, this.parameters);
105+
}
106+
103107
ngOnInit() {
104108
}
105109

0 commit comments

Comments
 (0)