-
Notifications
You must be signed in to change notification settings - Fork 1
Feature- Tests #10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Jurgee
wants to merge
38
commits into
main
Choose a base branch
from
feature/tests
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Feature- Tests #10
Changes from all commits
Commits
Show all changes
38 commits
Select commit
Hold shift + click to select a range
054c6a3
1st iter
Jurgee c3078c6
Merge branch 'main' into feature/tests
Jurgee 5f80c05
test runner
Jurgee 4aed754
fix
Jurgee 85db95c
tests
Jurgee 115e8a2
pyproj
Jurgee 8352582
better output
Jurgee b020ebc
fixes
Jurgee b74de01
sdk use
Jurgee 50eb79b
better print
Jurgee e855481
better print
Jurgee 5e7654d
fix port
Jurgee e7a7987
fix: change middle to x,y points
Jurgee c055043
generate new refs
Jurgee fa43f53
test: new test
Jurgee 968af4f
test fixes
Jurgee d78cddb
fix: different coordinates
Jurgee 324a713
fix coors
Jurgee 0913863
feat: add virchow2 test
Jurgee e72e900
fix: name
Jurgee 4d13c83
fix: tolerance
Jurgee 7f2924a
test: semantic test
Jurgee 1995689
test: print
Jurgee be23dd5
print
Jurgee fbfba69
fix: add isclose()
Jurgee 1a63350
Merge branch 'main' into feature/tests
Jurgee b1010b5
new tests
Jurgee db4cd4f
fix path
Jurgee db27737
print
Jurgee d557f5f
test
Jurgee f14c82c
fixes
Jurgee 8414aa6
Merge branch 'main' into feature/tests
Jurgee 661225b
more fixes
Jurgee f629274
fixes
Jurgee afbcab6
url fix
Jurgee 5bbc9b5
fix: uv lock and mypy
Jurgee ab16f23
review fixes
Jurgee 11c1dcd
new classes
Jurgee File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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, | ||
| ) | ||
|
|
||
| @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") | ||
|
Jurgee marked this conversation as resolved.
|
||
|
|
||
|
|
||
| app = TestRunner.bind() # type: ignore[attr-defined] | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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, | ||
| ) | ||
|
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") | ||
|
Jurgee marked this conversation as resolved.
|
||
|
|
||
|
|
||
| app = ThroughputRunner.bind() # type: ignore[attr-defined] | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 | ||
|
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 | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 | ||
|
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 | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -8,3 +8,5 @@ applications: | |
| - prostate-classifier-1 | ||
| - prov-gigapath | ||
| - virchow2 | ||
| - test-runner | ||
| - throughput-test | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
Empty file.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.