Skip to content

Commit 77c53f6

Browse files
authored
Merge pull request #11 from raphaelsty/improve-design
update ci
2 parents bcfc041 + fb049e7 commit 77c53f6

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

.github/workflows/database.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
run: uv python install 3.10
2828

2929
- name: install python packages
30-
run: uv pip install --system .
30+
run: uv sync
3131

3232
- name: track large files
3333
run: git lfs track "database/pipeline.pkl"
@@ -40,7 +40,7 @@ jobs:
4040
ZOTERO_API_KEY: ${{ secrets.ZOTERO_API_KEY }}
4141
ZOTERO_LIBRARY_ID: ${{ secrets.ZOTERO_LIBRARY_ID }}
4242
HUGGINGFACE_TOKEN: ${{ secrets.HUGGINGFACE_TOKEN }}
43-
run: python run.py
43+
run: uv run python run.py
4444

4545
- name: commit files
4646
run: |

.github/workflows/flyio.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
name: Deploy app
1616
runs-on: ubuntu-latest
1717
steps:
18-
- uses: actions/checkout@v2
18+
- uses: actions/checkout@v4
1919
with:
2020
lfs: true
2121
- uses: superfly/flyctl-actions/setup-flyctl@master

Dockerfile

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,20 @@ FROM python:3.10-slim
33
# Install uv
44
COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/
55

6-
# Clone the repository
76
WORKDIR /code
87

98
# Copy the necessary files
10-
COPY database/pipeline.pkl /code/database/pipeline.pkl
119
COPY pyproject.toml /code/pyproject.toml
10+
COPY readme.md /code/readme.md
11+
COPY database/pipeline.pkl /code/database/pipeline.pkl
1212
COPY knowledge_database /code/knowledge_database
1313
COPY api /code/api
1414

15-
# Install Python dependencies using uv
16-
RUN uv pip install --system .
15+
# Install Python dependencies using uv with a virtual environment
16+
RUN uv venv /code/.venv && uv pip install --python /code/.venv/bin/python .
1717

1818
# Set up the secret environment variable for OpenAI API Key
1919
RUN --mount=type=secret,id=OPENAI_API_KEY sh -c 'echo "export OPENAI_API_KEY=$(cat /run/secrets/OPENAI_API_KEY)" >> /etc/profile.d/openai.sh'
2020

2121
# Set the command to run the application
22-
CMD ["/bin/bash", "-c", "source /etc/profile && uvicorn api.api:app --host 0.0.0.0 --port 8080"]
22+
CMD ["/bin/bash", "-c", "source /etc/profile && /code/.venv/bin/uvicorn api.api:app --host 0.0.0.0 --port 8080"]

0 commit comments

Comments
 (0)