mlrun 1.9.0rc3__py3-none-any.whl → 1.10.0rc1__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/api/schemas/__init__.py +0 -1
- mlrun/common/__init__.py +0 -1
- mlrun/common/db/__init__.py +0 -1
- mlrun/common/db/sql_session.py +0 -1
- mlrun/common/formatters/__init__.py +0 -1
- mlrun/common/formatters/artifact.py +0 -1
- mlrun/common/formatters/base.py +0 -1
- mlrun/common/formatters/feature_set.py +0 -1
- mlrun/common/formatters/function.py +0 -1
- mlrun/common/formatters/model_endpoint.py +0 -1
- mlrun/common/formatters/pipeline.py +0 -1
- mlrun/common/formatters/project.py +0 -1
- mlrun/common/formatters/run.py +0 -2
- mlrun/common/runtimes/constants.py +1 -1
- mlrun/common/schemas/__init__.py +1 -0
- mlrun/common/schemas/alert.py +1 -1
- mlrun/common/schemas/api_gateway.py +1 -1
- mlrun/common/schemas/artifact.py +1 -1
- mlrun/common/schemas/auth.py +1 -1
- mlrun/common/schemas/background_task.py +1 -1
- mlrun/common/schemas/client_spec.py +1 -1
- mlrun/common/schemas/clusterization_spec.py +1 -1
- mlrun/common/schemas/constants.py +1 -1
- mlrun/common/schemas/datastore_profile.py +0 -1
- mlrun/common/schemas/events.py +1 -1
- mlrun/common/schemas/feature_store.py +1 -1
- mlrun/common/schemas/frontend_spec.py +1 -1
- mlrun/common/schemas/function.py +1 -1
- mlrun/common/schemas/http.py +1 -1
- mlrun/common/schemas/hub.py +1 -1
- mlrun/common/schemas/k8s.py +1 -1
- mlrun/common/schemas/memory_reports.py +0 -1
- mlrun/common/schemas/model_monitoring/model_endpoints.py +32 -8
- mlrun/common/schemas/notification.py +4 -0
- mlrun/common/schemas/object.py +1 -1
- mlrun/common/schemas/partition.py +1 -1
- mlrun/common/schemas/pipeline.py +1 -1
- mlrun/common/schemas/project.py +1 -1
- mlrun/common/schemas/regex.py +1 -1
- mlrun/common/schemas/runtime_resource.py +1 -1
- mlrun/common/schemas/schedule.py +1 -1
- mlrun/common/schemas/secret.py +1 -1
- mlrun/common/schemas/tag.py +0 -1
- mlrun/common/schemas/workflow.py +1 -1
- mlrun/common/secrets.py +0 -1
- mlrun/config.py +9 -17
- mlrun/data_types/infer.py +1 -1
- mlrun/data_types/spark.py +1 -1
- mlrun/datastore/datastore.py +1 -1
- mlrun/datastore/snowflake_utils.py +0 -1
- mlrun/datastore/spark_utils.py +0 -1
- mlrun/datastore/utils.py +1 -1
- mlrun/db/base.py +2 -0
- mlrun/db/httpdb.py +29 -19
- mlrun/db/nopdb.py +2 -1
- mlrun/errors.py +1 -1
- mlrun/execution.py +21 -9
- mlrun/feature_store/feature_set.py +0 -12
- mlrun/feature_store/retrieval/base.py +1 -1
- mlrun/feature_store/retrieval/dask_merger.py +1 -1
- mlrun/feature_store/retrieval/job.py +1 -1
- mlrun/feature_store/retrieval/spark_merger.py +0 -2
- mlrun/feature_store/steps.py +1 -1
- mlrun/features.py +1 -1
- mlrun/frameworks/_common/artifacts_library.py +1 -1
- mlrun/frameworks/_common/mlrun_interface.py +1 -1
- mlrun/frameworks/_common/model_handler.py +3 -3
- mlrun/frameworks/_common/producer.py +0 -1
- mlrun/frameworks/_common/utils.py +1 -1
- mlrun/frameworks/_dl_common/loggers/logger.py +0 -1
- mlrun/frameworks/_dl_common/loggers/mlrun_logger.py +1 -1
- mlrun/frameworks/_dl_common/loggers/tensorboard_logger.py +1 -1
- mlrun/frameworks/_dl_common/model_handler.py +1 -1
- mlrun/frameworks/_dl_common/utils.py +1 -1
- mlrun/frameworks/_ml_common/artifacts_library.py +1 -1
- mlrun/frameworks/_ml_common/loggers/logger.py +0 -1
- mlrun/frameworks/_ml_common/loggers/mlrun_logger.py +1 -1
- mlrun/frameworks/_ml_common/model_handler.py +1 -1
- mlrun/frameworks/_ml_common/pkl_model_server.py +1 -1
- mlrun/frameworks/_ml_common/plan.py +1 -1
- mlrun/frameworks/_ml_common/plans/calibration_curve_plan.py +0 -1
- mlrun/frameworks/_ml_common/plans/confusion_matrix_plan.py +0 -1
- mlrun/frameworks/_ml_common/plans/dataset_plan.py +1 -1
- mlrun/frameworks/_ml_common/plans/feature_importance_plan.py +1 -1
- mlrun/frameworks/_ml_common/plans/roc_curve_plan.py +1 -1
- mlrun/frameworks/_ml_common/producer.py +1 -1
- mlrun/frameworks/_ml_common/utils.py +1 -1
- mlrun/frameworks/lgbm/callbacks/callback.py +1 -1
- mlrun/frameworks/lgbm/callbacks/logging_callback.py +0 -1
- mlrun/frameworks/lgbm/callbacks/mlrun_logging_callback.py +0 -1
- mlrun/frameworks/lgbm/mlrun_interfaces/booster_mlrun_interface.py +1 -1
- mlrun/frameworks/lgbm/mlrun_interfaces/mlrun_interface.py +1 -1
- mlrun/frameworks/lgbm/mlrun_interfaces/model_mlrun_interface.py +1 -1
- mlrun/frameworks/lgbm/model_handler.py +1 -1
- mlrun/frameworks/lgbm/model_server.py +1 -1
- mlrun/frameworks/lgbm/utils.py +1 -1
- mlrun/frameworks/onnx/dataset.py +1 -1
- mlrun/frameworks/onnx/mlrun_interface.py +1 -1
- mlrun/frameworks/onnx/model_handler.py +1 -1
- mlrun/frameworks/onnx/model_server.py +1 -1
- mlrun/frameworks/pytorch/callbacks/callback.py +1 -1
- mlrun/frameworks/pytorch/callbacks/logging_callback.py +1 -1
- mlrun/frameworks/pytorch/callbacks/mlrun_logging_callback.py +1 -1
- mlrun/frameworks/pytorch/callbacks/tensorboard_logging_callback.py +1 -1
- mlrun/frameworks/pytorch/callbacks_handler.py +1 -1
- mlrun/frameworks/pytorch/mlrun_interface.py +1 -1
- mlrun/frameworks/pytorch/model_handler.py +1 -1
- mlrun/frameworks/pytorch/model_server.py +1 -1
- mlrun/frameworks/pytorch/utils.py +1 -1
- mlrun/frameworks/sklearn/__init__.py +0 -14
- mlrun/frameworks/sklearn/estimator.py +1 -1
- mlrun/frameworks/sklearn/metric.py +1 -1
- mlrun/frameworks/sklearn/metrics_library.py +1 -1
- mlrun/frameworks/sklearn/mlrun_interface.py +1 -1
- mlrun/frameworks/sklearn/model_handler.py +1 -1
- mlrun/frameworks/sklearn/utils.py +1 -1
- mlrun/frameworks/tf_keras/callbacks/logging_callback.py +1 -1
- mlrun/frameworks/tf_keras/callbacks/mlrun_logging_callback.py +1 -1
- mlrun/frameworks/tf_keras/callbacks/tensorboard_logging_callback.py +1 -1
- mlrun/frameworks/tf_keras/mlrun_interface.py +1 -1
- mlrun/frameworks/tf_keras/model_handler.py +1 -1
- mlrun/frameworks/tf_keras/model_server.py +1 -1
- mlrun/frameworks/tf_keras/utils.py +1 -1
- mlrun/frameworks/xgboost/mlrun_interface.py +1 -1
- mlrun/frameworks/xgboost/model_handler.py +1 -1
- mlrun/frameworks/xgboost/utils.py +1 -1
- mlrun/k8s_utils.py +340 -0
- mlrun/launcher/base.py +3 -3
- mlrun/launcher/local.py +2 -2
- mlrun/launcher/remote.py +2 -2
- mlrun/model.py +14 -0
- mlrun/model_monitoring/applications/__init__.py +0 -1
- mlrun/model_monitoring/applications/_application_steps.py +3 -1
- mlrun/model_monitoring/controller.py +3 -1
- mlrun/model_monitoring/db/tsdb/base.py +3 -1
- mlrun/model_monitoring/db/tsdb/tdengine/tdengine_connection.py +213 -0
- mlrun/model_monitoring/db/tsdb/tdengine/tdengine_connector.py +27 -49
- mlrun/model_monitoring/db/tsdb/v3io/v3io_connector.py +35 -30
- mlrun/package/context_handler.py +1 -1
- mlrun/package/errors.py +1 -1
- mlrun/package/packager.py +1 -1
- mlrun/package/packagers/default_packager.py +1 -1
- mlrun/package/packagers/numpy_packagers.py +1 -1
- mlrun/package/packagers/pandas_packagers.py +1 -1
- mlrun/package/packagers/python_standard_library_packagers.py +1 -1
- mlrun/package/packagers_manager.py +1 -1
- mlrun/package/utils/_archiver.py +1 -1
- mlrun/package/utils/_formatter.py +1 -1
- mlrun/package/utils/_pickler.py +1 -1
- mlrun/package/utils/_supported_format.py +1 -1
- mlrun/package/utils/log_hint_utils.py +1 -1
- mlrun/package/utils/type_hint_utils.py +1 -1
- mlrun/projects/operations.py +36 -21
- mlrun/projects/project.py +82 -74
- mlrun/run.py +1 -1
- mlrun/runtimes/base.py +16 -6
- mlrun/runtimes/daskjob.py +2 -1
- mlrun/runtimes/databricks_job/databricks_cancel_task.py +0 -1
- mlrun/runtimes/databricks_job/databricks_runtime.py +2 -1
- mlrun/runtimes/databricks_job/databricks_wrapper.py +0 -1
- mlrun/runtimes/mounts.py +2 -0
- mlrun/runtimes/nuclio/function.py +6 -1
- mlrun/runtimes/nuclio/serving.py +1 -1
- mlrun/runtimes/pod.py +4 -349
- mlrun/runtimes/sparkjob/spark3job.py +0 -12
- mlrun/serving/merger.py +0 -1
- mlrun/serving/remote.py +1 -1
- mlrun/serving/serving_wrapper.py +1 -1
- mlrun/serving/utils.py +1 -1
- mlrun/utils/async_http.py +0 -1
- mlrun/utils/clones.py +1 -1
- mlrun/utils/db.py +1 -1
- mlrun/utils/helpers.py +3 -1
- mlrun/utils/http.py +0 -1
- mlrun/utils/notifications/notification/webhook.py +18 -2
- mlrun/utils/regex.py +0 -1
- mlrun/utils/singleton.py +1 -1
- mlrun/utils/vault.py +1 -1
- mlrun/utils/version/__init__.py +1 -1
- mlrun/utils/version/version.json +2 -2
- mlrun/utils/version/version.py +1 -1
- {mlrun-1.9.0rc3.dist-info → mlrun-1.10.0rc1.dist-info}/METADATA +6 -10
- mlrun-1.10.0rc1.dist-info/RECORD +351 -0
- {mlrun-1.9.0rc3.dist-info → mlrun-1.10.0rc1.dist-info}/WHEEL +1 -1
- mlrun-1.9.0rc3.dist-info/RECORD +0 -350
- {mlrun-1.9.0rc3.dist-info → mlrun-1.10.0rc1.dist-info}/entry_points.txt +0 -0
- {mlrun-1.9.0rc3.dist-info → mlrun-1.10.0rc1.dist-info}/licenses/LICENSE +0 -0
- {mlrun-1.9.0rc3.dist-info → mlrun-1.10.0rc1.dist-info}/top_level.txt +0 -0
mlrun/projects/operations.py
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
12
|
# See the License for the specific language governing permissions and
|
|
13
13
|
# limitations under the License.
|
|
14
|
-
|
|
14
|
+
|
|
15
15
|
import typing
|
|
16
16
|
import warnings
|
|
17
17
|
from typing import Optional, Union
|
|
@@ -81,6 +81,7 @@ def run_function(
|
|
|
81
81
|
returns: Optional[list[Union[str, dict[str, str]]]] = None,
|
|
82
82
|
builder_env: Optional[list] = None,
|
|
83
83
|
reset_on_run: Optional[bool] = None,
|
|
84
|
+
output_path: Optional[str] = None,
|
|
84
85
|
) -> Union[mlrun.model.RunObject, mlrun_pipelines.models.PipelineNodeWrapper]:
|
|
85
86
|
"""Run a local or remote task as part of a local/kubeflow pipeline
|
|
86
87
|
|
|
@@ -144,7 +145,7 @@ def run_function(
|
|
|
144
145
|
during runtime from `mlrun.DataItem` to the given type hint. The type hint can be given
|
|
145
146
|
in the key field of the dictionary after a colon, e.g: "<key> : <type_hint>".
|
|
146
147
|
:param outputs: list of outputs which can pass in the workflow
|
|
147
|
-
:param workdir: default
|
|
148
|
+
:param workdir: working directory of the executed job and the default path for artifact inputs
|
|
148
149
|
:param labels: labels to tag the job/run with ({key:val, ..})
|
|
149
150
|
:param base_task: task object to use as base
|
|
150
151
|
:param watch: watch/follow run log, True by default
|
|
@@ -157,7 +158,8 @@ def run_function(
|
|
|
157
158
|
(which will be converted to the class using its `from_crontab` constructor),
|
|
158
159
|
see this link for help:
|
|
159
160
|
https://apscheduler.readthedocs.io/en/3.x/modules/triggers/cron.html#module-apscheduler.triggers.cron
|
|
160
|
-
:param artifact_path: path to store artifacts, when running in a workflow this will be set
|
|
161
|
+
:param artifact_path: (deprecated) path to store artifacts, when running in a workflow this will be set
|
|
162
|
+
automatically
|
|
161
163
|
:param notifications: list of notifications to push when the run is completed
|
|
162
164
|
:param returns: List of log hints - configurations for how to log the returning values from the handler's
|
|
163
165
|
run (as artifacts or results). The list's length must be equal to the amount of returning
|
|
@@ -174,8 +176,17 @@ def run_function(
|
|
|
174
176
|
:param reset_on_run: When True, function python modules would reload prior to code execution.
|
|
175
177
|
This ensures latest code changes are executed. This argument must be used in
|
|
176
178
|
conjunction with the local=True argument.
|
|
179
|
+
:param output_path: path to store artifacts, when running in a workflow this will be set automatically
|
|
177
180
|
:return: MLRun RunObject or PipelineNodeWrapper
|
|
178
181
|
"""
|
|
182
|
+
if artifact_path:
|
|
183
|
+
warnings.warn(
|
|
184
|
+
"'artifact_path' parameter is deprecated in 1.10.0 and will be removed in 1.12.0, "
|
|
185
|
+
"use 'output_path' instead.",
|
|
186
|
+
# TODO: Remove this in 1.12.0
|
|
187
|
+
FutureWarning,
|
|
188
|
+
)
|
|
189
|
+
output_path = output_path or artifact_path
|
|
179
190
|
engine, function = _get_engine_and_function(function, project_object)
|
|
180
191
|
task = mlrun.new_task(
|
|
181
192
|
handler=handler,
|
|
@@ -210,24 +221,28 @@ def run_function(
|
|
|
210
221
|
function.spec.command = command
|
|
211
222
|
if local and project and function.spec.build.source:
|
|
212
223
|
workdir = workdir or project.spec.get_code_path()
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
224
|
+
|
|
225
|
+
# remove this filter once the artifact_path parameter is deprecated in 1.12.0
|
|
226
|
+
with warnings.catch_warnings():
|
|
227
|
+
warnings.simplefilter("ignore", category=FutureWarning)
|
|
228
|
+
run_result = function.run(
|
|
229
|
+
name=name,
|
|
230
|
+
runspec=task,
|
|
231
|
+
workdir=workdir,
|
|
232
|
+
verbose=verbose,
|
|
233
|
+
watch=watch,
|
|
234
|
+
local=local,
|
|
235
|
+
output_path=output_path
|
|
236
|
+
# workflow output_path has precedence over the project artifact_path equivalent to passing
|
|
237
|
+
# output_path to function.run() has precedence over the project.artifact_path and the default one
|
|
238
|
+
or pipeline_context.workflow_artifact_path
|
|
239
|
+
or (project.artifact_path if project else None),
|
|
240
|
+
auto_build=auto_build,
|
|
241
|
+
schedule=schedule,
|
|
242
|
+
notifications=notifications,
|
|
243
|
+
builder_env=builder_env,
|
|
244
|
+
reset_on_run=reset_on_run,
|
|
245
|
+
)
|
|
231
246
|
if run_result:
|
|
232
247
|
run_result._notified = False
|
|
233
248
|
pipeline_context.runs_map[run_result.uid()] = run_result
|
mlrun/projects/project.py
CHANGED
|
@@ -30,7 +30,6 @@ from copy import deepcopy
|
|
|
30
30
|
from os import environ, makedirs, path
|
|
31
31
|
from typing import Callable, Optional, Union, cast
|
|
32
32
|
|
|
33
|
-
import deprecated
|
|
34
33
|
import dotenv
|
|
35
34
|
import git
|
|
36
35
|
import git.exc
|
|
@@ -470,7 +469,8 @@ def get_or_create_project(
|
|
|
470
469
|
parameters: Optional[dict] = None,
|
|
471
470
|
allow_cross_project: Optional[bool] = None,
|
|
472
471
|
) -> "MlrunProject":
|
|
473
|
-
"""Load a project from MLRun DB, or create/import if it does not exist
|
|
472
|
+
"""Load a project from MLRun DB, or create/import if it does not exist.
|
|
473
|
+
The project will become the default project for the current session.
|
|
474
474
|
|
|
475
475
|
MLRun looks for a project.yaml file with project definition and objects in the project root path
|
|
476
476
|
and use it to initialize the project, in addition it runs the project_setup.py file (if it exists)
|
|
@@ -2143,35 +2143,35 @@ class MlrunProject(ModelObj):
|
|
|
2143
2143
|
),
|
|
2144
2144
|
reset_policy: mlrun.common.schemas.alert.ResetPolicy = mlrun.common.schemas.alert.ResetPolicy.AUTO,
|
|
2145
2145
|
) -> list[mlrun.alerts.alert.AlertConfig]:
|
|
2146
|
-
"""
|
|
2147
|
-
Generate alert configurations based on specified model endpoints and result names, which can be defined
|
|
2146
|
+
"""Generate alert configurations based on specified model endpoints and result names, which can be defined
|
|
2148
2147
|
explicitly or using regex patterns.
|
|
2149
2148
|
|
|
2150
|
-
|
|
2151
|
-
|
|
2152
|
-
|
|
2153
|
-
|
|
2154
|
-
|
|
2155
|
-
|
|
2156
|
-
|
|
2157
|
-
|
|
2158
|
-
|
|
2159
|
-
|
|
2160
|
-
|
|
2161
|
-
|
|
2162
|
-
|
|
2163
|
-
|
|
2164
|
-
|
|
2165
|
-
|
|
2166
|
-
|
|
2167
|
-
|
|
2168
|
-
|
|
2169
|
-
|
|
2170
|
-
|
|
2171
|
-
|
|
2172
|
-
|
|
2173
|
-
|
|
2174
|
-
|
|
2149
|
+
:param name: The name of the AlertConfig template. It will be combined with
|
|
2150
|
+
mep id, app name and result name to generate a unique name.
|
|
2151
|
+
:param summary: Summary of the alert, will be sent in the generated notifications
|
|
2152
|
+
:param endpoints: The endpoints from which metrics will be retrieved to configure
|
|
2153
|
+
the alerts.
|
|
2154
|
+
The ModelEndpointList object is obtained via the `list_model_endpoints`
|
|
2155
|
+
method or created manually using `ModelEndpoint` objects.
|
|
2156
|
+
:param events: AlertTrigger event types (EventKind).
|
|
2157
|
+
:param notifications: List of notifications to invoke once the alert is triggered
|
|
2158
|
+
:param result_names: Optional. Filters the result names used to create the alert
|
|
2159
|
+
configuration, constructed from the app and result_name regex.
|
|
2160
|
+
|
|
2161
|
+
For example:
|
|
2162
|
+
[`app1.result-*`, `*.result1`]
|
|
2163
|
+
will match "mep_uid1.app1.result.result-1" and
|
|
2164
|
+
"mep_uid1.app2.result.result1".
|
|
2165
|
+
A specific result_name (not a wildcard) will always create a new alert
|
|
2166
|
+
config, regardless of whether the result name exists.
|
|
2167
|
+
:param severity: Severity of the alert.
|
|
2168
|
+
:param criteria: The threshold for triggering the alert based on the
|
|
2169
|
+
specified number of events within the defined time period.
|
|
2170
|
+
:param reset_policy: When to clear the alert. Either "manual" for manual reset of the alert,
|
|
2171
|
+
or "auto" if the criteria contains a time period.
|
|
2172
|
+
|
|
2173
|
+
:returns: List of AlertConfig according to endpoints results,
|
|
2174
|
+
filtered by result_names.
|
|
2175
2175
|
"""
|
|
2176
2176
|
db = mlrun.db.get_run_db(secrets=self._secrets)
|
|
2177
2177
|
matching_results = []
|
|
@@ -2860,20 +2860,6 @@ class MlrunProject(ModelObj):
|
|
|
2860
2860
|
|
|
2861
2861
|
self.spec.set_function(name, function_object, func)
|
|
2862
2862
|
|
|
2863
|
-
# TODO: Remove this in 1.10.0
|
|
2864
|
-
@deprecated.deprecated(
|
|
2865
|
-
version="1.8.0",
|
|
2866
|
-
reason="'remove_function' is deprecated and will be removed in 1.10.0. "
|
|
2867
|
-
"Please use `delete_function` instead.",
|
|
2868
|
-
category=FutureWarning,
|
|
2869
|
-
)
|
|
2870
|
-
def remove_function(self, name):
|
|
2871
|
-
"""remove the specified function from the project
|
|
2872
|
-
|
|
2873
|
-
:param name: name of the function (under the project)
|
|
2874
|
-
"""
|
|
2875
|
-
self.spec.remove_function(name)
|
|
2876
|
-
|
|
2877
2863
|
def delete_function(self, name, delete_from_db=False):
|
|
2878
2864
|
"""deletes the specified function from the project
|
|
2879
2865
|
|
|
@@ -3796,6 +3782,7 @@ class MlrunProject(ModelObj):
|
|
|
3796
3782
|
uids: Optional[list[str]] = None,
|
|
3797
3783
|
latest_only: bool = False,
|
|
3798
3784
|
tsdb_metrics: bool = True,
|
|
3785
|
+
metric_list: Optional[list[str]] = None,
|
|
3799
3786
|
) -> mlrun.common.schemas.ModelEndpointList:
|
|
3800
3787
|
"""
|
|
3801
3788
|
Returns a list of `ModelEndpoint` objects. Each `ModelEndpoint` object represents the current state of a
|
|
@@ -3825,10 +3812,15 @@ class MlrunProject(ModelObj):
|
|
|
3825
3812
|
or just `"label"` for key existence.
|
|
3826
3813
|
- A comma-separated string formatted as `"label1=value1,label2"` to match entities with
|
|
3827
3814
|
the specified key-value pairs or key existence.
|
|
3828
|
-
:param start:
|
|
3829
|
-
:param end:
|
|
3830
|
-
:param top_level:
|
|
3831
|
-
:param uids:
|
|
3815
|
+
:param start: The start time to filter by.Corresponding to the `created` field.
|
|
3816
|
+
:param end: The end time to filter by. Corresponding to the `created` field.
|
|
3817
|
+
:param top_level: If true will return only routers and endpoint that are NOT children of any router.
|
|
3818
|
+
:param uids: If passed will return a list `ModelEndpoint` object with uid in uids.
|
|
3819
|
+
:param tsdb_metrics: When True, the time series metrics will be added to the output
|
|
3820
|
+
of the resulting.
|
|
3821
|
+
:param metric_list: List of metrics to include from the time series DB. Defaults to all metrics.
|
|
3822
|
+
If tsdb_metrics=False, this parameter will be ignored and no tsdb metrics
|
|
3823
|
+
will be included.
|
|
3832
3824
|
|
|
3833
3825
|
:returns: Returns a list of `ModelEndpoint` objects.
|
|
3834
3826
|
"""
|
|
@@ -3847,6 +3839,7 @@ class MlrunProject(ModelObj):
|
|
|
3847
3839
|
uids=uids,
|
|
3848
3840
|
latest_only=latest_only,
|
|
3849
3841
|
tsdb_metrics=tsdb_metrics,
|
|
3842
|
+
metric_list=metric_list,
|
|
3850
3843
|
)
|
|
3851
3844
|
|
|
3852
3845
|
def run_function(
|
|
@@ -3873,6 +3866,7 @@ class MlrunProject(ModelObj):
|
|
|
3873
3866
|
returns: Optional[list[Union[str, dict[str, str]]]] = None,
|
|
3874
3867
|
builder_env: Optional[dict] = None,
|
|
3875
3868
|
reset_on_run: Optional[bool] = None,
|
|
3869
|
+
output_path: Optional[str] = None,
|
|
3876
3870
|
) -> typing.Union[mlrun.model.RunObject, PipelineNodeWrapper]:
|
|
3877
3871
|
"""Run a local or remote task as part of a local/kubeflow pipeline
|
|
3878
3872
|
|
|
@@ -3903,7 +3897,7 @@ class MlrunProject(ModelObj):
|
|
|
3903
3897
|
parsed during runtime from `mlrun.DataItem` to the given type hint. The type hint can be
|
|
3904
3898
|
given in the key field of the dictionary after a colon, e.g: "<key> : <type_hint>".
|
|
3905
3899
|
:param outputs: list of outputs which can pass in the workflow
|
|
3906
|
-
:param workdir: default
|
|
3900
|
+
:param workdir: working directory of the executed job and the default path for artifact inputs
|
|
3907
3901
|
:param labels: labels to tag the job/run with ({key:val, ..})
|
|
3908
3902
|
:param base_task: task object to use as base
|
|
3909
3903
|
:param watch: watch/follow run log, True by default
|
|
@@ -3915,7 +3909,8 @@ class MlrunProject(ModelObj):
|
|
|
3915
3909
|
(which will be converted to the class using its `from_crontab` constructor),
|
|
3916
3910
|
see this link for help:
|
|
3917
3911
|
https://apscheduler.readthedocs.io/en/3.x/modules/triggers/cron.html#module-apscheduler.triggers.cron
|
|
3918
|
-
:param artifact_path: path to store artifacts, when running in a workflow this will be set
|
|
3912
|
+
:param artifact_path: (deprecated) path to store artifacts, when running in a workflow this will be set
|
|
3913
|
+
automatically
|
|
3919
3914
|
:param notifications: list of notifications to push when the run is completed
|
|
3920
3915
|
:param returns: List of log hints - configurations for how to log the returning values from the
|
|
3921
3916
|
handler's run (as artifacts or results). The list's length must be equal to the amount
|
|
@@ -3933,34 +3928,47 @@ class MlrunProject(ModelObj):
|
|
|
3933
3928
|
:param reset_on_run: When True, function python modules would reload prior to code execution.
|
|
3934
3929
|
This ensures latest code changes are executed. This argument must be used in
|
|
3935
3930
|
conjunction with the local=True argument.
|
|
3931
|
+
:param output_path: path to store artifacts, when running in a workflow this will be set automatically
|
|
3936
3932
|
|
|
3937
3933
|
:return: MLRun RunObject or PipelineNodeWrapper
|
|
3938
3934
|
"""
|
|
3939
|
-
|
|
3940
|
-
|
|
3941
|
-
|
|
3942
|
-
|
|
3943
|
-
|
|
3944
|
-
|
|
3945
|
-
|
|
3946
|
-
|
|
3947
|
-
|
|
3948
|
-
|
|
3949
|
-
|
|
3950
|
-
|
|
3951
|
-
|
|
3952
|
-
|
|
3953
|
-
|
|
3954
|
-
|
|
3955
|
-
|
|
3956
|
-
|
|
3957
|
-
|
|
3958
|
-
|
|
3959
|
-
|
|
3960
|
-
|
|
3961
|
-
|
|
3962
|
-
|
|
3963
|
-
|
|
3935
|
+
if artifact_path:
|
|
3936
|
+
warnings.warn(
|
|
3937
|
+
"'artifact_path' parameter is deprecated in 1.10.0 and will be removed in 1.12.0, "
|
|
3938
|
+
"use 'output_path' instead.",
|
|
3939
|
+
# TODO: Remove this in 1.12.0
|
|
3940
|
+
FutureWarning,
|
|
3941
|
+
)
|
|
3942
|
+
output_path = output_path or artifact_path
|
|
3943
|
+
|
|
3944
|
+
# remove this filter once the artifact_path parameter is deprecated in 1.12.0
|
|
3945
|
+
with warnings.catch_warnings():
|
|
3946
|
+
warnings.simplefilter("ignore", category=FutureWarning)
|
|
3947
|
+
return run_function(
|
|
3948
|
+
function,
|
|
3949
|
+
handler=handler,
|
|
3950
|
+
name=name,
|
|
3951
|
+
params=params,
|
|
3952
|
+
hyperparams=hyperparams,
|
|
3953
|
+
hyper_param_options=hyper_param_options,
|
|
3954
|
+
inputs=inputs,
|
|
3955
|
+
outputs=outputs,
|
|
3956
|
+
workdir=workdir,
|
|
3957
|
+
labels=labels,
|
|
3958
|
+
base_task=base_task,
|
|
3959
|
+
watch=watch,
|
|
3960
|
+
local=local,
|
|
3961
|
+
verbose=verbose,
|
|
3962
|
+
selector=selector,
|
|
3963
|
+
project_object=self,
|
|
3964
|
+
auto_build=auto_build,
|
|
3965
|
+
schedule=schedule,
|
|
3966
|
+
output_path=output_path,
|
|
3967
|
+
notifications=notifications,
|
|
3968
|
+
returns=returns,
|
|
3969
|
+
builder_env=builder_env,
|
|
3970
|
+
reset_on_run=reset_on_run,
|
|
3971
|
+
)
|
|
3964
3972
|
|
|
3965
3973
|
def build_function(
|
|
3966
3974
|
self,
|
mlrun/run.py
CHANGED
|
@@ -637,7 +637,7 @@ def code_to_function(
|
|
|
637
637
|
- databricks: run code on Databricks cluster (python scripts, Spark etc.)
|
|
638
638
|
- application: run a long living application (e.g. a web server, UI, etc.)
|
|
639
639
|
|
|
640
|
-
Learn more about
|
|
640
|
+
Learn more about :doc:`../../concepts/functions-overview`
|
|
641
641
|
|
|
642
642
|
:param name: function name, typically best to use hyphen-case
|
|
643
643
|
:param project: project used to namespace the function, defaults to 'default'
|
mlrun/runtimes/base.py
CHANGED
|
@@ -345,6 +345,7 @@ class BaseRuntime(ModelObj):
|
|
|
345
345
|
returns: Optional[list[Union[str, dict[str, str]]]] = None,
|
|
346
346
|
state_thresholds: Optional[dict[str, int]] = None,
|
|
347
347
|
reset_on_run: Optional[bool] = None,
|
|
348
|
+
output_path: Optional[str] = "",
|
|
348
349
|
**launcher_kwargs,
|
|
349
350
|
) -> RunObject:
|
|
350
351
|
"""
|
|
@@ -358,9 +359,9 @@ class BaseRuntime(ModelObj):
|
|
|
358
359
|
:param inputs: Input objects to pass to the handler. Type hints can be given so the input will be parsed
|
|
359
360
|
during runtime from `mlrun.DataItem` to the given type hint. The type hint can be given
|
|
360
361
|
in the key field of the dictionary after a colon, e.g: "<key> : <type_hint>".
|
|
361
|
-
:param out_path: Default artifact output path.
|
|
362
|
-
:param artifact_path: Default artifact output path (will replace out_path).
|
|
363
|
-
:param workdir:
|
|
362
|
+
:param out_path: (deprecated) Default artifact output path.
|
|
363
|
+
:param artifact_path: (deprecated) Default artifact output path (will replace out_path).
|
|
364
|
+
:param workdir: Working directory of the executed job and the default path for artifact inputs
|
|
364
365
|
:param watch: Watch/follow run log.
|
|
365
366
|
:param schedule: ScheduleCronTrigger class instance or a standard crontab expression string
|
|
366
367
|
(which will be converted to the class using its `from_crontab` constructor),
|
|
@@ -402,8 +403,18 @@ class BaseRuntime(ModelObj):
|
|
|
402
403
|
:param reset_on_run: When True, function python modules would reload prior to code execution.
|
|
403
404
|
This ensures latest code changes are executed. This argument must be used in
|
|
404
405
|
conjunction with the local=True argument.
|
|
406
|
+
:param output_path: Default artifact output path.
|
|
405
407
|
:return: Run context object (RunObject) with run metadata, results and status
|
|
406
408
|
"""
|
|
409
|
+
if artifact_path or out_path:
|
|
410
|
+
deprecated_param = "artifact_path" if artifact_path else "out_path"
|
|
411
|
+
warnings.warn(
|
|
412
|
+
f"'{deprecated_param}' parameter is deprecated in 1.10.0 and will be removed in 1.12.0, "
|
|
413
|
+
"use 'output_path' instead.",
|
|
414
|
+
# TODO: Remove this in 1.12.0
|
|
415
|
+
FutureWarning,
|
|
416
|
+
)
|
|
417
|
+
output_path = output_path or out_path or artifact_path
|
|
407
418
|
launcher = mlrun.launcher.factory.LauncherFactory().create_launcher(
|
|
408
419
|
self._is_remote, local=local, **launcher_kwargs
|
|
409
420
|
)
|
|
@@ -415,9 +426,8 @@ class BaseRuntime(ModelObj):
|
|
|
415
426
|
project=project,
|
|
416
427
|
params=params,
|
|
417
428
|
inputs=inputs,
|
|
418
|
-
out_path=out_path,
|
|
419
429
|
workdir=workdir,
|
|
420
|
-
|
|
430
|
+
output_path=output_path,
|
|
421
431
|
watch=watch,
|
|
422
432
|
schedule=schedule,
|
|
423
433
|
hyperparams=hyperparams,
|
|
@@ -711,7 +721,7 @@ class BaseRuntime(ModelObj):
|
|
|
711
721
|
given in the key field of the dictionary after a colon, e.g: "<key> : <type_hint>".
|
|
712
722
|
:param outputs: list of outputs which can pass in the workflow
|
|
713
723
|
:param artifact_path: default artifact output path (replace out_path)
|
|
714
|
-
:param workdir: default
|
|
724
|
+
:param workdir: working directory of the executed job and the default path for artifact inputs
|
|
715
725
|
:param image: container image to use
|
|
716
726
|
:param labels: labels to tag the job/run with ({key:val, ..})
|
|
717
727
|
:param use_db: save function spec in the db (vs the workflow file)
|
mlrun/runtimes/daskjob.py
CHANGED
|
@@ -495,6 +495,7 @@ class DaskCluster(KubejobRuntime):
|
|
|
495
495
|
returns: Optional[list[Union[str, dict[str, str]]]] = None,
|
|
496
496
|
state_thresholds: Optional[dict[str, int]] = None,
|
|
497
497
|
reset_on_run: Optional[bool] = None,
|
|
498
|
+
output_path: Optional[str] = "",
|
|
498
499
|
**launcher_kwargs,
|
|
499
500
|
) -> RunObject:
|
|
500
501
|
if state_thresholds:
|
|
@@ -510,7 +511,7 @@ class DaskCluster(KubejobRuntime):
|
|
|
510
511
|
inputs=inputs,
|
|
511
512
|
out_path=out_path,
|
|
512
513
|
workdir=workdir,
|
|
513
|
-
|
|
514
|
+
output_path=output_path,
|
|
514
515
|
watch=watch,
|
|
515
516
|
schedule=schedule,
|
|
516
517
|
hyperparams=hyperparams,
|
|
@@ -234,6 +234,7 @@ def run_mlrun_databricks_job(context,task_parameters: dict, **kwargs):
|
|
|
234
234
|
returns: Optional[list[Union[str, dict[str, str]]]] = None,
|
|
235
235
|
state_thresholds: Optional[dict[str, int]] = None,
|
|
236
236
|
reset_on_run: Optional[bool] = None,
|
|
237
|
+
output_path: Optional[str] = "",
|
|
237
238
|
**launcher_kwargs,
|
|
238
239
|
) -> RunObject:
|
|
239
240
|
if local:
|
|
@@ -247,7 +248,7 @@ def run_mlrun_databricks_job(context,task_parameters: dict, **kwargs):
|
|
|
247
248
|
inputs=inputs,
|
|
248
249
|
out_path=out_path,
|
|
249
250
|
workdir=workdir,
|
|
250
|
-
|
|
251
|
+
output_path=output_path,
|
|
251
252
|
watch=watch,
|
|
252
253
|
schedule=schedule,
|
|
253
254
|
hyperparams=hyperparams,
|
mlrun/runtimes/mounts.py
CHANGED
|
@@ -352,10 +352,12 @@ def auto_mount(
|
|
|
352
352
|
"""Choose the mount based on env variables and params
|
|
353
353
|
|
|
354
354
|
Volume will be selected by the following order:
|
|
355
|
+
|
|
355
356
|
- k8s PVC volume when both pvc_name and volume_mount_path are set
|
|
356
357
|
- k8s PVC volume when env var is set: MLRUN_PVC_MOUNT=<pvc-name>:<mount-path>
|
|
357
358
|
- k8s PVC volume if it's configured as the auto mount type
|
|
358
359
|
- iguazio v3io volume when V3IO_ACCESS_KEY and V3IO_USERNAME env vars are set
|
|
360
|
+
|
|
359
361
|
"""
|
|
360
362
|
if pvc_name and volume_mount_path:
|
|
361
363
|
return mount_pvc(
|
|
@@ -651,6 +651,11 @@ class RemoteRuntime(KubeResource):
|
|
|
651
651
|
logger.info("Starting remote function deploy")
|
|
652
652
|
data = db.deploy_nuclio_function(func=self, builder_env=builder_env)
|
|
653
653
|
self.status = data["data"].get("status")
|
|
654
|
+
|
|
655
|
+
# Extract the spec to avoid overwriting server-side updates during the later save in
|
|
656
|
+
# _enrich_command_from_status.
|
|
657
|
+
self.spec = data["data"].get("spec")
|
|
658
|
+
|
|
654
659
|
self._update_credentials_from_remote_build(data["data"])
|
|
655
660
|
|
|
656
661
|
# when a function is deployed, we wait for it to be ready by default
|
|
@@ -1000,7 +1005,7 @@ class RemoteRuntime(KubeResource):
|
|
|
1000
1005
|
else:
|
|
1001
1006
|
http_client_kwargs["json"] = body
|
|
1002
1007
|
try:
|
|
1003
|
-
logger.
|
|
1008
|
+
logger.debug("Invoking function", method=method, path=path)
|
|
1004
1009
|
if not getattr(self, "_http_session", None):
|
|
1005
1010
|
self._http_session = requests.Session()
|
|
1006
1011
|
resp = self._http_session.request(
|
mlrun/runtimes/nuclio/serving.py
CHANGED
|
@@ -800,7 +800,7 @@ class ServingRuntime(RemoteRuntime):
|
|
|
800
800
|
serving_fn.add_model(
|
|
801
801
|
"my-classifier",
|
|
802
802
|
model_path=model_path,
|
|
803
|
-
class_name="mlrun.frameworks.sklearn.
|
|
803
|
+
class_name="mlrun.frameworks.sklearn.SKLearnModelServer",
|
|
804
804
|
)
|
|
805
805
|
serving_fn.plot(rankdir="LR")
|
|
806
806
|
|