Skip to content

Commit 22ca9f2

Browse files
Merge pull request #47 from DigitalProductInnovationAndDevelopment/feat/switch-pipenv
Switch to pipenv
2 parents dffb8fb + 66d83f1 commit 22ca9f2

25 files changed

+2056
-83
lines changed

.github/workflows/docker.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616

1717
strategy:
1818
matrix:
19-
app: [api, queue, dashboard]
19+
app: [recommender, dashboard]
2020

2121
steps:
2222
- name: Checkout repository
@@ -37,7 +37,7 @@ jobs:
3737

3838
- name: GET DockerFile Path
3939
run: |
40-
DOCKERFILE_PATH=$(if [ "${{ matrix.app }}" == "dashboard" ]; then echo "./dashboard/Dockerfile"; else echo "Dockerfile.${{ matrix.app }}"; fi)
40+
DOCKERFILE_PATH=$(if [ "${{ matrix.app }}" == "dashboard" ]; then echo "./dashboard/Dockerfile"; else echo "Dockerfile.base"; fi)
4141
echo "DOCKERFILE_PATH=$DOCKERFILE_PATH" >> $GITHUB_ENV
4242
- name: Build and push Docker image
4343
uses: docker/build-push-action@v5

.github/workflows/test.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ jobs:
2222

2323
- name: Install dependencies
2424
run: |
25-
python -m pip install --upgrade pip
26-
pip install -r requirements.txt
27-
pip install pytest
25+
pip install pipenv
26+
pipenv install
27+
pipenv install --dev
2828
2929
- name: Run tests
3030
run: |
31-
make test
31+
pipenv run make test

.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
# CVE Search plugin data
1313

1414
.cve_search_data/
15-
.docs
15+
.docs/
1616
.idea
1717
.DS_Store
1818

Dockerfile.api

+11-5
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,23 @@
1+
#DEPRECATED
2+
13
FROM python:3.11
24

5+
# Set the working directory in the container to /app
6+
COPY Pipfile /app/
7+
COPY Pipfile.lock /app/
8+
# install pipenv
9+
RUN pip install pipenv
10+
11+
RUN pipenv install --system --deploy
12+
313
# Set the working directory in the container to /app
414
WORKDIR /app
515

616
# Add the current directory contents into the container at /app
717
ADD . /app
818

9-
# Install any needed packages specified in requirements.txt
10-
RUN pip install -r requirements.txt
1119

12-
#install uvicorn
13-
RUN pip install uvicorn
1420
# Make port 8000 available to the world outside this container
1521
EXPOSE 8000
1622

17-
CMD ["/bin/bash", "-c", "cd src && uvicorn app:app --host 0.0.0.0 --port 8000"]
23+
CMD ["/bin/bash", "-c", "make db-migrate && cd src && uvicorn app:app --host 0.0.0.0 --port 8000"]

Dockerfile.queue Dockerfile.base

+13-3
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,24 @@ FROM python:3.11
33
# Set the working directory in the container to /app
44
WORKDIR /app
55

6+
7+
COPY Pipfile /app/
8+
COPY Pipfile.lock /app/
9+
# install pipenv
10+
RUN pip install pipenv
11+
12+
RUN pipenv install --system --deploy
13+
14+
615
# Add the current directory contents into the container at /app
716
ADD . /app
817

9-
# Install any needed packages specified in requirements.txt
10-
RUN pip install -r requirements.txt
1118

1219

1320
# Make port 8000 available to the world outside this container
1421
EXPOSE 8000
1522

16-
CMD ["/bin/bash", "-c", "cd src && celery -A worker.worker worker --loglevel=info --concurrency 1"]
23+
24+
25+
26+
# CMD ["/bin/bash", "-c", "cd src && celery -A worker.worker worker --loglevel=info --concurrency 1"]

Makefile

+11
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,23 @@ db-migrate-down-base:
2222
cd src && alembic downgrade base
2323

2424

25+
docker-nuke:
26+
. ./scripts/nuke.sh
27+
2528
dev:
2629
cd src && uvicorn app:app --host 0.0.0.0 --port 8001 --reload
2730

2831

32+
start:
33+
cd src && uvicorn app:app --host 0.0.0.0 --port 8000 --reload
34+
35+
2936
test:
3037
cd src && pytest
3138

39+
40+
docs:
41+
cd src && python3 extract-docs.py
42+
3243
start-worker:
3344
cd src && celery -A worker.worker worker --loglevel=info --concurrency 1

Pipfile

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
[[source]]
2+
url = "https://pypi.org/simple"
3+
verify_ssl = true
4+
name = "pypi"
5+
6+
[packages]
7+
pydantic = "*"
8+
pandas = "*"
9+
sqlmodel = "~=0.0.18"
10+
alembic = "~=1.13.1"
11+
psycopg = "*"
12+
psycopg-binary = "*"
13+
fastapi = "==0.109.1"
14+
uvicorn = "==0.15.0"
15+
python-dotenv = "*"
16+
jsonschema = "==4.22.0"
17+
sqlalchemy = "~=2.0.30"
18+
tqdm = "~=4.66.4"
19+
httpx = "~=0.27.0"
20+
tenacity = "~=8.3.0"
21+
celery = {extras = ["redis"], version = "==5.2.2"}
22+
openai = "~=1.33.0"
23+
anthropic = "~=0.28.0"
24+
pydantic-settings = "~=2.3.2"
25+
sentence-transformers = "*"
26+
kneed = "*"
27+
scikit-learn = "*"
28+
plotly = "*"
29+
30+
[dev-packages]
31+
mypy = "*"
32+
pytest = "*"
33+
34+
[requires]
35+
python_version = "3.11"

0 commit comments

Comments
 (0)