Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
054c6a3
1st iter
Jurgee Apr 7, 2026
c3078c6
Merge branch 'main' into feature/tests
Jurgee Apr 25, 2026
5f80c05
test runner
Jurgee Apr 26, 2026
4aed754
fix
Jurgee Apr 26, 2026
85db95c
tests
Jurgee Apr 26, 2026
115e8a2
pyproj
Jurgee Apr 26, 2026
8352582
better output
Jurgee Apr 26, 2026
b020ebc
fixes
Jurgee Apr 26, 2026
b74de01
sdk use
Jurgee Apr 26, 2026
50eb79b
better print
Jurgee Apr 26, 2026
e855481
better print
Jurgee Apr 28, 2026
5e7654d
fix port
Jurgee Apr 28, 2026
e7a7987
fix: change middle to x,y points
Jurgee May 4, 2026
c055043
generate new refs
Jurgee May 4, 2026
fa43f53
test: new test
Jurgee May 4, 2026
968af4f
test fixes
Jurgee May 4, 2026
d78cddb
fix: different coordinates
Jurgee May 4, 2026
324a713
fix coors
Jurgee May 4, 2026
0913863
feat: add virchow2 test
Jurgee May 5, 2026
e72e900
fix: name
Jurgee May 5, 2026
4d13c83
fix: tolerance
Jurgee May 5, 2026
7f2924a
test: semantic test
Jurgee May 6, 2026
1995689
test: print
Jurgee May 6, 2026
be23dd5
print
Jurgee May 6, 2026
fbfba69
fix: add isclose()
Jurgee May 6, 2026
1a63350
Merge branch 'main' into feature/tests
Jurgee May 11, 2026
b1010b5
new tests
Jurgee May 12, 2026
db4cd4f
fix path
Jurgee May 13, 2026
db27737
print
Jurgee May 13, 2026
d557f5f
test
Jurgee May 13, 2026
f14c82c
fixes
Jurgee May 31, 2026
8414aa6
Merge branch 'main' into feature/tests
Jurgee May 31, 2026
661225b
more fixes
Jurgee May 31, 2026
f629274
fixes
Jurgee May 31, 2026
afbcab6
url fix
Jurgee May 31, 2026
5bbc9b5
fix: uv lock and mypy
Jurgee May 31, 2026
ab16f23
review fixes
Jurgee May 31, 2026
11c1dcd
new classes
Jurgee May 31, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 44 additions & 0 deletions builders/test_runner.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
import subprocess
import sys

from fastapi import FastAPI, Response
from ray import serve


fastapi = FastAPI()


@serve.deployment(num_replicas=1)
@serve.ingress(fastapi)
class TestRunner:
def __init__(self) -> None:
subprocess.run(
[sys.executable, "-m", "pip", "install", "pytest", "-q"],
check=True,
)
Comment thread
Jurgee marked this conversation as resolved.

@fastapi.post("/")
def run(self) -> Response:
result = subprocess.run(
[
sys.executable,
"-m",
"pytest",
"tests/model_snapshots/",
"-v",
"--tb=short",
"--no-header",
"-s",
"--color=no",
],
capture_output=True,
text=True,
)

output = result.stdout
if result.returncode != 0:
output += f"\nSTDERR:\n{result.stderr}"
return Response(content=output, media_type="text/plain")
Comment thread
Jurgee marked this conversation as resolved.


app = TestRunner.bind() # type: ignore[attr-defined]
58 changes: 58 additions & 0 deletions builders/throughput_runner.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
import subprocess
import sys

from fastapi import FastAPI, Response
from ray import serve


fastapi = FastAPI()


@serve.deployment(num_replicas=1)
@serve.ingress(fastapi)
class ThroughputRunner:
def __init__(self) -> None:
subprocess.run(
[sys.executable, "-m", "pip", "install", "pytest", "-q"],
check=True,
)
Comment thread
Jurgee marked this conversation as resolved.

@fastapi.post("/")
def run(
self,
duration_s: float = 300.0,
concurrency: int = 8,
timeout: float = 60.0,
wait_ready: bool = True,
wait_timeout_s: float = 0.0,
wait_interval_s: float = 10.0,
) -> Response:
cmd = [
sys.executable,
"tests/perf_throughput.py",
"--duration-s",
str(duration_s),
"--concurrency",
str(concurrency),
"--timeout",
str(timeout),
]
if wait_ready:
cmd.extend(
[
"--wait-ready",
"--wait-timeout-s",
str(wait_timeout_s),
"--wait-interval-s",
str(wait_interval_s),
]
)

result = subprocess.run(cmd, capture_output=True, text=True)
output = result.stdout + (
f"\nSTDERR:\n{result.stderr}" if result.returncode != 0 else ""
)
return Response(content=output, media_type="text/plain")
Comment thread
Jurgee marked this conversation as resolved.


app = ThroughputRunner.bind() # type: ignore[attr-defined]
16 changes: 16 additions & 0 deletions helm/rayservice/applications/test-runner.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
- name: test-runner
import_path: builders.test_runner:app
route_prefix: /run-tests
runtime_env:
working_dir: https://github.com/RationAI/model-service/archive/refs/heads/main.zip
pip:
- git+https://github.com/RationAI/rationai-sdk-python.git
Comment thread
Jurgee marked this conversation as resolved.
deployments:
- name: TestRunner
autoscaling_config:
min_replicas: 0
max_replicas: 1
target_ongoing_requests: 1
ray_actor_options:
num_cpus: 1
memory: 2147483648
16 changes: 16 additions & 0 deletions helm/rayservice/applications/throughput-test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
- name: throughput-runner
import_path: builders.throughput_runner:app
route_prefix: /run-throughput
runtime_env:
working_dir: https://github.com/RationAI/model-service/archive/refs/heads/main.zip
pip:
- git+https://github.com/RationAI/rationai-sdk-python.git
Comment thread
Jurgee marked this conversation as resolved.
deployments:
- name: ThroughputRunner
autoscaling_config:
min_replicas: 0
max_replicas: 1
target_ongoing_requests: 1
ray_actor_options:
num_cpus: 1
memory: 2147483648
2 changes: 2 additions & 0 deletions helm/rayservice/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,5 @@ applications:
- prostate-classifier-1
- prov-gigapath
- virchow2
- test-runner
- throughput-test
5 changes: 5 additions & 0 deletions helm/rayservice/workers/cpu-workers.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ template:
mountPath: /mnt/cache
- name: huggingface-cache
mountPath: /mnt/huggingface_cache
- name: test-refs
mountPath: /mnt/test_refs
volumes:
- name: data
persistentVolumeClaim:
Expand All @@ -64,3 +66,6 @@ template:
- name: huggingface-cache
persistentVolumeClaim:
claimName: huggingface-cache-pvc
- name: test-refs
persistentVolumeClaim:
claimName: model-test-refs-pvc
5 changes: 5 additions & 0 deletions helm/rayservice/workers/mig20-workers.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ template:
mountPath: /mnt/cache
- name: huggingface-cache
mountPath: /mnt/huggingface_cache
- name: test-refs
mountPath: /mnt/test_refs
volumes:
- name: data
persistentVolumeClaim:
Expand All @@ -74,3 +76,6 @@ template:
- name: huggingface-cache
persistentVolumeClaim:
claimName: huggingface-cache-pvc
- name: test-refs
persistentVolumeClaim:
claimName: model-test-refs-pvc
12 changes: 12 additions & 0 deletions pvc/model-test-refs-pvc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: model-test-refs-pvc
namespace: rationai-jobs-ns
spec:
accessModes:
- ReadWriteMany
resources:
requests:
storage: 5Gi
storageClassName: nfs-csi
5 changes: 4 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,8 @@ dependencies = [
]

[dependency-groups]
dev = ["mypy>=1.18.2", "ruff>=0.14.6"]
dev = ["mypy>=1.18.2", "ruff>=0.14.6", "pytest>=8.4.2"]
docs = ["mkdocs>=1.6.0", "mkdocs-material>=9.6.0", "pymdown-extensions>=10.0"]

[tool.pytest.ini_options]
pythonpath = ["tests/model_snapshots"]
Empty file added tests/__init__.py
Empty file.
Empty file.
Loading
Loading