mlrun 1.10.0rc23__py3-none-any.whl → 1.10.0rc24__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/config.py CHANGED
@@ -107,7 +107,11 @@ default_config = {
107
107
  "submit_timeout": "280", # timeout when submitting a new k8s resource
108
108
  # runtimes cleanup interval in seconds
109
109
  "runtimes_cleanup_interval": "300",
110
- "background_task_cleanup_interval": "86400", # 24 hours in seconds
110
+ # disabled by default due to an internal bug in serving functions
111
+ # relying on a background task to hold the status for its model endpoints
112
+ # TODO: need to refine what/when we can delete the background tasks
113
+ # e.g: use labels or naming convention.
114
+ "background_task_cleanup_interval": "0",
111
115
  "background_task_max_age": "21600", # 6 hours in seconds
112
116
  "monitoring": {
113
117
  "runs": {
@@ -128,16 +128,16 @@ class ModelProvider(BaseRemoteClient):
128
128
 
129
129
  def load_client(self) -> None:
130
130
  """
131
- Initializes the SDK client for the model provider with the given keyword arguments
132
- and assigns it to an instance attribute (e.g., self._client).
131
+ Initialize the SDK client for the model provider and assign it to an instance attribute.
133
132
 
134
- Subclasses should override this method to:
135
- - Create and configure the provider-specific client instance.
136
- - Assign the client instance to self._client.
133
+ Subclasses should override this method to create and configure the provider-specific client.
137
134
  """
138
135
 
139
136
  raise NotImplementedError("load_client method is not implemented")
140
137
 
138
+ def load_async_client(self) -> Any:
139
+ raise NotImplementedError("load_async_client method is not implemented")
140
+
141
141
  @property
142
142
  def client(self) -> Any:
143
143
  return self._client
@@ -67,7 +67,6 @@ class OpenAIProvider(ModelProvider):
67
67
  default_invoke_kwargs=default_invoke_kwargs,
68
68
  )
69
69
  self.options = self.get_client_options()
70
- self.load_client()
71
70
 
72
71
  @classmethod
73
72
  def _import_response_class(cls) -> None:
@@ -98,24 +97,56 @@ class OpenAIProvider(ModelProvider):
98
97
  subpath = ""
99
98
  return endpoint, subpath
100
99
 
100
+ @property
101
+ def client(self) -> Any:
102
+ """
103
+ Lazily return the synchronous OpenAI client.
104
+
105
+ If the client has not been initialized yet, it will be created
106
+ by calling `load_client`.
107
+ """
108
+ self.load_client()
109
+ return self._client
110
+
101
111
  def load_client(self) -> None:
102
112
  """
103
- Initializes the OpenAI SDK client using the provided options.
113
+ Lazily initialize the synchronous OpenAI client.
114
+
115
+ The client is created only if it does not already exist.
116
+ Raises ImportError if the openai package is not installed.
117
+ """
118
+ if not self._client:
119
+ try:
120
+ from openai import OpenAI # noqa
121
+
122
+ self._client = OpenAI(**self.options)
123
+ except ImportError as exc:
124
+ raise ImportError("openai package is not installed") from exc
125
+
126
+ def load_async_client(self) -> None:
127
+ """
128
+ Lazily initialize the asynchronous OpenAI client.
129
+
130
+ The client is created only if it does not already exist.
131
+ Raises ImportError if the openai package is not installed.
132
+ """
133
+ if not self._async_client:
134
+ try:
135
+ from openai import AsyncOpenAI # noqa
104
136
 
105
- This method imports the `OpenAI` class from the `openai` package, instantiates
106
- a client with the given keyword arguments (`self.options`), and assigns it to
107
- `self._client` and `self._async_client`.
137
+ self._async_client = AsyncOpenAI(**self.options)
138
+ except ImportError as exc:
139
+ raise ImportError("openai package is not installed") from exc
108
140
 
109
- Raises:
110
- ImportError: If the `openai` package is not installed.
141
+ @property
142
+ def async_client(self) -> Any:
111
143
  """
112
- try:
113
- from openai import OpenAI, AsyncOpenAI # noqa
144
+ Return the asynchronous OpenAI client, creating it on first access.
114
145
 
115
- self._client = OpenAI(**self.options)
116
- self._async_client = AsyncOpenAI(**self.options)
117
- except ImportError as exc:
118
- raise ImportError("openai package is not installed") from exc
146
+ The client is lazily initialized via `load_async_client`.
147
+ """
148
+ self.load_async_client()
149
+ return self._async_client
119
150
 
120
151
  def get_client_options(self) -> dict:
121
152
  res = dict(
@@ -79,6 +79,10 @@ class ApplicationSpec(NuclioSpec):
79
79
  add_templated_ingress_host_mode=None,
80
80
  state_thresholds=None,
81
81
  disable_default_http_trigger=None,
82
+ serving_spec=None,
83
+ graph=None,
84
+ parameters=None,
85
+ track_models=None,
82
86
  internal_application_port=None,
83
87
  application_ports=None,
84
88
  ):
@@ -120,6 +124,10 @@ class ApplicationSpec(NuclioSpec):
120
124
  security_context=security_context,
121
125
  service_type=service_type,
122
126
  add_templated_ingress_host_mode=add_templated_ingress_host_mode,
127
+ serving_spec=serving_spec,
128
+ graph=graph,
129
+ parameters=parameters,
130
+ track_models=track_models,
123
131
  state_thresholds=state_thresholds,
124
132
  disable_default_http_trigger=disable_default_http_trigger,
125
133
  )
@@ -186,6 +194,13 @@ class ApplicationSpec(NuclioSpec):
186
194
  is_valid_port(port, raise_on_error=True)
187
195
  self._internal_application_port = port
188
196
 
197
+ # If when internal application port is being set, length of self._application_ports is 1,
198
+ # it means that it consist of [old_port] only
199
+ # so in this case, we rewrite the list completely, by setting value to [new_value]
200
+ if len(self.application_ports) == 1:
201
+ self._application_ports = [port]
202
+ return
203
+
189
204
  # when setting new internal application port, ensure that it is included in the application ports
190
205
  # it just triggers setter logic, so setting to the same value is a no-op
191
206
  self.application_ports = self._application_ports
@@ -1,4 +1,4 @@
1
1
  {
2
- "git_commit": "492ba7e7e40ca97c91a65058a403b6582387ea67",
3
- "version": "1.10.0-rc23"
2
+ "git_commit": "cc74f73a862905d1eb2adcbb80c8c7fc72550f00",
3
+ "version": "1.10.0-rc24"
4
4
  }
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: mlrun
3
- Version: 1.10.0rc23
3
+ Version: 1.10.0rc24
4
4
  Summary: Tracking and config of machine learning runs
5
5
  Home-page: https://github.com/mlrun/mlrun
6
6
  Author: Yaron Haviv
@@ -1,6 +1,6 @@
1
1
  mlrun/__init__.py,sha256=JYy9uteFFNPbPoC0geDEPhaLrfiqTijxUhLZSToAky4,8029
2
2
  mlrun/__main__.py,sha256=wQNaxW7QsqFBtWffnPkw-497fnpsrQzUnscBQQAP_UM,48364
3
- mlrun/config.py,sha256=XAAb68MwEHpuPddPMtKBULtFk0hI9YC25DniYQk1DKk,72853
3
+ mlrun/config.py,sha256=AHEC0j8mKywIdKfLRN1AH7_zTsMc_5lgE0PH6rRhJLE,73090
4
4
  mlrun/errors.py,sha256=bAk0t_qmCxQSPNK0TugOAfA5R6f0G6OYvEvXUWSJ_5U,9062
5
5
  mlrun/execution.py,sha256=wkmT1k0QROgGJFMBIsYUsJaqEF2bkqaYVzp_ZQb527Q,58814
6
6
  mlrun/features.py,sha256=jMEXo6NB36A6iaxNEJWzdtYwUmglYD90OIKTIEeWhE8,15841
@@ -110,8 +110,8 @@ mlrun/datastore/vectorstore.py,sha256=k-yom5gfw20hnVG0Rg7aBEehuXwvAloZwn0cx0VGal
110
110
  mlrun/datastore/model_provider/__init__.py,sha256=kXGBqhLN0rlAx0kTXhozGzFsIdSqW0uTSKMmsLgq_is,569
111
111
  mlrun/datastore/model_provider/huggingface_provider.py,sha256=c8t7kZ1ZbjZpbyRmwLNz_eqrfwRXmVs_sf6F1s_H2xg,11594
112
112
  mlrun/datastore/model_provider/mock_model_provider.py,sha256=uIgGP3yZtLDLS-2WMyH20SGfrpodpyxyIw4WYTpHhUg,3059
113
- mlrun/datastore/model_provider/model_provider.py,sha256=3F-iWkxfOI8ypgzJw1I8ZkSXF6xYaqCZf5BMQhG46Fo,11098
114
- mlrun/datastore/model_provider/openai_provider.py,sha256=KgbP8M4VnbWf9Yh5iG2g3qvXEoLmwWyeL1iTWqwFyWI,11406
113
+ mlrun/datastore/model_provider/model_provider.py,sha256=ZGP-bU2qgDy1mUYaes4hjZ3tlyq7MelnAJ4_0aAZJxY,11082
114
+ mlrun/datastore/model_provider/openai_provider.py,sha256=4yyNbcEUNlXCZUN0_Nu4Hup_gHaLhGeCp5CLxuj3hG4,12280
115
115
  mlrun/datastore/wasbfs/__init__.py,sha256=s5Ul-0kAhYqFjKDR2X0O2vDGDbLQQduElb32Ev56Te4,1343
116
116
  mlrun/datastore/wasbfs/fs.py,sha256=ge8NK__5vTcFT-krI155_8RDUywQw4SIRX6BWATXy9Q,6299
117
117
  mlrun/db/__init__.py,sha256=WqJ4x8lqJ7ZoKbhEyFqkYADd9P6E3citckx9e9ZLcIU,1163
@@ -304,7 +304,7 @@ mlrun/runtimes/nuclio/function.py,sha256=8cCcZKWkhvxWp2L5aOoNI6Q2Ya96RFWRswL942L
304
304
  mlrun/runtimes/nuclio/nuclio.py,sha256=sLK8KdGO1LbftlL3HqPZlFOFTAAuxJACZCVl1c0Ha6E,2942
305
305
  mlrun/runtimes/nuclio/serving.py,sha256=OadofTgla-1HoupdEbiOdgNbqE6LmFcCVOaffBjAByI,35383
306
306
  mlrun/runtimes/nuclio/application/__init__.py,sha256=rRs5vasy_G9IyoTpYIjYDafGoL6ifFBKgBtsXn31Atw,614
307
- mlrun/runtimes/nuclio/application/application.py,sha256=5HaB4JEF0PlgP17tyyh-g5X5XfGev4PvEtgVXkScVkg,32080
307
+ mlrun/runtimes/nuclio/application/application.py,sha256=O0UCuvMbwClofQjRdf8TmwGyklOqQaUnL4mVFNV6Ly0,32670
308
308
  mlrun/runtimes/nuclio/application/reverse_proxy.go,sha256=lEHH74vr2PridIHp1Jkc_NjkrWb5b6zawRrNxHQhwGU,2913
309
309
  mlrun/runtimes/sparkjob/__init__.py,sha256=GPP_ekItxiU9Ydn3mJa4Obph02Bg6DO-JYs791_MV58,607
310
310
  mlrun/runtimes/sparkjob/spark3job.py,sha256=3dW7RG2T58F2dsUw0TsRvE3SIFcekx3CerLdcaG1f50,41458
@@ -348,11 +348,11 @@ mlrun/utils/notifications/notification/mail.py,sha256=ZyJ3eqd8simxffQmXzqd3bgbAq
348
348
  mlrun/utils/notifications/notification/slack.py,sha256=kfhogR5keR7Zjh0VCjJNK3NR5_yXT7Cv-x9GdOUW4Z8,7294
349
349
  mlrun/utils/notifications/notification/webhook.py,sha256=zxh8CAlbPnTazsk6r05X5TKwqUZVOH5KBU2fJbzQlG4,5330
350
350
  mlrun/utils/version/__init__.py,sha256=YnzE6tlf24uOQ8y7Z7l96QLAI6-QEii7-77g8ynmzy0,613
351
- mlrun/utils/version/version.json,sha256=2qBVEU7lBKiv9zvHtV0mCeHZbaKZ8YTV9JnkwWpuEZc,90
351
+ mlrun/utils/version/version.json,sha256=TcUaIusw0SFgUssxKNpRpjPbZOkVOIgM4JBuUJFa4hk,90
352
352
  mlrun/utils/version/version.py,sha256=M2hVhRrgkN3SxacZHs3ZqaOsqAA7B6a22ne324IQ1HE,1877
353
- mlrun-1.10.0rc23.dist-info/licenses/LICENSE,sha256=zTiv1CxWNkOk1q8eJS1G_8oD4gWpWLwWxj_Agcsi8Os,11337
354
- mlrun-1.10.0rc23.dist-info/METADATA,sha256=xCwJjSygfymK3oJbuGfETNBukBcLNpKbCKDMSL9UNjg,26272
355
- mlrun-1.10.0rc23.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
356
- mlrun-1.10.0rc23.dist-info/entry_points.txt,sha256=1Owd16eAclD5pfRCoJpYC2ZJSyGNTtUr0nCELMioMmU,46
357
- mlrun-1.10.0rc23.dist-info/top_level.txt,sha256=NObLzw3maSF9wVrgSeYBv-fgnHkAJ1kEkh12DLdd5KM,6
358
- mlrun-1.10.0rc23.dist-info/RECORD,,
353
+ mlrun-1.10.0rc24.dist-info/licenses/LICENSE,sha256=zTiv1CxWNkOk1q8eJS1G_8oD4gWpWLwWxj_Agcsi8Os,11337
354
+ mlrun-1.10.0rc24.dist-info/METADATA,sha256=wDVkx2_4ETx4lXJkWpyBEh_mlS96tAcHAOO3yu0jlJc,26272
355
+ mlrun-1.10.0rc24.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
356
+ mlrun-1.10.0rc24.dist-info/entry_points.txt,sha256=1Owd16eAclD5pfRCoJpYC2ZJSyGNTtUr0nCELMioMmU,46
357
+ mlrun-1.10.0rc24.dist-info/top_level.txt,sha256=NObLzw3maSF9wVrgSeYBv-fgnHkAJ1kEkh12DLdd5KM,6
358
+ mlrun-1.10.0rc24.dist-info/RECORD,,