Skip to content

Commit d7dfac6

Browse files
author
Olawale Abimbola
committed
tf update
1 parent 6cae46f commit d7dfac6

31 files changed

+432
-5062
lines changed

.env

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
S3_ACCESS_KEY = user
2+
S3_SECRET_KEY = user@@123
3+
S3_URL = minio:9000
4+
S3_BUCKET = recommendation-bucket

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
data

Dockerfile

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
FROM python:3.7
2-
# WORKDIR /app
3-
# COPY ./app /app
4-
COPY requirements.txt ./requirements.txt
5-
RUN pip3 install --upgrade pip
6-
RUN pip3 install -r requirements.txt
7-
EXPOSE $PORT
8-
CMD ["uvicorn", "app:app", "--bind 0.0.0.0:$PORT", "--reload"]
1+
FROM python:3.8
2+
3+
WORKDIR /app
4+
CMD ["uvicorn", "app:app", "--host=0.0.0.0", "--reload"]
5+
6+
COPY src/* /app/
7+
COPY data/* /app/
8+
RUN pip install -r requirements.txt

app.py

Lines changed: 0 additions & 40 deletions
This file was deleted.

app/recommender.py

Lines changed: 0 additions & 15 deletions
This file was deleted.

data/final_data.csv

Lines changed: 0 additions & 4807 deletions
This file was deleted.

docker-compose.yml

Lines changed: 55 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,59 @@
1-
version: "3.5"
1+
version: '3.8'
22
services:
3+
etl:
4+
container_name: etl
5+
build: .
6+
command: python etl.py
7+
env_file:
8+
- .env
9+
depends_on:
10+
- minio
11+
networks:
12+
- app-net
13+
trainer:
14+
container_name: trainer
15+
build: .
16+
command: python trainer.py
17+
env_file:
18+
- .env
19+
depends_on:
20+
- minio
21+
networks:
22+
- app-net
323
fastapi:
24+
container_name: api
425
restart: "always"
5-
build: fastapi
26+
env_file:
27+
- .env
28+
build: .
29+
depends_on:
30+
- minio
31+
- etl
32+
- trainer
33+
networks:
34+
- app-net
35+
command: uvicorn app:app --host=0.0.0.0 --reload
636
ports:
7-
- 8000:8000
37+
- 8000:8000
38+
minio:
39+
image: minio/minio
40+
container_name: minio
41+
command: "server /data --console-address ':9001'"
42+
environment:
43+
MINIO_ROOT_USER: ${S3_ACCESS_KEY}
44+
MINIO_ROOT_PASSWORD: ${S3_SECRET_KEY}
45+
ports:
46+
- 9000:9000
47+
- 9001:9001
48+
networks:
49+
- app-net
50+
volumes:
51+
- ./data/minio-data:/data
52+
volumes:
53+
cache:
54+
driver: local
55+
minio-data:
56+
driver: local
57+
networks:
58+
app-net:
59+
driver: bridge

etl.py

Lines changed: 0 additions & 67 deletions
This file was deleted.

locustfile.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
from locust import HttpUser, task, between
2+
import random
3+
4+
class MovieRecommender(HttpUser):
5+
wait_time = between(1, 3) # Add some wait time between requests
6+
7+
@task
8+
def get_recommendation(self):
9+
movie_name = random.choice(['Titan A.E.', "Ender's Game", "Independence Day", 'Avatar', 'The Fifth Element', 'Star Trek Into Darkness', 'Jupiter Ascending', 'Battle: Los Angeles'])
10+
self.client.get(f"/predict?movie={movie_name}")

mlruns/0/meta.yaml

Lines changed: 0 additions & 4 deletions
This file was deleted.

0 commit comments

Comments
 (0)