ml-management 0.6.3rc15__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.3rc15 → ml_management-0.6.3rc16}/ML_management/graphql/schema.py +16 -8
- {ml_management-0.6.3rc15 → 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.3rc15 → ml_management-0.6.3rc16}/ML_management/mlmanagement/batcher.py +1 -0
- {ml_management-0.6.3rc15 → ml_management-0.6.3rc16}/ML_management/mlmanagement/load_api.py +58 -7
- {ml_management-0.6.3rc15 → ml_management-0.6.3rc16}/ML_management/sdk/job.py +4 -2
- {ml_management-0.6.3rc15 → ml_management-0.6.3rc16}/PKG-INFO +1 -1
- {ml_management-0.6.3rc15 → ml_management-0.6.3rc16}/pyproject.toml +1 -1
- ml_management-0.6.3rc15/ML_management/__init__.py +0 -1
- ml_management-0.6.3rc15/ML_management/mlmanagement/active_job.py +0 -74
- {ml_management-0.6.3rc15 → ml_management-0.6.3rc16}/ML_management/base_exceptions.py +0 -0
- {ml_management-0.6.3rc15 → ml_management-0.6.3rc16}/ML_management/collectors/__init__.py +0 -0
- {ml_management-0.6.3rc15 → ml_management-0.6.3rc16}/ML_management/collectors/collector_pattern.py +0 -0
- {ml_management-0.6.3rc15 → ml_management-0.6.3rc16}/ML_management/collectors/collector_pattern_to_methods_map.py +0 -0
- {ml_management-0.6.3rc15 → ml_management-0.6.3rc16}/ML_management/collectors/collectors.py +0 -0
- {ml_management-0.6.3rc15 → ml_management-0.6.3rc16}/ML_management/collectors/dummy/__init__.py +0 -0
- {ml_management-0.6.3rc15 → ml_management-0.6.3rc16}/ML_management/collectors/dummy/dummy_collector.py +0 -0
- {ml_management-0.6.3rc15 → ml_management-0.6.3rc16}/ML_management/collectors/s3/__init__.py +0 -0
- {ml_management-0.6.3rc15 → ml_management-0.6.3rc16}/ML_management/collectors/s3/s3collector.py +0 -0
- {ml_management-0.6.3rc15 → ml_management-0.6.3rc16}/ML_management/collectors/topic_markers/__init__.py +0 -0
- {ml_management-0.6.3rc15 → ml_management-0.6.3rc16}/ML_management/collectors/topic_markers/api_schema.py +0 -0
- {ml_management-0.6.3rc15 → ml_management-0.6.3rc16}/ML_management/collectors/topic_markers/topic_markers_collector.py +0 -0
- {ml_management-0.6.3rc15 → ml_management-0.6.3rc16}/ML_management/dataset_loader/__init__.py +0 -0
- {ml_management-0.6.3rc15 → ml_management-0.6.3rc16}/ML_management/dataset_loader/base_splits_dataset_loader.py +0 -0
- {ml_management-0.6.3rc15 → ml_management-0.6.3rc16}/ML_management/dataset_loader/dataset_loader_pattern.py +0 -0
- {ml_management-0.6.3rc15 → ml_management-0.6.3rc16}/ML_management/dataset_loader/dataset_loader_pattern_to_methods_map.py +0 -0
- {ml_management-0.6.3rc15 → ml_management-0.6.3rc16}/ML_management/dataset_loader/poisoned_images_dataset_loader.py +0 -0
- {ml_management-0.6.3rc15 → ml_management-0.6.3rc16}/ML_management/dataset_loader/templates/__init__.py +0 -0
- {ml_management-0.6.3rc15 → ml_management-0.6.3rc16}/ML_management/dataset_loader/templates/dummy_dataset_loader/__init__.py +0 -0
- {ml_management-0.6.3rc15 → ml_management-0.6.3rc16}/ML_management/dataset_loader/templates/dummy_dataset_loader/conda.yaml +0 -0
- {ml_management-0.6.3rc15 → ml_management-0.6.3rc16}/ML_management/dataset_loader/templates/dummy_dataset_loader/dummy_dataset.py +0 -0
- {ml_management-0.6.3rc15 → ml_management-0.6.3rc16}/ML_management/dataset_loader/templates/upload.py +0 -0
- {ml_management-0.6.3rc15 → ml_management-0.6.3rc16}/ML_management/executor/__init__.py +0 -0
- {ml_management-0.6.3rc15 → ml_management-0.6.3rc16}/ML_management/executor/base_executor.py +0 -0
- {ml_management-0.6.3rc15 → ml_management-0.6.3rc16}/ML_management/executor/executor_pattern.py +0 -0
- {ml_management-0.6.3rc15 → ml_management-0.6.3rc16}/ML_management/executor/executor_pattern_to_methods_map.py +0 -0
- {ml_management-0.6.3rc15 → ml_management-0.6.3rc16}/ML_management/executor/no_model_executor_pattern.py +0 -0
- {ml_management-0.6.3rc15 → ml_management-0.6.3rc16}/ML_management/executor/patterns.py +0 -0
- {ml_management-0.6.3rc15 → ml_management-0.6.3rc16}/ML_management/executor/templates/__init__.py +0 -0
- {ml_management-0.6.3rc15 → ml_management-0.6.3rc16}/ML_management/executor/templates/eval/__init__.py +0 -0
- {ml_management-0.6.3rc15 → ml_management-0.6.3rc16}/ML_management/executor/templates/eval/conda.yaml +0 -0
- {ml_management-0.6.3rc15 → ml_management-0.6.3rc16}/ML_management/executor/templates/eval/eval_executor.py +0 -0
- {ml_management-0.6.3rc15 → ml_management-0.6.3rc16}/ML_management/executor/templates/finetune/__init__.py +0 -0
- {ml_management-0.6.3rc15 → ml_management-0.6.3rc16}/ML_management/executor/templates/finetune/conda.yaml +0 -0
- {ml_management-0.6.3rc15 → ml_management-0.6.3rc16}/ML_management/executor/templates/finetune/finetune_executor.py +0 -0
- {ml_management-0.6.3rc15 → ml_management-0.6.3rc16}/ML_management/executor/templates/train/__init__.py +0 -0
- {ml_management-0.6.3rc15 → ml_management-0.6.3rc16}/ML_management/executor/templates/train/conda.yaml +0 -0
- {ml_management-0.6.3rc15 → ml_management-0.6.3rc16}/ML_management/executor/templates/train/train_executor.py +0 -0
- {ml_management-0.6.3rc15 → ml_management-0.6.3rc16}/ML_management/executor/templates/upload.py +0 -0
- {ml_management-0.6.3rc15 → ml_management-0.6.3rc16}/ML_management/executor/upload_model_mode.py +0 -0
- {ml_management-0.6.3rc15 → ml_management-0.6.3rc16}/ML_management/graphql/__init__.py +0 -0
- {ml_management-0.6.3rc15 → ml_management-0.6.3rc16}/ML_management/graphql/send_graphql_request.py +0 -0
- {ml_management-0.6.3rc15 → ml_management-0.6.3rc16}/ML_management/mlmanagement/backend_api.py +0 -0
- {ml_management-0.6.3rc15 → ml_management-0.6.3rc16}/ML_management/mlmanagement/jsonschema_exceptions.py +0 -0
- {ml_management-0.6.3rc15 → ml_management-0.6.3rc16}/ML_management/mlmanagement/jsonschema_inference.py +0 -0
- {ml_management-0.6.3rc15 → ml_management-0.6.3rc16}/ML_management/mlmanagement/log_api.py +0 -0
- {ml_management-0.6.3rc15 → ml_management-0.6.3rc16}/ML_management/mlmanagement/model_type.py +0 -0
- {ml_management-0.6.3rc15 → ml_management-0.6.3rc16}/ML_management/mlmanagement/module_finder.py +0 -0
- {ml_management-0.6.3rc15 → ml_management-0.6.3rc16}/ML_management/mlmanagement/server_mlmanager_exceptions.py +0 -0
- {ml_management-0.6.3rc15 → ml_management-0.6.3rc16}/ML_management/mlmanagement/utils.py +0 -0
- {ml_management-0.6.3rc15 → ml_management-0.6.3rc16}/ML_management/mlmanagement/visibility_options.py +0 -0
- {ml_management-0.6.3rc15 → ml_management-0.6.3rc16}/ML_management/model/__init__.py +0 -0
- {ml_management-0.6.3rc15 → ml_management-0.6.3rc16}/ML_management/model/model_type_to_methods_map.py +0 -0
- {ml_management-0.6.3rc15 → ml_management-0.6.3rc16}/ML_management/model/patterns/__init__.py +0 -0
- {ml_management-0.6.3rc15 → ml_management-0.6.3rc16}/ML_management/model/patterns/evaluatable_model.py +0 -0
- {ml_management-0.6.3rc15 → ml_management-0.6.3rc16}/ML_management/model/patterns/gradient_model.py +0 -0
- {ml_management-0.6.3rc15 → ml_management-0.6.3rc16}/ML_management/model/patterns/model_pattern.py +0 -0
- {ml_management-0.6.3rc15 → ml_management-0.6.3rc16}/ML_management/model/patterns/model_with_losses.py +0 -0
- {ml_management-0.6.3rc15 → ml_management-0.6.3rc16}/ML_management/model/patterns/model_with_metrics.py +0 -0
- {ml_management-0.6.3rc15 → ml_management-0.6.3rc16}/ML_management/model/patterns/preprocessor.py +0 -0
- {ml_management-0.6.3rc15 → ml_management-0.6.3rc16}/ML_management/model/patterns/retrainable_model.py +0 -0
- {ml_management-0.6.3rc15 → ml_management-0.6.3rc16}/ML_management/model/patterns/target_layer.py +0 -0
- {ml_management-0.6.3rc15 → ml_management-0.6.3rc16}/ML_management/model/patterns/torch_model.py +0 -0
- {ml_management-0.6.3rc15 → ml_management-0.6.3rc16}/ML_management/model/patterns/trainable_model.py +0 -0
- {ml_management-0.6.3rc15 → ml_management-0.6.3rc16}/ML_management/model/patterns/transformer.py +0 -0
- {ml_management-0.6.3rc15 → ml_management-0.6.3rc16}/ML_management/registry/__init__.py +0 -0
- {ml_management-0.6.3rc15 → ml_management-0.6.3rc16}/ML_management/registry/exceptions.py +0 -0
- {ml_management-0.6.3rc15 → ml_management-0.6.3rc16}/ML_management/s3/__init__.py +0 -0
- {ml_management-0.6.3rc15 → ml_management-0.6.3rc16}/ML_management/s3/manager.py +0 -0
- {ml_management-0.6.3rc15 → ml_management-0.6.3rc16}/ML_management/s3/utils.py +0 -0
- {ml_management-0.6.3rc15 → ml_management-0.6.3rc16}/ML_management/sdk/__init__.py +0 -0
- {ml_management-0.6.3rc15 → ml_management-0.6.3rc16}/ML_management/sdk/dataset_loader.py +0 -0
- {ml_management-0.6.3rc15 → ml_management-0.6.3rc16}/ML_management/sdk/executor.py +0 -0
- {ml_management-0.6.3rc15 → ml_management-0.6.3rc16}/ML_management/sdk/experiment.py +0 -0
- {ml_management-0.6.3rc15 → ml_management-0.6.3rc16}/ML_management/sdk/model.py +0 -0
- {ml_management-0.6.3rc15 → ml_management-0.6.3rc16}/ML_management/sdk/parameters.py +0 -0
- {ml_management-0.6.3rc15 → ml_management-0.6.3rc16}/ML_management/sdk/sdk.py +0 -0
- {ml_management-0.6.3rc15 → ml_management-0.6.3rc16}/ML_management/session.py +0 -0
- {ml_management-0.6.3rc15 → ml_management-0.6.3rc16}/ML_management/singleton_pattern.py +0 -0
- {ml_management-0.6.3rc15 → ml_management-0.6.3rc16}/ML_management/test_sdk/__init__.py +0 -0
- {ml_management-0.6.3rc15 → ml_management-0.6.3rc16}/ML_management/test_sdk/local_sdk_test.sh +0 -0
- {ml_management-0.6.3rc15 → ml_management-0.6.3rc16}/ML_management/test_sdk/mock_server.js +0 -0
- {ml_management-0.6.3rc15 → ml_management-0.6.3rc16}/ML_management/test_sdk/package.json +0 -0
- {ml_management-0.6.3rc15 → ml_management-0.6.3rc16}/ML_management/test_sdk/requirements.txt +0 -0
- {ml_management-0.6.3rc15 → ml_management-0.6.3rc16}/ML_management/test_sdk/test_sdk.py +0 -0
- {ml_management-0.6.3rc15 → ml_management-0.6.3rc16}/ML_management/tests/__init__.py +0 -0
- {ml_management-0.6.3rc15 → ml_management-0.6.3rc16}/ML_management/tests/requirements.txt +0 -0
- {ml_management-0.6.3rc15 → ml_management-0.6.3rc16}/ML_management/tests/run_all_tests.sh +0 -0
- {ml_management-0.6.3rc15 → ml_management-0.6.3rc16}/ML_management/tests/test_jsonschema_inference.py +0 -0
- {ml_management-0.6.3rc15 → ml_management-0.6.3rc16}/ML_management/uploader_data/__init__.py +0 -0
- {ml_management-0.6.3rc15 → ml_management-0.6.3rc16}/ML_management/uploader_data/s3_uploader.py +0 -0
- {ml_management-0.6.3rc15 → ml_management-0.6.3rc16}/ML_management/uploader_data/utils.py +0 -0
- {ml_management-0.6.3rc15 → ml_management-0.6.3rc16}/ML_management/variables.py +0 -0
- {ml_management-0.6.3rc15 → ml_management-0.6.3rc16}/README.md +0 -0
@@ -0,0 +1 @@
|
|
1
|
+
__version__ = "0.6.3rc16"
|
@@ -1128,7 +1128,7 @@ class JobPagination(sgqlc.types.Type):
|
|
1128
1128
|
|
1129
1129
|
class JobParams(sgqlc.types.Type):
|
1130
1130
|
__schema__ = schema
|
1131
|
-
__field_names__ = ('additional_system_packages', 'cron_expression', 'executor_params', 'experiment', 'experiment_id', 'gpu', 'list_role_data_params', 'list_role_model_params', 'periodic_type')
|
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')
|
1132
1132
|
additional_system_packages = sgqlc.types.Field(sgqlc.types.list_of(sgqlc.types.non_null(String)), graphql_name='additionalSystemPackages')
|
1133
1133
|
|
1134
1134
|
cron_expression = sgqlc.types.Field(String, graphql_name='cronExpression')
|
@@ -1145,6 +1145,8 @@ class JobParams(sgqlc.types.Type):
|
|
1145
1145
|
|
1146
1146
|
list_role_model_params = sgqlc.types.Field(sgqlc.types.list_of(sgqlc.types.non_null('RoleModelParams')), graphql_name='listRoleModelParams')
|
1147
1147
|
|
1148
|
+
models_schemas = sgqlc.types.Field(sgqlc.types.non_null(JSON), graphql_name='modelsSchemas')
|
1149
|
+
|
1148
1150
|
periodic_type = sgqlc.types.Field(PeriodicType, graphql_name='periodicType')
|
1149
1151
|
|
1150
1152
|
|
@@ -1252,7 +1254,7 @@ class ModelPagination(sgqlc.types.Type):
|
|
1252
1254
|
|
1253
1255
|
class ModelParams(sgqlc.types.Type):
|
1254
1256
|
__schema__ = schema
|
1255
|
-
__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')
|
1256
1258
|
description = sgqlc.types.Field(String, graphql_name='description')
|
1257
1259
|
|
1258
1260
|
list_model_method_params = sgqlc.types.Field(sgqlc.types.non_null(sgqlc.types.list_of(sgqlc.types.non_null(MethodParams))), graphql_name='listModelMethodParams')
|
@@ -1261,8 +1263,12 @@ class ModelParams(sgqlc.types.Type):
|
|
1261
1263
|
|
1262
1264
|
new_model_name = sgqlc.types.Field(String, graphql_name='newModelName')
|
1263
1265
|
|
1266
|
+
new_model_visibility = sgqlc.types.Field(sgqlc.types.non_null(VisibilityOptions), graphql_name='newModelVisibility')
|
1267
|
+
|
1264
1268
|
prepare_new_model_inference = sgqlc.types.Field(sgqlc.types.non_null(Boolean), graphql_name='prepareNewModelInference')
|
1265
1269
|
|
1270
|
+
start_build_new_model_image = sgqlc.types.Field(sgqlc.types.non_null(Boolean), graphql_name='startBuildNewModelImage')
|
1271
|
+
|
1266
1272
|
|
1267
1273
|
|
1268
1274
|
class ModelVersionChoiceParams(sgqlc.types.Type):
|
@@ -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)),
|
@@ -1944,16 +1950,17 @@ 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
|
-
|
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)),
|
1957
1964
|
('message', sgqlc.types.Arg(String, graphql_name='message', default=None)),
|
1958
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')),
|
@@ -1961,6 +1968,7 @@ class Mutation(sgqlc.types.Type):
|
|
1961
1968
|
)
|
1962
1969
|
'''Arguments:
|
1963
1970
|
|
1971
|
+
* `exception_traceback` (`String`)None (default: `null`)
|
1964
1972
|
* `message` (`String`)None (default: `null`)
|
1965
1973
|
* `secret_uuid` (`String!`)None
|
1966
1974
|
* `status` (`JobStatus!`)None (default: `SUCCESSFUL`)
|
@@ -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()
|
@@ -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:
|
@@ -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.3rc15"
|
@@ -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
|
-
secret_uuid = send_graphql_request(op=op, json_response=False).start_local_job
|
24
|
-
variables.secret_uuid = secret_uuid
|
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(secret_uuid=variables.secret_uuid, status=status)
|
35
|
-
try:
|
36
|
-
_ = send_graphql_request(op=op, json_response=False).stop_local_job
|
37
|
-
finally:
|
38
|
-
variables.secret_uuid = 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.3rc15 → 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.3rc15 → 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.3rc15 → 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.3rc15 → 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.3rc15 → 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.3rc15 → 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.3rc15 → ml_management-0.6.3rc16}/ML_management/executor/templates/__init__.py
RENAMED
File without changes
|
File without changes
|
{ml_management-0.6.3rc15 → 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.3rc15 → ml_management-0.6.3rc16}/ML_management/executor/templates/upload.py
RENAMED
File without changes
|
{ml_management-0.6.3rc15 → ml_management-0.6.3rc16}/ML_management/executor/upload_model_mode.py
RENAMED
File without changes
|
File without changes
|
{ml_management-0.6.3rc15 → ml_management-0.6.3rc16}/ML_management/graphql/send_graphql_request.py
RENAMED
File without changes
|
{ml_management-0.6.3rc15 → ml_management-0.6.3rc16}/ML_management/mlmanagement/backend_api.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{ml_management-0.6.3rc15 → ml_management-0.6.3rc16}/ML_management/mlmanagement/model_type.py
RENAMED
File without changes
|
{ml_management-0.6.3rc15 → 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.3rc15 → ml_management-0.6.3rc16}/ML_management/mlmanagement/visibility_options.py
RENAMED
File without changes
|
File without changes
|
{ml_management-0.6.3rc15 → ml_management-0.6.3rc16}/ML_management/model/model_type_to_methods_map.py
RENAMED
File without changes
|
{ml_management-0.6.3rc15 → ml_management-0.6.3rc16}/ML_management/model/patterns/__init__.py
RENAMED
File without changes
|
File without changes
|
{ml_management-0.6.3rc15 → ml_management-0.6.3rc16}/ML_management/model/patterns/gradient_model.py
RENAMED
File without changes
|
{ml_management-0.6.3rc15 → 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.3rc15 → ml_management-0.6.3rc16}/ML_management/model/patterns/preprocessor.py
RENAMED
File without changes
|
File without changes
|
{ml_management-0.6.3rc15 → ml_management-0.6.3rc16}/ML_management/model/patterns/target_layer.py
RENAMED
File without changes
|
{ml_management-0.6.3rc15 → ml_management-0.6.3rc16}/ML_management/model/patterns/torch_model.py
RENAMED
File without changes
|
{ml_management-0.6.3rc15 → ml_management-0.6.3rc16}/ML_management/model/patterns/trainable_model.py
RENAMED
File without changes
|
{ml_management-0.6.3rc15 → 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
|
File without changes
|
{ml_management-0.6.3rc15 → 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.3rc15 → ml_management-0.6.3rc16}/ML_management/tests/test_jsonschema_inference.py
RENAMED
File without changes
|
File without changes
|
{ml_management-0.6.3rc15 → ml_management-0.6.3rc16}/ML_management/uploader_data/s3_uploader.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|