Skip to content

Commit 3ec41ae

Browse files
committed
Merge branch 'feature/feature-store-1.0.4' of github.com:oracle/accelerated-data-science into ODSC-47451-streaming-dataframe-support
backmerged the code
2 parents 6bbb58a + 1ec5922 commit 3ec41ae

File tree

176 files changed

+3178
-1439
lines changed

Some content is hidden

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

176 files changed

+3178
-1439
lines changed

.github/workflows/add-3plicense-warning.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: "Add 3P License Warning to PR"
33
on:
44
pull_request:
55
paths:
6-
- setup.py
6+
- pyproject.toml
77

88
# Cancel in progress workflows on pull_requests.
99
# https://docs.github.com/en/actions/using-jobs/using-concurrency#example-using-a-fallback-value
@@ -23,9 +23,9 @@ jobs:
2323
steps:
2424
- run: |
2525
BODY_MSG=$(cat << EOF
26-
⚠️ This PR changed **setup.py** file. ⚠️
27-
- PR Creator must update 📃 THIRD_PARTY_LICENSES.txt, if any 📚 library added/removed in **setup.py**.
28-
- PR Approver must confirm 📃 THIRD_PARTY_LICENSES.txt updated, if any 📚 library added/removed in **setup.py**.
26+
⚠️ This PR changed **pyproject.toml** file. ⚠️
27+
- PR Creator must update 📃 THIRD_PARTY_LICENSES.txt, if any 📚 library added/removed in **pyproject.toml**.
28+
- PR Approver must confirm 📃 THIRD_PARTY_LICENSES.txt updated, if any 📚 library added/removed in **pyproject.toml**.
2929
EOF
3030
)
3131
echo "BODY_MSG<<EOF" >> $GITHUB_ENV
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# We are running out space on the disk, solution described here:
2+
# https://github.com/actions/runner-images/issues/2840#issuecomment-790492173
3+
4+
name: "Create more disk space"
5+
description: "Removing some folders to create more disk space"
6+
runs:
7+
using: composite
8+
steps:
9+
- shell: bash
10+
run: |
11+
sudo rm -rf /usr/share/dotnet
12+
sudo rm -rf /opt/ghc
13+
sudo rm -rf "/usr/local/share/boost"
14+
sudo rm -rf "$AGENT_TOOLSDIRECTORY"

.github/workflows/publish-to-pypi.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,15 @@ jobs:
1616
python-version: "3.x"
1717
- name: Build distribution 📦
1818
run: |
19-
pip install wheel
19+
pip install build
2020
make dist
2121
- name: Validate
2222
run: |
2323
pip install dist/*.whl
2424
python -c "import ads;"
25-
## To run publish to test PyPI secret with token needs to be added,
25+
## To run publish to test PyPI a secret with token needs to be added,
2626
## this one GH_ADS_TESTPYPI_TOKEN - removed after initial test.
27-
## Project name also needed to be updated in setup.py - setup(name="test_oracle_ads", ...),
27+
## Project name also needed to be updated in pyproject.toml - name = "test_oracle_ads" in [project] section
2828
## regular name is occupied by former developer and can't be used for testing
2929
# - name: Publish distribution 📦 to Test PyPI
3030
# env:

.github/workflows/run-unittests-default_setup.yml

Lines changed: 9 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,13 @@
1-
name: tests/unitary/default_setup/**
1+
name: "[Py3.8][Py3.9][Py3.10] tests/unitary/default_setup/**"
22

33
on:
44
workflow_dispatch:
55
pull_request:
6-
branches:
7-
- main
8-
- "release/**"
9-
- develop
106
paths:
117
- "ads/**"
12-
- "!ads/ads_version.json"
13-
- setup.py
8+
- pyproject.toml
149
- "**requirements.txt"
15-
- .github/workflows/run-unittests.yml
16-
- .github/workflows/run-unittests-default_setup.yml
10+
- ".github/workflows/run-unittests*.yml"
1711

1812
# Cancel in progress workflows on pull_requests.
1913
# https://docs.github.com/en/actions/using-jobs/using-concurrency#example-using-a-fallback-value
@@ -42,37 +36,16 @@ jobs:
4236
steps:
4337
- uses: actions/checkout@v3
4438

45-
# Caching python libraries installed with pip
46-
# https://github.com/actions/cache/blob/main/examples.md#python---pip
47-
- uses: actions/cache@v3
48-
with:
49-
path: ~/.cache/pip
50-
key: ${{ runner.os }}-pip-${{ hashFiles('**/test-requirements.txt') }}
51-
restore-keys: |
52-
${{ runner.os }}-pip-
5339
- uses: actions/setup-python@v4
5440
with:
5541
python-version: ${{ matrix.python-version }}
42+
cache: "pip"
43+
cache-dependency-path: |
44+
pyproject.toml
45+
"**requirements.txt"
5646
57-
- name: "Test config setup"
58-
shell: bash
59-
env:
60-
HOME_RUNNER_DIR: /home/runner
61-
run: |
62-
set -x # print commands that are executed
63-
mkdir -p "$HOME_RUNNER_DIR"/.oci
64-
openssl genrsa -out $HOME_RUNNER_DIR/.oci/oci_ads_user.pem 2048
65-
cat <<EOT >> "$HOME_RUNNER_DIR/.oci/config"
66-
[DEFAULT]
67-
user=ocid1.user.oc1..xxx
68-
fingerprint=00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00
69-
tenancy=ocid1.tenancy.oc1..xxx
70-
region=test_region
71-
key_file=$HOME_RUNNER_DIR/.oci/oci_ads_user.pem
72-
EOT
73-
ls -lha "$HOME_RUNNER_DIR"/.oci
74-
echo "Test config file:"
75-
cat $HOME_RUNNER_DIR/.oci/config
47+
- uses: ./.github/workflows/set-dummy-conf
48+
name: "Test config setup"
7649

7750
- name: "Run default_setup tests folder ONLY with minimum ADS dependencies"
7851
timeout-minutes: 15

.github/workflows/run-unittests.yml renamed to .github/workflows/run-unittests-py38-cov-report.yml

Lines changed: 31 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,13 @@
1-
name: tests/unitary/**
1+
name: "[Py3.8][COV REPORT] tests/unitary/**"
22

33
on:
44
workflow_dispatch:
55
pull_request:
6-
branches:
7-
- main
8-
- "release/**"
9-
- develop
106
paths:
117
- "ads/**"
12-
- "!ads/ads_version.json"
13-
- setup.py
8+
- pyproject.toml
149
- "**requirements.txt"
15-
- .github/workflows/run-unittests.yml
16-
- .github/workflows/run-unittests-default_setup.yml
10+
- ".github/workflows/run-unittests*.yml"
1711

1812
# Cancel in progress workflows on pull_requests.
1913
# https://docs.github.com/en/actions/using-jobs/using-concurrency#example-using-a-fallback-value
@@ -31,58 +25,37 @@ env:
3125

3226
jobs:
3327
test:
34-
name: python ${{ matrix.python-version }}, ${{ matrix.name }}
28+
name: python 3.8, ${{ matrix.name }}
3529
runs-on: ubuntu-latest
3630
timeout-minutes: 90
3731

3832
strategy:
3933
fail-fast: false
4034
matrix:
41-
python-version: ["3.8", "3.9", "3.10"]
42-
test-path: ["tests/unitary", "tests/unitary/with_extras/model"]
35+
test-path: ["tests/unitary/with_extras tests/unitary/default_setup", "tests/unitary/with_extras/model"]
4336
include:
44-
- test-path: "tests/unitary"
37+
- test-path: "tests/unitary/with_extras tests/unitary/default_setup"
4538
ignore-path: "--ignore tests/unitary/with_extras/model --ignore tests/unitary/with_extras/feature_store"
4639
name: "unitary"
4740
- test-path: "tests/unitary/with_extras/model"
4841
name: "model"
49-
- python-version: "3.8"
50-
cov-reports: --cov=ads --cov-report=xml --cov-report=html
5142

5243
steps:
5344
- uses: actions/checkout@v3
5445

55-
# Caching python libraries installed with pip
56-
# https://github.com/actions/cache/blob/main/examples.md#python---pip
57-
- uses: actions/cache@v3
58-
with:
59-
path: ~/.cache/pip
60-
key: ${{ runner.os }}-pip-${{ hashFiles('**/dev-requirements.txt') }}
61-
restore-keys: |
62-
${{ runner.os }}-pip-
46+
- uses: ./.github/workflows/create-more-space
47+
name: "Create more disk space"
48+
6349
- uses: actions/setup-python@v4
6450
with:
65-
python-version: ${{ matrix.python-version }}
51+
python-version: "3.8"
52+
cache: "pip"
53+
cache-dependency-path: |
54+
pyproject.toml
55+
"**requirements.txt"
6656
67-
- name: "Test config setup"
68-
shell: bash
69-
env:
70-
HOME_RUNNER_DIR: /home/runner
71-
run: |
72-
set -x # print commands that are executed
73-
mkdir -p "$HOME_RUNNER_DIR"/.oci
74-
openssl genrsa -out $HOME_RUNNER_DIR/.oci/oci_ads_user.pem 2048
75-
cat <<EOT >> "$HOME_RUNNER_DIR/.oci/config"
76-
[DEFAULT]
77-
user=ocid1.user.oc1..xxx
78-
fingerprint=00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00
79-
tenancy=ocid1.tenancy.oc1..xxx
80-
region=test_region
81-
key_file=$HOME_RUNNER_DIR/.oci/oci_ads_user.pem
82-
EOT
83-
ls -lha "$HOME_RUNNER_DIR"/.oci
84-
echo "Test config file:"
85-
cat $HOME_RUNNER_DIR/.oci/config
57+
- uses: ./.github/workflows/set-dummy-conf
58+
name: "Test config setup"
8659

8760
- name: "Test env setup"
8861
timeout-minutes: 20
@@ -105,22 +78,19 @@ jobs:
10578
set -x # print commands that are executed
10679
10780
# Setup project and tests folder for cov reports to not be overwritten by another parallel step
108-
if [[ ! -z "${{ matrix.cov-reports }}" ]]; then
109-
mkdir -p cov-${{ matrix.name }}
110-
cd cov-${{ matrix.name }}
111-
ln -s ../tests tests
112-
ln -s ../ads ads
113-
ln -s ../.coveragerc .coveragerc
114-
fi
81+
mkdir -p cov-${{ matrix.name }}
82+
cd cov-${{ matrix.name }}
83+
ln -s ../tests tests
84+
ln -s ../ads ads
85+
ln -s ../.coveragerc .coveragerc
11586
11687
# Run tests
11788
python -m pytest -v -p no:warnings --durations=5 \
118-
-n auto --dist loadfile ${{ matrix.cov-reports }} \
89+
-n auto --dist loadfile --cov=ads --cov-report=xml --cov-report=html \
11990
${{ matrix.test-path }} ${{ matrix.ignore-path }}
12091
12192
- name: "Save coverage files"
12293
uses: actions/upload-artifact@v3
123-
if: ${{ matrix.cov-reports }}
12494
with:
12595
name: cov-reports-${{ matrix.name }}
12696
path: |
@@ -133,7 +103,7 @@ jobs:
133103
runs-on: ubuntu-latest
134104
continue-on-error: true
135105
needs: test
136-
if: ${{ success() }} && ${{ github.event.issue.pull_request }}
106+
if: ${{ success() }} && && github.event_name == 'pull_request'
137107
env:
138108
COMPARE_BRANCH: main
139109

@@ -148,15 +118,15 @@ jobs:
148118
run: |
149119
set -x # print commands that are executed
150120
151-
# Prepare default cov body text
121+
# Prepare default cov body text
152122
COV_BODY_INTRO="📌 Overall coverage:\n\n"
153123
echo COV_BODY="$COV_BODY_INTRO No success to gather report. 😿" >> $GITHUB_ENV
154124
155125
# Prepare file paths to .coverage files
156126
# Filenames taken from job.test last step with name - "Save coverage files"
157-
FILE_UNITARY="cov-reports-unitary/.coverage"; [[ ! -f $FILE_UNITARY ]] && FILE_UNITARY=""
127+
FILE_UNITARY="cov-reports-unitary/.coverage"; [[ ! -f $FILE_UNITARY ]] && FILE_UNITARY=""
158128
FILE_MODEL="cov-reports-model/.coverage"; [[ ! -f $FILE_MODEL ]] && FILE_MODEL=""
159-
129+
160130
# Combine coverage files
161131
pip install coverage
162132
coverage combine $FILE_UNITARY $FILE_MODEL
@@ -166,7 +136,7 @@ jobs:
166136
167137
# Calculate overall coverage and update body message
168138
COV=$(grep -E 'pc_cov' htmlcov/index.html | cut -d'>' -f 2 | cut -d'%' -f 1)
169-
if [[ ! -z $COV ]]; then
139+
if [[ ! -z $COV ]]; then
170140
if [[ $COV -lt 50 ]]; then COLOR=red; elif [[ $COV -lt 80 ]]; then COLOR=yellow; else COLOR=green; fi
171141
echo COV_BODY="$COV_BODY_INTRO ![Coverage-$COV%](https://img.shields.io/badge/coverage-$COV%25-$COLOR)" >> $GITHUB_ENV
172142
fi
@@ -176,23 +146,23 @@ jobs:
176146
run: |
177147
set -x # print commands that are executed
178148
179-
# Prepare default diff body text
149+
# Prepare default diff body text
180150
DIFF_BODY_INTRO="📌 Cov diff with **${{ env.COMPARE_BRANCH }}**:\n\n"
181151
echo DIFF_BODY="$DIFF_BODY_INTRO No success to gather report. 😿" >> $GITHUB_ENV
182152
183153
# Prepare file paths to coverage xml files
184154
# Filenames taken from job.test last step with name - "Save coverage files"
185-
FILE1="cov-reports-unitary/coverage.xml"; [[ ! -f $FILE1 ]] && FILE1=""
155+
FILE1="cov-reports-unitary/coverage.xml"; [[ ! -f $FILE1 ]] && FILE1=""
186156
FILE2="cov-reports-model/coverage.xml"; [[ ! -f $FILE2 ]] && FILE2=""
187157
echo "FILE1=$FILE1" >> $GITHUB_ENV
188158
echo "FILE2=$FILE2" >> $GITHUB_ENV
189159
190160
# Calculate coverage diff and update body message
191161
pip install diff_cover
192-
diff-cover $FILE1 $FILE2 --compare-branch=origin/${{ env.COMPARE_BRANCH }}
162+
diff-cover $FILE1 $FILE2 --compare-branch=origin/${{ env.COMPARE_BRANCH }}
193163
DIFF=$(diff-cover $FILE1 $FILE2 \
194164
--compare-branch=origin/${{ env.COMPARE_BRANCH }} | grep Coverage: | cut -d' ' -f 2 | cut -d'%' -f 1)
195-
if [[ -z $DIFF ]]; then
165+
if [[ -z $DIFF ]]; then
196166
DIFF_INFO=$(diff-cover $FILE1 $FILE2 \
197167
--compare-branch=origin/${{ env.COMPARE_BRANCH }} | grep "No lines");
198168
echo DIFF_BODY="$DIFF_BODY_INTRO $DIFF_INFO">> $GITHUB_ENV
Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
name: "[Py3.9][Py3.10] - tests/unitary/**"
2+
3+
on:
4+
workflow_dispatch:
5+
pull_request:
6+
paths:
7+
- "ads/**"
8+
- pyproject.toml
9+
- "**requirements.txt"
10+
- ".github/workflows/run-unittests*.yml"
11+
12+
# Cancel in progress workflows on pull_requests.
13+
# https://docs.github.com/en/actions/using-jobs/using-concurrency#example-using-a-fallback-value
14+
concurrency:
15+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
16+
cancel-in-progress: true
17+
18+
permissions:
19+
contents: read
20+
pull-requests: write
21+
22+
# hack for https://github.com/actions/cache/issues/810#issuecomment-1222550359
23+
env:
24+
SEGMENT_DOWNLOAD_TIMEOUT_MINS: 5
25+
26+
jobs:
27+
test:
28+
name: python ${{ matrix.python-version }}, ${{ matrix.name }}
29+
runs-on: ubuntu-latest
30+
timeout-minutes: 90
31+
32+
strategy:
33+
fail-fast: false
34+
matrix:
35+
python-version: ["3.9", "3.10"]
36+
test-path: ["tests/unitary/with_extras tests/unitary/default_setup", "tests/unitary/with_extras/model"]
37+
include:
38+
- test-path: "tests/unitary/with_extras tests/unitary/default_setup"
39+
ignore-path: "--ignore tests/unitary/with_extras/model --ignore tests/unitary/with_extras/feature_store"
40+
name: "unitary"
41+
- test-path: "tests/unitary/with_extras/model"
42+
name: "model"
43+
44+
steps:
45+
- uses: actions/checkout@v3
46+
47+
- uses: ./.github/workflows/create-more-space
48+
name: "Create more disk space"
49+
50+
- uses: actions/setup-python@v4
51+
with:
52+
python-version: ${{ matrix.python-version }}
53+
cache: "pip"
54+
cache-dependency-path: |
55+
pyproject.toml
56+
"**requirements.txt"
57+
58+
- uses: ./.github/workflows/set-dummy-conf
59+
name: "Test config setup"
60+
61+
- name: "Test env setup"
62+
timeout-minutes: 20
63+
shell: bash
64+
run: |
65+
set -x # print commands that are executed
66+
67+
sudo apt-get install libkrb5-dev graphviz
68+
$CONDA/bin/conda init
69+
source /home/runner/.bashrc
70+
71+
pip install -r dev-requirements.txt
72+
73+
- name: "Run unitary tests folder with maximum ADS dependencies"
74+
timeout-minutes: 60
75+
shell: bash
76+
env:
77+
CONDA_PREFIX: /usr/share/miniconda
78+
run: |
79+
set -x # print commands that are executed
80+
81+
# Run tests
82+
python -m pytest -v -p no:warnings --durations=5 \
83+
-n auto --dist loadfile \
84+
${{ matrix.test-path }} ${{ matrix.ignore-path }}

0 commit comments

Comments
 (0)