Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ jobs:
pip install -r tests/requirements.txt
- name: Pre build mock server docker image
run: |
cd src/
docker build -t arterys_inference_server .
- name: Test the mock inference server
run: |
Expand Down
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ The SDK helps you containerize your model into a Flask app with a predefined API
## Integrating the SDK

You should use this SDK to allow the Arterys web app to invoke your model.
The `gateway.py` is a helper class that creates a Flask server to communicate with the Arterys app via HTTP.
You will find the files needed for the integration in the `src` folder.
The `src/gateway.py` is a helper class that creates a Flask server to communicate with the Arterys app via HTTP.

You will have to provide 2 endpoints:

Expand All @@ -43,7 +44,7 @@ You should handle healthcheck requests by returning a string 'READY' if your ser
Otherwise return something else, with status code 200 in both cases.
Returning "READY" too early will result in failures due to requests being sent too early.

You can do this by modifying the `healthcheck_handler` function in `mock_server.py`
You can do this by modifying the `healthcheck_handler` function in `src/mock_server.py`

### Handling an inference request

Expand Down Expand Up @@ -92,7 +93,7 @@ if __name__ == '__main__':
app.run(host='0.0.0.0', port=8000, debug=True, use_reloader=True)
```

See mock_server.py, for more examples of handlers that respond with different types of annotations.
See `mock_server.py`, for more examples of handlers that respond with different types of annotations.

> You will normally not need to change `gateway.py`.
However, you will have to **parse the request, call your model and return a response** in the `mock_server.py`
Expand Down Expand Up @@ -349,6 +350,7 @@ This would need custom work from the Arterys support team.

```bash
# Start the service.
cd src/
./start_server.sh <command>

# View the logs
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions tests/mock_server_test_case.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ def setUp(self):
should_start_server = not os.getenv('ARTERYS_SDK_ASSUME_SERVER_STARTED', False)
if should_start_server:
print("Starting", self.test_name)
self.server_proc = subprocess.Popen(["./start_server.sh", self.command, "--name", self.test_container_name], stdout=subprocess.PIPE,
stderr=subprocess.PIPE, encoding='utf-8')
self.server_proc = subprocess.Popen(["./start_server.sh", self.command, "--name", self.test_container_name],
cwd='src', stdout=subprocess.PIPE, stderr=subprocess.PIPE, encoding='utf-8')
else:
self.inference_port = os.getenv('ARTERYS_SDK_INFERENCE_SERVER_PORT', '8900')
print("Assuming the server is already running.")
Expand Down
2 changes: 1 addition & 1 deletion tests/test_tagged_logger.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import unittest
import logging

from utils.tagged_logger import TaggedLogger
from src.utils.tagged_logger import TaggedLogger

class TestLogHandler(logging.Handler):
def emit(self, record):
Expand Down