Skip to content

Commit b050ac1

Browse files
committed
Merge branch '2.8.2' of github.com:oracle/accelerated-data-science into ODSC-38627/huggingface_docs
2 parents b458553 + ffc2336 commit b050ac1

File tree

110 files changed

+3739
-957
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

110 files changed

+3739
-957
lines changed

.github/workflows/run-unittests.yml

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
name: Unit Tests
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches:
7+
- main
8+
- 'release/**'
9+
- develop
10+
paths:
11+
- '!docs/**'
12+
13+
pull_request:
14+
15+
# Cancel in progress workflows on pull_requests.
16+
# https://docs.github.com/en/actions/using-jobs/using-concurrency#example-using-a-fallback-value
17+
concurrency:
18+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
19+
cancel-in-progress: true
20+
21+
permissions:
22+
contents: read
23+
24+
jobs:
25+
test:
26+
name: ${{ matrix.tests-type }}, python ${{ matrix.python-version }}
27+
runs-on: ubuntu-latest
28+
timeout-minutes: 45
29+
30+
strategy:
31+
fail-fast: false
32+
matrix:
33+
python-version: ["3.7","3.8","3.9","3.10"]
34+
tests-type: ["DefaultSetup"]
35+
36+
steps:
37+
- uses: actions/checkout@v3
38+
# - uses: actions/cache@v3
39+
# with:
40+
# path: ~/.cache/pip
41+
# key: ${{ runner.os }}-pip-${{ hashFiles('**/test-requirements.txt') }}
42+
# restore-keys: |
43+
# ${{ runner.os }}-pip-
44+
- uses: actions/setup-python@v4
45+
with:
46+
python-version: ${{ matrix.python-version }}
47+
48+
- name: "Setup test env"
49+
run: |
50+
pip install coverage pytest-codecov tox==4.2.8
51+
52+
- name: "Run unit tests"
53+
timeout-minutes: 45
54+
shell: bash
55+
run: |
56+
set -x # print commands that are executed
57+
# coverage erase
58+
# ./scripts/runtox.sh "${{ matrix.python-version }}-${{ matrix.tests-type }}" --cov --cov-report=
59+
# coverage combine .coverage-*
60+
# coverage html -i
61+
62+
# Uploading test artifacts
63+
# https://docs.github.com/en/actions/using-workflows/storing-workflow-data-as-artifacts#uploading-build-and-test-artifacts
64+
# - name: "Upload artifact"
65+
# uses: actions/upload-artifact@v3
66+
# with:
67+
# name: code-coverage-report
68+
# path: htmlcov/
69+
# retention-days: 10

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ This example uses SQL injection safe binding variables.
166166

167167
## Contributing
168168

169-
This project welcomes contributions from the community. Before submitting a pull request, please review our contribution guide [CONTRIBUTING.md](https://github.com/oracle/accelerated-data-science/blob/main/CONTRIBUTING.md).
169+
This project welcomes contributions from the community. Before submitting a pull request, please [review our contribution guide](./CONTRIBUTING.md)
170170

171171
Find Getting Started instructions for developers in [README-development.md](https://github.com/oracle/accelerated-data-science/blob/main/README-development.md)
172172

SECURITY.md

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,10 @@ and privacy of all our users.
66

77
Please do NOT raise a GitHub Issue to report a security vulnerability. If you
88
believe you have found a security vulnerability, please submit a report to
9-
[secalert_us@oracle.com](mailto:secalert_us@oracle.com) preferably with a proof of concept.
10-
Please review some additional information on
11-
[how to report security vulnerabilities to Oracle](https://www.oracle.com/corporate/security-practices/assurance/vulnerability/reporting.html).
9+
[secalert_us@oracle.com][1] preferably with a proof of concept. Please review
10+
some additional information on [how to report security vulnerabilities to Oracle][2].
1211
We encourage people who contact Oracle Security to use email encryption using
13-
[our encryption key](https://www.oracle.com/security-alerts/encryptionkey.html).
12+
[our encryption key][3].
1413

1514
We ask that you do not use other channels or contact the project maintainers
1615
directly.
@@ -22,15 +21,18 @@ security features are welcome on GitHub Issues.
2221

2322
Security updates will be released on a regular cadence. Many of our projects
2423
will typically release security fixes in conjunction with the
25-
[Oracle Critical Patch Update](https://www.oracle.com/security-alerts/encryptionkey.html) program.
26-
Security updates are released on the Tuesday closest to the 17th day of January, April, July and October.
27-
A pre-release announcement will be published on the Thursday preceding each release. Additional
28-
information, including past advisories, is available on our
29-
[security alerts](https://www.oracle.com/security-alerts/) page.
24+
[Oracle Critical Patch Update][3] program. Additional
25+
information, including past advisories, is available on our [security alerts][4]
26+
page.
3027

3128
## Security-related information
3229

3330
We will provide security related information such as a threat model, considerations
3431
for secure use, or any known security issues in our documentation. Please note
3532
that labs and sample code are intended to demonstrate a concept and may not be
3633
sufficiently hardened for production use.
34+
35+
[1]: mailto:secalert_us@oracle.com
36+
[2]: https://www.oracle.com/corporate/security-practices/assurance/vulnerability/reporting.html
37+
[3]: https://www.oracle.com/security-alerts/encryptionkey.html
38+
[4]: https://www.oracle.com/security-alerts/

ads/ads_version.json

Lines changed: 1 addition & 1 deletion
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

Lines changed: 9 additions & 3 deletions
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 6 additions & 5 deletions
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

Lines changed: 9 additions & 3 deletions
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

Lines changed: 7 additions & 1 deletion
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:

build_spec.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Copyright (c) 2023, 2022, Oracle and/or its affiliates.
2+
3+
version: 0.1
4+
component: build
5+
timeoutInSeconds: 1000
6+
shell: bash
7+
8+
steps:
9+
- type: Command
10+
name: "compress the repo"
11+
command: |
12+
tar -cvzf ${OCI_WORKSPACE_DIR}/repo.tgz ./
13+
outputArtifacts:
14+
- name: artifact
15+
type: BINARY
16+
location: ${OCI_WORKSPACE_DIR}/repo.tgz

0 commit comments

Comments
 (0)