Skip to content

Commit 5943433

Browse files
authored
Task/dss 13.0.0 publish on pypi (#295)
* Sync sources * Release metadata * Fix release date
1 parent c9f340b commit 5943433

16 files changed

+662
-28
lines changed

Diff for: HISTORY.txt

+6
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@ Changelog
22
==========
33

44

5+
6+
13.0.0 (2024-06-26)
7+
---------------------
8+
9+
* Initial release for DSS 13.0.0
10+
511
12.6.4 (2024-06-12)
612
---------------------
713

Diff for: dataikuapi/apinode_admin_client.py

+16
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import json
2+
13
from .apinode_admin.service import APINodeService
24
from .apinode_admin.auth import APINodeAuth
35
from .utils import DataikuException
@@ -102,3 +104,17 @@ def clear_model_cache(self):
102104
Clear the model cache
103105
"""
104106
self._perform_empty("DELETE", "model-cache")
107+
108+
def clean_unused_services_and_generations(self):
109+
"""
110+
Deletes disabled services, unused generations and unused code environments
111+
"""
112+
resp = self._perform_json("DELETE", "services-clean-unused")
113+
print(json.dumps(resp, indent=4))
114+
115+
def clean_code_env_cache(self):
116+
"""
117+
Deletes unused code envs from cache
118+
"""
119+
resp = self._perform_json("DELETE", "cached-code-envs")
120+
print(json.dumps(resp, indent=4))

Diff for: dataikuapi/dss/apideployer.py

+52-1
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ def create_infra(self, infra_id, stage, type, govern_check_policy="NO_CHECK"):
9090
9191
:param str infra_id: Unique Identifier of the infra to create
9292
:param str stage: Infrastructure stage. Stages are configurable on each API Deployer
93-
:param str type: STATIC, K8S, AZURE_ML, SAGEMAKER or VERTEX_AI
93+
:param str type: STATIC, K8S, AZURE_ML, SAGEMAKER, SNOWPARK or VERTEX_AI
9494
:param str govern_check_policy: PREVENT, WARN, or NO_CHECK depending if the deployer will check whether the saved model versions deployed on this infrastructure has to be managed and approved in Dataiku Govern
9595
:rtype: :class:`DSSAPIDeployerInfra`
9696
"""
@@ -150,6 +150,9 @@ def get_service(self, service_id):
150150
"""
151151
return DSSAPIDeployerService(self.client, service_id)
152152

153+
154+
155+
153156
###############################################
154157
# Infrastructures
155158
###############################################
@@ -397,6 +400,54 @@ def get_open_api(self):
397400
return DSSAPIDeployerDeploymentOpenApi(open_api)
398401

399402

403+
def run_test_queries(self, endpoint_id=None, test_queries=None):
404+
"""
405+
Runs test queries on a deployment and returns results as a dict
406+
407+
:param str endpoint_id: Mandatory if the deployment has multiple endpoints
408+
:param list test_queries: Queries as str, formatted as [{"q": {"features": {"feat_1": "value", ...}}, {...}, ... ].
409+
If left to None, the test queries of the current version of the service will be used.
410+
:rtype: dict
411+
412+
Usage example
413+
414+
.. code-block:: python
415+
416+
import dataiku
417+
418+
client = dataiku.api_client()
419+
deployer = client.get_apideployer()
420+
deployment = deployer.get_deployment('service14');
421+
422+
test_queries = [{'q': {'features': {
423+
'Pclass': '200',
424+
'Sex': 'male',
425+
'Age': '22',
426+
'Embarked': 'S'
427+
}}}]
428+
429+
# run existing test queries on deployement endpoint (if unique, else error)
430+
test_queries_result = deployment.run_test_queries()
431+
432+
# run specified test queries on deployement "survived" endpoint
433+
test_queries_result = deployment.run_test_queries(endpoint_id="survived", test_queries=test_queries)
434+
435+
# run existing test queries on deployement "survived" endpoint
436+
test_queries_result = deployment.run_test_queries(endpoint_id="survived")
437+
438+
# run specified test queries on deployement endpoint (if unique, else error)
439+
test_queries_result = deployment.run_test_queries(test_queries=test_queries)
440+
441+
"""
442+
settings = {}
443+
if endpoint_id is not None:
444+
settings["endpointIdParam"] = endpoint_id
445+
if test_queries is not None:
446+
settings["testQueriesParam"] = json.dumps(test_queries)
447+
448+
return self.client._perform_json("POST", "/api-deployer/deployments/%s/actions/run-test-queries" % self.deployment_id, params=settings)
449+
450+
400451
class DSSAPIDeployerDeploymentSettings(object):
401452
"""
402453
The settings of an API Deployer deployment.

Diff for: dataikuapi/dss/langchain/__init__.py

Whitespace-only changes.

0 commit comments

Comments
 (0)