mlrun 1.7.1rc10__py3-none-any.whl → 1.8.0rc11__py3-none-any.whl
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.
Potentially problematic release.
This version of mlrun might be problematic. Click here for more details.
- mlrun/__init__.py +23 -21
- mlrun/__main__.py +3 -3
- mlrun/alerts/alert.py +148 -14
- mlrun/artifacts/__init__.py +2 -3
- mlrun/artifacts/base.py +55 -12
- mlrun/artifacts/dataset.py +16 -16
- mlrun/artifacts/document.py +378 -0
- mlrun/artifacts/manager.py +26 -17
- mlrun/artifacts/model.py +66 -53
- mlrun/common/constants.py +8 -0
- mlrun/common/formatters/__init__.py +1 -0
- mlrun/common/formatters/feature_set.py +1 -0
- mlrun/common/formatters/function.py +1 -0
- mlrun/{model_monitoring/db/stores/base/__init__.py → common/formatters/model_endpoint.py} +16 -1
- mlrun/common/formatters/pipeline.py +1 -2
- mlrun/common/formatters/project.py +9 -0
- mlrun/common/model_monitoring/__init__.py +0 -5
- mlrun/common/model_monitoring/helpers.py +1 -29
- mlrun/common/runtimes/constants.py +1 -2
- mlrun/common/schemas/__init__.py +6 -2
- mlrun/common/schemas/alert.py +111 -19
- mlrun/common/schemas/api_gateway.py +3 -3
- mlrun/common/schemas/artifact.py +11 -7
- mlrun/common/schemas/auth.py +6 -4
- mlrun/common/schemas/background_task.py +7 -7
- mlrun/common/schemas/client_spec.py +2 -3
- mlrun/common/schemas/clusterization_spec.py +2 -2
- mlrun/common/schemas/common.py +53 -3
- mlrun/common/schemas/constants.py +15 -0
- mlrun/common/schemas/datastore_profile.py +1 -1
- mlrun/common/schemas/feature_store.py +9 -9
- mlrun/common/schemas/frontend_spec.py +4 -4
- mlrun/common/schemas/function.py +10 -10
- mlrun/common/schemas/hub.py +1 -1
- mlrun/common/schemas/k8s.py +3 -3
- mlrun/common/schemas/memory_reports.py +3 -3
- mlrun/common/schemas/model_monitoring/__init__.py +2 -1
- mlrun/common/schemas/model_monitoring/constants.py +67 -14
- mlrun/common/schemas/model_monitoring/grafana.py +1 -1
- mlrun/common/schemas/model_monitoring/model_endpoints.py +92 -147
- mlrun/common/schemas/notification.py +24 -3
- mlrun/common/schemas/object.py +1 -1
- mlrun/common/schemas/pagination.py +4 -4
- mlrun/common/schemas/partition.py +137 -0
- mlrun/common/schemas/pipeline.py +2 -2
- mlrun/common/schemas/project.py +25 -17
- mlrun/common/schemas/runs.py +2 -2
- mlrun/common/schemas/runtime_resource.py +5 -5
- mlrun/common/schemas/schedule.py +1 -1
- mlrun/common/schemas/secret.py +1 -1
- mlrun/common/schemas/tag.py +3 -3
- mlrun/common/schemas/workflow.py +5 -5
- mlrun/config.py +68 -10
- mlrun/data_types/__init__.py +0 -2
- mlrun/data_types/data_types.py +1 -0
- mlrun/data_types/infer.py +3 -1
- mlrun/data_types/spark.py +5 -3
- mlrun/data_types/to_pandas.py +11 -2
- mlrun/datastore/__init__.py +2 -2
- mlrun/datastore/alibaba_oss.py +4 -1
- mlrun/datastore/azure_blob.py +4 -1
- mlrun/datastore/base.py +12 -4
- mlrun/datastore/datastore.py +9 -3
- mlrun/datastore/datastore_profile.py +79 -20
- mlrun/datastore/dbfs_store.py +4 -1
- mlrun/datastore/filestore.py +4 -1
- mlrun/datastore/google_cloud_storage.py +4 -1
- mlrun/datastore/hdfs.py +4 -1
- mlrun/datastore/inmem.py +4 -1
- mlrun/datastore/redis.py +4 -1
- mlrun/datastore/s3.py +4 -1
- mlrun/datastore/sources.py +52 -51
- mlrun/datastore/store_resources.py +7 -4
- mlrun/datastore/targets.py +23 -22
- mlrun/datastore/utils.py +2 -2
- mlrun/datastore/v3io.py +4 -1
- mlrun/datastore/vectorstore.py +229 -0
- mlrun/datastore/wasbfs/fs.py +13 -12
- mlrun/db/base.py +213 -83
- mlrun/db/factory.py +0 -3
- mlrun/db/httpdb.py +1265 -387
- mlrun/db/nopdb.py +205 -74
- mlrun/errors.py +2 -2
- mlrun/execution.py +136 -50
- mlrun/feature_store/__init__.py +0 -2
- mlrun/feature_store/api.py +41 -40
- mlrun/feature_store/common.py +9 -9
- mlrun/feature_store/feature_set.py +20 -18
- mlrun/feature_store/feature_vector.py +27 -24
- mlrun/feature_store/retrieval/base.py +14 -9
- mlrun/feature_store/retrieval/job.py +2 -1
- mlrun/feature_store/steps.py +2 -2
- mlrun/features.py +30 -13
- mlrun/frameworks/__init__.py +1 -2
- mlrun/frameworks/_common/__init__.py +1 -2
- mlrun/frameworks/_common/artifacts_library.py +2 -2
- mlrun/frameworks/_common/mlrun_interface.py +10 -6
- mlrun/frameworks/_common/model_handler.py +29 -27
- mlrun/frameworks/_common/producer.py +3 -1
- mlrun/frameworks/_dl_common/__init__.py +1 -2
- mlrun/frameworks/_dl_common/loggers/__init__.py +1 -2
- mlrun/frameworks/_dl_common/loggers/mlrun_logger.py +4 -4
- mlrun/frameworks/_dl_common/loggers/tensorboard_logger.py +3 -3
- mlrun/frameworks/_ml_common/__init__.py +1 -2
- mlrun/frameworks/_ml_common/loggers/__init__.py +1 -2
- mlrun/frameworks/_ml_common/model_handler.py +21 -21
- mlrun/frameworks/_ml_common/plans/__init__.py +1 -2
- mlrun/frameworks/_ml_common/plans/confusion_matrix_plan.py +3 -1
- mlrun/frameworks/_ml_common/plans/dataset_plan.py +3 -3
- mlrun/frameworks/_ml_common/plans/roc_curve_plan.py +4 -4
- mlrun/frameworks/auto_mlrun/__init__.py +1 -2
- mlrun/frameworks/auto_mlrun/auto_mlrun.py +22 -15
- mlrun/frameworks/huggingface/__init__.py +1 -2
- mlrun/frameworks/huggingface/model_server.py +9 -9
- mlrun/frameworks/lgbm/__init__.py +47 -44
- mlrun/frameworks/lgbm/callbacks/__init__.py +1 -2
- mlrun/frameworks/lgbm/callbacks/logging_callback.py +4 -2
- mlrun/frameworks/lgbm/callbacks/mlrun_logging_callback.py +4 -2
- mlrun/frameworks/lgbm/mlrun_interfaces/__init__.py +1 -2
- mlrun/frameworks/lgbm/mlrun_interfaces/mlrun_interface.py +5 -5
- mlrun/frameworks/lgbm/model_handler.py +15 -11
- mlrun/frameworks/lgbm/model_server.py +11 -7
- mlrun/frameworks/lgbm/utils.py +2 -2
- mlrun/frameworks/onnx/__init__.py +1 -2
- mlrun/frameworks/onnx/dataset.py +3 -3
- mlrun/frameworks/onnx/mlrun_interface.py +2 -2
- mlrun/frameworks/onnx/model_handler.py +7 -5
- mlrun/frameworks/onnx/model_server.py +8 -6
- mlrun/frameworks/parallel_coordinates.py +11 -11
- mlrun/frameworks/pytorch/__init__.py +22 -23
- mlrun/frameworks/pytorch/callbacks/__init__.py +1 -2
- mlrun/frameworks/pytorch/callbacks/callback.py +2 -1
- mlrun/frameworks/pytorch/callbacks/logging_callback.py +15 -8
- mlrun/frameworks/pytorch/callbacks/mlrun_logging_callback.py +19 -12
- mlrun/frameworks/pytorch/callbacks/tensorboard_logging_callback.py +22 -15
- mlrun/frameworks/pytorch/callbacks_handler.py +36 -30
- mlrun/frameworks/pytorch/mlrun_interface.py +17 -17
- mlrun/frameworks/pytorch/model_handler.py +21 -17
- mlrun/frameworks/pytorch/model_server.py +13 -9
- mlrun/frameworks/sklearn/__init__.py +19 -18
- mlrun/frameworks/sklearn/estimator.py +2 -2
- mlrun/frameworks/sklearn/metric.py +3 -3
- mlrun/frameworks/sklearn/metrics_library.py +8 -6
- mlrun/frameworks/sklearn/mlrun_interface.py +3 -2
- mlrun/frameworks/sklearn/model_handler.py +4 -3
- mlrun/frameworks/tf_keras/__init__.py +11 -12
- mlrun/frameworks/tf_keras/callbacks/__init__.py +1 -2
- mlrun/frameworks/tf_keras/callbacks/logging_callback.py +17 -14
- mlrun/frameworks/tf_keras/callbacks/mlrun_logging_callback.py +15 -12
- mlrun/frameworks/tf_keras/callbacks/tensorboard_logging_callback.py +21 -18
- mlrun/frameworks/tf_keras/model_handler.py +17 -13
- mlrun/frameworks/tf_keras/model_server.py +12 -8
- mlrun/frameworks/xgboost/__init__.py +19 -18
- mlrun/frameworks/xgboost/model_handler.py +13 -9
- mlrun/launcher/base.py +3 -4
- mlrun/launcher/local.py +1 -1
- mlrun/launcher/remote.py +1 -1
- mlrun/lists.py +4 -3
- mlrun/model.py +117 -46
- mlrun/model_monitoring/__init__.py +4 -4
- mlrun/model_monitoring/api.py +72 -59
- mlrun/model_monitoring/applications/_application_steps.py +17 -17
- mlrun/model_monitoring/applications/base.py +165 -6
- mlrun/model_monitoring/applications/context.py +88 -37
- mlrun/model_monitoring/applications/evidently_base.py +0 -1
- mlrun/model_monitoring/applications/histogram_data_drift.py +43 -21
- mlrun/model_monitoring/applications/results.py +55 -3
- mlrun/model_monitoring/controller.py +207 -239
- mlrun/model_monitoring/db/__init__.py +0 -2
- mlrun/model_monitoring/db/_schedules.py +156 -0
- mlrun/model_monitoring/db/_stats.py +189 -0
- mlrun/model_monitoring/db/tsdb/base.py +78 -25
- mlrun/model_monitoring/db/tsdb/tdengine/schemas.py +61 -6
- mlrun/model_monitoring/db/tsdb/tdengine/stream_graph_steps.py +33 -0
- mlrun/model_monitoring/db/tsdb/tdengine/tdengine_connector.py +255 -29
- mlrun/model_monitoring/db/tsdb/v3io/stream_graph_steps.py +1 -0
- mlrun/model_monitoring/db/tsdb/v3io/v3io_connector.py +78 -17
- mlrun/model_monitoring/helpers.py +151 -49
- mlrun/model_monitoring/stream_processing.py +99 -283
- mlrun/model_monitoring/tracking_policy.py +10 -3
- mlrun/model_monitoring/writer.py +48 -36
- mlrun/package/__init__.py +3 -6
- mlrun/package/context_handler.py +1 -1
- mlrun/package/packager.py +12 -9
- mlrun/package/packagers/__init__.py +0 -2
- mlrun/package/packagers/default_packager.py +14 -11
- mlrun/package/packagers/numpy_packagers.py +16 -7
- mlrun/package/packagers/pandas_packagers.py +18 -18
- mlrun/package/packagers/python_standard_library_packagers.py +25 -11
- mlrun/package/packagers_manager.py +31 -14
- mlrun/package/utils/__init__.py +0 -3
- mlrun/package/utils/_pickler.py +6 -6
- mlrun/platforms/__init__.py +47 -16
- mlrun/platforms/iguazio.py +4 -1
- mlrun/projects/operations.py +27 -27
- mlrun/projects/pipelines.py +71 -36
- mlrun/projects/project.py +890 -220
- mlrun/run.py +53 -10
- mlrun/runtimes/__init__.py +1 -3
- mlrun/runtimes/base.py +15 -11
- mlrun/runtimes/daskjob.py +9 -9
- mlrun/runtimes/generators.py +2 -1
- mlrun/runtimes/kubejob.py +4 -5
- mlrun/runtimes/mounts.py +572 -0
- mlrun/runtimes/mpijob/__init__.py +0 -2
- mlrun/runtimes/mpijob/abstract.py +7 -6
- mlrun/runtimes/nuclio/api_gateway.py +7 -7
- mlrun/runtimes/nuclio/application/application.py +11 -11
- mlrun/runtimes/nuclio/function.py +19 -17
- mlrun/runtimes/nuclio/serving.py +18 -13
- mlrun/runtimes/pod.py +154 -45
- mlrun/runtimes/remotesparkjob.py +3 -2
- mlrun/runtimes/sparkjob/__init__.py +0 -2
- mlrun/runtimes/sparkjob/spark3job.py +21 -11
- mlrun/runtimes/utils.py +6 -5
- mlrun/serving/merger.py +6 -4
- mlrun/serving/remote.py +18 -17
- mlrun/serving/routers.py +185 -172
- mlrun/serving/server.py +7 -1
- mlrun/serving/states.py +97 -78
- mlrun/serving/utils.py +13 -2
- mlrun/serving/v1_serving.py +3 -2
- mlrun/serving/v2_serving.py +105 -72
- mlrun/track/__init__.py +1 -1
- mlrun/track/tracker.py +2 -2
- mlrun/track/trackers/mlflow_tracker.py +6 -5
- mlrun/utils/async_http.py +1 -1
- mlrun/utils/clones.py +1 -1
- mlrun/utils/helpers.py +63 -19
- mlrun/utils/logger.py +106 -4
- mlrun/utils/notifications/notification/__init__.py +22 -19
- mlrun/utils/notifications/notification/base.py +33 -14
- mlrun/utils/notifications/notification/console.py +6 -6
- mlrun/utils/notifications/notification/git.py +11 -11
- mlrun/utils/notifications/notification/ipython.py +10 -9
- mlrun/utils/notifications/notification/mail.py +176 -0
- mlrun/utils/notifications/notification/slack.py +6 -6
- mlrun/utils/notifications/notification/webhook.py +6 -6
- mlrun/utils/notifications/notification_pusher.py +86 -44
- mlrun/utils/regex.py +11 -2
- mlrun/utils/version/version.json +2 -2
- {mlrun-1.7.1rc10.dist-info → mlrun-1.8.0rc11.dist-info}/METADATA +29 -24
- mlrun-1.8.0rc11.dist-info/RECORD +347 -0
- mlrun/model_monitoring/db/stores/__init__.py +0 -136
- mlrun/model_monitoring/db/stores/base/store.py +0 -213
- mlrun/model_monitoring/db/stores/sqldb/__init__.py +0 -13
- mlrun/model_monitoring/db/stores/sqldb/models/__init__.py +0 -71
- mlrun/model_monitoring/db/stores/sqldb/models/base.py +0 -190
- mlrun/model_monitoring/db/stores/sqldb/models/mysql.py +0 -103
- mlrun/model_monitoring/db/stores/sqldb/models/sqlite.py +0 -40
- mlrun/model_monitoring/db/stores/sqldb/sql_store.py +0 -659
- mlrun/model_monitoring/db/stores/v3io_kv/__init__.py +0 -13
- mlrun/model_monitoring/db/stores/v3io_kv/kv_store.py +0 -726
- mlrun/model_monitoring/model_endpoint.py +0 -118
- mlrun-1.7.1rc10.dist-info/RECORD +0 -351
- {mlrun-1.7.1rc10.dist-info → mlrun-1.8.0rc11.dist-info}/LICENSE +0 -0
- {mlrun-1.7.1rc10.dist-info → mlrun-1.8.0rc11.dist-info}/WHEEL +0 -0
- {mlrun-1.7.1rc10.dist-info → mlrun-1.8.0rc11.dist-info}/entry_points.txt +0 -0
- {mlrun-1.7.1rc10.dist-info → mlrun-1.8.0rc11.dist-info}/top_level.txt +0 -0
|
@@ -14,13 +14,13 @@
|
|
|
14
14
|
import typing
|
|
15
15
|
|
|
16
16
|
import kubernetes.client
|
|
17
|
-
from mlrun_pipelines.mounts import mount_v3io, mount_v3iod
|
|
18
17
|
|
|
19
18
|
import mlrun.common.schemas.function
|
|
20
19
|
import mlrun.errors
|
|
21
20
|
import mlrun.k8s_utils
|
|
22
21
|
import mlrun.runtimes.pod
|
|
23
22
|
from mlrun.config import config
|
|
23
|
+
from mlrun.runtimes.mounts import mount_v3io, mount_v3iod
|
|
24
24
|
|
|
25
25
|
from ...execution import MLClientCtx
|
|
26
26
|
from ...model import RunObject
|
|
@@ -405,8 +405,8 @@ class Spark3JobSpec(KubeResourceSpec):
|
|
|
405
405
|
def _verify_and_set_requests(
|
|
406
406
|
self,
|
|
407
407
|
resources_field_name,
|
|
408
|
-
mem: str = None,
|
|
409
|
-
cpu: str = None,
|
|
408
|
+
mem: typing.Optional[str] = None,
|
|
409
|
+
cpu: typing.Optional[str] = None,
|
|
410
410
|
patch: bool = False,
|
|
411
411
|
):
|
|
412
412
|
# Spark operator uses JVM notation for memory, so we must verify it separately
|
|
@@ -774,7 +774,11 @@ class Spark3Runtime(KubejobRuntime):
|
|
|
774
774
|
exporter_jar="/spark/jars/jmx_prometheus_javaagent-0.16.1.jar",
|
|
775
775
|
)
|
|
776
776
|
|
|
777
|
-
def with_cores(
|
|
777
|
+
def with_cores(
|
|
778
|
+
self,
|
|
779
|
+
executor_cores: typing.Optional[int] = None,
|
|
780
|
+
driver_cores: typing.Optional[int] = None,
|
|
781
|
+
):
|
|
778
782
|
"""
|
|
779
783
|
Allows to configure spark.executor.cores and spark.driver.cores parameters. The values must be integers
|
|
780
784
|
greater than or equal to 1. If a parameter is not specified, it defaults to 1.
|
|
@@ -853,7 +857,7 @@ class Spark3Runtime(KubejobRuntime):
|
|
|
853
857
|
skip_deployed=False,
|
|
854
858
|
is_kfp=False,
|
|
855
859
|
mlrun_version_specifier=None,
|
|
856
|
-
builder_env: dict = None,
|
|
860
|
+
builder_env: typing.Optional[dict] = None,
|
|
857
861
|
show_on_failure: bool = False,
|
|
858
862
|
force_build: bool = False,
|
|
859
863
|
):
|
|
@@ -944,7 +948,10 @@ class Spark3Runtime(KubejobRuntime):
|
|
|
944
948
|
)
|
|
945
949
|
|
|
946
950
|
def with_executor_requests(
|
|
947
|
-
self,
|
|
951
|
+
self,
|
|
952
|
+
mem: typing.Optional[str] = None,
|
|
953
|
+
cpu: typing.Optional[str] = None,
|
|
954
|
+
patch: bool = False,
|
|
948
955
|
):
|
|
949
956
|
"""
|
|
950
957
|
set executor pod required cpu/memory/gpu resources
|
|
@@ -954,8 +961,8 @@ class Spark3Runtime(KubejobRuntime):
|
|
|
954
961
|
|
|
955
962
|
def with_executor_limits(
|
|
956
963
|
self,
|
|
957
|
-
cpu: str = None,
|
|
958
|
-
gpus: int = None,
|
|
964
|
+
cpu: typing.Optional[str] = None,
|
|
965
|
+
gpus: typing.Optional[int] = None,
|
|
959
966
|
gpu_type: str = "nvidia.com/gpu",
|
|
960
967
|
patch: bool = False,
|
|
961
968
|
):
|
|
@@ -970,7 +977,10 @@ class Spark3Runtime(KubejobRuntime):
|
|
|
970
977
|
)
|
|
971
978
|
|
|
972
979
|
def with_driver_requests(
|
|
973
|
-
self,
|
|
980
|
+
self,
|
|
981
|
+
mem: typing.Optional[str] = None,
|
|
982
|
+
cpu: typing.Optional[str] = None,
|
|
983
|
+
patch: bool = False,
|
|
974
984
|
):
|
|
975
985
|
"""
|
|
976
986
|
set driver pod required cpu/memory/gpu resources
|
|
@@ -980,8 +990,8 @@ class Spark3Runtime(KubejobRuntime):
|
|
|
980
990
|
|
|
981
991
|
def with_driver_limits(
|
|
982
992
|
self,
|
|
983
|
-
cpu: str = None,
|
|
984
|
-
gpus: int = None,
|
|
993
|
+
cpu: typing.Optional[str] = None,
|
|
994
|
+
gpus: typing.Optional[int] = None,
|
|
985
995
|
gpu_type: str = "nvidia.com/gpu",
|
|
986
996
|
patch: bool = False,
|
|
987
997
|
):
|
mlrun/runtimes/utils.py
CHANGED
|
@@ -18,6 +18,7 @@ import os
|
|
|
18
18
|
import re
|
|
19
19
|
from io import StringIO
|
|
20
20
|
from sys import stderr
|
|
21
|
+
from typing import Optional
|
|
21
22
|
|
|
22
23
|
import pandas as pd
|
|
23
24
|
|
|
@@ -147,7 +148,7 @@ def add_code_metadata(path=""):
|
|
|
147
148
|
|
|
148
149
|
def results_to_iter(results, runspec, execution):
|
|
149
150
|
if not results:
|
|
150
|
-
logger.error("
|
|
151
|
+
logger.error("Got an empty results list in to_iter")
|
|
151
152
|
return
|
|
152
153
|
|
|
153
154
|
iter = []
|
|
@@ -174,7 +175,7 @@ def results_to_iter(results, runspec, execution):
|
|
|
174
175
|
|
|
175
176
|
if not iter:
|
|
176
177
|
execution.set_state("completed", commit=True)
|
|
177
|
-
logger.warning("
|
|
178
|
+
logger.warning("Warning!, zero iteration results")
|
|
178
179
|
return
|
|
179
180
|
if hasattr(pd, "json_normalize"):
|
|
180
181
|
df = pd.json_normalize(iter).sort_values("iter")
|
|
@@ -189,10 +190,10 @@ def results_to_iter(results, runspec, execution):
|
|
|
189
190
|
item, id = selector(results, criteria)
|
|
190
191
|
if runspec.spec.selector and not id:
|
|
191
192
|
logger.warning(
|
|
192
|
-
f"
|
|
193
|
+
f"No best result selected, check selector ({criteria}) or results"
|
|
193
194
|
)
|
|
194
195
|
if id:
|
|
195
|
-
logger.info(f"
|
|
196
|
+
logger.info(f"Best iteration={id}, used criteria {criteria}")
|
|
196
197
|
task = results[item] if id and results else None
|
|
197
198
|
execution.log_iteration_results(id, summary, task)
|
|
198
199
|
|
|
@@ -432,7 +433,7 @@ def enrich_function_from_dict(function, function_dict):
|
|
|
432
433
|
|
|
433
434
|
def enrich_run_labels(
|
|
434
435
|
labels: dict,
|
|
435
|
-
labels_to_enrich: list[RunLabels] = None,
|
|
436
|
+
labels_to_enrich: Optional[list[RunLabels]] = None,
|
|
436
437
|
):
|
|
437
438
|
labels_enrichment = {
|
|
438
439
|
RunLabels.owner: os.environ.get("V3IO_USERNAME") or getpass.getuser(),
|
mlrun/serving/merger.py
CHANGED
|
@@ -13,6 +13,8 @@
|
|
|
13
13
|
# limitations under the License.
|
|
14
14
|
#
|
|
15
15
|
|
|
16
|
+
from typing import Optional
|
|
17
|
+
|
|
16
18
|
import storey
|
|
17
19
|
|
|
18
20
|
|
|
@@ -37,10 +39,10 @@ class CacheEntry:
|
|
|
37
39
|
class Merge(storey.Flow):
|
|
38
40
|
def __init__(
|
|
39
41
|
self,
|
|
40
|
-
full_event: bool = None,
|
|
41
|
-
key_path: str = None,
|
|
42
|
-
max_behind: int = None,
|
|
43
|
-
expected_num_events: int = None,
|
|
42
|
+
full_event: Optional[bool] = None,
|
|
43
|
+
key_path: Optional[str] = None,
|
|
44
|
+
max_behind: Optional[int] = None,
|
|
45
|
+
expected_num_events: Optional[int] = None,
|
|
44
46
|
**kwargs,
|
|
45
47
|
):
|
|
46
48
|
"""Merge multiple events based on event id or provided key path
|
mlrun/serving/remote.py
CHANGED
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
#
|
|
15
15
|
import asyncio
|
|
16
16
|
import json
|
|
17
|
+
from typing import Optional
|
|
17
18
|
|
|
18
19
|
import aiohttp
|
|
19
20
|
import requests
|
|
@@ -40,14 +41,14 @@ class RemoteStep(storey.SendToHttp):
|
|
|
40
41
|
def __init__(
|
|
41
42
|
self,
|
|
42
43
|
url: str,
|
|
43
|
-
subpath: str = None,
|
|
44
|
-
method: str = None,
|
|
45
|
-
headers: dict = None,
|
|
46
|
-
url_expression: str = None,
|
|
47
|
-
body_expression: str = None,
|
|
44
|
+
subpath: Optional[str] = None,
|
|
45
|
+
method: Optional[str] = None,
|
|
46
|
+
headers: Optional[dict] = None,
|
|
47
|
+
url_expression: Optional[str] = None,
|
|
48
|
+
body_expression: Optional[str] = None,
|
|
48
49
|
return_json: bool = True,
|
|
49
|
-
input_path: str = None,
|
|
50
|
-
result_path: str = None,
|
|
50
|
+
input_path: Optional[str] = None,
|
|
51
|
+
result_path: Optional[str] = None,
|
|
51
52
|
max_in_flight=None,
|
|
52
53
|
retries=None,
|
|
53
54
|
backoff_factor=None,
|
|
@@ -57,7 +58,7 @@ class RemoteStep(storey.SendToHttp):
|
|
|
57
58
|
"""class for calling remote endpoints
|
|
58
59
|
|
|
59
60
|
sync and async graph step implementation for request/resp to remote service (class shortcut = "$remote")
|
|
60
|
-
url can be an http(s) url (e.g.
|
|
61
|
+
url can be an http(s) url (e.g. `https://myservice/path`) or an mlrun function uri ([project/]name).
|
|
61
62
|
alternatively the url_expression can be specified to build the url from the event (e.g. "event['url']").
|
|
62
63
|
|
|
63
64
|
example pipeline::
|
|
@@ -241,15 +242,15 @@ class RemoteStep(storey.SendToHttp):
|
|
|
241
242
|
class BatchHttpRequests(_ConcurrentJobExecution):
|
|
242
243
|
def __init__(
|
|
243
244
|
self,
|
|
244
|
-
url: str = None,
|
|
245
|
-
subpath: str = None,
|
|
246
|
-
method: str = None,
|
|
247
|
-
headers: dict = None,
|
|
248
|
-
url_expression: str = None,
|
|
249
|
-
body_expression: str = None,
|
|
245
|
+
url: Optional[str] = None,
|
|
246
|
+
subpath: Optional[str] = None,
|
|
247
|
+
method: Optional[str] = None,
|
|
248
|
+
headers: Optional[dict] = None,
|
|
249
|
+
url_expression: Optional[str] = None,
|
|
250
|
+
body_expression: Optional[str] = None,
|
|
250
251
|
return_json: bool = True,
|
|
251
|
-
input_path: str = None,
|
|
252
|
-
result_path: str = None,
|
|
252
|
+
input_path: Optional[str] = None,
|
|
253
|
+
result_path: Optional[str] = None,
|
|
253
254
|
retries=None,
|
|
254
255
|
backoff_factor=None,
|
|
255
256
|
timeout=None,
|
|
@@ -258,7 +259,7 @@ class BatchHttpRequests(_ConcurrentJobExecution):
|
|
|
258
259
|
"""class for calling remote endpoints in parallel
|
|
259
260
|
|
|
260
261
|
sync and async graph step implementation for request/resp to remote service (class shortcut = "$remote")
|
|
261
|
-
url can be an http(s) url (e.g.
|
|
262
|
+
url can be an http(s) url (e.g. `https://myservice/path`) or an mlrun function uri ([project/]name).
|
|
262
263
|
alternatively the url_expression can be specified to build the url from the event (e.g. "event['url']").
|
|
263
264
|
|
|
264
265
|
example pipeline::
|