Skip to content

Commit

Permalink
add sample response and file not dependent on git-lfs
Browse files Browse the repository at this point in the history
  • Loading branch information
pbeukema committed Nov 23, 2023
1 parent 9ba22a1 commit 637b151
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
4 changes: 2 additions & 2 deletions example/sample_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@

PORT = os.getenv("VVD_PORT", default=5555)
VVD_ENDPOINT = f"http://localhost:{PORT}/detections"
SAMPLE_INPUT_DIR = "/test_files/"
SAMPLE_OUTPUT_DIR = "/test_files/chips/"
SAMPLE_INPUT_DIR = "/example/"
SAMPLE_OUTPUT_DIR = "/example/chips/"
TIMEOUT_SECONDS = 600


Expand Down
13 changes: 11 additions & 2 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Note that the model and API are designed to run in resource constrained environm
- Python 3.10
- Docker: https://docs.docker.com/get-docker/
- Docker Compose: https://docs.docker.com/compose/install/ (note that Docker compose may already be installed depending on how you installed docker)
- git-lfs: https://git-lfs.com/ Test files used for development are stored on GitHub with git-lfs.
- git-lfs: https://git-lfs.com/ Test files used for development are stored on GitHub with git-lfs. Tu run the tests (pytest), please install git-lfs and retrieve the files in test_files with git-lfs.

## Installation

Expand Down Expand Up @@ -59,13 +59,22 @@ pip install -r requirements/requirements-inference.txt

## Usage

Note that the sample request depends on sample data that is stored on GitHub in example/\*.nc

Start the service with that directory available in the container. E.g.

```bash
docker run -d -p 5555:5555 -v ABS_PATH_TO_REPO/example:/example/ ghcr.io/allenai/vessel-detection-viirs:latest
```

```bash
$ python examples/sample_request.py
```

## Tests

Unit and integration tests (see tests/) are run as part of CICD via GitHub actions. To manually run these tests, execute:
Unit and integration tests (see tests/) are run as part of CICD via GitHub actions. Note that to run the tests, it is required to download the test files which are stored on GitHub via git-lfs.
To manually run these tests (after installing git-lfs and downloading the files stored in tests/test_files/), execute:

```bash
$ pytest tests -vv
Expand Down
1 change: 1 addition & 0 deletions sample_response.json

Large diffs are not rendered by default.

0 comments on commit 637b151

Please sign in to comment.