Skip to content

Commit 3b6df22

Browse files
authored
Merge branch 'main' into feature/ODSC-68351
2 parents 4ae443b + 324e682 commit 3b6df22

37 files changed

+2262
-362
lines changed

.github/workflows/run-forecast-unit-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,6 @@ jobs:
5656
$CONDA/bin/conda init
5757
source /home/runner/.bashrc
5858
pip install -r test-requirements-operators.txt
59-
pip install "oracle-automlx[forecasting]>=24.4.1"
59+
pip install "oracle-automlx[forecasting]>=25.1.1"
6060
pip install pandas>=2.2.0
6161
python -m pytest -v -p no:warnings --durations=5 tests/operators/forecast

.github/workflows/run-unittests-py39-py310.yml renamed to .github/workflows/run-unittests-py310-py311.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: "[Py3.9-3.11] - All Unit Tests"
1+
name: "[Py3.10-3.11] - All Unit Tests"
22

33
on:
44
workflow_dispatch:
@@ -33,15 +33,14 @@ jobs:
3333
strategy:
3434
fail-fast: false
3535
matrix:
36-
python-version: ["3.9", "3.10", "3.11"]
36+
python-version: ["3.10", "3.11"]
3737
name: ["unitary", "slow_tests"]
3838
include:
3939
- name: "unitary"
4040
test-path: "tests/unitary"
4141
# `model` tests running in "slow_tests",
4242
# `feature_store` tests has its own test suite
43-
# `forecast` tests not supported in python 3.9,3.10 (automlx dependency). Tests are running in python3.8 test env, see run-unittests-py38-cov-report.yml
44-
# 'pii' tests run only with py3.8, 'datapane' library conflicts with pandas>2.2.0, which used in py3.9/3.10 setup
43+
# `forecast` tests not run in this suite
4544
# 'hpo' tests hangs if run together with all unitary tests. Tests running in separate command before running all unitary
4645
ignore-path: |
4746
--ignore tests/unitary/with_extras/model \

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: "[Py3.8][COV REPORT] - All Unit Tests"
1+
name: "[Py3.9][COV REPORT] - All Unit Tests"
22

33
on:
44
workflow_dispatch:
@@ -26,7 +26,7 @@ env:
2626

2727
jobs:
2828
test:
29-
name: python 3.8, ${{ matrix.name }}
29+
name: python 3.9, ${{ matrix.name }}
3030
runs-on: ubuntu-latest
3131
timeout-minutes: 90
3232

@@ -58,7 +58,7 @@ jobs:
5858

5959
- uses: actions/setup-python@v5
6060
with:
61-
python-version: "3.8"
61+
python-version: "3.9"
6262
cache: "pip"
6363
cache-dependency-path: |
6464
pyproject.toml
@@ -71,7 +71,7 @@ jobs:
7171
name: "Test env setup"
7272
timeout-minutes: 30
7373

74-
# Installing pii deps for python3.8 test setup only, it will not work with python3.9/3.10, because
74+
# Installing pii deps for python3.9 test setup only, it will not work with python3.9/3.10, because
7575
# 'datapane' library conflicts with pandas>2.2.0, which used in py3.9/3.10 setup
7676
- name: "Install PII dependencies"
7777
run: |

ads/aqua/extension/base_handler.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,10 @@ def __init__(
3737
except Exception:
3838
pass
3939

40+
def prepare(self, *args, **kwargs):
41+
"""The base class prepare is not required for Aqua"""
42+
pass
43+
4044
@staticmethod
4145
def serialize(obj: Any):
4246
"""Serialize the object.

ads/aqua/server/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/usr/bin/env python
2+
3+
# Copyright (c) 2025 Oracle and/or its affiliates.
4+
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/

ads/aqua/server/__main__.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#!/usr/bin/env python
2+
3+
# Copyright (c) 2025 Oracle and/or its affiliates.
4+
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/
5+
6+
import os
7+
from logging import getLogger
8+
9+
from dotenv import load_dotenv
10+
11+
from ads.aqua.server.app import start_server
12+
13+
logger = getLogger(__name__)
14+
config_location = os.path.join(os.getcwd(), ".env")
15+
if os.path.exists(config_location):
16+
logger.info(f"Loading environment variables from {config_location}")
17+
load_dotenv(dotenv_path=config_location)
18+
logger.info("Environment variables loaded successfully")
19+
else:
20+
logger.warning(
21+
f"{config_location} not found. Consider using `.env` file to setup default environment variables"
22+
)
23+
24+
start_server()

ads/aqua/server/app.py

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
#!/usr/bin/env python
2+
3+
# Copyright (c) 2025 Oracle and/or its affiliates.
4+
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/
5+
6+
import os
7+
from logging import getLogger
8+
9+
import tornado.ioloop
10+
import tornado.web
11+
12+
from ads.aqua.extension import __handlers__
13+
14+
logger = getLogger(__name__)
15+
AQUA_PORT = "AQUA_PORT"
16+
AQUA_HOST = "AQUA_HOST"
17+
AQUA_PROCESS_COUNT = "AQUA_PROCESS_COUNT"
18+
AQUA_CORS_ENABLE = "AQUA_CORS_ENABLE"
19+
20+
URL_PATTERN = r"/aqua/"
21+
22+
23+
def prepare(self):
24+
self.set_header("Access-Control-Allow-Origin", "*")
25+
26+
27+
def make_app():
28+
# Patch the prepare method to allow CORS request
29+
if os.environ.get(AQUA_CORS_ENABLE, "0") == "1":
30+
for _, handler in __handlers__:
31+
handler.prepare = prepare
32+
handlers = [(URL_PATTERN + url, handler) for url, handler in __handlers__]
33+
# logger.debug(handlers)
34+
return tornado.web.Application(handlers)
35+
36+
37+
def start_server():
38+
app = make_app()
39+
server = tornado.httpserver.HTTPServer(app)
40+
port = int(os.environ.get(AQUA_PORT, 8080))
41+
host = os.environ.get(AQUA_HOST, "0.0.0.0")
42+
processes = int(os.environ.get(AQUA_PROCESS_COUNT, 0))
43+
server.bind(port=port, address=host)
44+
server.start(processes)
45+
logger.info(f"Starting the server from directory: {os.getcwd()}")
46+
logger.info(f"Aqua API server running on http://{host}:{port}")
47+
tornado.ioloop.IOLoop.current().start()

0 commit comments

Comments
 (0)