Skip to content

Commit ffceb0e

Browse files
authored
Merge branch 'main' into spavlusieva-patch-1
2 parents 129e853 + d2280e3 commit ffceb0e

File tree

187 files changed

+13636
-1548
lines changed

Some content is hidden

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

187 files changed

+13636
-1548
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: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -23,95 +23,95 @@ You have various options when installing ADS.
2323
### Installing the oracle-ads base package
2424

2525
```bash
26-
$ python3 -m pip install oracle-ads
26+
python3 -m pip install oracle-ads
2727
```
2828

2929
### Installing extras libraries
3030

31-
The `all-optional` module will install all optional dependencies.
31+
The `all-optional` module will install all optional dependencies. Note the single quotes around installation of extra libraries.
3232

3333
```bash
34-
$ python3 -m pip install oracle-ads[all-optional]
34+
python3 -m pip install 'oracle-ads[all-optional]'
3535
```
3636

3737
To work with gradient boosting models, install the `boosted` module. This module includes XGBoost and LightGBM model classes.
3838

3939
```bash
40-
$ python3 -m pip install oracle-ads[boosted]
40+
python3 -m pip install 'oracle-ads[boosted]'
4141
```
4242

4343
For big data use cases using Oracle Big Data Service (BDS), install the `bds` module. It includes the following libraries, `ibis-framework[impala]`, `hdfs[kerberos]` and `sqlalchemy`.
4444

4545
```bash
46-
$ python3 -m pip install oracle-ads[bds]
46+
python3 -m pip install 'oracle-ads[bds]'
4747
```
4848

4949
To work with a broad set of data formats (for example, Excel, Avro, etc.) install the `data` module. It includes the `fastavro`, `openpyxl`, `pandavro`, `asteval`, `datefinder`, `htmllistparse`, and `sqlalchemy` libraries.
5050

5151
```bash
52-
$ python3 -m pip install oracle-ads[data]
52+
python3 -m pip install 'oracle-ads[data]'
5353
```
5454

5555
To work with geospatial data install the `geo` module. It includes the `geopandas` and libraries from the `viz` module.
5656

5757
```bash
58-
$ python3 -m pip install oracle-ads[geo]
58+
python3 -m pip install 'oracle-ads[geo]'
5959
```
6060

6161
Install the `notebook` module to use ADS within a OCI Data Science service [notebook session](https://docs.oracle.com/en-us/iaas/data-science/using/manage-notebook-sessions.htm). This module installs `ipywidgets` and `ipython` libraries.
6262

6363
```bash
64-
$ python3 -m pip install oracle-ads[notebook]
64+
python3 -m pip install 'oracle-ads[notebook]'
6565
```
6666

6767
To work with ONNX-compatible run times and libraries designed to maximize performance and model portability, install the `onnx` module. It includes the following libraries, `onnx`, `onnxruntime`, `onnxmltools`, `skl2onnx`, `xgboost`, `lightgbm` and libraries from the `viz` module.
6868

6969
```bash
70-
$ python3 -m pip install oracle-ads[onnx]
70+
python3 -m pip install 'oracle-ads[onnx]'
7171
```
7272

7373
For infrastructure tasks, install the `opctl` module. It includes the following libraries, `oci-cli`, `docker`, `conda-pack`, `nbconvert`, `nbformat`, and `inflection`.
7474

7575
```bash
76-
$ python3 -m pip install oracle-ads[opctl]
76+
python3 -m pip install 'oracle-ads[opctl]'
7777
```
7878

7979
For hyperparameter optimization tasks install the `optuna` module. It includes the `optuna` and libraries from the `viz` module.
8080

8181
```bash
82-
$ python3 -m pip install oracle-ads[optuna]
82+
python3 -m pip install 'oracle-ads[optuna]'
8383
```
8484

8585
Install the `tensorflow` module to include `tensorflow` and libraries from the `viz` module.
8686

8787
```bash
88-
$ python3 -m pip install oracle-ads[tensorflow]
88+
python3 -m pip install 'oracle-ads[tensorflow]'
8989
```
9090

9191
For text related tasks, install the `text` module. This will include the `wordcloud`, `spacy` libraries.
9292

9393
```bash
94-
$ python3 -m pip install oracle-ads[text]
94+
python3 -m pip install 'oracle-ads[text]'
9595
```
9696

9797
Install the `torch` module to include `pytorch` and libraries from the `viz` module.
9898

9999
```bash
100-
$ python3 -m pip install oracle-ads[torch]
100+
python3 -m pip install 'oracle-ads[torch]'
101101
```
102102

103103
Install the `viz` module to include libraries for visualization tasks. Some of the key packages are `bokeh`, `folium`, `seaborn` and related packages.
104104

105105
```bash
106-
$ python3 -m pip install oracle-ads[viz]
106+
python3 -m pip install 'oracle-ads[viz]'
107107
```
108108

109109
**Note**
110110

111111
Multiple extra dependencies can be installed together. For example:
112112

113113
```bash
114-
$ python3 -m pip install oracle-ads[notebook,viz,text]
114+
python3 -m pip install 'oracle-ads[notebook,viz,text]'
115115
```
116116

117117
## Documentation
@@ -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.7.2"
2+
"version": "2.8.1"
33
}

ads/catalog/model.py

Lines changed: 23 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
@@ -51,6 +51,7 @@
5151
)
5252
from ads.dataset.progress import DummyProgressBar, TqdmProgressBar
5353
from ads.feature_engineering.schema import Schema
54+
from ads.model.model_version_set import ModelVersionSet, _extract_model_version_set_id
5455
from ads.model.deployment.model_deployer import ModelDeployer
5556
from oci.data_science.data_science_client import DataScienceClient
5657
from oci.data_science.models import (
@@ -72,6 +73,8 @@
7273
"description",
7374
"freeform_tags",
7475
"defined_tags",
76+
"model_version_set_id",
77+
"version_label",
7578
]
7679
_MODEL_PROVENANCE_ATTRIBUTES = ModelProvenance().swagger_types.keys()
7780
_ETAG_KEY = "ETag"
@@ -1284,6 +1287,8 @@ def upload_model(
12841287
bucket_uri: Optional[str] = None,
12851288
remove_existing_artifact: Optional[bool] = True,
12861289
overwrite_existing_artifact: Optional[bool] = True,
1290+
model_version_set: Optional[Union[str, ModelVersionSet]] = None,
1291+
version_label: Optional[str] = None,
12871292
):
12881293
"""
12891294
Uploads the model artifact to cloud storage.
@@ -1315,6 +1320,10 @@ def upload_model(
13151320
Whether artifacts uploaded to object storage bucket need to be removed or not.
13161321
overwrite_existing_artifact: (bool, optional). Defaults to `True`.
13171322
Overwrite target bucket artifact if exists.
1323+
model_version_set: (Union[str, ModelVersionSet], optional). Defaults to None.
1324+
The Model version set OCID, or name, or `ModelVersionSet` instance.
1325+
version_label: (str, optional). Defaults to None.
1326+
The model version label.
13181327
13191328
Returns
13201329
-------
@@ -1340,6 +1349,9 @@ def upload_model(
13401349
)
13411350
copy_artifact_to_os = True
13421351

1352+
# extract model_version_set_id from model_version_set attribute or environment
1353+
# variables in case of saving model in context of model version set.
1354+
model_version_set_id = _extract_model_version_set_id(model_version_set)
13431355
# Set default display_name if not specified - randomly generated easy to remember name generated
13441356
display_name = display_name or utils.get_random_name_for_resource()
13451357

@@ -1373,6 +1385,8 @@ def upload_model(
13731385
else '{"schema": []}',
13741386
freeform_tags=freeform_tags,
13751387
defined_tags=defined_tags,
1388+
model_version_set_id=model_version_set_id,
1389+
version_label=version_label,
13761390
)
13771391
model = self.ds_client.create_model(create_model_details)
13781392

@@ -1545,15 +1559,21 @@ def _wait_for_work_request(
15451559
work_request_logs = self.ds_client.list_work_request_logs(
15461560
work_request_id
15471561
).data
1548-
new_work_request_logs = work_request_logs[i:]
1562+
if work_request_logs:
1563+
new_work_request_logs = work_request_logs[i:]
15491564

15501565
for wr_item in new_work_request_logs:
15511566
progress.update(wr_item.message)
15521567
i += 1
15531568

15541569
if work_request.data.status in STOP_STATE:
15551570
if work_request.data.status != WorkRequest.STATUS_SUCCEEDED:
1556-
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+
)
15571577
else:
15581578
break
15591579
return work_request

ads/catalog/summary.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,10 @@ def __init__(self, entity_list, datetime_format=utils.date_format):
6868
self.df["compartment_id"] = "..." + self.df["compartment_id"].str[-6:]
6969
if "project_id" in ordered_columns:
7070
self.df["project_id"] = "..." + self.df["project_id"].str[-6:]
71+
if "model_version_set_id" in ordered_columns:
72+
self.df["model_version_set_id"] = (
73+
"..." + self.df["model_version_set_id"].str[-6:]
74+
)
7175
self.df["time_created"] = pd.to_datetime(
7276
self.df["time_created"]
7377
).dt.strftime(datetime_format)

ads/cli.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,16 @@
77
import click
88
import ads.opctl.cli
99
import ads.jobs.cli
10+
import ads.pipeline.cli
1011
import os
1112
import json
1213
except:
1314
print(
1415
"Please run `pip install oracle-ads[opctl]` to install the required dependencies for ADS CLI"
1516
)
1617
exit()
18+
19+
1720
with open(
1821
os.path.join(os.path.dirname(os.path.abspath(__file__)), "ads_version.json")
1922
) as version_file:
@@ -29,6 +32,7 @@ def cli():
2932

3033
cli.add_command(ads.opctl.cli.commands)
3134
cli.add_command(ads.jobs.cli.commands)
35+
cli.add_command(ads.pipeline.cli.commands)
3236

3337

3438
if __name__ == "__main__":

0 commit comments

Comments
 (0)