Skip to content

Release/2.8.1 #87

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Feb 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading