-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from fpgmaas/prod
Add building for CPU
- Loading branch information
Showing
4 changed files
with
98 additions
and
7 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,39 @@ | ||
name: Build and Push Docker Images | ||
|
||
on: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
push-to-acr: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
|
||
- name: Login to Azure Container Registry | ||
uses: azure/docker-login@v1 | ||
with: | ||
login-server: pypiscoutacr.azurecr.io | ||
username: ${{ secrets.ACR_USERNAME }} | ||
password: ${{ secrets.ACR_PASSWORD }} | ||
|
||
- name: Build and Push Backend Docker image | ||
uses: docker/build-push-action@v4 | ||
with: | ||
context: . | ||
file: ./DockerfileCPU | ||
platforms: linux/amd64 | ||
push: true | ||
tags: pypiscoutacr.azurecr.io/pypi-scout-backend:latest | ||
|
||
- name: Build and Push Frontend Docker image | ||
uses: docker/build-push-action@v4 | ||
with: | ||
context: ./frontend | ||
file: ./frontend/Dockerfile | ||
platforms: linux/amd64 | ||
push: true | ||
tags: pypiscoutacr.azurecr.io/pypi-scout-frontend:latest |
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,34 @@ | ||
# syntax=docker/dockerfile:1 | ||
|
||
# Use a slim Python image as the base | ||
FROM python:3.10-slim-bookworm | ||
|
||
# Set environment variables | ||
ENV PYTHONUNBUFFERED=1 | ||
|
||
# Install system dependencies | ||
RUN apt-get update && apt-get install -y --no-install-recommends \ | ||
build-essential \ | ||
&& apt-get clean && rm -rf /var/lib/apt/lists/* | ||
|
||
# Set working directory | ||
WORKDIR /code | ||
|
||
# Copy only requirements to cache them in docker layer | ||
COPY requirements-cpu.txt /code/requirements-cpu.txt | ||
|
||
# Install Python dependencies | ||
RUN pip install --no-cache-dir -r requirements-cpu.txt | ||
|
||
# Copy the rest of the application code | ||
COPY pypi_scout /code/pypi_scout/ | ||
|
||
# Copy the start script and make it executable | ||
COPY start.sh /start.sh | ||
RUN chmod +x /start.sh | ||
|
||
# Make empty data directory | ||
RUN mkdir -p /code/data | ||
|
||
# Use the script as the entrypoint | ||
ENTRYPOINT ["/start.sh"] |
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,14 @@ | ||
beautifulsoup4==4.12.3 | ||
polars==0.20.31 | ||
sentence-transformers==3.0.1 | ||
lxml==5.2.2 | ||
python-dotenv==1.0.1 | ||
pinecone-client==4.0.0 | ||
tqdm==4.66.4 | ||
fastapi==0.111.0 | ||
pydantic==2.7.4 | ||
uvicorn==0.30.1 | ||
gdown==5.2.0 | ||
torch==2.0.1 | ||
--index-url=https://download.pytorch.org/whl/cpu | ||
--extra-index-url=https://pypi.org/simple |