Skip to content

Commit

Permalink
[Serving] Save parent function before children deployment (mlrun#4194)
Browse files Browse the repository at this point in the history
  • Loading branch information
alonmr committed Sep 5, 2023
1 parent 6912fd0 commit 9589e7f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 11 deletions.
22 changes: 11 additions & 11 deletions mlrun/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -656,22 +656,22 @@ class HyperParamOptions(ModelObj):
"""Hyper Parameter Options
Parameters:
param_file (str): hyper params input file path/url, instead of inline
strategy (str): hyper param strategy - grid, list or random
selector (str): selection criteria for best result ([min|max.]<result>), e.g. max.accuracy
stop_condition (str): early stop condition e.g. "accuracy > 0.9"
parallel_runs (int): number of param combinations to run in parallel (over Dask)
dask_cluster_uri (str): db uri for a deployed dask cluster function, e.g. db://myproject/dask
max_iterations (int): max number of runs (in random strategy)
max_errors (int): max number of child runs errors for the overall job to fail
teardown_dask (bool): kill the dask cluster pods after the runs
param_file (str): hyper params input file path/url, instead of inline
strategy (HyperParamStrategies): hyper param strategy - grid, list or random
selector (str): selection criteria for best result ([min|max.]<result>), e.g. max.accuracy
stop_condition (str): early stop condition e.g. "accuracy > 0.9"
parallel_runs (int): number of param combinations to run in parallel (over Dask)
dask_cluster_uri (str): db uri for a deployed dask cluster function, e.g. db://myproject/dask
max_iterations (int): max number of runs (in random strategy)
max_errors (int): max number of child runs errors for the overall job to fail
teardown_dask (bool): kill the dask cluster pods after the runs
"""

def __init__(
self,
param_file=None,
strategy=None,
selector: HyperParamStrategies = None,
strategy: typing.Optional[HyperParamStrategies] = None,
selector=None,
stop_condition=None,
parallel_runs=None,
dask_cluster_uri=None,
Expand Down
3 changes: 3 additions & 0 deletions mlrun/runtimes/serving.py
Original file line number Diff line number Diff line change
Expand Up @@ -638,6 +638,9 @@ def deploy(
self.spec.secret_sources = self._secrets.to_serial()

if self._spec.function_refs:
# ensure the function is available to the UI while deploying the child functions
self.save(versioned=False)

# deploy child functions
self._add_ref_triggers()
self._deploy_function_refs()
Expand Down

0 comments on commit 9589e7f

Please sign in to comment.