Skip to content

Commit d625b30

Browse files
committed
Merge branch 'main' of https://github.com/oracle/oci-mlflow into bump_version_to_1_0_1
2 parents f5f74b6 + 2fa3c29 commit d625b30

Some content is hidden

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

45 files changed

+1686
-91
lines changed

.coveragerc

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
[run]
2+
omit =
3+
**/*.jinja2
4+
**/__init__.py
5+
container-image/*
6+
docs/*
7+
tests/*
8+
9+
[report]
10+
exclude_lines =
11+
pragma: no cover
12+
def __repr__
13+
if __name__ == .__main__.:
14+
@(abc\.)?abstractmethod
15+
raise AssertionError
16+
raise NotImplementedError
17+
omit =
18+
**/*.jinja2
19+
**/__init__.py
20+
container-image/*
21+
docs/*
22+
tests/*
23+
show_missing = true
24+
skip_empty = true
25+
precision = 2
26+
27+
[html]
28+
directory = htmlcov
Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
name: Bug Report
2+
description: Bug observed in oci-mlflow library
3+
title: "[Bug]: "
4+
labels: [Bug, Backlog]
5+
6+
body:
7+
- type: markdown
8+
attributes:
9+
value: |
10+
If you think you've found a security vulnerability, don't raise a GitHub issue and follow the instructions
11+
in our [security policy](https://github.com/oracle/oci-mlflow/security/policy).
12+
13+
---
14+
15+
Thank you for taking the time to file a bug report.
16+
- type: checkboxes
17+
id: checks
18+
attributes:
19+
label: oci-mlflow version used
20+
options:
21+
- label: >
22+
I have checked that this issue has not already been reported.
23+
required: true
24+
- label: >
25+
I have confirmed this bug exists on the
26+
[latest version](https://github.com/oracle/oci-mlflow/releases) of oci-mlflow.
27+
- label: >
28+
I have confirmed this bug exists on the main branch of oci-mlflow.
29+
- label: >
30+
I agree to follow the [Code of Conduct](https://github.com/oracle/.github/blob/main/CODE_OF_CONDUCT.md).
31+
required: true
32+
- type: textarea
33+
id: description
34+
attributes:
35+
label: Description
36+
description: >
37+
Please provide a brief description of the problem, describe setup used as that may be the key to the issue.
38+
validations:
39+
required: true
40+
- type: textarea
41+
id: how-to-reproduce
42+
attributes:
43+
label: How to Reproduce
44+
description: >
45+
Please provide a copy-pastable short code example.
46+
If possible provide an ordered list of steps on how to reproduce the problem.
47+
placeholder: >
48+
mlflow deployments help -t oci-datascience
49+
50+
...
51+
render: python
52+
validations:
53+
required: true
54+
- type: textarea
55+
id: what-was-observed
56+
attributes:
57+
label: What was Observed
58+
description: >
59+
Please provide snippets of output or describe wrong behavior.
60+
validations:
61+
required: true
62+
- type: textarea
63+
id: what-was-expected
64+
attributes:
65+
label: What was Expected
66+
description: >
67+
Please describe what should have happened and how it is different from what was observed.
68+
validations:
69+
required: true
70+
- type: textarea
71+
id: version
72+
attributes:
73+
label: Version
74+
description: >
75+
Please paste the output of ``pip freeze | grep oci-mlflow``
76+
value: >
77+
<details>
78+
79+
Paste here the output of ``pip freeze | grep oci-mlflow``
80+
81+
</details>
82+
validations:
83+
required: true

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
blank_issues_enabled: false
2+
contact_links:
3+
- name: Check the docs
4+
url: https://oci-mlflow.readthedocs.io
5+
about: If you need help with your first steps with oci-mlflow please check the docs.
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: Feature Request
2+
description: Feature and enhancement proposals in oci-mlflow library
3+
title: "[FR]: "
4+
labels: [Task, Backlog]
5+
6+
body:
7+
- type: markdown
8+
attributes:
9+
value: |
10+
Before proceeding, please review the [Contributing to this repository](https://github.com/oracle/oci-mlflow/blob/main/CONTRIBUTING.md) and the [Code of Conduct](https://github.com/oracle/.github/blob/main/CODE_OF_CONDUCT.md).
11+
12+
---
13+
14+
Thank you for submitting a feature request.
15+
- type: dropdown
16+
id: contribution
17+
attributes:
18+
label: Willingness to contribute
19+
description: Would you or another member of your organization be willing to contribute an implementation of this feature?
20+
options:
21+
- Yes. I can contribute this feature independently.
22+
- Yes. I would be willing to contribute this feature with guidance from the oci-mlflow team.
23+
- No. I cannot contribute this feature at this time.
24+
validations:
25+
required: true
26+
- type: textarea
27+
attributes:
28+
label: Proposal Summary
29+
description: |
30+
In a few sentences, provide a clear, high-level description of the feature request
31+
validations:
32+
required: true
33+
- type: textarea
34+
attributes:
35+
label: Motivation
36+
description: |
37+
- What is the use case for this feature?
38+
- Why is this use case valuable to support for OCI DataScience users in general?
39+
- Why is this use case valuable to support for your project(s) or organization?
40+
- Why is it currently difficult to achieve this use case?
41+
value: |
42+
> #### What is the use case for this feature?
43+
44+
> #### Why is this use case valuable to support for OCI DataScience users in general?
45+
46+
> #### Why is this use case valuable to support for your project(s) or organization?
47+
48+
> #### Why is it currently difficult to achieve this use case?
49+
validations:
50+
required: true
51+
- type: textarea
52+
attributes:
53+
label: Details
54+
description: |
55+
Use this section to include any additional information about the feature. If you have a proposal for how to implement this feature, please include it here. For implementation guidelines, please refer to the [Contributing to this repository](https://github.com/oracle/oci-mlflow/blob/main/CONTRIBUTING.md).
56+
validations:
57+
required: false
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: "Publish Docs"
2+
3+
on:
4+
# Auto-trigger this workflow on tag creation
5+
push:
6+
tags:
7+
- 'v*.*.*'
8+
9+
env:
10+
RTDS_MLFLOW_PROJECT: https://readthedocs.org/api/v3/projects/accelerated-data-science
11+
RTDS_MLFLOW_TOKEN: ${{ secrets.RTDS_MLFLOW_TOKEN }}
12+
13+
jobs:
14+
build-n-publish:
15+
name: Build and publish Docs 📖 to Readthedocs
16+
runs-on: ubuntu-latest
17+
18+
steps:
19+
- name: When tag 🏷️ pushed - Trigger Readthedocs build
20+
if: github.event_name == 'push' && startsWith(github.ref_name, 'v')
21+
run: |
22+
# trigger build/publish of latest version
23+
curl \
24+
-X POST \
25+
-H "Authorization: Token $RTDS_MLFLOW_TOKEN" $RTDS_MLFLOW_PROJECT/versions/latest/builds/
26+
# add 15 minutes wait time for readthedocs see freshly created tag
27+
sleep 15m
28+
# trigger build/publish of v*.*.* version
29+
curl \
30+
-X POST \
31+
-H "Authorization: Token $RTDS_MLFLOW_TOKEN" $RTDS_MLFLOW_PROJECT/versions/${{ github.ref_name }}/builds/

.github/workflows/run-tests.yml

Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
name: Run Tests
2+
3+
on:
4+
pull_request:
5+
paths:
6+
- "container-image/**"
7+
- "oci_mlflow/**"
8+
- "tests/**"
9+
- "**requirements.txt"
10+
- setup.py
11+
# To run this workflow manually from the Actions tab
12+
workflow_dispatch:
13+
14+
# Cancel in progress workflows on pull_requests.
15+
# https://docs.github.com/en/actions/using-jobs/using-concurrency#example-using-a-fallback-value
16+
concurrency:
17+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
18+
cancel-in-progress: true
19+
20+
permissions:
21+
contents: read
22+
pull-requests: write
23+
24+
# hack for https://github.com/actions/cache/issues/810#issuecomment-1222550359
25+
env:
26+
SEGMENT_DOWNLOAD_TIMEOUT_MINS: 5
27+
28+
jobs:
29+
test:
30+
name: python ${{ matrix.python-version }}
31+
runs-on: ubuntu-latest
32+
timeout-minutes: 20
33+
34+
strategy:
35+
fail-fast: false
36+
matrix:
37+
python-version: ["3.8", "3.9", "3.10"]
38+
include:
39+
- python-version: "3.9"
40+
cov-reports: --cov=oci_mlflow --cov-report=xml --cov-report=html
41+
42+
steps:
43+
- uses: actions/checkout@v3
44+
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-
53+
- uses: actions/setup-python@v4
54+
with:
55+
python-version: ${{ matrix.python-version }}
56+
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_mlflow_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_mlflow_user.pem
72+
EOT
73+
ls -lha "$HOME_RUNNER_DIR"/.oci
74+
echo "Test config file:"
75+
cat $HOME_RUNNER_DIR/.oci/config
76+
77+
- name: "Run tests"
78+
timeout-minutes: 5
79+
shell: bash
80+
run: |
81+
set -x # print commands that are executed
82+
$CONDA/bin/conda init
83+
source /home/runner/.bashrc
84+
pip install -r test-requirements.txt
85+
python -m pytest ${{ matrix.cov-reports }} tests
86+
87+
- name: "Calculate coverage"
88+
if: ${{ success() }} && ${{ github.event.issue.pull_request }}
89+
run: |
90+
set -x # print commands that are executed
91+
92+
# Prepare default cov body text
93+
COV_BODY_INTRO="📌 Overall coverage:\n\n"
94+
echo COV_BODY="$COV_BODY_INTRO No success to gather report. 😿" >> $GITHUB_ENV
95+
96+
# Calculate overall coverage and update body message
97+
COV=$(grep -E 'pc_cov' htmlcov/index.html | cut -d'>' -f 2 | cut -d'%' -f 1)
98+
if [[ ! -z $COV ]]; then
99+
ROUNDED_COV=$(echo $COV | cut -d'.' -f 1)
100+
if [[ $ROUNDED_COV -lt 50 ]]; then COLOR=red; elif [[ $ROUNDED_COV -lt 80 ]]; then COLOR=yellow; else COLOR=green; fi
101+
echo COV_BODY="$COV_BODY_INTRO ![Coverage-$COV%](https://img.shields.io/badge/coverage-$COV%25-$COLOR)" >> $GITHUB_ENV
102+
fi
103+
104+
- name: "Add comment with coverage info to PR"
105+
uses: actions/github-script@v6
106+
if: ${{ success() }} && ${{ github.event.issue.pull_request }}
107+
with:
108+
github-token: ${{ github.token }}
109+
script: |
110+
github.rest.issues.createComment({
111+
issue_number: context.issue.number,
112+
owner: context.repo.owner,
113+
repo: context.repo.repo,
114+
body: '${{ env.COV_BODY }}'
115+
})
116+
117+
- name: "Save coverage files"
118+
uses: actions/upload-artifact@v3
119+
if: ${{ matrix.cov-reports }}
120+
with:
121+
name: cov-reports
122+
path: |
123+
htmlcov/
124+
.coverage
125+
coverage.xml

.readthedocs.yaml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Read the Docs configuration file
2+
3+
# Required
4+
version: 2
5+
6+
# Set the version of Python and other tools you might need
7+
build:
8+
os: ubuntu-22.04
9+
tools:
10+
python: "3.9"
11+
12+
# Build documentation in the docs/ directory with Sphinx
13+
sphinx:
14+
configuration: docs/source/conf.py
15+
16+
# Optionally declare the Python requirements required to build your docs
17+
python:
18+
install:
19+
- requirements: docs/requirements.txt

Makefile

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,24 +8,23 @@ CONTAINERDIR:=container-image
88
RND:=1
99

1010
clean:
11-
@rm -rf dist build oci_mlflow.egg-info
11+
@rm -rf dist build oci_mlflow.egg-info $(CONTAINERDIR)/run/*.whl
1212
@find ./ -name '*.pyc' -exec rm -f {} \;
1313
@find ./ -name 'Thumbs.db' -exec rm -f {} \;
1414
@find ./ -name '*~' -exec rm -f {} \;
1515

1616
dist: clean
1717
@python setup.py bdist_wheel
1818

19-
wheel: dist tmp-copy-whl
20-
2119
build-image:
2220
docker build --network host --build-arg RND=$(RND) -t $(IMAGE_NAME):$(TAG) -f container-image/Dockerfile .
21+
$(MAKE) clean
2322

2423
launch: build-image
2524
@docker run --rm -it --net host -v ~/.oci:/root/.oci --env-file .env --name oci-mlflow $(IMAGE_NAME):$(TAG)
2625

27-
launch-shell:
26+
launch-shell: build-image
2827
@docker run --rm -it --net host -v ~/.oci:/root/.oci --env-file .env --entrypoint bash --name oci-mlflow-shell $(IMAGE_NAME):$(TAG)
2928

30-
launch-shell-remote:
31-
@docker run --rm -it --net host --env-file .env --entrypoint bash --name oci-mlflow-shell $(IMAGE_NAME):$(TAG)
29+
wheel: dist
30+
@cp dist/*.whl container-image/run/

0 commit comments

Comments
 (0)