Skip to content

Commit

Permalink
Release/2.8.1 (#87)
Browse files Browse the repository at this point in the history
  • Loading branch information
z7ye authored Feb 17, 2023
2 parents f3fe3b1 + d54b350 commit 77577b6
Show file tree
Hide file tree
Showing 7 changed files with 40 additions and 14 deletions.
2 changes: 1 addition & 1 deletion ads/ads_version.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"version": "2.8.0"
"version": "2.8.1"
}
12 changes: 9 additions & 3 deletions ads/catalog/model.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env python
# -*- coding: utf-8; -*-

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

import warnings
Expand Down Expand Up @@ -1559,15 +1559,21 @@ def _wait_for_work_request(
work_request_logs = self.ds_client.list_work_request_logs(
work_request_id
).data
new_work_request_logs = work_request_logs[i:]
if work_request_logs:
new_work_request_logs = work_request_logs[i:]

for wr_item in new_work_request_logs:
progress.update(wr_item.message)
i += 1

if work_request.data.status in STOP_STATE:
if work_request.data.status != WorkRequest.STATUS_SUCCEEDED:
raise Exception(work_request_logs[-1].message)
if work_request_logs:
raise Exception(work_request_logs[-1].message)
else:
raise Exception(
"An error occurred in attempt to perform the operation. Check the service logs to get more details."
)
else:
break
return work_request
2 changes: 1 addition & 1 deletion ads/common/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ def create_signer(
>>> auth = ads.auth.create_signer(config=config) # api_key type of authentication dictionary created based on provided config
>>> singer = oci.auth.signers.get_resource_principals_signer()
>>> auth = ads.auth.create_signer(config={}, singer=signer) # resource principals authentication dictionary created
>>> auth = ads.auth.create_signer(config={}, signer=signer) # resource principals authentication dictionary created
>>> auth = ads.auth.create_signer(auth_type='instance_principal') # instance principals authentication dictionary created
Expand Down
11 changes: 6 additions & 5 deletions ads/model/datascience_model.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env python
# -*- coding: utf-8; -*-

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

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

# Create model provenance
logger.info("Saving model provenance metadata.")
self.dsc_model.create_model_provenance(
self.provenance_metadata._to_oci_metadata()
)
if self.provenance_metadata:
logger.info("Saving model provenance metadata.")
self.dsc_model.create_model_provenance(
self.provenance_metadata._to_oci_metadata()
)

# Upload artifacts
logger.info("Uploading model artifacts.")
Expand Down
12 changes: 9 additions & 3 deletions ads/model/service/oci_datascience_model.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env python
# -*- coding: utf-8; -*-

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

import logging
Expand Down Expand Up @@ -573,14 +573,20 @@ def _wait_for_work_request(self, work_request_id: str, num_steps: int = 3) -> No
work_request_logs = self.client.list_work_request_logs(
work_request_id
).data
new_work_request_logs = work_request_logs[i:]
if work_request_logs:
new_work_request_logs = work_request_logs[i:]

for wr_item in new_work_request_logs:
progress.update(wr_item.message)
i += 1

if work_request.data.status in STOP_STATE:
if work_request.data.status != WorkRequest.STATUS_SUCCEEDED:
raise Exception(work_request_logs[-1].message)
if work_request_logs:
raise Exception(work_request_logs[-1].message)
else:
raise Exception(
"An error occurred in attempt to perform the operation. Check the service logs to get more details."
)
else:
break
8 changes: 7 additions & 1 deletion ads/opctl/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import yaml

from ads.common.auth import AuthType
from ads.common import auth as authutil
from ads.opctl.cmds import cancel as cancel_cmd
from ads.opctl.cmds import configure as configure_cmd
from ads.opctl.cmds import delete as delete_cmd
Expand Down Expand Up @@ -358,7 +359,12 @@ def run(file, **kwargs):
debug = kwargs["debug"]
if file:
if os.path.exists(file):
auth = kwargs["auth"] or authutil.default_signer()
auth = {}
if kwargs["auth"]:
auth = authutil.create_signer(kwargs["auth"])
else:
auth = authutil.default_signer()

with fsspec.open(file, "r", **auth) as f:
config = suppress_traceback(debug)(yaml.safe_load)(f.read())
else:
Expand Down
7 changes: 7 additions & 0 deletions docs/source/release_notes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@
Release Notes
=============

2.8.1
-----
Release date: February 16, 2023

* Fixed a bug for ``ads opctl run`` when ``--auth`` flag is passed and image is built by ADS.
* Fixed a bug in ``GenericModel.save()`` when the work requests are not successfully populated.
* Fixed a bug in ``DataScienceModel.create()`` to when the provenance metadata is not provided.

2.8.0
-----
Expand Down

0 comments on commit 77577b6

Please sign in to comment.