Skip to content

Commit 77577b6

Browse files
authored
Release/2.8.1 (#87)
2 parents f3fe3b1 + d54b350 commit 77577b6

File tree

7 files changed

+40
-14
lines changed

7 files changed

+40
-14
lines changed

ads/ads_version.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
"version": "2.8.0"
2+
"version": "2.8.1"
33
}

ads/catalog/model.py

+9-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env python
22
# -*- coding: utf-8; -*-
33

4-
# Copyright (c) 2020, 2022 Oracle and/or its affiliates.
4+
# Copyright (c) 2020, 2023 Oracle and/or its affiliates.
55
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/
66

77
import warnings
@@ -1559,15 +1559,21 @@ def _wait_for_work_request(
15591559
work_request_logs = self.ds_client.list_work_request_logs(
15601560
work_request_id
15611561
).data
1562-
new_work_request_logs = work_request_logs[i:]
1562+
if work_request_logs:
1563+
new_work_request_logs = work_request_logs[i:]
15631564

15641565
for wr_item in new_work_request_logs:
15651566
progress.update(wr_item.message)
15661567
i += 1
15671568

15681569
if work_request.data.status in STOP_STATE:
15691570
if work_request.data.status != WorkRequest.STATUS_SUCCEEDED:
1570-
raise Exception(work_request_logs[-1].message)
1571+
if work_request_logs:
1572+
raise Exception(work_request_logs[-1].message)
1573+
else:
1574+
raise Exception(
1575+
"An error occurred in attempt to perform the operation. Check the service logs to get more details."
1576+
)
15711577
else:
15721578
break
15731579
return work_request

ads/common/auth.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ def create_signer(
283283
>>> auth = ads.auth.create_signer(config=config) # api_key type of authentication dictionary created based on provided config
284284
285285
>>> singer = oci.auth.signers.get_resource_principals_signer()
286-
>>> auth = ads.auth.create_signer(config={}, singer=signer) # resource principals authentication dictionary created
286+
>>> auth = ads.auth.create_signer(config={}, signer=signer) # resource principals authentication dictionary created
287287
288288
>>> auth = ads.auth.create_signer(auth_type='instance_principal') # instance principals authentication dictionary created
289289

ads/model/datascience_model.py

+6-5
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env python
22
# -*- coding: utf-8; -*-
33

4-
# Copyright (c) 2022 Oracle and/or its affiliates.
4+
# Copyright (c) 2022, 2023 Oracle and/or its affiliates.
55
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/
66

77
import cgi
@@ -590,10 +590,11 @@ def create(self, **kwargs) -> "DataScienceModel":
590590
self.dsc_model = self._to_oci_dsc_model(**kwargs).create()
591591

592592
# Create model provenance
593-
logger.info("Saving model provenance metadata.")
594-
self.dsc_model.create_model_provenance(
595-
self.provenance_metadata._to_oci_metadata()
596-
)
593+
if self.provenance_metadata:
594+
logger.info("Saving model provenance metadata.")
595+
self.dsc_model.create_model_provenance(
596+
self.provenance_metadata._to_oci_metadata()
597+
)
597598

598599
# Upload artifacts
599600
logger.info("Uploading model artifacts.")

ads/model/service/oci_datascience_model.py

+9-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env python
22
# -*- coding: utf-8; -*-
33

4-
# Copyright (c) 2022 Oracle and/or its affiliates.
4+
# Copyright (c) 2022, 2023 Oracle and/or its affiliates.
55
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/
66

77
import logging
@@ -573,14 +573,20 @@ def _wait_for_work_request(self, work_request_id: str, num_steps: int = 3) -> No
573573
work_request_logs = self.client.list_work_request_logs(
574574
work_request_id
575575
).data
576-
new_work_request_logs = work_request_logs[i:]
576+
if work_request_logs:
577+
new_work_request_logs = work_request_logs[i:]
577578

578579
for wr_item in new_work_request_logs:
579580
progress.update(wr_item.message)
580581
i += 1
581582

582583
if work_request.data.status in STOP_STATE:
583584
if work_request.data.status != WorkRequest.STATUS_SUCCEEDED:
584-
raise Exception(work_request_logs[-1].message)
585+
if work_request_logs:
586+
raise Exception(work_request_logs[-1].message)
587+
else:
588+
raise Exception(
589+
"An error occurred in attempt to perform the operation. Check the service logs to get more details."
590+
)
585591
else:
586592
break

ads/opctl/cli.py

+7-1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
import yaml
1313

1414
from ads.common.auth import AuthType
15+
from ads.common import auth as authutil
1516
from ads.opctl.cmds import cancel as cancel_cmd
1617
from ads.opctl.cmds import configure as configure_cmd
1718
from ads.opctl.cmds import delete as delete_cmd
@@ -358,7 +359,12 @@ def run(file, **kwargs):
358359
debug = kwargs["debug"]
359360
if file:
360361
if os.path.exists(file):
361-
auth = kwargs["auth"] or authutil.default_signer()
362+
auth = {}
363+
if kwargs["auth"]:
364+
auth = authutil.create_signer(kwargs["auth"])
365+
else:
366+
auth = authutil.default_signer()
367+
362368
with fsspec.open(file, "r", **auth) as f:
363369
config = suppress_traceback(debug)(yaml.safe_load)(f.read())
364370
else:

docs/source/release_notes.rst

+7
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@
22
Release Notes
33
=============
44

5+
2.8.1
6+
-----
7+
Release date: February 16, 2023
8+
9+
* Fixed a bug for ``ads opctl run`` when ``--auth`` flag is passed and image is built by ADS.
10+
* Fixed a bug in ``GenericModel.save()`` when the work requests are not successfully populated.
11+
* Fixed a bug in ``DataScienceModel.create()`` to when the provenance metadata is not provided.
512

613
2.8.0
714
-----

0 commit comments

Comments
 (0)