Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docker fastapi #3

Open
wants to merge 39 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
6de8715
Add data fodler to gitignore
NicoFena Aug 12, 2024
c8ec266
Add notebook to merge data
NicoFena Aug 12, 2024
608b3ee
Keep data folders but ignore contents
NicoFena Aug 12, 2024
2c12559
Merge branch 'dvlpt' into develop/nf
NicoFena Aug 12, 2024
840a90b
Merge pull request #1 from DataScientest-Studio/develop/nf
NicoFena Aug 12, 2024
b3ebe23
Comment all as file is failing
NicoFena Sep 12, 2024
2351e55
delete workflow
NicoFena Sep 12, 2024
a7b8d98
Preprocessing, Models test, load a knn model
NicoFena Sep 12, 2024
999f672
model_performance file creation
NicoFena Sep 12, 2024
1d4ec41
API creation -predict endpoint not working
NicoFena Sep 12, 2024
5af0918
change variable name "int" to "inter" - model trained once more
NicoFena Sep 13, 2024
2a6f962
add encoder to use in app
NicoFena Sep 13, 2024
526e24d
troubleshooting for /predict
NicoFena Sep 13, 2024
6fc27ec
Ajout des datas
estelle205 Sep 17, 2024
a70c008
Ajout authentification
estelle205 Sep 17, 2024
830bac8
Logs added
estelle205 Sep 17, 2024
966f11e
Log file rotation
estelle205 Sep 17, 2024
ab8e943
bugfix /predict and changed all path to start from the root folder
NicoFena Sep 17, 2024
19b3c26
Ajout du Dockerfile pour containerisation
Atnos-G Oct 1, 2024
6e3c6d9
Updated
NicoFena Oct 11, 2024
a9b6b81
Added ".py" for importing
NicoFena Oct 11, 2024
c6b5fdb
Functions creation for extracting data
NicoFena Oct 11, 2024
6819920
Cleaning data added
NicoFena Oct 11, 2024
3cf4bfe
first steps added to the etl
NicoFena Oct 11, 2024
98d6a8f
dockerfile and docker-compose added, todo : clean requirements
estelle205 Oct 11, 2024
ddc0abb
build_features integrated in ETL
NicoFena Oct 14, 2024
1fdaf19
Added training and test of the model
NicoFena Oct 17, 2024
85bbbf1
Separation of ETl and model pipeline
NicoFena Oct 22, 2024
a45fdad
change to code for etl execution
NicoFena Oct 22, 2024
2046b54
add file to test etl
NicoFena Oct 22, 2024
dd11511
added logger
NicoFena Oct 23, 2024
7951f70
Add ETL tests for shape and names of df
NicoFena Oct 23, 2024
f58bee9
Merge branch 'etl' of https://github.com/DataScientest-Studio/jun24_c…
Atnos-G Oct 24, 2024
f38d8ec
Ajout du Dockerfile pour le dossier 'models' et conteneurisation du m…
Atnos-G Oct 24, 2024
8154f30
Ajout du conteneur Docker pour la partie data et ETL
Atnos-G Oct 24, 2024
b025d1c
Modification du conteneur Dockerfile_data + vérification du bon fonct…
Atnos-G Oct 24, 2024
4b5fb59
Modification du fichier 'test_etl.py' : ajout du chemin d'accès au fi…
Atnos-G Oct 24, 2024
7500604
Merge branch 'dvlpt' of https://github.com/DataScientest-Studio/jun24…
Atnos-G Oct 24, 2024
3b0e165
Ajout du conteneur FastAPI
Atnos-G Oct 24, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 0 additions & 39 deletions .github/workflows/python-app.yml

This file was deleted.

5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
Project Name
MLOps project - Car accident
==============================

This project is a starting Pack for MLOps projects based on the subject "movie_recommandation". It's not perfect so feel free to make some modifications on it.
This project is realized during the formation "MLOps" at Datascientest. It aims to develop and test a machine learning model and create an API to access the model and make real time predictions.
The raw data is loaded in data/raw (added to gitignore because of the total size) before being processed.

Project Organization
------------
Expand Down
File renamed without changes.
Binary file added data/processed/database.db
Binary file not shown.
File renamed without changes.
4 changes: 4 additions & 0 deletions data/raw/login_data.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"user1": "password1",
"user2": "password2"
}
11 changes: 11 additions & 0 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Étape 1 : Choisir l'image de base
FROM python:3.9-slim
# Étape 2 : Définir le répertoire de travail dans le container
WORKDIR /app
# Étape 3 : Copier les fichiers requirements et installer les dépendances
COPY requirements.txt requirements.txt
RUN pip install --no-cache-dir -r requirements.txt
# Étape 4 : Copier le reste du code de l'application dans le répertoire de travail
COPY . .
# Étape 5 : Spécifier la commande de démarrage
CMD ["uvicorn", "src.api.app:app", "--host", "0.0.0.0", "--port", "8000"]
20 changes: 20 additions & 0 deletions docker/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
version: '3.8'

services:
registry:
image: registry:2
ports:
- "5000:5000" # Expose le registre sur le port 5000

api:
build:
context: ../ # Le contexte est tout le répertoire "models"
dockerfile: docker/Dockerfile
image: localhost:5000/api:latest # Image nommée et taggée pour le registre local
ports:
- "8000:8000" # Expose l'API sur le port 8000
depends_on:
- registry
environment:
- PYTHONUNBUFFERED=1 # Variable d'environnement pour ne pas buffer les logs Python, affiche logs en console en temps réel

1 change: 1 addition & 0 deletions models/KNN250_performance.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"accuracy": 0.5146269690150597, "f1_score": 0.49333974682631226, "recall": 0.5146269690150597, "precision": 0.4996245809185517}
Binary file added models/KNN_250.joblib
Binary file not shown.
Binary file added models/encoder.joblib
Binary file not shown.
Loading