-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
60 additions
and
2 deletions.
There are no files selected for viewing
This file contains 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,27 @@ | ||
name: Python integration tests | ||
|
||
on: | ||
push: | ||
pull_request: | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
python-version: ["3.9", "3.10", "3.11", "3.12"] | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
# You can test your matrix by printing the current Python version | ||
- name: Display Python version | ||
run: python -c "import sys; print(sys.version)" | ||
- name: Install dependencies | ||
run: pip install -r requirements.txt | ||
- name: Install test dependencies | ||
run: pip install -r test-requirements.txt | ||
- name: Integration tests | ||
run: pytest |
This file contains 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,22 @@ | ||
FROM nvidia/cuda:12.2.2-runtime-ubuntu22.04 | ||
|
||
|
||
ENV DEBIAN_FRONTEND=noninteractive | ||
ENV PORT=8080 | ||
|
||
RUN --mount=target=/var/lib/apt/lists,type=cache,sharing=locked \ | ||
--mount=target=/var/cache/apt,type=cache,sharing=locked \ | ||
apt-get update && \ | ||
apt-get -y --no-install-recommends install python3 python3-pip git && \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
COPY requirements.txt requirements.txt | ||
RUN --mount=type=cache,target=/root/.cache/pip \ | ||
pip3 install --upgrade pip && \ | ||
pip3 install -r requirements.txt | ||
|
||
COPY main.py . | ||
COPY entrypoint.sh /usr/local/bin/ | ||
CMD [ "entrypoint.sh" ] | ||
|
||
EXPOSE ${PORT} |
This file contains 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 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,3 @@ | ||
#!/usr/bin/env bash | ||
|
||
uvicorn main:app --host 0.0.0.0 --port $PORT |
This file contains 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 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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
fastapi | ||
sentence-transformers | ||
uvicorn | ||
uvicorn[standard] |