mirror of
https://github.com/clearml/clearml-web
synced 2025-03-13 07:08:17 +00:00
Added io mapping for models and parameters
This commit is contained in:
parent
bf49d855cd
commit
e196169c98
@ -65,6 +65,8 @@ export class EditPipelinePageComponent implements OnInit, OnDestroy {
|
|||||||
this.reactFlowState.edges
|
this.reactFlowState.edges
|
||||||
);
|
);
|
||||||
const options: Array<PipelinesStepInputOutputMappingOptions> = [];
|
const options: Array<PipelinesStepInputOutputMappingOptions> = [];
|
||||||
|
|
||||||
|
// add outputs from incomming nodes.
|
||||||
incommingNodes.forEach((node) => {
|
incommingNodes.forEach((node) => {
|
||||||
if (node.data?.experimentDetails?.execution?.artifacts?.length) {
|
if (node.data?.experimentDetails?.execution?.artifacts?.length) {
|
||||||
// for now we are using only artifacts of i/o mapping.
|
// for now we are using only artifacts of i/o mapping.
|
||||||
@ -77,7 +79,33 @@ export class EditPipelinePageComponent implements OnInit, OnDestroy {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(node.data?.experimentDetails?.models?.output?.length) {
|
||||||
|
// models i/o mapping.
|
||||||
|
node.data.experimentDetails.models.output.forEach((model) => {
|
||||||
|
options.push({
|
||||||
|
...model,
|
||||||
|
stepName: node.data.name,
|
||||||
|
id: model.model.id,
|
||||||
|
type: "model",
|
||||||
|
key: model.name
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// add pipeline parameters
|
||||||
|
if(this.selectedPipeline?.parameters?.length) {
|
||||||
|
this.selectedPipeline.parameters.forEach((param) => {
|
||||||
|
options.push({
|
||||||
|
...param,
|
||||||
|
stepName: this.selectedPipeline.name,
|
||||||
|
type: "pipeline_parameter",
|
||||||
|
key: param.name
|
||||||
|
});
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
this.selectedStepInputOutputOptions = options;
|
this.selectedStepInputOutputOptions = options;
|
||||||
console.log(options);
|
console.log(options);
|
||||||
}
|
}
|
||||||
@ -96,7 +124,7 @@ export class EditPipelinePageComponent implements OnInit, OnDestroy {
|
|||||||
this.pipelineId = pipelineId;
|
this.pipelineId = pipelineId;
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.store.dispatch(getPipelineById({ id: pipelineId, name: "" }));
|
this.store.dispatch(getPipelineById({ id: pipelineId, name: "" }));
|
||||||
}, 1000);
|
});
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
::ng-deep {
|
::ng-deep {
|
||||||
.option {
|
.option {
|
||||||
background-color: red;
|
// background-color: red;
|
||||||
|
|
||||||
span {
|
span {
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
|
@ -30,11 +30,20 @@ export class PipelineStepInfoComponent {
|
|||||||
|
|
||||||
@Input() set ioOptions(options: any) {
|
@Input() set ioOptions(options: any) {
|
||||||
const opts = options.map((op) => {
|
const opts = options.map((op) => {
|
||||||
return {
|
if(op.type === "pipeline_parameter") {
|
||||||
value: "${"+op.stepName+".id}."+op.key,
|
return {
|
||||||
label: `${op.stepName}.${op.key}`,
|
value: "${pipeline." + op.key +"}",
|
||||||
type: op.type
|
label: `${op.stepName}.${op.key}`,
|
||||||
|
type: op.type
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
return {
|
||||||
|
value: "${"+op.stepName+".id}."+op.key,
|
||||||
|
label: `${op.stepName}.${op.key}`,
|
||||||
|
type: op.type
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
this._ioOptions = cloneDeep(opts);
|
this._ioOptions = cloneDeep(opts);
|
||||||
|
@ -19,7 +19,7 @@ import {
|
|||||||
import { Task } from '~/business-logic/model/tasks/task';
|
import { Task } from '~/business-logic/model/tasks/task';
|
||||||
import { PipelineParametersComponent } from '@common/pipelines/pipeline-parameters/pipeline-parameters.component';
|
import { PipelineParametersComponent } from '@common/pipelines/pipeline-parameters/pipeline-parameters.component';
|
||||||
|
|
||||||
import { cloneDeep } from 'lodash-es';
|
import { cloneDeep, upperCase } from 'lodash-es';
|
||||||
import { ParamsItem } from '~/business-logic/model/tasks/paramsItem';
|
import { ParamsItem } from '~/business-logic/model/tasks/paramsItem';
|
||||||
|
|
||||||
|
|
||||||
@ -91,7 +91,7 @@ export class PipelineAddStepFormComponent implements OnChanges, OnDestroy {
|
|||||||
this._experiments = experiments;
|
this._experiments = experiments;
|
||||||
this.experimentsOptions = [
|
this.experimentsOptions = [
|
||||||
...((this.rootFiltered || experiments === null) ? [] : [this.experimentsRoot]),
|
...((this.rootFiltered || experiments === null) ? [] : [this.experimentsRoot]),
|
||||||
...(experiments ? experiments.map(experiment => ({label: experiment.name, value: experiment.id, parameters: experiment.hyperparams, otherDetails: {...experiment}})) : [])
|
...(experiments ? experiments.map(experiment => ({label: experiment.name + " ("+ upperCase(experiment?.status) + ")", value: experiment.id, parameters: experiment.hyperparams, otherDetails: {...experiment}})) : [])
|
||||||
];
|
];
|
||||||
this.experimentsNames = this.experimentsOptions.map(experiment => experiment.label);
|
this.experimentsNames = this.experimentsOptions.map(experiment => experiment.label);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user