ml-management 0.6.3rc13__tar.gz → 0.6.3rc16__tar.gz
Sign up to get free protection for your applications and to get access to all the features.
- ml_management-0.6.3rc16/ML_management/__init__.py +1 -0
- {ml_management-0.6.3rc13 → ml_management-0.6.3rc16}/ML_management/graphql/schema.py +51 -43
- {ml_management-0.6.3rc13 → ml_management-0.6.3rc16}/ML_management/mlmanagement/__init__.py +2 -1
- ml_management-0.6.3rc16/ML_management/mlmanagement/active_job.py +99 -0
- {ml_management-0.6.3rc13 → ml_management-0.6.3rc16}/ML_management/mlmanagement/batcher.py +5 -2
- {ml_management-0.6.3rc13 → ml_management-0.6.3rc16}/ML_management/mlmanagement/load_api.py +58 -7
- {ml_management-0.6.3rc13 → ml_management-0.6.3rc16}/ML_management/mlmanagement/log_api.py +10 -10
- {ml_management-0.6.3rc13 → ml_management-0.6.3rc16}/ML_management/registry/exceptions.py +2 -2
- {ml_management-0.6.3rc13 → ml_management-0.6.3rc16}/ML_management/sdk/job.py +4 -2
- {ml_management-0.6.3rc13 → ml_management-0.6.3rc16}/ML_management/variables.py +1 -1
- {ml_management-0.6.3rc13 → ml_management-0.6.3rc16}/PKG-INFO +1 -1
- {ml_management-0.6.3rc13 → ml_management-0.6.3rc16}/pyproject.toml +1 -1
- ml_management-0.6.3rc13/ML_management/__init__.py +0 -1
- ml_management-0.6.3rc13/ML_management/mlmanagement/active_job.py +0 -74
- {ml_management-0.6.3rc13 → ml_management-0.6.3rc16}/ML_management/base_exceptions.py +0 -0
- {ml_management-0.6.3rc13 → ml_management-0.6.3rc16}/ML_management/collectors/__init__.py +0 -0
- {ml_management-0.6.3rc13 → ml_management-0.6.3rc16}/ML_management/collectors/collector_pattern.py +0 -0
- {ml_management-0.6.3rc13 → ml_management-0.6.3rc16}/ML_management/collectors/collector_pattern_to_methods_map.py +0 -0
- {ml_management-0.6.3rc13 → ml_management-0.6.3rc16}/ML_management/collectors/collectors.py +0 -0
- {ml_management-0.6.3rc13 → ml_management-0.6.3rc16}/ML_management/collectors/dummy/__init__.py +0 -0
- {ml_management-0.6.3rc13 → ml_management-0.6.3rc16}/ML_management/collectors/dummy/dummy_collector.py +0 -0
- {ml_management-0.6.3rc13 → ml_management-0.6.3rc16}/ML_management/collectors/s3/__init__.py +0 -0
- {ml_management-0.6.3rc13 → ml_management-0.6.3rc16}/ML_management/collectors/s3/s3collector.py +0 -0
- {ml_management-0.6.3rc13 → ml_management-0.6.3rc16}/ML_management/collectors/topic_markers/__init__.py +0 -0
- {ml_management-0.6.3rc13 → ml_management-0.6.3rc16}/ML_management/collectors/topic_markers/api_schema.py +0 -0
- {ml_management-0.6.3rc13 → ml_management-0.6.3rc16}/ML_management/collectors/topic_markers/topic_markers_collector.py +0 -0
- {ml_management-0.6.3rc13 → ml_management-0.6.3rc16}/ML_management/dataset_loader/__init__.py +0 -0
- {ml_management-0.6.3rc13 → ml_management-0.6.3rc16}/ML_management/dataset_loader/base_splits_dataset_loader.py +0 -0
- {ml_management-0.6.3rc13 → ml_management-0.6.3rc16}/ML_management/dataset_loader/dataset_loader_pattern.py +0 -0
- {ml_management-0.6.3rc13 → ml_management-0.6.3rc16}/ML_management/dataset_loader/dataset_loader_pattern_to_methods_map.py +0 -0
- {ml_management-0.6.3rc13 → ml_management-0.6.3rc16}/ML_management/dataset_loader/poisoned_images_dataset_loader.py +0 -0
- {ml_management-0.6.3rc13 → ml_management-0.6.3rc16}/ML_management/dataset_loader/templates/__init__.py +0 -0
- {ml_management-0.6.3rc13 → ml_management-0.6.3rc16}/ML_management/dataset_loader/templates/dummy_dataset_loader/__init__.py +0 -0
- {ml_management-0.6.3rc13 → ml_management-0.6.3rc16}/ML_management/dataset_loader/templates/dummy_dataset_loader/conda.yaml +0 -0
- {ml_management-0.6.3rc13 → ml_management-0.6.3rc16}/ML_management/dataset_loader/templates/dummy_dataset_loader/dummy_dataset.py +0 -0
- {ml_management-0.6.3rc13 → ml_management-0.6.3rc16}/ML_management/dataset_loader/templates/upload.py +0 -0
- {ml_management-0.6.3rc13 → ml_management-0.6.3rc16}/ML_management/executor/__init__.py +0 -0
- {ml_management-0.6.3rc13 → ml_management-0.6.3rc16}/ML_management/executor/base_executor.py +0 -0
- {ml_management-0.6.3rc13 → ml_management-0.6.3rc16}/ML_management/executor/executor_pattern.py +0 -0
- {ml_management-0.6.3rc13 → ml_management-0.6.3rc16}/ML_management/executor/executor_pattern_to_methods_map.py +0 -0
- {ml_management-0.6.3rc13 → ml_management-0.6.3rc16}/ML_management/executor/no_model_executor_pattern.py +0 -0
- {ml_management-0.6.3rc13 → ml_management-0.6.3rc16}/ML_management/executor/patterns.py +0 -0
- {ml_management-0.6.3rc13 → ml_management-0.6.3rc16}/ML_management/executor/templates/__init__.py +0 -0
- {ml_management-0.6.3rc13 → ml_management-0.6.3rc16}/ML_management/executor/templates/eval/__init__.py +0 -0
- {ml_management-0.6.3rc13 → ml_management-0.6.3rc16}/ML_management/executor/templates/eval/conda.yaml +0 -0
- {ml_management-0.6.3rc13 → ml_management-0.6.3rc16}/ML_management/executor/templates/eval/eval_executor.py +0 -0
- {ml_management-0.6.3rc13 → ml_management-0.6.3rc16}/ML_management/executor/templates/finetune/__init__.py +0 -0
- {ml_management-0.6.3rc13 → ml_management-0.6.3rc16}/ML_management/executor/templates/finetune/conda.yaml +0 -0
- {ml_management-0.6.3rc13 → ml_management-0.6.3rc16}/ML_management/executor/templates/finetune/finetune_executor.py +0 -0
- {ml_management-0.6.3rc13 → ml_management-0.6.3rc16}/ML_management/executor/templates/train/__init__.py +0 -0
- {ml_management-0.6.3rc13 → ml_management-0.6.3rc16}/ML_management/executor/templates/train/conda.yaml +0 -0
- {ml_management-0.6.3rc13 → ml_management-0.6.3rc16}/ML_management/executor/templates/train/train_executor.py +0 -0
- {ml_management-0.6.3rc13 → ml_management-0.6.3rc16}/ML_management/executor/templates/upload.py +0 -0
- {ml_management-0.6.3rc13 → ml_management-0.6.3rc16}/ML_management/executor/upload_model_mode.py +0 -0
- {ml_management-0.6.3rc13 → ml_management-0.6.3rc16}/ML_management/graphql/__init__.py +0 -0
- {ml_management-0.6.3rc13 → ml_management-0.6.3rc16}/ML_management/graphql/send_graphql_request.py +0 -0
- {ml_management-0.6.3rc13 → ml_management-0.6.3rc16}/ML_management/mlmanagement/backend_api.py +0 -0
- {ml_management-0.6.3rc13 → ml_management-0.6.3rc16}/ML_management/mlmanagement/jsonschema_exceptions.py +0 -0
- {ml_management-0.6.3rc13 → ml_management-0.6.3rc16}/ML_management/mlmanagement/jsonschema_inference.py +0 -0
- {ml_management-0.6.3rc13 → ml_management-0.6.3rc16}/ML_management/mlmanagement/model_type.py +0 -0
- {ml_management-0.6.3rc13 → ml_management-0.6.3rc16}/ML_management/mlmanagement/module_finder.py +0 -0
- {ml_management-0.6.3rc13 → ml_management-0.6.3rc16}/ML_management/mlmanagement/server_mlmanager_exceptions.py +0 -0
- {ml_management-0.6.3rc13 → ml_management-0.6.3rc16}/ML_management/mlmanagement/utils.py +0 -0
- {ml_management-0.6.3rc13 → ml_management-0.6.3rc16}/ML_management/mlmanagement/visibility_options.py +0 -0
- {ml_management-0.6.3rc13 → ml_management-0.6.3rc16}/ML_management/model/__init__.py +0 -0
- {ml_management-0.6.3rc13 → ml_management-0.6.3rc16}/ML_management/model/model_type_to_methods_map.py +0 -0
- {ml_management-0.6.3rc13 → ml_management-0.6.3rc16}/ML_management/model/patterns/__init__.py +0 -0
- {ml_management-0.6.3rc13 → ml_management-0.6.3rc16}/ML_management/model/patterns/evaluatable_model.py +0 -0
- {ml_management-0.6.3rc13 → ml_management-0.6.3rc16}/ML_management/model/patterns/gradient_model.py +0 -0
- {ml_management-0.6.3rc13 → ml_management-0.6.3rc16}/ML_management/model/patterns/model_pattern.py +0 -0
- {ml_management-0.6.3rc13 → ml_management-0.6.3rc16}/ML_management/model/patterns/model_with_losses.py +0 -0
- {ml_management-0.6.3rc13 → ml_management-0.6.3rc16}/ML_management/model/patterns/model_with_metrics.py +0 -0
- {ml_management-0.6.3rc13 → ml_management-0.6.3rc16}/ML_management/model/patterns/preprocessor.py +0 -0
- {ml_management-0.6.3rc13 → ml_management-0.6.3rc16}/ML_management/model/patterns/retrainable_model.py +0 -0
- {ml_management-0.6.3rc13 → ml_management-0.6.3rc16}/ML_management/model/patterns/target_layer.py +0 -0
- {ml_management-0.6.3rc13 → ml_management-0.6.3rc16}/ML_management/model/patterns/torch_model.py +0 -0
- {ml_management-0.6.3rc13 → ml_management-0.6.3rc16}/ML_management/model/patterns/trainable_model.py +0 -0
- {ml_management-0.6.3rc13 → ml_management-0.6.3rc16}/ML_management/model/patterns/transformer.py +0 -0
- {ml_management-0.6.3rc13 → ml_management-0.6.3rc16}/ML_management/registry/__init__.py +0 -0
- {ml_management-0.6.3rc13 → ml_management-0.6.3rc16}/ML_management/s3/__init__.py +0 -0
- {ml_management-0.6.3rc13 → ml_management-0.6.3rc16}/ML_management/s3/manager.py +0 -0
- {ml_management-0.6.3rc13 → ml_management-0.6.3rc16}/ML_management/s3/utils.py +0 -0
- {ml_management-0.6.3rc13 → ml_management-0.6.3rc16}/ML_management/sdk/__init__.py +0 -0
- {ml_management-0.6.3rc13 → ml_management-0.6.3rc16}/ML_management/sdk/dataset_loader.py +0 -0
- {ml_management-0.6.3rc13 → ml_management-0.6.3rc16}/ML_management/sdk/executor.py +0 -0
- {ml_management-0.6.3rc13 → ml_management-0.6.3rc16}/ML_management/sdk/experiment.py +0 -0
- {ml_management-0.6.3rc13 → ml_management-0.6.3rc16}/ML_management/sdk/model.py +0 -0
- {ml_management-0.6.3rc13 → ml_management-0.6.3rc16}/ML_management/sdk/parameters.py +0 -0
- {ml_management-0.6.3rc13 → ml_management-0.6.3rc16}/ML_management/sdk/sdk.py +0 -0
- {ml_management-0.6.3rc13 → ml_management-0.6.3rc16}/ML_management/session.py +0 -0
- {ml_management-0.6.3rc13 → ml_management-0.6.3rc16}/ML_management/singleton_pattern.py +0 -0
- {ml_management-0.6.3rc13 → ml_management-0.6.3rc16}/ML_management/test_sdk/__init__.py +0 -0
- {ml_management-0.6.3rc13 → ml_management-0.6.3rc16}/ML_management/test_sdk/local_sdk_test.sh +0 -0
- {ml_management-0.6.3rc13 → ml_management-0.6.3rc16}/ML_management/test_sdk/mock_server.js +0 -0
- {ml_management-0.6.3rc13 → ml_management-0.6.3rc16}/ML_management/test_sdk/package.json +0 -0
- {ml_management-0.6.3rc13 → ml_management-0.6.3rc16}/ML_management/test_sdk/requirements.txt +0 -0
- {ml_management-0.6.3rc13 → ml_management-0.6.3rc16}/ML_management/test_sdk/test_sdk.py +0 -0
- {ml_management-0.6.3rc13 → ml_management-0.6.3rc16}/ML_management/tests/__init__.py +0 -0
- {ml_management-0.6.3rc13 → ml_management-0.6.3rc16}/ML_management/tests/requirements.txt +0 -0
- {ml_management-0.6.3rc13 → ml_management-0.6.3rc16}/ML_management/tests/run_all_tests.sh +0 -0
- {ml_management-0.6.3rc13 → ml_management-0.6.3rc16}/ML_management/tests/test_jsonschema_inference.py +0 -0
- {ml_management-0.6.3rc13 → ml_management-0.6.3rc16}/ML_management/uploader_data/__init__.py +0 -0
- {ml_management-0.6.3rc13 → ml_management-0.6.3rc16}/ML_management/uploader_data/s3_uploader.py +0 -0
- {ml_management-0.6.3rc13 → ml_management-0.6.3rc16}/ML_management/uploader_data/utils.py +0 -0
- {ml_management-0.6.3rc13 → ml_management-0.6.3rc16}/README.md +0 -0
@@ -0,0 +1 @@
|
|
1
|
+
__version__ = "0.6.3rc16"
|
@@ -147,13 +147,15 @@ class ExecutorParamsInput(sgqlc.types.Input):
|
|
147
147
|
|
148
148
|
class JobFilterSettings(sgqlc.types.Input):
|
149
149
|
__schema__ = schema
|
150
|
-
__field_names__ = ('dataset_loader_version', 'end_interval', 'executor_version', 'experiment_name', 'init_model_version', 'job_name', 'periodic_type', 'start_interval', 'status')
|
150
|
+
__field_names__ = ('dataset_loader_version', 'end_interval', 'executor_version', 'experiment_id', 'experiment_name', 'init_model_version', 'job_name', 'periodic_type', 'start_interval', 'status')
|
151
151
|
dataset_loader_version = sgqlc.types.Field('ObjectVersionInput', graphql_name='datasetLoaderVersion')
|
152
152
|
|
153
153
|
end_interval = sgqlc.types.Field('TimestampInterval', graphql_name='endInterval')
|
154
154
|
|
155
155
|
executor_version = sgqlc.types.Field('ObjectVersionInput', graphql_name='executorVersion')
|
156
156
|
|
157
|
+
experiment_id = sgqlc.types.Field(Int, graphql_name='experimentId')
|
158
|
+
|
157
159
|
experiment_name = sgqlc.types.Field(String, graphql_name='experimentName')
|
158
160
|
|
159
161
|
init_model_version = sgqlc.types.Field('ObjectVersionInput', graphql_name='initModelVersion')
|
@@ -1027,7 +1029,7 @@ class ExperimentPagination(sgqlc.types.Type):
|
|
1027
1029
|
|
1028
1030
|
class GraphNode(sgqlc.types.Type):
|
1029
1031
|
__schema__ = schema
|
1030
|
-
__field_names__ = ('creation_timestamp', 'list_next_node', 'name', '
|
1032
|
+
__field_names__ = ('creation_timestamp', 'list_next_node', 'name', 'obj_uuid', 'root_obj_uuid', 'source_name', 'source_obj_uuid', 'source_version', 'upload_model_type', 'version')
|
1031
1033
|
creation_timestamp = sgqlc.types.Field(sgqlc.types.non_null(Long), graphql_name='creationTimestamp')
|
1032
1034
|
|
1033
1035
|
list_next_node = sgqlc.types.Field(sgqlc.types.list_of(sgqlc.types.non_null('GraphNode')), graphql_name='listNextNode', args=sgqlc.types.ArgDict((
|
@@ -1042,13 +1044,13 @@ class GraphNode(sgqlc.types.Type):
|
|
1042
1044
|
|
1043
1045
|
name = sgqlc.types.Field(sgqlc.types.non_null(String), graphql_name='name')
|
1044
1046
|
|
1045
|
-
|
1047
|
+
obj_uuid = sgqlc.types.Field(sgqlc.types.non_null(ID), graphql_name='objUuid')
|
1046
1048
|
|
1047
|
-
|
1049
|
+
root_obj_uuid = sgqlc.types.Field(sgqlc.types.non_null(ID), graphql_name='rootObjUuid')
|
1048
1050
|
|
1049
1051
|
source_name = sgqlc.types.Field(String, graphql_name='sourceName')
|
1050
1052
|
|
1051
|
-
|
1053
|
+
source_obj_uuid = sgqlc.types.Field(ID, graphql_name='sourceObjUuid')
|
1052
1054
|
|
1053
1055
|
source_version = sgqlc.types.Field(Int, graphql_name='sourceVersion')
|
1054
1056
|
|
@@ -1126,16 +1128,16 @@ class JobPagination(sgqlc.types.Type):
|
|
1126
1128
|
|
1127
1129
|
class JobParams(sgqlc.types.Type):
|
1128
1130
|
__schema__ = schema
|
1129
|
-
__field_names__ = ('additional_system_packages', 'cron_expression', 'executor_params', '
|
1131
|
+
__field_names__ = ('additional_system_packages', 'cron_expression', 'executor_params', 'experiment', 'experiment_id', 'gpu', 'list_role_data_params', 'list_role_model_params', 'models_schemas', 'periodic_type')
|
1130
1132
|
additional_system_packages = sgqlc.types.Field(sgqlc.types.list_of(sgqlc.types.non_null(String)), graphql_name='additionalSystemPackages')
|
1131
1133
|
|
1132
1134
|
cron_expression = sgqlc.types.Field(String, graphql_name='cronExpression')
|
1133
1135
|
|
1134
1136
|
executor_params = sgqlc.types.Field(sgqlc.types.non_null(ExecutorParams), graphql_name='executorParams')
|
1135
1137
|
|
1136
|
-
|
1138
|
+
experiment = sgqlc.types.Field(Experiment, graphql_name='experiment')
|
1137
1139
|
|
1138
|
-
|
1140
|
+
experiment_id = sgqlc.types.Field(Int, graphql_name='experimentId')
|
1139
1141
|
|
1140
1142
|
gpu = sgqlc.types.Field(Boolean, graphql_name='gpu')
|
1141
1143
|
|
@@ -1143,6 +1145,8 @@ class JobParams(sgqlc.types.Type):
|
|
1143
1145
|
|
1144
1146
|
list_role_model_params = sgqlc.types.Field(sgqlc.types.list_of(sgqlc.types.non_null('RoleModelParams')), graphql_name='listRoleModelParams')
|
1145
1147
|
|
1148
|
+
models_schemas = sgqlc.types.Field(sgqlc.types.non_null(JSON), graphql_name='modelsSchemas')
|
1149
|
+
|
1146
1150
|
periodic_type = sgqlc.types.Field(PeriodicType, graphql_name='periodicType')
|
1147
1151
|
|
1148
1152
|
|
@@ -1250,7 +1254,7 @@ class ModelPagination(sgqlc.types.Type):
|
|
1250
1254
|
|
1251
1255
|
class ModelParams(sgqlc.types.Type):
|
1252
1256
|
__schema__ = schema
|
1253
|
-
__field_names__ = ('description', 'list_model_method_params', 'model_version_choice', 'new_model_name', 'prepare_new_model_inference')
|
1257
|
+
__field_names__ = ('description', 'list_model_method_params', 'model_version_choice', 'new_model_name', 'new_model_visibility', 'prepare_new_model_inference', 'start_build_new_model_image')
|
1254
1258
|
description = sgqlc.types.Field(String, graphql_name='description')
|
1255
1259
|
|
1256
1260
|
list_model_method_params = sgqlc.types.Field(sgqlc.types.non_null(sgqlc.types.list_of(sgqlc.types.non_null(MethodParams))), graphql_name='listModelMethodParams')
|
@@ -1259,8 +1263,12 @@ class ModelParams(sgqlc.types.Type):
|
|
1259
1263
|
|
1260
1264
|
new_model_name = sgqlc.types.Field(String, graphql_name='newModelName')
|
1261
1265
|
|
1266
|
+
new_model_visibility = sgqlc.types.Field(sgqlc.types.non_null(VisibilityOptions), graphql_name='newModelVisibility')
|
1267
|
+
|
1262
1268
|
prepare_new_model_inference = sgqlc.types.Field(sgqlc.types.non_null(Boolean), graphql_name='prepareNewModelInference')
|
1263
1269
|
|
1270
|
+
start_build_new_model_image = sgqlc.types.Field(sgqlc.types.non_null(Boolean), graphql_name='startBuildNewModelImage')
|
1271
|
+
|
1264
1272
|
|
1265
1273
|
|
1266
1274
|
class ModelVersionChoiceParams(sgqlc.types.Type):
|
@@ -1276,7 +1284,7 @@ class ModelVersionChoiceParams(sgqlc.types.Type):
|
|
1276
1284
|
|
1277
1285
|
class ModelVersionInfo(sgqlc.types.Type):
|
1278
1286
|
__schema__ = schema
|
1279
|
-
__field_names__ = ('artifacts', 'available_collectors', 'available_dataset_loader_versions', 'available_dataset_loaders', 'available_executor_versions', 'available_executors', 'build_job', 'creation_timestamp', 'description', 'experiment', '
|
1287
|
+
__field_names__ = ('artifacts', 'available_collectors', 'available_dataset_loader_versions', 'available_dataset_loaders', 'available_executor_versions', 'available_executors', 'build_job', 'creation_timestamp', 'description', 'experiment', 'get_conda_env', 'group_secret_uuid', 'last_updated_timestamp', 'list_deployed_jobs', 'list_job', 'list_lineage_model_version', 'list_new_model_from_version', 'list_new_version_from_version', 'list_next_graph_nodes', 'list_next_model_version', 'list_requirements', 'model', 'model_method_schemas', 'name', 'owner', 'pagination_available_collectors', 'pagination_available_dataset_loader_versions', 'pagination_available_dataset_loaders', 'pagination_available_executor_versions', 'pagination_available_executors', 'pagination_deployed_jobs', 'pagination_job', 'pagination_lineage_model_version', 'pagination_new_model_from_version', 'pagination_new_version_from_version', 'pagination_next_model_version', 'parent_job', 'root_model_version', 'source_executor_version', 'source_model_version', 'tags', 'upload_model_type', 'venv_build_job', 'version', 'visibility')
|
1280
1288
|
artifacts = sgqlc.types.Field(sgqlc.types.non_null(Artifacts), graphql_name='artifacts')
|
1281
1289
|
|
1282
1290
|
available_collectors = sgqlc.types.Field(sgqlc.types.non_null(sgqlc.types.list_of(sgqlc.types.non_null(InlineObject))), graphql_name='availableCollectors')
|
@@ -1311,11 +1319,9 @@ class ModelVersionInfo(sgqlc.types.Type):
|
|
1311
1319
|
|
1312
1320
|
experiment = sgqlc.types.Field(Experiment, graphql_name='experiment')
|
1313
1321
|
|
1314
|
-
experiment_name = sgqlc.types.Field(sgqlc.types.non_null(String), graphql_name='experimentName')
|
1315
|
-
|
1316
1322
|
get_conda_env = sgqlc.types.Field(sgqlc.types.non_null(JSON), graphql_name='getCondaEnv')
|
1317
1323
|
|
1318
|
-
|
1324
|
+
group_secret_uuid = sgqlc.types.Field(String, graphql_name='groupSecretUuid')
|
1319
1325
|
|
1320
1326
|
last_updated_timestamp = sgqlc.types.Field(Long, graphql_name='lastUpdatedTimestamp')
|
1321
1327
|
|
@@ -1562,7 +1568,7 @@ class ModelVersionPagination(sgqlc.types.Type):
|
|
1562
1568
|
|
1563
1569
|
class Mutation(sgqlc.types.Type):
|
1564
1570
|
__schema__ = schema
|
1565
|
-
__field_names__ = ('add_ml_job', 'cancel_build_job_for_executor_version', 'cancel_build_job_for_model_version', 'cancel_job', 'cancel_venv_build_job_for_model_version', 'create_experiment', 'create_local_job', 'delete_dataset_loader', 'delete_dataset_loader_tag', 'delete_dataset_loader_version_from_name_version', 'delete_dataset_loader_version_tag', 'delete_executor', 'delete_executor_tag', 'delete_executor_version_from_name_version', 'delete_executor_version_tag', 'delete_experiment_tag', 'delete_model', 'delete_model_tag', 'delete_model_version_from_name_version', 'delete_model_version_tag', 'log_metric', 'log_metrics', 'log_param', 'log_params', 'rebuild_model_version_image', 'rebuild_no_model_executor_version_image', 'rename_experiment', 'serve_model', 'set_dataset_loader_tag', 'set_dataset_loader_version_tag', 'set_executor_tag', 'set_executor_version_tag', 'set_experiment_tag', 'set_model_tag', 'set_model_version_tag', '
|
1571
|
+
__field_names__ = ('add_ml_job', 'cancel_build_job_for_executor_version', 'cancel_build_job_for_model_version', 'cancel_job', 'cancel_venv_build_job_for_model_version', 'create_experiment', 'create_local_job', 'delete_dataset_loader', 'delete_dataset_loader_tag', 'delete_dataset_loader_version_from_name_version', 'delete_dataset_loader_version_tag', 'delete_executor', 'delete_executor_tag', 'delete_executor_version_from_name_version', 'delete_executor_version_tag', 'delete_experiment_tag', 'delete_model', 'delete_model_tag', 'delete_model_version_from_name_version', 'delete_model_version_tag', 'log_metric', 'log_metrics', 'log_param', 'log_params', 'rebuild_model_version_image', 'rebuild_no_model_executor_version_image', 'rename_experiment', 'serve_model', 'set_dataset_loader_tag', 'set_dataset_loader_version_tag', 'set_executor_tag', 'set_executor_version_tag', 'set_experiment_tag', 'set_model_tag', 'set_model_version_tag', 'start_job', 'stop_job', 'stop_model_serving', 'update_dataset_loader', 'update_dataset_loader_version', 'update_executor', 'update_executor_version', 'update_experiment', 'update_job', 'update_model', 'update_model_version')
|
1566
1572
|
add_ml_job = sgqlc.types.Field(sgqlc.types.non_null(ExecutionJob), graphql_name='addMlJob', args=sgqlc.types.ArgDict((
|
1567
1573
|
('form', sgqlc.types.Arg(sgqlc.types.non_null(JobParameters), graphql_name='form', default=None)),
|
1568
1574
|
))
|
@@ -1627,7 +1633,7 @@ class Mutation(sgqlc.types.Type):
|
|
1627
1633
|
* `visibility` (`VisibilityOptions!`)None (default: `PRIVATE`)
|
1628
1634
|
'''
|
1629
1635
|
|
1630
|
-
create_local_job = sgqlc.types.Field(sgqlc.types.non_null(
|
1636
|
+
create_local_job = sgqlc.types.Field(sgqlc.types.non_null(String), graphql_name='createLocalJob', args=sgqlc.types.ArgDict((
|
1631
1637
|
('experiment_name', sgqlc.types.Arg(sgqlc.types.non_null(String), graphql_name='experimentName', default=None)),
|
1632
1638
|
('job_name', sgqlc.types.Arg(String, graphql_name='jobName', default=None)),
|
1633
1639
|
('visibility', sgqlc.types.Arg(sgqlc.types.non_null(VisibilityOptions), graphql_name='visibility', default=None)),
|
@@ -1772,47 +1778,47 @@ class Mutation(sgqlc.types.Type):
|
|
1772
1778
|
'''
|
1773
1779
|
|
1774
1780
|
log_metric = sgqlc.types.Field(sgqlc.types.non_null(Boolean), graphql_name='logMetric', args=sgqlc.types.ArgDict((
|
1775
|
-
('job_run_id', sgqlc.types.Arg(sgqlc.types.non_null(String), graphql_name='jobRunId', default=None)),
|
1776
1781
|
('metric', sgqlc.types.Arg(sgqlc.types.non_null(MetricInput), graphql_name='metric', default=None)),
|
1782
|
+
('secret_uuid', sgqlc.types.Arg(sgqlc.types.non_null(String), graphql_name='secretUuid', default=None)),
|
1777
1783
|
))
|
1778
1784
|
)
|
1779
1785
|
'''Arguments:
|
1780
1786
|
|
1781
|
-
* `job_run_id` (`String!`)None
|
1782
1787
|
* `metric` (`MetricInput!`)None
|
1788
|
+
* `secret_uuid` (`String!`)None
|
1783
1789
|
'''
|
1784
1790
|
|
1785
1791
|
log_metrics = sgqlc.types.Field(sgqlc.types.non_null(Boolean), graphql_name='logMetrics', args=sgqlc.types.ArgDict((
|
1786
|
-
('job_run_id', sgqlc.types.Arg(sgqlc.types.non_null(String), graphql_name='jobRunId', default=None)),
|
1787
1792
|
('metrics', sgqlc.types.Arg(sgqlc.types.non_null(sgqlc.types.list_of(sgqlc.types.non_null(MetricInput))), graphql_name='metrics', default=None)),
|
1793
|
+
('secret_uuid', sgqlc.types.Arg(sgqlc.types.non_null(String), graphql_name='secretUuid', default=None)),
|
1788
1794
|
))
|
1789
1795
|
)
|
1790
1796
|
'''Arguments:
|
1791
1797
|
|
1792
|
-
* `job_run_id` (`String!`)None
|
1793
1798
|
* `metrics` (`[MetricInput!]!`)None
|
1799
|
+
* `secret_uuid` (`String!`)None
|
1794
1800
|
'''
|
1795
1801
|
|
1796
1802
|
log_param = sgqlc.types.Field(sgqlc.types.non_null(Boolean), graphql_name='logParam', args=sgqlc.types.ArgDict((
|
1797
|
-
('job_run_id', sgqlc.types.Arg(sgqlc.types.non_null(String), graphql_name='jobRunId', default=None)),
|
1798
1803
|
('param', sgqlc.types.Arg(sgqlc.types.non_null(ParamInput), graphql_name='param', default=None)),
|
1804
|
+
('secret_uuid', sgqlc.types.Arg(sgqlc.types.non_null(String), graphql_name='secretUuid', default=None)),
|
1799
1805
|
))
|
1800
1806
|
)
|
1801
1807
|
'''Arguments:
|
1802
1808
|
|
1803
|
-
* `job_run_id` (`String!`)None
|
1804
1809
|
* `param` (`ParamInput!`)None
|
1810
|
+
* `secret_uuid` (`String!`)None
|
1805
1811
|
'''
|
1806
1812
|
|
1807
1813
|
log_params = sgqlc.types.Field(sgqlc.types.non_null(Boolean), graphql_name='logParams', args=sgqlc.types.ArgDict((
|
1808
|
-
('job_run_id', sgqlc.types.Arg(sgqlc.types.non_null(String), graphql_name='jobRunId', default=None)),
|
1809
1814
|
('params', sgqlc.types.Arg(sgqlc.types.non_null(sgqlc.types.list_of(sgqlc.types.non_null(ParamInput))), graphql_name='params', default=None)),
|
1815
|
+
('secret_uuid', sgqlc.types.Arg(sgqlc.types.non_null(String), graphql_name='secretUuid', default=None)),
|
1810
1816
|
))
|
1811
1817
|
)
|
1812
1818
|
'''Arguments:
|
1813
1819
|
|
1814
|
-
* `job_run_id` (`String!`)None
|
1815
1820
|
* `params` (`[ParamInput!]!`)None
|
1821
|
+
* `secret_uuid` (`String!`)None
|
1816
1822
|
'''
|
1817
1823
|
|
1818
1824
|
rebuild_model_version_image = sgqlc.types.Field(sgqlc.types.non_null(String), graphql_name='rebuildModelVersionImage', args=sgqlc.types.ArgDict((
|
@@ -1944,25 +1950,27 @@ class Mutation(sgqlc.types.Type):
|
|
1944
1950
|
* `value` (`String!`)None
|
1945
1951
|
'''
|
1946
1952
|
|
1947
|
-
|
1948
|
-
('
|
1953
|
+
start_job = sgqlc.types.Field(sgqlc.types.non_null(ExecutionJob), graphql_name='startJob', args=sgqlc.types.ArgDict((
|
1954
|
+
('secret_uuid', sgqlc.types.Arg(sgqlc.types.non_null(String), graphql_name='secretUuid', default=None)),
|
1949
1955
|
))
|
1950
1956
|
)
|
1951
1957
|
'''Arguments:
|
1952
1958
|
|
1953
|
-
* `
|
1959
|
+
* `secret_uuid` (`String!`)None
|
1954
1960
|
'''
|
1955
1961
|
|
1956
|
-
|
1957
|
-
('
|
1962
|
+
stop_job = sgqlc.types.Field(sgqlc.types.non_null(Boolean), graphql_name='stopJob', args=sgqlc.types.ArgDict((
|
1963
|
+
('exception_traceback', sgqlc.types.Arg(String, graphql_name='exceptionTraceback', default=None)),
|
1958
1964
|
('message', sgqlc.types.Arg(String, graphql_name='message', default=None)),
|
1965
|
+
('secret_uuid', sgqlc.types.Arg(sgqlc.types.non_null(String), graphql_name='secretUuid', default=None)),
|
1959
1966
|
('status', sgqlc.types.Arg(sgqlc.types.non_null(JobStatus), graphql_name='status', default='SUCCESSFUL')),
|
1960
1967
|
))
|
1961
1968
|
)
|
1962
1969
|
'''Arguments:
|
1963
1970
|
|
1964
|
-
* `
|
1971
|
+
* `exception_traceback` (`String`)None (default: `null`)
|
1965
1972
|
* `message` (`String`)None (default: `null`)
|
1973
|
+
* `secret_uuid` (`String!`)None
|
1966
1974
|
* `status` (`JobStatus!`)None (default: `SUCCESSFUL`)
|
1967
1975
|
'''
|
1968
1976
|
|
@@ -2085,7 +2093,7 @@ class Param(sgqlc.types.Type):
|
|
2085
2093
|
|
2086
2094
|
class Query(sgqlc.types.Type):
|
2087
2095
|
__schema__ = schema
|
2088
|
-
__field_names__ = ('dataset_loader_from_name', 'dataset_loader_version_from_name_version', '
|
2096
|
+
__field_names__ = ('dataset_loader_from_name', 'dataset_loader_version_from_name_version', 'dataset_loader_version_from_obj_uuid', 'executor_from_name', 'executor_version_from_name_version', 'executor_version_from_obj_uuid', 'experiment_from_id', 'experiment_from_name', 'graph_node', 'is_inference_model_ready', 'job_from_name', 'list_artifacts_by_source_paths', 'list_build_job', 'list_dataset_loader', 'list_executor', 'list_experiment', 'list_graph_node', 'list_initial_executor_version', 'list_initial_model_version', 'list_job', 'list_model', 'list_subtree_graph_node', 'model_from_name', 'model_version_from_name_version', 'model_version_from_obj_uuid', 'pagination_dataset_loader', 'pagination_executor', 'pagination_experiment', 'pagination_initial_executor_version', 'pagination_initial_model_version', 'pagination_job', 'pagination_model', 'warning_delete_model_query')
|
2089
2097
|
dataset_loader_from_name = sgqlc.types.Field(sgqlc.types.non_null(DatasetLoaderInfo), graphql_name='datasetLoaderFromName', args=sgqlc.types.ArgDict((
|
2090
2098
|
('name', sgqlc.types.Arg(sgqlc.types.non_null(String), graphql_name='name', default=None)),
|
2091
2099
|
))
|
@@ -2104,13 +2112,13 @@ class Query(sgqlc.types.Type):
|
|
2104
2112
|
* `dataset_loader_version` (`ObjectVersionOptionalInput!`)None
|
2105
2113
|
'''
|
2106
2114
|
|
2107
|
-
|
2108
|
-
('
|
2115
|
+
dataset_loader_version_from_obj_uuid = sgqlc.types.Field(sgqlc.types.non_null(DatasetLoaderVersionInfo), graphql_name='datasetLoaderVersionFromObjUuid', args=sgqlc.types.ArgDict((
|
2116
|
+
('obj_uuid', sgqlc.types.Arg(sgqlc.types.non_null(String), graphql_name='objUuid', default=None)),
|
2109
2117
|
))
|
2110
2118
|
)
|
2111
2119
|
'''Arguments:
|
2112
2120
|
|
2113
|
-
* `
|
2121
|
+
* `obj_uuid` (`String!`)None
|
2114
2122
|
'''
|
2115
2123
|
|
2116
2124
|
executor_from_name = sgqlc.types.Field(sgqlc.types.non_null(ExecutorInfo), graphql_name='executorFromName', args=sgqlc.types.ArgDict((
|
@@ -2131,13 +2139,13 @@ class Query(sgqlc.types.Type):
|
|
2131
2139
|
* `executor_version` (`ObjectVersionOptionalInput!`)None
|
2132
2140
|
'''
|
2133
2141
|
|
2134
|
-
|
2135
|
-
('
|
2142
|
+
executor_version_from_obj_uuid = sgqlc.types.Field(sgqlc.types.non_null(ExecutorVersionInfo), graphql_name='executorVersionFromObjUuid', args=sgqlc.types.ArgDict((
|
2143
|
+
('obj_uuid', sgqlc.types.Arg(sgqlc.types.non_null(String), graphql_name='objUuid', default=None)),
|
2136
2144
|
))
|
2137
2145
|
)
|
2138
2146
|
'''Arguments:
|
2139
2147
|
|
2140
|
-
* `
|
2148
|
+
* `obj_uuid` (`String!`)None
|
2141
2149
|
'''
|
2142
2150
|
|
2143
2151
|
experiment_from_id = sgqlc.types.Field(sgqlc.types.non_null(Experiment), graphql_name='experimentFromId', args=sgqlc.types.ArgDict((
|
@@ -2159,12 +2167,12 @@ class Query(sgqlc.types.Type):
|
|
2159
2167
|
'''
|
2160
2168
|
|
2161
2169
|
graph_node = sgqlc.types.Field(sgqlc.types.non_null(GraphNode), graphql_name='graphNode', args=sgqlc.types.ArgDict((
|
2162
|
-
('
|
2170
|
+
('obj_uuid', sgqlc.types.Arg(sgqlc.types.non_null(String), graphql_name='objUuid', default=None)),
|
2163
2171
|
))
|
2164
2172
|
)
|
2165
2173
|
'''Arguments:
|
2166
2174
|
|
2167
|
-
* `
|
2175
|
+
* `obj_uuid` (`String!`)None
|
2168
2176
|
'''
|
2169
2177
|
|
2170
2178
|
is_inference_model_ready = sgqlc.types.Field(sgqlc.types.non_null(Boolean), graphql_name='isInferenceModelReady', args=sgqlc.types.ArgDict((
|
@@ -2241,12 +2249,12 @@ class Query(sgqlc.types.Type):
|
|
2241
2249
|
'''
|
2242
2250
|
|
2243
2251
|
list_subtree_graph_node = sgqlc.types.Field(sgqlc.types.non_null(sgqlc.types.list_of(sgqlc.types.non_null(GraphNode))), graphql_name='listSubtreeGraphNode', args=sgqlc.types.ArgDict((
|
2244
|
-
('
|
2252
|
+
('root_obj_uuid', sgqlc.types.Arg(sgqlc.types.non_null(String), graphql_name='rootObjUuid', default=None)),
|
2245
2253
|
))
|
2246
2254
|
)
|
2247
2255
|
'''Arguments:
|
2248
2256
|
|
2249
|
-
* `
|
2257
|
+
* `root_obj_uuid` (`String!`)None
|
2250
2258
|
'''
|
2251
2259
|
|
2252
2260
|
model_from_name = sgqlc.types.Field(sgqlc.types.non_null(ModelInfo), graphql_name='modelFromName', args=sgqlc.types.ArgDict((
|
@@ -2267,13 +2275,13 @@ class Query(sgqlc.types.Type):
|
|
2267
2275
|
* `model_version` (`ObjectVersionOptionalInput!`)None
|
2268
2276
|
'''
|
2269
2277
|
|
2270
|
-
|
2271
|
-
('
|
2278
|
+
model_version_from_obj_uuid = sgqlc.types.Field(sgqlc.types.non_null(ModelVersionInfo), graphql_name='modelVersionFromObjUuid', args=sgqlc.types.ArgDict((
|
2279
|
+
('obj_uuid', sgqlc.types.Arg(sgqlc.types.non_null(String), graphql_name='objUuid', default=None)),
|
2272
2280
|
))
|
2273
2281
|
)
|
2274
2282
|
'''Arguments:
|
2275
2283
|
|
2276
|
-
* `
|
2284
|
+
* `obj_uuid` (`String!`)None
|
2277
2285
|
'''
|
2278
2286
|
|
2279
2287
|
pagination_dataset_loader = sgqlc.types.Field(sgqlc.types.non_null(DatasetLoaderPagination), graphql_name='paginationDatasetLoader', args=sgqlc.types.ArgDict((
|
@@ -1,4 +1,4 @@
|
|
1
|
-
from ML_management.mlmanagement import backend_api, load_api, log_api
|
1
|
+
from ML_management.mlmanagement import active_job, backend_api, load_api, log_api
|
2
2
|
|
3
3
|
log_executor_src = log_api.log_executor_src
|
4
4
|
log_dataset_loader_src = log_api.log_dataset_loader_src
|
@@ -14,3 +14,4 @@ load_dataset = load_api.load_dataset
|
|
14
14
|
load_executor = load_api.load_executor
|
15
15
|
download_artifacts_by_name_version = load_api.download_artifacts_by_name_version
|
16
16
|
download_job_artifacts = load_api.download_job_artifacts
|
17
|
+
start_job = active_job.start_job
|
@@ -0,0 +1,99 @@
|
|
1
|
+
import traceback
|
2
|
+
from typing import Optional
|
3
|
+
|
4
|
+
from sgqlc.operation import Operation
|
5
|
+
|
6
|
+
from ML_management import variables
|
7
|
+
from ML_management.graphql import schema
|
8
|
+
from ML_management.graphql.send_graphql_request import send_graphql_request
|
9
|
+
from ML_management.mlmanagement.batcher import Batcher
|
10
|
+
from ML_management.mlmanagement.visibility_options import VisibilityOptions
|
11
|
+
from ML_management.variables import DEFAULT_EXPERIMENT
|
12
|
+
|
13
|
+
|
14
|
+
class ActiveJob:
|
15
|
+
"""
|
16
|
+
A context manager that allows for the execution of a task locally.
|
17
|
+
|
18
|
+
This class provides a convenient way to run a job locally.
|
19
|
+
|
20
|
+
"""
|
21
|
+
|
22
|
+
def __init__(self, secret_uuid):
|
23
|
+
self.secret_uuid = secret_uuid
|
24
|
+
|
25
|
+
def __enter__(self):
|
26
|
+
op = Operation(schema.Mutation)
|
27
|
+
base_query = op.start_job(secret_uuid=self.secret_uuid)
|
28
|
+
base_query.name()
|
29
|
+
base_query.experiment.name()
|
30
|
+
_query_job_params(base_query)
|
31
|
+
self.job = send_graphql_request(op=op, json_response=False).start_job
|
32
|
+
variables.secret_uuid = self.secret_uuid
|
33
|
+
return self.job
|
34
|
+
|
35
|
+
def __exit__(self, exc_type, exc_val, exc_tb):
|
36
|
+
Batcher().wait_log_metrics()
|
37
|
+
exception_traceback = None
|
38
|
+
message = None
|
39
|
+
status = "SUCCESSFUL"
|
40
|
+
if exc_type:
|
41
|
+
exception_traceback = traceback.format_exc()
|
42
|
+
message = str(exc_val)
|
43
|
+
status = "FAILED"
|
44
|
+
|
45
|
+
op = Operation(schema.Mutation)
|
46
|
+
op.stop_job(
|
47
|
+
secret_uuid=variables.secret_uuid, status=status, message=message, exception_traceback=exception_traceback
|
48
|
+
)
|
49
|
+
try:
|
50
|
+
_ = send_graphql_request(op=op, json_response=False).stop_job
|
51
|
+
finally:
|
52
|
+
variables.secret_uuid = None
|
53
|
+
|
54
|
+
|
55
|
+
def start_job(
|
56
|
+
job_name: Optional[str], experiment_name: str = DEFAULT_EXPERIMENT, visibility=VisibilityOptions.PRIVATE
|
57
|
+
) -> ActiveJob:
|
58
|
+
"""
|
59
|
+
Create local job.
|
60
|
+
|
61
|
+
Parameters
|
62
|
+
----------
|
63
|
+
job_name: str | None
|
64
|
+
Name of the new job. If not passed, it will be generated.
|
65
|
+
experiment_name: str = "Default"
|
66
|
+
Name of the experiment. Default: "Default"
|
67
|
+
visibility: VisibilityOptions
|
68
|
+
Visibility of this job to other users. Default: PRIVATE.
|
69
|
+
|
70
|
+
Returns
|
71
|
+
-------
|
72
|
+
ActiveJob
|
73
|
+
Active job.
|
74
|
+
|
75
|
+
Usage:
|
76
|
+
with start_local_job('my-beautiful-job') as job:
|
77
|
+
mlmanagement.log_metric(...)
|
78
|
+
mlmanagement.log_artifacts(...)
|
79
|
+
"""
|
80
|
+
op = Operation(schema.Mutation)
|
81
|
+
op.create_local_job(job_name=job_name, experiment_name=experiment_name, visibility=visibility.name)
|
82
|
+
secret_uuid = send_graphql_request(op=op, json_response=False).create_local_job
|
83
|
+
return ActiveJob(secret_uuid)
|
84
|
+
|
85
|
+
|
86
|
+
def _query_job_params(base_query):
|
87
|
+
base_query.params()
|
88
|
+
base_query.params.gpu()
|
89
|
+
base_query.params.models_schemas()
|
90
|
+
base_query.params.list_role_model_params()
|
91
|
+
base_query.params.list_role_data_params()
|
92
|
+
base_query.params.list_role_data_params.data_params()
|
93
|
+
base_query.params.list_role_data_params.role()
|
94
|
+
base_query.params.list_role_model_params.model_params()
|
95
|
+
base_query.params.list_role_model_params.role()
|
96
|
+
base_query.params.executor_params()
|
97
|
+
base_query.params.executor_params.executor_method_params()
|
98
|
+
base_query.params.executor_params.executor_version_choice()
|
99
|
+
base_query.executor_version.upload_model_modes()
|
@@ -39,14 +39,18 @@ class Batcher(metaclass=Singleton):
|
|
39
39
|
if self.thread:
|
40
40
|
self.stop_event.set()
|
41
41
|
self.thread.join()
|
42
|
+
self.thread = None
|
42
43
|
|
43
44
|
def log_batch_metric(self, stop_event):
|
44
45
|
while not stop_event.is_set():
|
46
|
+
time.sleep(METRIC_ACCUMULATION_DURATION)
|
47
|
+
if len(self.batch) == 0:
|
48
|
+
continue
|
45
49
|
metrics_to_log = self.batch.copy()
|
46
50
|
op = Operation(schema.Mutation)
|
47
51
|
op.log_metrics(
|
48
52
|
metrics=[MetricInput(key=key, value=value, step=step) for key, value, step in metrics_to_log],
|
49
|
-
|
53
|
+
secret_uuid=variables.secret_uuid,
|
50
54
|
)
|
51
55
|
try:
|
52
56
|
send_graphql_request(op, json_response=False, timeout=5)
|
@@ -54,7 +58,6 @@ class Batcher(metaclass=Singleton):
|
|
54
58
|
self.batch.popleft()
|
55
59
|
except Exception as err:
|
56
60
|
warnings.warn(str(err))
|
57
|
-
time.sleep(METRIC_ACCUMULATION_DURATION)
|
58
61
|
|
59
62
|
def wait_log_metrics(self):
|
60
63
|
stop_time = time.time()
|
@@ -28,9 +28,31 @@ from ML_management.variables import (
|
|
28
28
|
|
29
29
|
|
30
30
|
def download_artifacts_by_name_version(
|
31
|
-
name: str,
|
31
|
+
name: str,
|
32
|
+
version: Optional[int],
|
33
|
+
model_type: ModelType,
|
34
|
+
path: str,
|
35
|
+
dst_path: Optional[str] = None,
|
32
36
|
) -> str:
|
33
|
-
"""Download an artifact by name and version to a local directory, and return a local path for it.
|
37
|
+
"""Download an artifact by name and version to a local directory, and return a local path for it.
|
38
|
+
|
39
|
+
Parameters
|
40
|
+
==========
|
41
|
+
name: str
|
42
|
+
Name of the entity.
|
43
|
+
version: Optional[int] = None
|
44
|
+
Version of the entity. Default: None, "latest" version is used.
|
45
|
+
model_type: ModelType
|
46
|
+
Type of the entity. Possible values: ModelType.MODEL | ModelType.EXECUTOR | ModelType.DATASET_LOADER
|
47
|
+
path: str = ""
|
48
|
+
Specific path for artifacts download. Default: "", all artifacts will be downloaded.
|
49
|
+
dst_path: Optional[str]: None
|
50
|
+
Destination path. Default: None.
|
51
|
+
Returns
|
52
|
+
=======
|
53
|
+
str
|
54
|
+
Local path to the entity folder.
|
55
|
+
"""
|
34
56
|
url = get_log_service_url("download_artifacts_by_name_version")
|
35
57
|
params = {
|
36
58
|
"path": os.path.normpath(path) if path else path,
|
@@ -41,10 +63,24 @@ def download_artifacts_by_name_version(
|
|
41
63
|
return _request_download_artifacts(url, params, dst_path)
|
42
64
|
|
43
65
|
|
44
|
-
def download_job_artifacts(
|
45
|
-
"""Download an artifact file or directory from a job to a local directory, and return a local path for it.
|
66
|
+
def download_job_artifacts(name: str, path: str = "", dst_path: Optional[str] = None) -> str:
|
67
|
+
"""Download an artifact file or directory from a job to a local directory, and return a local path for it.
|
68
|
+
|
69
|
+
Parameters
|
70
|
+
==========
|
71
|
+
name: str
|
72
|
+
Name of the job.
|
73
|
+
path: str = ""
|
74
|
+
Specific path for artifacts download. Default: "", all artifacts will be downloaded.
|
75
|
+
dst_path: Optional[str]: None
|
76
|
+
Destination path. Default: None.
|
77
|
+
Returns
|
78
|
+
=======
|
79
|
+
str
|
80
|
+
Local path to artifacts.
|
81
|
+
"""
|
46
82
|
url = get_log_service_url("download_job_artifacts")
|
47
|
-
params = {"path": os.path.normpath(path) if path else path, "job_name":
|
83
|
+
params = {"path": os.path.normpath(path) if path else path, "job_name": name}
|
48
84
|
return _request_download_artifacts(url, params, dst_path)
|
49
85
|
|
50
86
|
|
@@ -92,7 +128,14 @@ def load_dataset(
|
|
92
128
|
DatasetLoaderPattern
|
93
129
|
The object of the dataset to use.
|
94
130
|
"""
|
95
|
-
return _load_model_type(
|
131
|
+
return _load_model_type(
|
132
|
+
name,
|
133
|
+
version,
|
134
|
+
ModelType.DATASET_LOADER,
|
135
|
+
install_requirements,
|
136
|
+
dst_path,
|
137
|
+
kwargs_for_init,
|
138
|
+
)
|
96
139
|
|
97
140
|
|
98
141
|
def _set_model_version_requirements(local_path) -> None:
|
@@ -107,7 +150,15 @@ def _set_model_version_requirements(local_path) -> None:
|
|
107
150
|
try:
|
108
151
|
if requirements:
|
109
152
|
subprocess.check_call(
|
110
|
-
[
|
153
|
+
[
|
154
|
+
sys.executable,
|
155
|
+
"-m",
|
156
|
+
"pip",
|
157
|
+
"install",
|
158
|
+
"--no-cache-dir",
|
159
|
+
"--default-timeout=100",
|
160
|
+
*requirements,
|
161
|
+
]
|
111
162
|
)
|
112
163
|
|
113
164
|
except Exception:
|
@@ -454,7 +454,7 @@ def _request_log_model(kwargs: dict):
|
|
454
454
|
kwargs.pop(delete_arg, None)
|
455
455
|
|
456
456
|
log_request = {
|
457
|
-
"
|
457
|
+
"secret_uuid": variables.secret_uuid,
|
458
458
|
}
|
459
459
|
|
460
460
|
artifacts_path = os.path.join(kwargs["model_path"], CONFIG_KEY_ARTIFACTS)
|
@@ -482,7 +482,7 @@ def _request_log_artifacts(
|
|
482
482
|
"""Send request for log artifact."""
|
483
483
|
log_artifact_request = {
|
484
484
|
"artifact_path": artifact_path,
|
485
|
-
"
|
485
|
+
"secret_uuid": variables.secret_uuid,
|
486
486
|
"model_type": model_type,
|
487
487
|
"name": name,
|
488
488
|
"version": version,
|
@@ -625,7 +625,7 @@ def log_metric(key: str, value: float, step: int = 0, no_wait=False):
|
|
625
625
|
=======
|
626
626
|
None
|
627
627
|
"""
|
628
|
-
if not variables.
|
628
|
+
if not variables.secret_uuid:
|
629
629
|
raise MLMClientError("The log_metric function must be called from the active job.")
|
630
630
|
if not (isinstance(value, (float, int)) and math.isfinite(value)):
|
631
631
|
warnings.warn(f"The log_metric function can log only float or integer values. Value {value} is not log.")
|
@@ -639,7 +639,7 @@ def log_metric(key: str, value: float, step: int = 0, no_wait=False):
|
|
639
639
|
return
|
640
640
|
if no_wait:
|
641
641
|
op = Operation(schema.Mutation)
|
642
|
-
op.log_metric(metric=MetricInput(key=key, value=value, step=step),
|
642
|
+
op.log_metric(metric=MetricInput(key=key, value=value, step=step), secret_uuid=variables.secret_uuid)
|
643
643
|
try:
|
644
644
|
return send_graphql_request(op, json_response=False).log_metric
|
645
645
|
except Exception as err:
|
@@ -674,7 +674,7 @@ def log_metrics(metrics: Dict[str, float], step: int = 0, no_wait=False):
|
|
674
674
|
=======
|
675
675
|
None
|
676
676
|
"""
|
677
|
-
if not variables.
|
677
|
+
if not variables.secret_uuid:
|
678
678
|
raise MLMClientError("The log_metric function must be called from the active job.")
|
679
679
|
|
680
680
|
metrics_to_log = {}
|
@@ -693,7 +693,7 @@ def log_metrics(metrics: Dict[str, float], step: int = 0, no_wait=False):
|
|
693
693
|
op = Operation(schema.Mutation)
|
694
694
|
op.log_metrics(
|
695
695
|
metrics=[MetricInput(key=key, value=value, step=step) for key, value in metrics_to_log.items()],
|
696
|
-
|
696
|
+
secret_uuid=variables.secret_uuid,
|
697
697
|
)
|
698
698
|
try:
|
699
699
|
return send_graphql_request(op, json_response=False).log_metrics
|
@@ -725,10 +725,10 @@ def _log_param(key: str, value: str):
|
|
725
725
|
if not isinstance(value, str):
|
726
726
|
warnings.warn(f"The log_param function can log only string values. Value {value} is not log.")
|
727
727
|
return
|
728
|
-
if not variables.
|
728
|
+
if not variables.secret_uuid:
|
729
729
|
raise MLMClientError("The log_param function must be called from the active job.")
|
730
730
|
op = Operation(schema.Mutation)
|
731
|
-
op.log_param(param=ParamInput(key=key, value=value),
|
731
|
+
op.log_param(param=ParamInput(key=key, value=value), secret_uuid=variables.secret_uuid)
|
732
732
|
try:
|
733
733
|
return send_graphql_request(op, json_response=False).log_param
|
734
734
|
except Exception as err:
|
@@ -753,7 +753,7 @@ def _log_params(params: Dict[str, str]):
|
|
753
753
|
=======
|
754
754
|
None
|
755
755
|
"""
|
756
|
-
if not variables.
|
756
|
+
if not variables.secret_uuid:
|
757
757
|
raise MLMClientError("The log_metric function must be called from the active job.")
|
758
758
|
|
759
759
|
for key, value in params:
|
@@ -764,7 +764,7 @@ def _log_params(params: Dict[str, str]):
|
|
764
764
|
return
|
765
765
|
op = Operation(schema.Mutation)
|
766
766
|
op.log_params(
|
767
|
-
params=[ParamInput(key=key, value=value) for key, value in params.items()],
|
767
|
+
params=[ParamInput(key=key, value=value) for key, value in params.items()], secret_uuid=variables.secret_uuid
|
768
768
|
)
|
769
769
|
try:
|
770
770
|
return send_graphql_request(op, json_response=False).log_params
|
@@ -112,7 +112,7 @@ class JobNotFoundNameError(RegistryError):
|
|
112
112
|
return (JobNotFoundNameError, (self.job_name,))
|
113
113
|
|
114
114
|
|
115
|
-
class
|
115
|
+
class JobHasNoObjUuidError(RegistryError):
|
116
116
|
"""Define job has no run id exception."""
|
117
117
|
|
118
118
|
def __init__(self, job_name: str):
|
@@ -122,4 +122,4 @@ class JobHasNoRunIdError(RegistryError):
|
|
122
122
|
|
123
123
|
def __reduce__(self):
|
124
124
|
"""Define reduce method to make exception picklable."""
|
125
|
-
return (
|
125
|
+
return (JobHasNoObjUuidError, (self.job_name,))
|
@@ -15,7 +15,7 @@ from ML_management.collectors.collector_pattern_to_methods_map import collector_
|
|
15
15
|
from ML_management.graphql import schema
|
16
16
|
from ML_management.graphql.schema import ExecutionJob, Param
|
17
17
|
from ML_management.graphql.send_graphql_request import send_graphql_request
|
18
|
-
from ML_management.mlmanagement import get_server_url
|
18
|
+
from ML_management.mlmanagement.backend_api import get_server_url
|
19
19
|
from ML_management.mlmanagement.log_api import _raise_error
|
20
20
|
from ML_management.mlmanagement.visibility_options import VisibilityOptions
|
21
21
|
from ML_management.sdk.model import get_latest_model_version
|
@@ -47,8 +47,10 @@ def job_by_name(name: str) -> ExecutionJob:
|
|
47
47
|
base_query.registration_timestamp()
|
48
48
|
base_query.start_timestamp()
|
49
49
|
base_query.end_timestamp()
|
50
|
-
base_query.build_job()
|
50
|
+
base_query.build_job.status()
|
51
|
+
base_query.build_job.message()
|
51
52
|
base_query.message()
|
53
|
+
base_query.experiment.name()
|
52
54
|
|
53
55
|
job = send_graphql_request(op, json_response=False)
|
54
56
|
|
@@ -1 +0,0 @@
|
|
1
|
-
__version__ = "0.6.3rc13"
|
@@ -1,74 +0,0 @@
|
|
1
|
-
from sgqlc.operation import Operation
|
2
|
-
|
3
|
-
from ML_management import variables
|
4
|
-
from ML_management.graphql import schema
|
5
|
-
from ML_management.graphql.schema import ExecutionJob
|
6
|
-
from ML_management.graphql.send_graphql_request import send_graphql_request
|
7
|
-
from ML_management.mlmanagement.batcher import Batcher
|
8
|
-
from ML_management.mlmanagement.visibility_options import VisibilityOptions
|
9
|
-
from ML_management.variables import DEFAULT_EXPERIMENT
|
10
|
-
|
11
|
-
|
12
|
-
class ActiveJob(ExecutionJob):
|
13
|
-
"""
|
14
|
-
A context manager that allows for the execution of a task locally.
|
15
|
-
|
16
|
-
This class provides a convenient way to run a job locally.
|
17
|
-
|
18
|
-
"""
|
19
|
-
|
20
|
-
def __enter__(self):
|
21
|
-
op = Operation(schema.Mutation)
|
22
|
-
op.start_local_job(job_name=self.name)
|
23
|
-
job_run_id = send_graphql_request(op=op, json_response=False).start_local_job
|
24
|
-
variables.job_run_id = job_run_id
|
25
|
-
return self
|
26
|
-
|
27
|
-
def __exit__(self, exc_type, exc_val, exc_tb):
|
28
|
-
Batcher().wait_log_metrics()
|
29
|
-
if exc_type:
|
30
|
-
status = "FAILED"
|
31
|
-
else:
|
32
|
-
status = "SUCCESSFUL"
|
33
|
-
op = Operation(schema.Mutation)
|
34
|
-
op.stop_local_job(job_run_id=variables.job_run_id, status=status)
|
35
|
-
try:
|
36
|
-
_ = send_graphql_request(op=op, json_response=False).stop_local_job
|
37
|
-
finally:
|
38
|
-
variables.job_run_id = None
|
39
|
-
|
40
|
-
|
41
|
-
def start_local_job(
|
42
|
-
job_name, experiment_name: str = DEFAULT_EXPERIMENT, visibility=VisibilityOptions.PRIVATE
|
43
|
-
) -> ActiveJob:
|
44
|
-
"""
|
45
|
-
Create local job.
|
46
|
-
|
47
|
-
Parameters
|
48
|
-
----------
|
49
|
-
job_name: str | None
|
50
|
-
Name of the new job. If not passed, it will be generated.
|
51
|
-
experiment_name: str = "Default"
|
52
|
-
Name of the experiment. Default: "Default"
|
53
|
-
visibility: VisibilityOptions
|
54
|
-
Visibility of this job to other users. Default: PRIVATE.
|
55
|
-
|
56
|
-
Returns
|
57
|
-
-------
|
58
|
-
ActiveJob
|
59
|
-
Active job.
|
60
|
-
|
61
|
-
Usage:
|
62
|
-
with start_local_job('my-beautiful-job') as job:
|
63
|
-
mlmanagement.log_metric(...)
|
64
|
-
mlmanagement.log_artifacts(...)
|
65
|
-
"""
|
66
|
-
op = Operation(schema.Mutation)
|
67
|
-
create_local_job = op.create_local_job(
|
68
|
-
job_name=job_name, experiment_name=experiment_name, visibility=visibility.name
|
69
|
-
)
|
70
|
-
create_local_job.name()
|
71
|
-
create_local_job.visibility()
|
72
|
-
create_local_job.experiment.name()
|
73
|
-
job = send_graphql_request(op=op, json_response=True)
|
74
|
-
return ActiveJob(job["createLocalJob"])
|
File without changes
|
File without changes
|
{ml_management-0.6.3rc13 → ml_management-0.6.3rc16}/ML_management/collectors/collector_pattern.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
{ml_management-0.6.3rc13 → ml_management-0.6.3rc16}/ML_management/collectors/dummy/__init__.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
{ml_management-0.6.3rc13 → ml_management-0.6.3rc16}/ML_management/collectors/s3/s3collector.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{ml_management-0.6.3rc13 → ml_management-0.6.3rc16}/ML_management/dataset_loader/__init__.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{ml_management-0.6.3rc13 → ml_management-0.6.3rc16}/ML_management/dataset_loader/templates/upload.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
{ml_management-0.6.3rc13 → ml_management-0.6.3rc16}/ML_management/executor/executor_pattern.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{ml_management-0.6.3rc13 → ml_management-0.6.3rc16}/ML_management/executor/templates/__init__.py
RENAMED
File without changes
|
File without changes
|
{ml_management-0.6.3rc13 → ml_management-0.6.3rc16}/ML_management/executor/templates/eval/conda.yaml
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{ml_management-0.6.3rc13 → ml_management-0.6.3rc16}/ML_management/executor/templates/upload.py
RENAMED
File without changes
|
{ml_management-0.6.3rc13 → ml_management-0.6.3rc16}/ML_management/executor/upload_model_mode.py
RENAMED
File without changes
|
File without changes
|
{ml_management-0.6.3rc13 → ml_management-0.6.3rc16}/ML_management/graphql/send_graphql_request.py
RENAMED
File without changes
|
{ml_management-0.6.3rc13 → ml_management-0.6.3rc16}/ML_management/mlmanagement/backend_api.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
{ml_management-0.6.3rc13 → ml_management-0.6.3rc16}/ML_management/mlmanagement/model_type.py
RENAMED
File without changes
|
{ml_management-0.6.3rc13 → ml_management-0.6.3rc16}/ML_management/mlmanagement/module_finder.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
{ml_management-0.6.3rc13 → ml_management-0.6.3rc16}/ML_management/mlmanagement/visibility_options.py
RENAMED
File without changes
|
File without changes
|
{ml_management-0.6.3rc13 → ml_management-0.6.3rc16}/ML_management/model/model_type_to_methods_map.py
RENAMED
File without changes
|
{ml_management-0.6.3rc13 → ml_management-0.6.3rc16}/ML_management/model/patterns/__init__.py
RENAMED
File without changes
|
File without changes
|
{ml_management-0.6.3rc13 → ml_management-0.6.3rc16}/ML_management/model/patterns/gradient_model.py
RENAMED
File without changes
|
{ml_management-0.6.3rc13 → ml_management-0.6.3rc16}/ML_management/model/patterns/model_pattern.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
{ml_management-0.6.3rc13 → ml_management-0.6.3rc16}/ML_management/model/patterns/preprocessor.py
RENAMED
File without changes
|
File without changes
|
{ml_management-0.6.3rc13 → ml_management-0.6.3rc16}/ML_management/model/patterns/target_layer.py
RENAMED
File without changes
|
{ml_management-0.6.3rc13 → ml_management-0.6.3rc16}/ML_management/model/patterns/torch_model.py
RENAMED
File without changes
|
{ml_management-0.6.3rc13 → ml_management-0.6.3rc16}/ML_management/model/patterns/trainable_model.py
RENAMED
File without changes
|
{ml_management-0.6.3rc13 → ml_management-0.6.3rc16}/ML_management/model/patterns/transformer.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{ml_management-0.6.3rc13 → ml_management-0.6.3rc16}/ML_management/test_sdk/local_sdk_test.sh
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{ml_management-0.6.3rc13 → ml_management-0.6.3rc16}/ML_management/tests/test_jsonschema_inference.py
RENAMED
File without changes
|
File without changes
|
{ml_management-0.6.3rc13 → ml_management-0.6.3rc16}/ML_management/uploader_data/s3_uploader.py
RENAMED
File without changes
|
File without changes
|
File without changes
|