@things-factory/mlops 9.1.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +341 -0
- package/client/bootstrap.ts +41 -0
- package/client/index.ts +2 -0
- package/client/pages/ml-deployment/ml-deployment-list-page.ts +46 -0
- package/client/pages/ml-model/ml-model-list-page.ts +46 -0
- package/client/pages/ml-pipeline/ml-pipeline-list-page.ts +46 -0
- package/client/pages/mlops-dashboard/mlops-dashboard-page.ts +90 -0
- package/client/route.ts +19 -0
- package/client/tsconfig.json +12 -0
- package/dist-client/bootstrap.d.ts +1 -0
- package/dist-client/bootstrap.js +40 -0
- package/dist-client/bootstrap.js.map +1 -0
- package/dist-client/index.d.ts +2 -0
- package/dist-client/index.js +3 -0
- package/dist-client/index.js.map +1 -0
- package/dist-client/pages/ml-deployment/ml-deployment-list-page.d.ts +5 -0
- package/dist-client/pages/ml-deployment/ml-deployment-list-page.js +49 -0
- package/dist-client/pages/ml-deployment/ml-deployment-list-page.js.map +1 -0
- package/dist-client/pages/ml-model/ml-model-list-page.d.ts +5 -0
- package/dist-client/pages/ml-model/ml-model-list-page.js +49 -0
- package/dist-client/pages/ml-model/ml-model-list-page.js.map +1 -0
- package/dist-client/pages/ml-pipeline/ml-pipeline-list-page.d.ts +5 -0
- package/dist-client/pages/ml-pipeline/ml-pipeline-list-page.js +49 -0
- package/dist-client/pages/ml-pipeline/ml-pipeline-list-page.js.map +1 -0
- package/dist-client/pages/mlops-dashboard/mlops-dashboard-page.d.ts +5 -0
- package/dist-client/pages/mlops-dashboard/mlops-dashboard-page.js +93 -0
- package/dist-client/pages/mlops-dashboard/mlops-dashboard-page.js.map +1 -0
- package/dist-client/route.d.ts +1 -0
- package/dist-client/route.js +17 -0
- package/dist-client/route.js.map +1 -0
- package/dist-client/tsconfig.tsbuildinfo +1 -0
- package/dist-server/index.d.ts +2 -0
- package/dist-server/index.js +6 -0
- package/dist-server/index.js.map +1 -0
- package/dist-server/routes.d.ts +5 -0
- package/dist-server/routes.js +12 -0
- package/dist-server/routes.js.map +1 -0
- package/dist-server/service/index.d.ts +8 -0
- package/dist-server/service/index.js +31 -0
- package/dist-server/service/index.js.map +1 -0
- package/dist-server/service/ml-deployment/index.d.ts +3 -0
- package/dist-server/service/ml-deployment/index.js +8 -0
- package/dist-server/service/ml-deployment/index.js.map +1 -0
- package/dist-server/service/ml-deployment/ml-deployment.d.ts +48 -0
- package/dist-server/service/ml-deployment/ml-deployment.js +153 -0
- package/dist-server/service/ml-deployment/ml-deployment.js.map +1 -0
- package/dist-server/service/ml-model/index.d.ts +5 -0
- package/dist-server/service/ml-model/index.js +11 -0
- package/dist-server/service/ml-model/index.js.map +1 -0
- package/dist-server/service/ml-model/ml-model-mutation.d.ts +24 -0
- package/dist-server/service/ml-model/ml-model-mutation.js +177 -0
- package/dist-server/service/ml-model/ml-model-mutation.js.map +1 -0
- package/dist-server/service/ml-model/ml-model-query.d.ts +23 -0
- package/dist-server/service/ml-model/ml-model-query.js +123 -0
- package/dist-server/service/ml-model/ml-model-query.js.map +1 -0
- package/dist-server/service/ml-model/ml-model-types.d.ts +27 -0
- package/dist-server/service/ml-model/ml-model-types.js +105 -0
- package/dist-server/service/ml-model/ml-model-types.js.map +1 -0
- package/dist-server/service/ml-model/ml-model.d.ts +52 -0
- package/dist-server/service/ml-model/ml-model.js +161 -0
- package/dist-server/service/ml-model/ml-model.js.map +1 -0
- package/dist-server/service/ml-pipeline/index.d.ts +3 -0
- package/dist-server/service/ml-pipeline/index.js +8 -0
- package/dist-server/service/ml-pipeline/index.js.map +1 -0
- package/dist-server/service/ml-pipeline/ml-pipeline.d.ts +50 -0
- package/dist-server/service/ml-pipeline/ml-pipeline.js +163 -0
- package/dist-server/service/ml-pipeline/ml-pipeline.js.map +1 -0
- package/dist-server/service/ml-pipeline-run/index.d.ts +3 -0
- package/dist-server/service/ml-pipeline-run/index.js +8 -0
- package/dist-server/service/ml-pipeline-run/index.js.map +1 -0
- package/dist-server/service/ml-pipeline-run/ml-pipeline-run.d.ts +40 -0
- package/dist-server/service/ml-pipeline-run/ml-pipeline-run.js +136 -0
- package/dist-server/service/ml-pipeline-run/ml-pipeline-run.js.map +1 -0
- package/dist-server/tsconfig.json +11 -0
- package/dist-server/tsconfig.tsbuildinfo +1 -0
- package/package.json +52 -0
- package/server/index.ts +3 -0
- package/server/routes.ts +13 -0
- package/server/service/index.ts +29 -0
- package/server/service/ml-deployment/index.ts +6 -0
- package/server/service/ml-deployment/ml-deployment.ts +136 -0
- package/server/service/ml-model/index.ts +9 -0
- package/server/service/ml-model/ml-model-mutation.ts +171 -0
- package/server/service/ml-model/ml-model-query.ts +97 -0
- package/server/service/ml-model/ml-model-types.ts +71 -0
- package/server/service/ml-model/ml-model.ts +143 -0
- package/server/service/ml-pipeline/index.ts +6 -0
- package/server/service/ml-pipeline/ml-pipeline.ts +144 -0
- package/server/service/ml-pipeline-run/index.ts +6 -0
- package/server/service/ml-pipeline-run/ml-pipeline-run.ts +118 -0
- package/server/tsconfig.json +11 -0
- package/things-factory.config.js +13 -0
- package/translations/en.json +30 -0
- package/translations/ko.json +30 -0
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PromoteModelInput = exports.UpdateMLModelInput = exports.RegisterMLModelInput = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const type_graphql_1 = require("type-graphql");
|
|
6
|
+
const ml_model_1 = require("./ml-model");
|
|
7
|
+
let RegisterMLModelInput = class RegisterMLModelInput {
|
|
8
|
+
};
|
|
9
|
+
exports.RegisterMLModelInput = RegisterMLModelInput;
|
|
10
|
+
tslib_1.__decorate([
|
|
11
|
+
(0, type_graphql_1.Field)({ description: 'Model name' }),
|
|
12
|
+
tslib_1.__metadata("design:type", String)
|
|
13
|
+
], RegisterMLModelInput.prototype, "name", void 0);
|
|
14
|
+
tslib_1.__decorate([
|
|
15
|
+
(0, type_graphql_1.Field)({ description: 'Model version' }),
|
|
16
|
+
tslib_1.__metadata("design:type", String)
|
|
17
|
+
], RegisterMLModelInput.prototype, "version", void 0);
|
|
18
|
+
tslib_1.__decorate([
|
|
19
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'Model description' }),
|
|
20
|
+
tslib_1.__metadata("design:type", String)
|
|
21
|
+
], RegisterMLModelInput.prototype, "description", void 0);
|
|
22
|
+
tslib_1.__decorate([
|
|
23
|
+
(0, type_graphql_1.Field)(type => ml_model_1.ModelStage, { nullable: true, description: 'Initial stage' }),
|
|
24
|
+
tslib_1.__metadata("design:type", String)
|
|
25
|
+
], RegisterMLModelInput.prototype, "stage", void 0);
|
|
26
|
+
tslib_1.__decorate([
|
|
27
|
+
(0, type_graphql_1.Field)(type => ml_model_1.ModelFramework, { nullable: true, description: 'ML framework' }),
|
|
28
|
+
tslib_1.__metadata("design:type", String)
|
|
29
|
+
], RegisterMLModelInput.prototype, "framework", void 0);
|
|
30
|
+
tslib_1.__decorate([
|
|
31
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'Model metrics as JSON string' }),
|
|
32
|
+
tslib_1.__metadata("design:type", String)
|
|
33
|
+
], RegisterMLModelInput.prototype, "metrics", void 0);
|
|
34
|
+
tslib_1.__decorate([
|
|
35
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'Model metadata as JSON string' }),
|
|
36
|
+
tslib_1.__metadata("design:type", String)
|
|
37
|
+
], RegisterMLModelInput.prototype, "metadata", void 0);
|
|
38
|
+
tslib_1.__decorate([
|
|
39
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'Artifact URI' }),
|
|
40
|
+
tslib_1.__metadata("design:type", String)
|
|
41
|
+
], RegisterMLModelInput.prototype, "artifactUri", void 0);
|
|
42
|
+
tslib_1.__decorate([
|
|
43
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'MLflow run ID' }),
|
|
44
|
+
tslib_1.__metadata("design:type", String)
|
|
45
|
+
], RegisterMLModelInput.prototype, "mlflowRunId", void 0);
|
|
46
|
+
tslib_1.__decorate([
|
|
47
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'MLflow experiment ID' }),
|
|
48
|
+
tslib_1.__metadata("design:type", String)
|
|
49
|
+
], RegisterMLModelInput.prototype, "mlflowExperimentId", void 0);
|
|
50
|
+
tslib_1.__decorate([
|
|
51
|
+
(0, type_graphql_1.Field)(type => type_graphql_1.Int, { nullable: true, description: 'Label Studio project ID' }),
|
|
52
|
+
tslib_1.__metadata("design:type", Number)
|
|
53
|
+
], RegisterMLModelInput.prototype, "labelStudioProjectId", void 0);
|
|
54
|
+
tslib_1.__decorate([
|
|
55
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'Tags as JSON array string' }),
|
|
56
|
+
tslib_1.__metadata("design:type", String)
|
|
57
|
+
], RegisterMLModelInput.prototype, "tags", void 0);
|
|
58
|
+
exports.RegisterMLModelInput = RegisterMLModelInput = tslib_1.__decorate([
|
|
59
|
+
(0, type_graphql_1.InputType)({ description: 'Input for registering ML model' })
|
|
60
|
+
], RegisterMLModelInput);
|
|
61
|
+
let UpdateMLModelInput = class UpdateMLModelInput {
|
|
62
|
+
};
|
|
63
|
+
exports.UpdateMLModelInput = UpdateMLModelInput;
|
|
64
|
+
tslib_1.__decorate([
|
|
65
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'Model description' }),
|
|
66
|
+
tslib_1.__metadata("design:type", String)
|
|
67
|
+
], UpdateMLModelInput.prototype, "description", void 0);
|
|
68
|
+
tslib_1.__decorate([
|
|
69
|
+
(0, type_graphql_1.Field)(type => ml_model_1.ModelStage, { nullable: true, description: 'Stage' }),
|
|
70
|
+
tslib_1.__metadata("design:type", String)
|
|
71
|
+
], UpdateMLModelInput.prototype, "stage", void 0);
|
|
72
|
+
tslib_1.__decorate([
|
|
73
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'Model metrics as JSON string' }),
|
|
74
|
+
tslib_1.__metadata("design:type", String)
|
|
75
|
+
], UpdateMLModelInput.prototype, "metrics", void 0);
|
|
76
|
+
tslib_1.__decorate([
|
|
77
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'Model metadata as JSON string' }),
|
|
78
|
+
tslib_1.__metadata("design:type", String)
|
|
79
|
+
], UpdateMLModelInput.prototype, "metadata", void 0);
|
|
80
|
+
tslib_1.__decorate([
|
|
81
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'Tags as JSON array string' }),
|
|
82
|
+
tslib_1.__metadata("design:type", String)
|
|
83
|
+
], UpdateMLModelInput.prototype, "tags", void 0);
|
|
84
|
+
exports.UpdateMLModelInput = UpdateMLModelInput = tslib_1.__decorate([
|
|
85
|
+
(0, type_graphql_1.InputType)({ description: 'Input for updating ML model' })
|
|
86
|
+
], UpdateMLModelInput);
|
|
87
|
+
let PromoteModelInput = class PromoteModelInput {
|
|
88
|
+
};
|
|
89
|
+
exports.PromoteModelInput = PromoteModelInput;
|
|
90
|
+
tslib_1.__decorate([
|
|
91
|
+
(0, type_graphql_1.Field)({ description: 'Model ID to promote' }),
|
|
92
|
+
tslib_1.__metadata("design:type", String)
|
|
93
|
+
], PromoteModelInput.prototype, "modelId", void 0);
|
|
94
|
+
tslib_1.__decorate([
|
|
95
|
+
(0, type_graphql_1.Field)(type => ml_model_1.ModelStage, { description: 'Target stage' }),
|
|
96
|
+
tslib_1.__metadata("design:type", String)
|
|
97
|
+
], PromoteModelInput.prototype, "targetStage", void 0);
|
|
98
|
+
tslib_1.__decorate([
|
|
99
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'Promotion notes' }),
|
|
100
|
+
tslib_1.__metadata("design:type", String)
|
|
101
|
+
], PromoteModelInput.prototype, "notes", void 0);
|
|
102
|
+
exports.PromoteModelInput = PromoteModelInput = tslib_1.__decorate([
|
|
103
|
+
(0, type_graphql_1.InputType)({ description: 'Input for promoting model stage' })
|
|
104
|
+
], PromoteModelInput);
|
|
105
|
+
//# sourceMappingURL=ml-model-types.js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,EAAE,CAAC;;kDAC/B;AAGf;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,qBAAU,EAAE,EAAE,WAAW,EAAE,cAAc,EAAE,CAAC;;sDACpC;AAGvB;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,iBAAiB,EAAE,CAAC;;gDAC5C;4BARH,iBAAiB;IAD7B,IAAA,wBAAS,EAAC,EAAE,WAAW,EAAE,iCAAiC,EAAE,CAAC;GACjD,iBAAiB,CAS7B","sourcesContent":["import { InputType, Field, Int } from 'type-graphql'\nimport { ModelStage, ModelFramework } from './ml-model'\n\n@InputType({ description: 'Input for registering ML model' })\nexport class RegisterMLModelInput {\n @Field({ description: 'Model name' })\n name: string\n\n @Field({ description: 'Model version' })\n version: string\n\n @Field({ nullable: true, description: 'Model description' })\n description?: string\n\n @Field(type => ModelStage, { nullable: true, description: 'Initial stage' })\n stage?: ModelStage\n\n @Field(type => ModelFramework, { nullable: true, description: 'ML framework' })\n framework?: ModelFramework\n\n @Field({ nullable: true, description: 'Model metrics as JSON string' })\n metrics?: string\n\n @Field({ nullable: true, description: 'Model metadata as JSON string' })\n metadata?: string\n\n @Field({ nullable: true, description: 'Artifact URI' })\n artifactUri?: string\n\n @Field({ nullable: true, description: 'MLflow run ID' })\n mlflowRunId?: string\n\n @Field({ nullable: true, description: 'MLflow experiment ID' })\n mlflowExperimentId?: string\n\n @Field(type => Int, { nullable: true, description: 'Label Studio project ID' })\n labelStudioProjectId?: number\n\n @Field({ nullable: true, description: 'Tags as JSON array string' })\n tags?: string\n}\n\n@InputType({ description: 'Input for updating ML model' })\nexport class UpdateMLModelInput {\n @Field({ nullable: true, description: 'Model description' })\n description?: string\n\n @Field(type => ModelStage, { nullable: true, description: 'Stage' })\n stage?: ModelStage\n\n @Field({ nullable: true, description: 'Model metrics as JSON string' })\n metrics?: string\n\n @Field({ nullable: true, description: 'Model metadata as JSON string' })\n metadata?: string\n\n @Field({ nullable: true, description: 'Tags as JSON array string' })\n tags?: string\n}\n\n@InputType({ description: 'Input for promoting model stage' })\nexport class PromoteModelInput {\n @Field({ description: 'Model ID to promote' })\n modelId: string\n\n @Field(type => ModelStage, { description: 'Target stage' })\n targetStage: ModelStage\n\n @Field({ nullable: true, description: 'Promotion notes' })\n notes?: string\n}\n"]}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { Domain } from '@things-factory/shell';
|
|
2
|
+
import { User } from '@things-factory/auth-base';
|
|
3
|
+
/**
|
|
4
|
+
* ML Model Stage
|
|
5
|
+
*/
|
|
6
|
+
export declare enum ModelStage {
|
|
7
|
+
NONE = "None",
|
|
8
|
+
STAGING = "Staging",
|
|
9
|
+
PRODUCTION = "Production",
|
|
10
|
+
ARCHIVED = "Archived"
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Model Framework
|
|
14
|
+
*/
|
|
15
|
+
export declare enum ModelFramework {
|
|
16
|
+
TENSORFLOW = "TensorFlow",
|
|
17
|
+
PYTORCH = "PyTorch",
|
|
18
|
+
SKLEARN = "Scikit-Learn",
|
|
19
|
+
XGBOOST = "XGBoost",
|
|
20
|
+
LIGHTGBM = "LightGBM",
|
|
21
|
+
ONNX = "ONNX",
|
|
22
|
+
CUSTOM = "Custom"
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* ML Model Entity
|
|
26
|
+
*
|
|
27
|
+
* Represents a registered ML model with version management
|
|
28
|
+
*/
|
|
29
|
+
export declare class MLModel {
|
|
30
|
+
id: string;
|
|
31
|
+
name: string;
|
|
32
|
+
version: string;
|
|
33
|
+
description?: string;
|
|
34
|
+
stage: ModelStage;
|
|
35
|
+
framework?: ModelFramework;
|
|
36
|
+
metrics?: string;
|
|
37
|
+
metadata?: string;
|
|
38
|
+
artifactUri?: string;
|
|
39
|
+
mlflowRunId?: string;
|
|
40
|
+
mlflowExperimentId?: string;
|
|
41
|
+
labelStudioProjectId?: number;
|
|
42
|
+
tags?: string;
|
|
43
|
+
domain?: Domain;
|
|
44
|
+
domainId?: string;
|
|
45
|
+
creator?: User;
|
|
46
|
+
creatorId?: string;
|
|
47
|
+
updater?: User;
|
|
48
|
+
updaterId?: string;
|
|
49
|
+
createdAt: Date;
|
|
50
|
+
updatedAt: Date;
|
|
51
|
+
deletedAt?: Date;
|
|
52
|
+
}
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MLModel = exports.ModelFramework = exports.ModelStage = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const typeorm_1 = require("typeorm");
|
|
6
|
+
const type_graphql_1 = require("type-graphql");
|
|
7
|
+
const shell_1 = require("@things-factory/shell");
|
|
8
|
+
const auth_base_1 = require("@things-factory/auth-base");
|
|
9
|
+
/**
|
|
10
|
+
* ML Model Stage
|
|
11
|
+
*/
|
|
12
|
+
var ModelStage;
|
|
13
|
+
(function (ModelStage) {
|
|
14
|
+
ModelStage["NONE"] = "None";
|
|
15
|
+
ModelStage["STAGING"] = "Staging";
|
|
16
|
+
ModelStage["PRODUCTION"] = "Production";
|
|
17
|
+
ModelStage["ARCHIVED"] = "Archived";
|
|
18
|
+
})(ModelStage || (exports.ModelStage = ModelStage = {}));
|
|
19
|
+
(0, type_graphql_1.registerEnumType)(ModelStage, {
|
|
20
|
+
name: 'ModelStage',
|
|
21
|
+
description: 'ML model deployment stage'
|
|
22
|
+
});
|
|
23
|
+
/**
|
|
24
|
+
* Model Framework
|
|
25
|
+
*/
|
|
26
|
+
var ModelFramework;
|
|
27
|
+
(function (ModelFramework) {
|
|
28
|
+
ModelFramework["TENSORFLOW"] = "TensorFlow";
|
|
29
|
+
ModelFramework["PYTORCH"] = "PyTorch";
|
|
30
|
+
ModelFramework["SKLEARN"] = "Scikit-Learn";
|
|
31
|
+
ModelFramework["XGBOOST"] = "XGBoost";
|
|
32
|
+
ModelFramework["LIGHTGBM"] = "LightGBM";
|
|
33
|
+
ModelFramework["ONNX"] = "ONNX";
|
|
34
|
+
ModelFramework["CUSTOM"] = "Custom";
|
|
35
|
+
})(ModelFramework || (exports.ModelFramework = ModelFramework = {}));
|
|
36
|
+
(0, type_graphql_1.registerEnumType)(ModelFramework, {
|
|
37
|
+
name: 'ModelFramework',
|
|
38
|
+
description: 'ML framework used for model training'
|
|
39
|
+
});
|
|
40
|
+
/**
|
|
41
|
+
* ML Model Entity
|
|
42
|
+
*
|
|
43
|
+
* Represents a registered ML model with version management
|
|
44
|
+
*/
|
|
45
|
+
let MLModel = class MLModel {
|
|
46
|
+
};
|
|
47
|
+
exports.MLModel = MLModel;
|
|
48
|
+
tslib_1.__decorate([
|
|
49
|
+
(0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
|
|
50
|
+
(0, type_graphql_1.Field)(type => type_graphql_1.ID, { description: 'Model ID' }),
|
|
51
|
+
tslib_1.__metadata("design:type", String)
|
|
52
|
+
], MLModel.prototype, "id", void 0);
|
|
53
|
+
tslib_1.__decorate([
|
|
54
|
+
(0, typeorm_1.Column)({ nullable: true, comment: 'Model name' }),
|
|
55
|
+
(0, type_graphql_1.Field)({ description: 'Model name' }),
|
|
56
|
+
tslib_1.__metadata("design:type", String)
|
|
57
|
+
], MLModel.prototype, "name", void 0);
|
|
58
|
+
tslib_1.__decorate([
|
|
59
|
+
(0, typeorm_1.Column)({ nullable: true, comment: 'Model version' }),
|
|
60
|
+
(0, type_graphql_1.Field)({ description: 'Model version' }),
|
|
61
|
+
tslib_1.__metadata("design:type", String)
|
|
62
|
+
], MLModel.prototype, "version", void 0);
|
|
63
|
+
tslib_1.__decorate([
|
|
64
|
+
(0, typeorm_1.Column)({ nullable: true, comment: 'Model description' }),
|
|
65
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'Model description' }),
|
|
66
|
+
tslib_1.__metadata("design:type", String)
|
|
67
|
+
], MLModel.prototype, "description", void 0);
|
|
68
|
+
tslib_1.__decorate([
|
|
69
|
+
(0, typeorm_1.Column)({ type: 'varchar', default: ModelStage.NONE, comment: 'Deployment stage' }),
|
|
70
|
+
(0, type_graphql_1.Field)(type => ModelStage, { description: 'Current deployment stage' }),
|
|
71
|
+
tslib_1.__metadata("design:type", String)
|
|
72
|
+
], MLModel.prototype, "stage", void 0);
|
|
73
|
+
tslib_1.__decorate([
|
|
74
|
+
(0, typeorm_1.Column)({ type: 'varchar', nullable: true, comment: 'ML framework' }),
|
|
75
|
+
(0, type_graphql_1.Field)(type => ModelFramework, { nullable: true, description: 'Framework used for training' }),
|
|
76
|
+
tslib_1.__metadata("design:type", String)
|
|
77
|
+
], MLModel.prototype, "framework", void 0);
|
|
78
|
+
tslib_1.__decorate([
|
|
79
|
+
(0, typeorm_1.Column)({ type: 'simple-json', nullable: true, comment: 'Model metrics (accuracy, loss, etc.)' }),
|
|
80
|
+
(0, type_graphql_1.Field)(type => String, { nullable: true, description: 'Model metrics as JSON' }),
|
|
81
|
+
tslib_1.__metadata("design:type", String)
|
|
82
|
+
], MLModel.prototype, "metrics", void 0);
|
|
83
|
+
tslib_1.__decorate([
|
|
84
|
+
(0, typeorm_1.Column)({ type: 'simple-json', nullable: true, comment: 'Model metadata' }),
|
|
85
|
+
(0, type_graphql_1.Field)(type => String, { nullable: true, description: 'Model metadata as JSON' }),
|
|
86
|
+
tslib_1.__metadata("design:type", String)
|
|
87
|
+
], MLModel.prototype, "metadata", void 0);
|
|
88
|
+
tslib_1.__decorate([
|
|
89
|
+
(0, typeorm_1.Column)({ nullable: true, comment: 'Model artifact URI (S3, local path, etc.)' }),
|
|
90
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'Model artifact storage URI' }),
|
|
91
|
+
tslib_1.__metadata("design:type", String)
|
|
92
|
+
], MLModel.prototype, "artifactUri", void 0);
|
|
93
|
+
tslib_1.__decorate([
|
|
94
|
+
(0, typeorm_1.Column)({ nullable: true, comment: 'MLflow run ID' }),
|
|
95
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'MLflow run ID for tracking' }),
|
|
96
|
+
tslib_1.__metadata("design:type", String)
|
|
97
|
+
], MLModel.prototype, "mlflowRunId", void 0);
|
|
98
|
+
tslib_1.__decorate([
|
|
99
|
+
(0, typeorm_1.Column)({ nullable: true, comment: 'MLflow experiment ID' }),
|
|
100
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'MLflow experiment ID' }),
|
|
101
|
+
tslib_1.__metadata("design:type", String)
|
|
102
|
+
], MLModel.prototype, "mlflowExperimentId", void 0);
|
|
103
|
+
tslib_1.__decorate([
|
|
104
|
+
(0, typeorm_1.Column)({ type: 'int', nullable: true, comment: 'Label Studio project ID' }),
|
|
105
|
+
(0, type_graphql_1.Field)(type => type_graphql_1.Int, { nullable: true, description: 'Associated Label Studio project' }),
|
|
106
|
+
tslib_1.__metadata("design:type", Number)
|
|
107
|
+
], MLModel.prototype, "labelStudioProjectId", void 0);
|
|
108
|
+
tslib_1.__decorate([
|
|
109
|
+
(0, typeorm_1.Column)({ type: 'simple-json', nullable: true, comment: 'Model tags' }),
|
|
110
|
+
(0, type_graphql_1.Field)(type => String, { nullable: true, description: 'Tags as JSON array' }),
|
|
111
|
+
tslib_1.__metadata("design:type", String)
|
|
112
|
+
], MLModel.prototype, "tags", void 0);
|
|
113
|
+
tslib_1.__decorate([
|
|
114
|
+
(0, typeorm_1.ManyToOne)(() => shell_1.Domain),
|
|
115
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'Domain' }),
|
|
116
|
+
tslib_1.__metadata("design:type", shell_1.Domain)
|
|
117
|
+
], MLModel.prototype, "domain", void 0);
|
|
118
|
+
tslib_1.__decorate([
|
|
119
|
+
(0, typeorm_1.RelationId)((model) => model.domain),
|
|
120
|
+
tslib_1.__metadata("design:type", String)
|
|
121
|
+
], MLModel.prototype, "domainId", void 0);
|
|
122
|
+
tslib_1.__decorate([
|
|
123
|
+
(0, typeorm_1.ManyToOne)(() => auth_base_1.User, { nullable: true }),
|
|
124
|
+
(0, type_graphql_1.Field)(type => auth_base_1.User, { nullable: true, description: 'Creator' }),
|
|
125
|
+
tslib_1.__metadata("design:type", auth_base_1.User)
|
|
126
|
+
], MLModel.prototype, "creator", void 0);
|
|
127
|
+
tslib_1.__decorate([
|
|
128
|
+
(0, typeorm_1.RelationId)((model) => model.creator),
|
|
129
|
+
tslib_1.__metadata("design:type", String)
|
|
130
|
+
], MLModel.prototype, "creatorId", void 0);
|
|
131
|
+
tslib_1.__decorate([
|
|
132
|
+
(0, typeorm_1.ManyToOne)(() => auth_base_1.User, { nullable: true }),
|
|
133
|
+
(0, type_graphql_1.Field)(type => auth_base_1.User, { nullable: true, description: 'Last updater' }),
|
|
134
|
+
tslib_1.__metadata("design:type", auth_base_1.User)
|
|
135
|
+
], MLModel.prototype, "updater", void 0);
|
|
136
|
+
tslib_1.__decorate([
|
|
137
|
+
(0, typeorm_1.RelationId)((model) => model.updater),
|
|
138
|
+
tslib_1.__metadata("design:type", String)
|
|
139
|
+
], MLModel.prototype, "updaterId", void 0);
|
|
140
|
+
tslib_1.__decorate([
|
|
141
|
+
(0, typeorm_1.CreateDateColumn)(),
|
|
142
|
+
(0, type_graphql_1.Field)({ description: 'Created at' }),
|
|
143
|
+
tslib_1.__metadata("design:type", Date)
|
|
144
|
+
], MLModel.prototype, "createdAt", void 0);
|
|
145
|
+
tslib_1.__decorate([
|
|
146
|
+
(0, typeorm_1.UpdateDateColumn)(),
|
|
147
|
+
(0, type_graphql_1.Field)({ description: 'Updated at' }),
|
|
148
|
+
tslib_1.__metadata("design:type", Date)
|
|
149
|
+
], MLModel.prototype, "updatedAt", void 0);
|
|
150
|
+
tslib_1.__decorate([
|
|
151
|
+
(0, typeorm_1.DeleteDateColumn)(),
|
|
152
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'Deleted at' }),
|
|
153
|
+
tslib_1.__metadata("design:type", Date)
|
|
154
|
+
], MLModel.prototype, "deletedAt", void 0);
|
|
155
|
+
exports.MLModel = MLModel = tslib_1.__decorate([
|
|
156
|
+
(0, typeorm_1.Entity)('ml_models'),
|
|
157
|
+
(0, typeorm_1.Index)('ix_ml_model_0', ['domain', 'name', 'version'], { unique: true }),
|
|
158
|
+
(0, typeorm_1.Index)('ix_ml_model_1', ['domain', 'stage']),
|
|
159
|
+
(0, type_graphql_1.ObjectType)({ description: 'ML Model registered in the system' })
|
|
160
|
+
], MLModel);
|
|
161
|
+
//# sourceMappingURL=ml-model.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ml-model.js","sourceRoot":"","sources":["../../../server/service/ml-model/ml-model.ts"],"names":[],"mappings":";;;;AAAA,qCAUgB;AAChB,+CAA2E;AAC3E,iDAA8C;AAC9C,yDAAgD;AAEhD;;GAEG;AACH,IAAY,UAKX;AALD,WAAY,UAAU;IACpB,2BAAa,CAAA;IACb,iCAAmB,CAAA;IACnB,uCAAyB,CAAA;IACzB,mCAAqB,CAAA;AACvB,CAAC,EALW,UAAU,0BAAV,UAAU,QAKrB;AAED,IAAA,+BAAgB,EAAC,UAAU,EAAE;IAC3B,IAAI,EAAE,YAAY;IAClB,WAAW,EAAE,2BAA2B;CACzC,CAAC,CAAA;AAEF;;GAEG;AACH,IAAY,cAQX;AARD,WAAY,cAAc;IACxB,2CAAyB,CAAA;IACzB,qCAAmB,CAAA;IACnB,0CAAwB,CAAA;IACxB,qCAAmB,CAAA;IACnB,uCAAqB,CAAA;IACrB,+BAAa,CAAA;IACb,mCAAiB,CAAA;AACnB,CAAC,EARW,cAAc,8BAAd,cAAc,QAQzB;AAED,IAAA,+BAAgB,EAAC,cAAc,EAAE;IAC/B,IAAI,EAAE,gBAAgB;IACtB,WAAW,EAAE,sCAAsC;CACpD,CAAC,CAAA;AAEF;;;;GAIG;AAKI,IAAM,OAAO,GAAb,MAAM,OAAO;CAqFnB,CAAA;AArFY,0BAAO;AAGlB;IAFC,IAAA,gCAAsB,EAAC,MAAM,CAAC;IAC9B,IAAA,oBAAK,EAAC,IAAI,CAA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EAAE,YAAY,EAAE,CAAC;sCAC1B,IAAI;0CAAA;AAIf;IAFC,IAAA,0BAAgB,GAAE;IAClB,IAAA,oBAAK,EAAC,EAAE,WAAW,EAAE,YAAY,EAAE,CAAC;sCAC1B,IAAI;0CAAA;AAIf;IAFC,IAAA,0BAAgB,GAAE;IAClB,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,YAAY,EAAE,CAAC;sCACzC,IAAI;0CAAA;kBApFL,OAAO;IAJnB,IAAA,gBAAM,EAAC,WAAW,CAAC;IACnB,IAAA,eAAK,EAAC,eAAe,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;IACvE,IAAA,eAAK,EAAC,eAAe,EAAE,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;IAC3C,IAAA,yBAAU,EAAC,EAAE,WAAW,EAAE,mCAAmC,EAAE,CAAC;GACpD,OAAO,CAqFnB","sourcesContent":["import {\n CreateDateColumn,\n UpdateDateColumn,\n DeleteDateColumn,\n Entity,\n Index,\n Column,\n RelationId,\n ManyToOne,\n PrimaryGeneratedColumn\n} from 'typeorm'\nimport { ObjectType, Field, Int, ID, registerEnumType } from 'type-graphql'\nimport { Domain } from '@things-factory/shell'\nimport { User } from '@things-factory/auth-base'\n\n/**\n * ML Model Stage\n */\nexport enum ModelStage {\n NONE = 'None',\n STAGING = 'Staging',\n PRODUCTION = 'Production',\n ARCHIVED = 'Archived'\n}\n\nregisterEnumType(ModelStage, {\n name: 'ModelStage',\n description: 'ML model deployment stage'\n})\n\n/**\n * Model Framework\n */\nexport enum ModelFramework {\n TENSORFLOW = 'TensorFlow',\n PYTORCH = 'PyTorch',\n SKLEARN = 'Scikit-Learn',\n XGBOOST = 'XGBoost',\n LIGHTGBM = 'LightGBM',\n ONNX = 'ONNX',\n CUSTOM = 'Custom'\n}\n\nregisterEnumType(ModelFramework, {\n name: 'ModelFramework',\n description: 'ML framework used for model training'\n})\n\n/**\n * ML Model Entity\n *\n * Represents a registered ML model with version management\n */\n@Entity('ml_models')\n@Index('ix_ml_model_0', ['domain', 'name', 'version'], { unique: true })\n@Index('ix_ml_model_1', ['domain', 'stage'])\n@ObjectType({ description: 'ML Model registered in the system' })\nexport class MLModel {\n @PrimaryGeneratedColumn('uuid')\n @Field(type => ID, { description: 'Model ID' })\n id: string\n\n @Column({ nullable: true, comment: 'Model name' })\n @Field({ description: 'Model name' })\n name: string\n\n @Column({ nullable: true, comment: 'Model version' })\n @Field({ description: 'Model version' })\n version: string\n\n @Column({ nullable: true, comment: 'Model description' })\n @Field({ nullable: true, description: 'Model description' })\n description?: string\n\n @Column({ type: 'varchar', default: ModelStage.NONE, comment: 'Deployment stage' })\n @Field(type => ModelStage, { description: 'Current deployment stage' })\n stage: ModelStage\n\n @Column({ type: 'varchar', nullable: true, comment: 'ML framework' })\n @Field(type => ModelFramework, { nullable: true, description: 'Framework used for training' })\n framework?: ModelFramework\n\n @Column({ type: 'simple-json', nullable: true, comment: 'Model metrics (accuracy, loss, etc.)' })\n @Field(type => String, { nullable: true, description: 'Model metrics as JSON' })\n metrics?: string\n\n @Column({ type: 'simple-json', nullable: true, comment: 'Model metadata' })\n @Field(type => String, { nullable: true, description: 'Model metadata as JSON' })\n metadata?: string\n\n @Column({ nullable: true, comment: 'Model artifact URI (S3, local path, etc.)' })\n @Field({ nullable: true, description: 'Model artifact storage URI' })\n artifactUri?: string\n\n @Column({ nullable: true, comment: 'MLflow run ID' })\n @Field({ nullable: true, description: 'MLflow run ID for tracking' })\n mlflowRunId?: string\n\n @Column({ nullable: true, comment: 'MLflow experiment ID' })\n @Field({ nullable: true, description: 'MLflow experiment ID' })\n mlflowExperimentId?: string\n\n @Column({ type: 'int', nullable: true, comment: 'Label Studio project ID' })\n @Field(type => Int, { nullable: true, description: 'Associated Label Studio project' })\n labelStudioProjectId?: number\n\n @Column({ type: 'simple-json', nullable: true, comment: 'Model tags' })\n @Field(type => String, { nullable: true, description: 'Tags as JSON array' })\n tags?: string\n\n @ManyToOne(() => Domain)\n @Field({ nullable: true, description: 'Domain' })\n domain?: Domain\n\n @RelationId((model: MLModel) => model.domain)\n domainId?: string\n\n @ManyToOne(() => User, { nullable: true })\n @Field(type => User, { nullable: true, description: 'Creator' })\n creator?: User\n\n @RelationId((model: MLModel) => model.creator)\n creatorId?: string\n\n @ManyToOne(() => User, { nullable: true })\n @Field(type => User, { nullable: true, description: 'Last updater' })\n updater?: User\n\n @RelationId((model: MLModel) => model.updater)\n updaterId?: string\n\n @CreateDateColumn()\n @Field({ description: 'Created at' })\n createdAt: Date\n\n @UpdateDateColumn()\n @Field({ description: 'Updated at' })\n updatedAt: Date\n\n @DeleteDateColumn()\n @Field({ nullable: true, description: 'Deleted at' })\n deletedAt?: Date\n}\n"]}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.resolvers = exports.entities = void 0;
|
|
4
|
+
const ml_pipeline_1 = require("./ml-pipeline");
|
|
5
|
+
exports.entities = [ml_pipeline_1.MLPipeline];
|
|
6
|
+
exports.resolvers = [];
|
|
7
|
+
// export * from './ml-pipeline'
|
|
8
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../server/service/ml-pipeline/index.ts"],"names":[],"mappings":";;;AAAA,+CAA0C;AAE7B,QAAA,QAAQ,GAAG,CAAC,wBAAU,CAAC,CAAA;AACvB,QAAA,SAAS,GAAG,EAAE,CAAA;AAE3B,gCAAgC","sourcesContent":["import { MLPipeline } from './ml-pipeline'\n\nexport const entities = [MLPipeline]\nexport const resolvers = []\n\n// export * from './ml-pipeline'\n"]}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { Domain } from '@things-factory/shell';
|
|
2
|
+
import { User } from '@things-factory/auth-base';
|
|
3
|
+
/**
|
|
4
|
+
* Pipeline Status
|
|
5
|
+
*/
|
|
6
|
+
export declare enum PipelineStatus {
|
|
7
|
+
DRAFT = "DRAFT",
|
|
8
|
+
ACTIVE = "ACTIVE",
|
|
9
|
+
PAUSED = "PAUSED",
|
|
10
|
+
ARCHIVED = "ARCHIVED"
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Pipeline Trigger Type
|
|
14
|
+
*/
|
|
15
|
+
export declare enum PipelineTriggerType {
|
|
16
|
+
MANUAL = "MANUAL",
|
|
17
|
+
SCHEDULE = "SCHEDULE",
|
|
18
|
+
WEBHOOK = "WEBHOOK",
|
|
19
|
+
EVENT = "EVENT"
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* ML Pipeline Entity
|
|
23
|
+
*
|
|
24
|
+
* Represents an end-to-end ML pipeline for auto-training
|
|
25
|
+
*/
|
|
26
|
+
export declare class MLPipeline {
|
|
27
|
+
id: string;
|
|
28
|
+
name: string;
|
|
29
|
+
description?: string;
|
|
30
|
+
status: PipelineStatus;
|
|
31
|
+
triggerType: PipelineTriggerType;
|
|
32
|
+
schedule?: string;
|
|
33
|
+
labelStudioProjectId?: number;
|
|
34
|
+
annotationThreshold?: number;
|
|
35
|
+
config?: string;
|
|
36
|
+
trainingParams?: string;
|
|
37
|
+
promotionThreshold?: number;
|
|
38
|
+
notifications?: string;
|
|
39
|
+
lastExecutedAt?: Date;
|
|
40
|
+
executionCount: number;
|
|
41
|
+
domain?: Domain;
|
|
42
|
+
domainId?: string;
|
|
43
|
+
creator?: User;
|
|
44
|
+
creatorId?: string;
|
|
45
|
+
updater?: User;
|
|
46
|
+
updaterId?: string;
|
|
47
|
+
createdAt: Date;
|
|
48
|
+
updatedAt: Date;
|
|
49
|
+
deletedAt?: Date;
|
|
50
|
+
}
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MLPipeline = exports.PipelineTriggerType = exports.PipelineStatus = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const typeorm_1 = require("typeorm");
|
|
6
|
+
const type_graphql_1 = require("type-graphql");
|
|
7
|
+
const shell_1 = require("@things-factory/shell");
|
|
8
|
+
const auth_base_1 = require("@things-factory/auth-base");
|
|
9
|
+
/**
|
|
10
|
+
* Pipeline Status
|
|
11
|
+
*/
|
|
12
|
+
var PipelineStatus;
|
|
13
|
+
(function (PipelineStatus) {
|
|
14
|
+
PipelineStatus["DRAFT"] = "DRAFT";
|
|
15
|
+
PipelineStatus["ACTIVE"] = "ACTIVE";
|
|
16
|
+
PipelineStatus["PAUSED"] = "PAUSED";
|
|
17
|
+
PipelineStatus["ARCHIVED"] = "ARCHIVED";
|
|
18
|
+
})(PipelineStatus || (exports.PipelineStatus = PipelineStatus = {}));
|
|
19
|
+
(0, type_graphql_1.registerEnumType)(PipelineStatus, {
|
|
20
|
+
name: 'PipelineStatus',
|
|
21
|
+
description: 'ML pipeline status'
|
|
22
|
+
});
|
|
23
|
+
/**
|
|
24
|
+
* Pipeline Trigger Type
|
|
25
|
+
*/
|
|
26
|
+
var PipelineTriggerType;
|
|
27
|
+
(function (PipelineTriggerType) {
|
|
28
|
+
PipelineTriggerType["MANUAL"] = "MANUAL";
|
|
29
|
+
PipelineTriggerType["SCHEDULE"] = "SCHEDULE";
|
|
30
|
+
PipelineTriggerType["WEBHOOK"] = "WEBHOOK";
|
|
31
|
+
PipelineTriggerType["EVENT"] = "EVENT";
|
|
32
|
+
})(PipelineTriggerType || (exports.PipelineTriggerType = PipelineTriggerType = {}));
|
|
33
|
+
(0, type_graphql_1.registerEnumType)(PipelineTriggerType, {
|
|
34
|
+
name: 'PipelineTriggerType',
|
|
35
|
+
description: 'How pipeline is triggered'
|
|
36
|
+
});
|
|
37
|
+
/**
|
|
38
|
+
* ML Pipeline Entity
|
|
39
|
+
*
|
|
40
|
+
* Represents an end-to-end ML pipeline for auto-training
|
|
41
|
+
*/
|
|
42
|
+
let MLPipeline = class MLPipeline {
|
|
43
|
+
};
|
|
44
|
+
exports.MLPipeline = MLPipeline;
|
|
45
|
+
tslib_1.__decorate([
|
|
46
|
+
(0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
|
|
47
|
+
(0, type_graphql_1.Field)(type => type_graphql_1.ID, { description: 'Pipeline ID' }),
|
|
48
|
+
tslib_1.__metadata("design:type", String)
|
|
49
|
+
], MLPipeline.prototype, "id", void 0);
|
|
50
|
+
tslib_1.__decorate([
|
|
51
|
+
(0, typeorm_1.Column)({ nullable: true, comment: 'Pipeline name' }),
|
|
52
|
+
(0, type_graphql_1.Field)({ description: 'Pipeline name' }),
|
|
53
|
+
tslib_1.__metadata("design:type", String)
|
|
54
|
+
], MLPipeline.prototype, "name", void 0);
|
|
55
|
+
tslib_1.__decorate([
|
|
56
|
+
(0, typeorm_1.Column)({ nullable: true, comment: 'Pipeline description' }),
|
|
57
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'Pipeline description' }),
|
|
58
|
+
tslib_1.__metadata("design:type", String)
|
|
59
|
+
], MLPipeline.prototype, "description", void 0);
|
|
60
|
+
tslib_1.__decorate([
|
|
61
|
+
(0, typeorm_1.Column)({ type: 'varchar', default: PipelineStatus.DRAFT, comment: 'Pipeline status' }),
|
|
62
|
+
(0, type_graphql_1.Field)(type => PipelineStatus, { description: 'Current pipeline status' }),
|
|
63
|
+
tslib_1.__metadata("design:type", String)
|
|
64
|
+
], MLPipeline.prototype, "status", void 0);
|
|
65
|
+
tslib_1.__decorate([
|
|
66
|
+
(0, typeorm_1.Column)({ type: 'varchar', default: PipelineTriggerType.MANUAL, comment: 'Trigger type' }),
|
|
67
|
+
(0, type_graphql_1.Field)(type => PipelineTriggerType, { description: 'How pipeline is triggered' }),
|
|
68
|
+
tslib_1.__metadata("design:type", String)
|
|
69
|
+
], MLPipeline.prototype, "triggerType", void 0);
|
|
70
|
+
tslib_1.__decorate([
|
|
71
|
+
(0, typeorm_1.Column)({ nullable: true, comment: 'Cron schedule (if SCHEDULE trigger)' }),
|
|
72
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'Cron expression for scheduling' }),
|
|
73
|
+
tslib_1.__metadata("design:type", String)
|
|
74
|
+
], MLPipeline.prototype, "schedule", void 0);
|
|
75
|
+
tslib_1.__decorate([
|
|
76
|
+
(0, typeorm_1.Column)({ type: 'int', nullable: true, comment: 'Label Studio project ID' }),
|
|
77
|
+
(0, type_graphql_1.Field)(type => type_graphql_1.Int, { nullable: true, description: 'Source Label Studio project' }),
|
|
78
|
+
tslib_1.__metadata("design:type", Number)
|
|
79
|
+
], MLPipeline.prototype, "labelStudioProjectId", void 0);
|
|
80
|
+
tslib_1.__decorate([
|
|
81
|
+
(0, typeorm_1.Column)({ type: 'int', nullable: true, comment: 'Minimum new annotations to trigger' }),
|
|
82
|
+
(0, type_graphql_1.Field)(type => type_graphql_1.Int, { nullable: true, description: 'Min annotations threshold' }),
|
|
83
|
+
tslib_1.__metadata("design:type", Number)
|
|
84
|
+
], MLPipeline.prototype, "annotationThreshold", void 0);
|
|
85
|
+
tslib_1.__decorate([
|
|
86
|
+
(0, typeorm_1.Column)({ type: 'simple-json', nullable: true, comment: 'Pipeline configuration' }),
|
|
87
|
+
(0, type_graphql_1.Field)(type => String, { nullable: true, description: 'Pipeline config as JSON' }),
|
|
88
|
+
tslib_1.__metadata("design:type", String)
|
|
89
|
+
], MLPipeline.prototype, "config", void 0);
|
|
90
|
+
tslib_1.__decorate([
|
|
91
|
+
(0, typeorm_1.Column)({ type: 'simple-json', nullable: true, comment: 'Training parameters' }),
|
|
92
|
+
(0, type_graphql_1.Field)(type => String, { nullable: true, description: 'Training params as JSON' }),
|
|
93
|
+
tslib_1.__metadata("design:type", String)
|
|
94
|
+
], MLPipeline.prototype, "trainingParams", void 0);
|
|
95
|
+
tslib_1.__decorate([
|
|
96
|
+
(0, typeorm_1.Column)({ type: 'float', nullable: true, comment: 'Auto-promotion accuracy threshold' }),
|
|
97
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'Auto-promote if accuracy exceeds this' }),
|
|
98
|
+
tslib_1.__metadata("design:type", Number)
|
|
99
|
+
], MLPipeline.prototype, "promotionThreshold", void 0);
|
|
100
|
+
tslib_1.__decorate([
|
|
101
|
+
(0, typeorm_1.Column)({ type: 'simple-json', nullable: true, comment: 'Notification settings' }),
|
|
102
|
+
(0, type_graphql_1.Field)(type => String, { nullable: true, description: 'Notification config as JSON' }),
|
|
103
|
+
tslib_1.__metadata("design:type", String)
|
|
104
|
+
], MLPipeline.prototype, "notifications", void 0);
|
|
105
|
+
tslib_1.__decorate([
|
|
106
|
+
(0, typeorm_1.Column)({ type: 'timestamp', nullable: true, comment: 'Last execution time' }),
|
|
107
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'Last executed at' }),
|
|
108
|
+
tslib_1.__metadata("design:type", Date)
|
|
109
|
+
], MLPipeline.prototype, "lastExecutedAt", void 0);
|
|
110
|
+
tslib_1.__decorate([
|
|
111
|
+
(0, typeorm_1.Column)({ type: 'int', default: 0, comment: 'Total execution count' }),
|
|
112
|
+
(0, type_graphql_1.Field)(type => type_graphql_1.Int, { description: 'Total times executed' }),
|
|
113
|
+
tslib_1.__metadata("design:type", Number)
|
|
114
|
+
], MLPipeline.prototype, "executionCount", void 0);
|
|
115
|
+
tslib_1.__decorate([
|
|
116
|
+
(0, typeorm_1.ManyToOne)(() => shell_1.Domain),
|
|
117
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'Domain' }),
|
|
118
|
+
tslib_1.__metadata("design:type", shell_1.Domain)
|
|
119
|
+
], MLPipeline.prototype, "domain", void 0);
|
|
120
|
+
tslib_1.__decorate([
|
|
121
|
+
(0, typeorm_1.RelationId)((pipeline) => pipeline.domain),
|
|
122
|
+
tslib_1.__metadata("design:type", String)
|
|
123
|
+
], MLPipeline.prototype, "domainId", void 0);
|
|
124
|
+
tslib_1.__decorate([
|
|
125
|
+
(0, typeorm_1.ManyToOne)(() => auth_base_1.User, { nullable: true }),
|
|
126
|
+
(0, type_graphql_1.Field)(type => auth_base_1.User, { nullable: true, description: 'Creator' }),
|
|
127
|
+
tslib_1.__metadata("design:type", auth_base_1.User)
|
|
128
|
+
], MLPipeline.prototype, "creator", void 0);
|
|
129
|
+
tslib_1.__decorate([
|
|
130
|
+
(0, typeorm_1.RelationId)((pipeline) => pipeline.creator),
|
|
131
|
+
tslib_1.__metadata("design:type", String)
|
|
132
|
+
], MLPipeline.prototype, "creatorId", void 0);
|
|
133
|
+
tslib_1.__decorate([
|
|
134
|
+
(0, typeorm_1.ManyToOne)(() => auth_base_1.User, { nullable: true }),
|
|
135
|
+
(0, type_graphql_1.Field)(type => auth_base_1.User, { nullable: true, description: 'Last updater' }),
|
|
136
|
+
tslib_1.__metadata("design:type", auth_base_1.User)
|
|
137
|
+
], MLPipeline.prototype, "updater", void 0);
|
|
138
|
+
tslib_1.__decorate([
|
|
139
|
+
(0, typeorm_1.RelationId)((pipeline) => pipeline.updater),
|
|
140
|
+
tslib_1.__metadata("design:type", String)
|
|
141
|
+
], MLPipeline.prototype, "updaterId", void 0);
|
|
142
|
+
tslib_1.__decorate([
|
|
143
|
+
(0, typeorm_1.CreateDateColumn)(),
|
|
144
|
+
(0, type_graphql_1.Field)({ description: 'Created at' }),
|
|
145
|
+
tslib_1.__metadata("design:type", Date)
|
|
146
|
+
], MLPipeline.prototype, "createdAt", void 0);
|
|
147
|
+
tslib_1.__decorate([
|
|
148
|
+
(0, typeorm_1.UpdateDateColumn)(),
|
|
149
|
+
(0, type_graphql_1.Field)({ description: 'Updated at' }),
|
|
150
|
+
tslib_1.__metadata("design:type", Date)
|
|
151
|
+
], MLPipeline.prototype, "updatedAt", void 0);
|
|
152
|
+
tslib_1.__decorate([
|
|
153
|
+
(0, typeorm_1.DeleteDateColumn)(),
|
|
154
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'Deleted at' }),
|
|
155
|
+
tslib_1.__metadata("design:type", Date)
|
|
156
|
+
], MLPipeline.prototype, "deletedAt", void 0);
|
|
157
|
+
exports.MLPipeline = MLPipeline = tslib_1.__decorate([
|
|
158
|
+
(0, typeorm_1.Entity)('ml_pipelines'),
|
|
159
|
+
(0, typeorm_1.Index)('ix_ml_pipeline_0', ['domain', 'name']),
|
|
160
|
+
(0, typeorm_1.Index)('ix_ml_pipeline_1', ['domain', 'status']),
|
|
161
|
+
(0, type_graphql_1.ObjectType)({ description: 'ML Pipeline for automated training workflow' })
|
|
162
|
+
], MLPipeline);
|
|
163
|
+
//# sourceMappingURL=ml-pipeline.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ml-pipeline.js","sourceRoot":"","sources":["../../../server/service/ml-pipeline/ml-pipeline.ts"],"names":[],"mappings":";;;;AAAA,qCAUgB;AAChB,+CAA2E;AAC3E,iDAA8C;AAC9C,yDAAgD;AAEhD;;GAEG;AACH,IAAY,cAKX;AALD,WAAY,cAAc;IACxB,iCAAe,CAAA;IACf,mCAAiB,CAAA;IACjB,mCAAiB,CAAA;IACjB,uCAAqB,CAAA;AACvB,CAAC,EALW,cAAc,8BAAd,cAAc,QAKzB;AAED,IAAA,+BAAgB,EAAC,cAAc,EAAE;IAC/B,IAAI,EAAE,gBAAgB;IACtB,WAAW,EAAE,oBAAoB;CAClC,CAAC,CAAA;AAEF;;GAEG;AACH,IAAY,mBAKX;AALD,WAAY,mBAAmB;IAC7B,wCAAiB,CAAA;IACjB,4CAAqB,CAAA;IACrB,0CAAmB,CAAA;IACnB,sCAAe,CAAA;AACjB,CAAC,EALW,mBAAmB,mCAAnB,mBAAmB,QAK9B;AAED,IAAA,+BAAgB,EAAC,mBAAmB,EAAE;IACpC,IAAI,EAAE,qBAAqB;IAC3B,WAAW,EAAE,2BAA2B;CACzC,CAAC,CAAA;AAEF;;;;GAIG;AAKI,IAAM,UAAU,GAAhB,MAAM,UAAU;CAyFtB,CAAA;AAzFY,gCAAU;AAGrB;I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E,CAAC,QAAQ,CAAC,OAAO,CAAC;;6CACrC;AAIlB;IAFC,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,gBAAI,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IACzC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,cAAc,EAAE,CAAC;sCAC3D,gBAAI;2CAAA;AAGd;IADC,IAAA,oBAAU,EAAC,CAAC,QAAoB,EAAE,EAAE,CAAC,QAAQ,CAAC,OAAO,CAAC;;6CACrC;AAIlB;IAFC,IAAA,0BAAgB,GAAE;IAClB,IAAA,oBAAK,EAAC,EAAE,WAAW,EAAE,YAAY,EAAE,CAAC;sCAC1B,IAAI;6CAAA;AAIf;IAFC,IAAA,0BAAgB,GAAE;IAClB,IAAA,oBAAK,EAAC,EAAE,WAAW,EAAE,YAAY,EAAE,CAAC;sCAC1B,IAAI;6CAAA;AAIf;IAFC,IAAA,0BAAgB,GAAE;IAClB,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,YAAY,EAAE,CAAC;sCACzC,IAAI;6CAAA;qBAxFL,UAAU;IAJtB,IAAA,gBAAM,EAAC,cAAc,CAAC;IACtB,IAAA,eAAK,EAAC,kBAAkB,EAAE,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;IAC7C,IAAA,eAAK,EAAC,kBAAkB,EAAE,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;IAC/C,IAAA,yBAAU,EAAC,EAAE,WAAW,EAAE,6CAA6C,EAAE,CAAC;GAC9D,UAAU,CAyFtB","sourcesContent":["import {\n CreateDateColumn,\n UpdateDateColumn,\n DeleteDateColumn,\n Entity,\n Index,\n Column,\n RelationId,\n ManyToOne,\n PrimaryGeneratedColumn\n} from 'typeorm'\nimport { ObjectType, Field, Int, ID, registerEnumType } from 'type-graphql'\nimport { Domain } from '@things-factory/shell'\nimport { User } from '@things-factory/auth-base'\n\n/**\n * Pipeline Status\n */\nexport enum PipelineStatus {\n DRAFT = 'DRAFT',\n ACTIVE = 'ACTIVE',\n PAUSED = 'PAUSED',\n ARCHIVED = 'ARCHIVED'\n}\n\nregisterEnumType(PipelineStatus, {\n name: 'PipelineStatus',\n description: 'ML pipeline status'\n})\n\n/**\n * Pipeline Trigger Type\n */\nexport enum PipelineTriggerType {\n MANUAL = 'MANUAL',\n SCHEDULE = 'SCHEDULE',\n WEBHOOK = 'WEBHOOK',\n EVENT = 'EVENT'\n}\n\nregisterEnumType(PipelineTriggerType, {\n name: 'PipelineTriggerType',\n description: 'How pipeline is triggered'\n})\n\n/**\n * ML Pipeline Entity\n *\n * Represents an end-to-end ML pipeline for auto-training\n */\n@Entity('ml_pipelines')\n@Index('ix_ml_pipeline_0', ['domain', 'name'])\n@Index('ix_ml_pipeline_1', ['domain', 'status'])\n@ObjectType({ description: 'ML Pipeline for automated training workflow' })\nexport class MLPipeline {\n @PrimaryGeneratedColumn('uuid')\n @Field(type => ID, { description: 'Pipeline ID' })\n id: string\n\n @Column({ nullable: true, comment: 'Pipeline name' })\n @Field({ description: 'Pipeline name' })\n name: string\n\n @Column({ nullable: true, comment: 'Pipeline description' })\n @Field({ nullable: true, description: 'Pipeline description' })\n description?: string\n\n @Column({ type: 'varchar', default: PipelineStatus.DRAFT, comment: 'Pipeline status' })\n @Field(type => PipelineStatus, { description: 'Current pipeline status' })\n status: PipelineStatus\n\n @Column({ type: 'varchar', default: PipelineTriggerType.MANUAL, comment: 'Trigger type' })\n @Field(type => PipelineTriggerType, { description: 'How pipeline is triggered' })\n triggerType: PipelineTriggerType\n\n @Column({ nullable: true, comment: 'Cron schedule (if SCHEDULE trigger)' })\n @Field({ nullable: true, description: 'Cron expression for scheduling' })\n schedule?: string\n\n @Column({ type: 'int', nullable: true, comment: 'Label Studio project ID' })\n @Field(type => Int, { nullable: true, description: 'Source Label Studio project' })\n labelStudioProjectId?: number\n\n @Column({ type: 'int', nullable: true, comment: 'Minimum new annotations to trigger' })\n @Field(type => Int, { nullable: true, description: 'Min annotations threshold' })\n annotationThreshold?: number\n\n @Column({ type: 'simple-json', nullable: true, comment: 'Pipeline configuration' })\n @Field(type => String, { nullable: true, description: 'Pipeline config as JSON' })\n config?: string\n\n @Column({ type: 'simple-json', nullable: true, comment: 'Training parameters' })\n @Field(type => String, { nullable: true, description: 'Training params as JSON' })\n trainingParams?: string\n\n @Column({ type: 'float', nullable: true, comment: 'Auto-promotion accuracy threshold' })\n @Field({ nullable: true, description: 'Auto-promote if accuracy exceeds this' })\n promotionThreshold?: number\n\n @Column({ type: 'simple-json', nullable: true, comment: 'Notification settings' })\n @Field(type => String, { nullable: true, description: 'Notification config as JSON' })\n notifications?: string\n\n @Column({ type: 'timestamp', nullable: true, comment: 'Last execution time' })\n @Field({ nullable: true, description: 'Last executed at' })\n lastExecutedAt?: Date\n\n @Column({ type: 'int', default: 0, comment: 'Total execution count' })\n @Field(type => Int, { description: 'Total times executed' })\n executionCount: number\n\n @ManyToOne(() => Domain)\n @Field({ nullable: true, description: 'Domain' })\n domain?: Domain\n\n @RelationId((pipeline: MLPipeline) => pipeline.domain)\n domainId?: string\n\n @ManyToOne(() => User, { nullable: true })\n @Field(type => User, { nullable: true, description: 'Creator' })\n creator?: User\n\n @RelationId((pipeline: MLPipeline) => pipeline.creator)\n creatorId?: string\n\n @ManyToOne(() => User, { nullable: true })\n @Field(type => User, { nullable: true, description: 'Last updater' })\n updater?: User\n\n @RelationId((pipeline: MLPipeline) => pipeline.updater)\n updaterId?: string\n\n @CreateDateColumn()\n @Field({ description: 'Created at' })\n createdAt: Date\n\n @UpdateDateColumn()\n @Field({ description: 'Updated at' })\n updatedAt: Date\n\n @DeleteDateColumn()\n @Field({ nullable: true, description: 'Deleted at' })\n deletedAt?: Date\n}\n"]}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.resolvers = exports.entities = void 0;
|
|
4
|
+
const ml_pipeline_run_1 = require("./ml-pipeline-run");
|
|
5
|
+
exports.entities = [ml_pipeline_run_1.MLPipelineRun];
|
|
6
|
+
exports.resolvers = [];
|
|
7
|
+
// export * from './ml-pipeline-run'
|
|
8
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../server/service/ml-pipeline-run/index.ts"],"names":[],"mappings":";;;AAAA,uDAAiD;AAEpC,QAAA,QAAQ,GAAG,CAAC,+BAAa,CAAC,CAAA;AAC1B,QAAA,SAAS,GAAG,EAAE,CAAA;AAE3B,oCAAoC","sourcesContent":["import { MLPipelineRun } from './ml-pipeline-run'\n\nexport const entities = [MLPipelineRun]\nexport const resolvers = []\n\n// export * from './ml-pipeline-run'\n"]}
|