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

Josef final #6

Open
wants to merge 174 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
174 commits
Select commit Hold shift + click to select a range
4195876
Add files via upload
probinb Jun 12, 2024
3479508
updated .gitignore to ignore .venv/ also and used pathlib.Path for pa…
evan-stromatias Jun 13, 2024
b41565b
initial docker compose for the db and pgadmin
evan-stromatias Jun 13, 2024
40182b4
finished db docker-compose
evan-stromatias Jun 14, 2024
f1bf761
Update files for local file system and path references
DocJosef Jun 14, 2024
bc06c81
Add all my data to my branch
DocJosef Jun 14, 2024
12df9e6
Add api.py to ModelAPI branch
Jun 14, 2024
a853581
First draft user interface.
DocJosef Jun 14, 2024
9f507dd
added tutorial notebook
evan-stromatias Jun 14, 2024
50fad7a
Updated gitignore
DocJosef Jun 17, 2024
fa4cba4
changed the input span of the ModelInputFeatures
probinb Jun 19, 2024
10b53bf
filepath adjusted from // to just /
probinb Jun 19, 2024
91abdc6
added further requirements
probinb Jun 19, 2024
1fdc83e
Update src/models/api.py and src/models/train_model.py
probinb Jun 19, 2024
70b1836
added empty test and cicd pipeline
evan-stromatias Jun 19, 2024
7963bcc
Merge pull request #1 from DataScientest-Studio/feature/database
evan-stromatias Jun 19, 2024
7f5ac65
fixed an issue with uploading the data to the db to make it faster
evan-stromatias Jun 19, 2024
750d52b
Updated last improvements:
DocJosef Jun 20, 2024
fb635e8
Merge pull request #2 from DataScientest-Studio/feature/faster_db
evan-stromatias Jun 21, 2024
27ace2a
Api works now
probinb Jun 21, 2024
e1c145c
created Docker
probinb Jun 21, 2024
a4d4452
merged with master
probinb Jun 21, 2024
855b9dd
added to docker-compose
probinb Jun 21, 2024
3bea85c
Merge pull request #3 from DataScientest-Studio/ModelAPI
probinb Jun 21, 2024
43e7384
Update Model Files
DocJosef Jun 24, 2024
5a04d88
Merge with Master
DocJosef Jun 24, 2024
a8e1a8a
Update files for local file system and path references
DocJosef Jun 24, 2024
50afef3
Airflow with custom filesensor is running
evan-stromatias Jun 25, 2024
e152a16
added tests for the db and file tasks because Iwill use them in airfl…
evan-stromatias Jun 25, 2024
a8e68e7
Updates ...
DocJosef Jun 26, 2024
21ad04e
custom airflow image, dag tasks and tests
evan-stromatias Jun 26, 2024
4fb297f
Update for Training dags
DocJosef Jun 27, 2024
0b03438
airflow docker runs
evan-stromatias Jun 27, 2024
eb12884
created sep python packages
evan-stromatias Jun 27, 2024
b76e9b8
created stub project structure for model api and stub test
evan-stromatias Jun 27, 2024
c6a367f
added user login and unittesting
probinb Jun 28, 2024
42e7b2d
added comments
evan-stromatias Jun 28, 2024
e884786
added missing reqs
evan-stromatias Jun 28, 2024
369cfe5
Merge branch 'ModelAPI' into feature/database_ingest_dag_and_model
evan-stromatias Jun 28, 2024
28b8801
created a python project for the Model api
evan-stromatias Jun 28, 2024
d283666
removed old src files
evan-stromatias Jun 28, 2024
6248d25
update .gitignore
evan-stromatias Jun 30, 2024
8d5c93e
created and tested the UI. It works locally and with docker compose b…
evan-stromatias Jun 30, 2024
14a7a10
Merge pull request #5 from DataScientest-Studio/feature/database_inge…
DocJosef Jun 30, 2024
914da85
fixed merge issues, added admin user in .env
evan-stromatias Jun 30, 2024
57195e0
Merge pull request #4 from DataScientest-Studio/feature/database_inge…
DocJosef Jul 1, 2024
135c0e7
testing login to dockerhub
evan-stromatias Jul 1, 2024
39fc6fe
testing building the docker image with github actions
evan-stromatias Jul 1, 2024
e0b5853
testing building the docker image with github actions
evan-stromatias Jul 1, 2024
bdfdca2
testing building the docker image with github actions
evan-stromatias Jul 1, 2024
8d8ddcd
testing pushing the docker image with github actions
evan-stromatias Jul 1, 2024
3b3da93
changed the docker image name
evan-stromatias Jul 1, 2024
06fba1e
changed the docker image name
evan-stromatias Jul 1, 2024
00ba639
added cd for the model_api
evan-stromatias Jul 1, 2024
5b5a953
added ui to cicd
evan-stromatias Jul 1, 2024
6591b6b
removed root docker files since docker images should be downloaded fr…
evan-stromatias Jul 1, 2024
0cb03dd
added missing airflow dag dependencies in the airflowDb.Dockerfile
evan-stromatias Jul 1, 2024
53d0922
Merge pull request #7 from DataScientest-Studio/fix/unblock_dags
DocJosef Jul 1, 2024
76de115
first try of refresh endpoint
probinb Jul 1, 2024
0b29142
added updates from master manually
probinb Jul 1, 2024
0805cd4
no longer needed file
probinb Jul 1, 2024
f800723
deleted unnecessary lines
probinb Jul 1, 2024
321c5dd
Resolved merge conflicts by taking changes from master
probinb Jul 1, 2024
03e803c
Several Changes:
DocJosef Jul 1, 2024
b99ca88
Several Changes:
DocJosef Jul 1, 2024
3d8f1b5
Merge pull request #8 from DataScientest-Studio/josef_final
evan-stromatias Jul 1, 2024
7877e17
updating readme.md
evan-stromatias Jul 1, 2024
0996df7
Merge branch 'master' into fix/readme_docs
evan-stromatias Jul 1, 2024
ed19e33
first version of the Green Light Services documentation
evan-stromatias Jul 1, 2024
15486dc
merged with master. Updated the airflowdb docker image and ci/cd
evan-stromatias Jul 1, 2024
11b65ea
updated the github actions of road_accidents_database_ingestion
evan-stromatias Jul 1, 2024
9caa105
updated the github actions of road_accidents_database_ingestion
evan-stromatias Jul 1, 2024
fa9d29b
updated the github actions of road_accidents_database_ingestion
evan-stromatias Jul 1, 2024
183613f
added task in my airflow dag to set a variable when new data added to…
evan-stromatias Jul 2, 2024
860122a
Merge pull request #6 from DataScientest-Studio/feature/cicd_dockerhub
DocJosef Jul 2, 2024
6280081
Updates to keep file structures & Content of Volumes
DocJosef Jul 2, 2024
592f060
added a working refresh endpoint
probinb Jul 2, 2024
d16a184
Merge pull request #10 from DataScientest-Studio/feature/airflow_set_…
DocJosef Jul 2, 2024
c6620ec
fixed conflicts by removing the unused readme_db.md file
evan-stromatias Jul 2, 2024
c0c6b62
Merge pull request #9 from DataScientest-Studio/fix/readme_docs
DocJosef Jul 2, 2024
381218e
renewed the modelpath
probinb Jul 2, 2024
f0b7d3f
updated the endpoint refresh
probinb Jul 2, 2024
78f42e9
fixed a small issue with the data ingestion dag when there was an emp…
evan-stromatias Jul 2, 2024
5996e05
Merge pull request #11 from DataScientest-Studio/improvements/ingest_…
probinb Jul 3, 2024
95c103a
changed model to models repository
probinb Jul 3, 2024
8fdf6ea
Merge branch 'master' into ModelAPI
probinb Jul 3, 2024
5030be2
Updates on the DAG for 1_training_pipeline_dag
DocJosef Jul 3, 2024
9a3be96
Commit for merge to master
DocJosef Jul 3, 2024
37c7d02
Merge pull request #12 from DataScientest-Studio/ModelAPI
DocJosef Jul 3, 2024
7c12fcd
Merge branch 'master' into josef_final
DocJosef Jul 3, 2024
ce0880a
Merge pull request #13 from DataScientest-Studio/josef_final
evan-stromatias Jul 3, 2024
2d9b715
model_evaluation updates
DocJosef Jul 3, 2024
fc00325
Merge branch 'master' into josef_final
DocJosef Jul 3, 2024
8aa9bf8
fixed some bugs in the green light ui so it can start but i had to co…
evan-stromatias Jul 3, 2024
61fe5e6
added a unit test to make sure greenlight streamlit app strats
evan-stromatias Jul 3, 2024
835584f
fixed test streamlit app path
evan-stromatias Jul 3, 2024
cc5f5fc
testing a new github workflow that should run when a PR is merged to …
evan-stromatias Jul 3, 2024
b9ae53f
Updates before merge master
DocJosef Jul 3, 2024
f9f8a9d
changes suggested from josef
evan-stromatias Jul 3, 2024
6f6ee2c
Merge pull request #14 from DataScientest-Studio/fix/green_light_ui_w…
DocJosef Jul 3, 2024
3065b8d
Merge branch 'master' into josef_final
DocJosef Jul 3, 2024
a31c777
fixed an issue with the airflow dag
evan-stromatias Jul 3, 2024
9770fc5
created a github actions var for the docker hub pass
evan-stromatias Jul 3, 2024
14c31b6
created a github actions var for the docker hub pass
evan-stromatias Jul 3, 2024
5afa08e
created a github actions var for the docker hub pass
evan-stromatias Jul 3, 2024
4cdee11
the ci now only builds the docker images but not push to dockerhub. T…
evan-stromatias Jul 3, 2024
ee93f84
Merge pull request #16 from DataScientest-Studio/update_ci_cd
evan-stromatias Jul 3, 2024
9ba0b21
fixed issue with processing road accident data from 2020-2022
evan-stromatias Jul 4, 2024
8415361
Merge pull request #15 from DataScientest-Studio/fix/road_accident_db…
probinb Jul 4, 2024
130d07d
Updates for Training DAG and assciacted files.
DocJosef Jul 5, 2024
23480ed
Collateral files
DocJosef Jul 5, 2024
244090e
added xgboost as a req in the model_api
evan-stromatias Jul 5, 2024
4651bfe
Merge branch 'master' into josef_final
DocJosef Jul 5, 2024
c74b12f
Merge branch 'josef_final' of https://github.com/DataScientest-Studio…
DocJosef Jul 5, 2024
44ab4b5
fixed and tested an env variable issue with a db ingestion dag
evan-stromatias Jul 5, 2024
09d9c2a
Added the functions to call the refresh endpoint
DocJosef Jul 5, 2024
7ba946e
Merge pull request #17 from DataScientest-Studio/fix/airflowdb_env_va…
DocJosef Jul 5, 2024
9eaf017
Merge branch 'master' into josef_final
DocJosef Jul 5, 2024
a538276
added github secret for the dockerhub
evan-stromatias Jul 5, 2024
2dc72e5
Merge pull request #18 from DataScientest-Studio/update/ci_cd_secrets
DocJosef Jul 5, 2024
3d3a1a9
Added trigger on env.variable to start train-dags
DocJosef Jul 5, 2024
0e5fe41
Added gitignore
DocJosef Jul 5, 2024
e548cac
shellscript
DocJosef Jul 5, 2024
6449b5b
Merge branch 'master' into josef_final
DocJosef Jul 5, 2024
98c1182
fixing dirs
evan-stromatias Jul 5, 2024
ab38bf2
Updated the docker env variables and paths for the road accidents csv…
evan-stromatias Jul 5, 2024
44a10fb
added extra folder structure
evan-stromatias Jul 5, 2024
c7d1aeb
Push before pulling evans version
DocJosef Jul 6, 2024
61867a1
added docker startup shell
DocJosef Jul 6, 2024
9ac2a94
Merge branch 'evan/josef_final' into josef_final
DocJosef Jul 6, 2024
c443a3d
finalizing the cicd pipelines
evan-stromatias Jul 6, 2024
7e1e990
Merge pull request #19 from DataScientest-Studio/cicd/finalize
evan-stromatias Jul 6, 2024
e9f1e9e
This is a first draft on Paulas Streamlit pages for
DocJosef Jul 6, 2024
77db792
testing deployment on new tag
evan-stromatias Jul 6, 2024
3fd7e02
Update deploy-docker-images-on-new-tag.yml
evan-stromatias Jul 6, 2024
7faf442
Merge pull request #20 from DataScientest-Studio/cicd/finalize_part2
evan-stromatias Jul 6, 2024
e676c85
deploy docker images using latest and github tag version
evan-stromatias Jul 6, 2024
6eb7464
Merge pull request #21 from DataScientest-Studio/cicd/finalize_part2
evan-stromatias Jul 6, 2024
70f6eb3
use the correct dockerfile for the DeployRoadAccidentsDatabaseIngesti…
evan-stromatias Jul 6, 2024
8c0939a
Last updates on api.py
DocJosef Jul 6, 2024
2f2c7ae
Added text for the CI/CD part in the green_light_ui package. Updated …
evan-stromatias Jul 7, 2024
768bf52
Added a start_docker.sh since in my ubuntu these
DocJosef Jul 7, 2024
71c91a6
Updated the Streamlit app for a crude login feature
DocJosef Jul 7, 2024
597e7ed
finished the airflow data ingestion dag
evan-stromatias Jul 7, 2024
fd91a2b
updated readme.md
evan-stromatias Jul 7, 2024
3b7dc34
Merge pull request #22 from DataScientest-Studio/final_docs/evan_from…
DocJosef Jul 7, 2024
1450ba2
Updated the Training and the Modelliung page.
DocJosef Jul 7, 2024
955581f
Merge pull request #23 from DataScientest-Studio/josef_final
DocJosef Jul 8, 2024
e0e6bf7
added code to run the ModelAPi locally
probinb Jul 8, 2024
e1143b8
Fixed Bugs in predict and added light/heavy acc feature
DocJosef Jul 8, 2024
020ff7d
added evans and Paulas LinkedIn profile and Github
probinb Jul 8, 2024
95c2264
added some details to Api tab in Streamlit UI
probinb Jul 8, 2024
f4f0c19
Merge branch 'josef_final' of https://github.com/DataScientest-Studio…
probinb Jul 8, 2024
cb3a0a9
edited the api tab
probinb Jul 8, 2024
a2e8a41
Had to switch DOCKERIZED = True to make it run in
DocJosef Jul 8, 2024
3412cb0
added email configuration in docker composer for sending email alerts…
Jul 8, 2024
0722b73
updated readme
Jul 8, 2024
5674d53
Merge remote-tracking branch 'origin/Josef_final' into small_changes_…
probinb Jul 8, 2024
d462d3b
deleted unnecessary file
probinb Jul 8, 2024
969a3b5
edited file paths to dockerize
probinb Jul 8, 2024
03d2e4e
Merge branch 'josef_final' of https://github.com/DataScientest-Studio…
probinb Jul 8, 2024
664a1e3
edited api tab
probinb Jul 8, 2024
7ecf0e8
added the MVP Architecture image
probinb Jul 9, 2024
63af495
added info about admin login
probinb Jul 9, 2024
bfcff13
Merge pull request #24 from DataScientest-Studio/demo/airflow_email_a…
DocJosef Jul 9, 2024
389ebd1
Final updates
DocJosef Jul 9, 2024
7c8b4c8
shortening of the phrases in intro and api
probinb Jul 9, 2024
c58eed5
Merge branch 'small_changes_ui_paula' into josef_final
probinb Jul 9, 2024
00fd371
deleted old expander in service platform tab
probinb Jul 9, 2024
b97788c
corrected a typo
probinb Jul 9, 2024
946d6f8
Change Dag Task Name to model_evaluation
DocJosef Jul 9, 2024
f369063
Merge branch 'master' into josef_final
DocJosef Jul 9, 2024
70f0021
Updated the readme.md, updated my tabs, removed the old Volumes/data/…
evan-stromatias Jul 9, 2024
4334b71
Merge pull request #25 from DataScientest-Studio/josef_final_evan_upd…
evan-stromatias Jul 9, 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
4 changes: 4 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Volumes
*.egg-info
.venv
__pycache__
33 changes: 33 additions & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Green Light Super User
ADMIN_USERNAME=admin
ADMIN_PASSWORD=adm1n

# ML Model API
MODEL_PATH=/models
MODEL_FILENAME="trained_model.joblib"
MODEL_API_PORTS="8001:8000"

# Road Accidents DB (Postgresql)
ROAD_ACCIDENTS_POSTGRES_DB=RoadAccidents
ROAD_ACCIDENTS_POSTGRES_PORT=5432
ROAD_ACCIDENTS_POSTGRES_HOST=postgres_road_accidents
# Raw Road Accidents CSV files upload path in Docker
ROAD_ACCIDENTS_DATA_DIRECTORIES=/road_accidents_data_directories/
# The name of the Airflow variable used between DAGs to indicate the time new Road Accidents data added to the db.
AIRFLOW_NEW_DATA_IN_ROAD_ACCIDENTS_DB_VARNAME="new_road_accident_data_in_db_timestamp"

# Road Accidents DB PgAdmin
[email protected]
PGADMIN_DEFAULT_PASSWORD=admin

# Airflow
AIRFLOW_UID=501
AIRFLOW_GID=0
AIRFLOW_PROJ_DIR=./Volumes/airflow

# for Testing purposes

DOCKERIZED=True

# TODO
# Add volume dir names
74 changes: 74 additions & 0 deletions .github/workflows/build-and-push-docker-images.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
name: Continuous Delivery when a PR is merged to master

on:
pull_request:
types:
- closed

permissions:
contents: read

jobs:
RoadAccidentsDatabaseIngestion:
if: github.event.pull_request.merged == true
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Login to the Docker Hub
uses: docker/login-action@v1
with:
username: roadaccidentsmlops24
password: ${{ secrets.DOCKER_HUB_PASS }}

- name: Build and push the road_accidents_database_ingestion Docker image to the roadaccidentsmlops24 DockerHub
uses: docker/build-push-action@v2
with:
context: ./python-packages/
file: ./python-packages/airflowdb.Dockerfile
push: true
tags: roadaccidentsmlops24/airflowdb:latest, roadaccidentsmlops24/airflowdb:${{ github.run_number }}

ModelApi:
if: github.event.pull_request.merged == true
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Login to the Docker Hub
uses: docker/login-action@v1
with:
username: roadaccidentsmlops24
password: ${{ secrets.DOCKER_HUB_PASS }}

- name: Build and push the model_api Docker image to the roadaccidentsmlops24 DockerHub
uses: docker/build-push-action@v2
with:
context: ./python-packages/model_api/
push: true
tags: roadaccidentsmlops24/model_api:latest, roadaccidentsmlops24/model_api:${{ github.run_number }}
dockerfile: ./python-packages/model_api/Dockerfile


GreenLightUi:
if: github.event.pull_request.merged == true
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Login to the Docker Hub
uses: docker/login-action@v1
with:
username: roadaccidentsmlops24
password: ${{ secrets.DOCKER_HUB_PASS }}

- name: Build and push the green_light_ui Docker image to the roadaccidentsmlops24 DockerHub
uses: docker/build-push-action@v2
with:
context: ./python-packages/green_light_ui/
push: true
tags: roadaccidentsmlops24/accidents_ui:latest, roadaccidentsmlops24/accidents_ui:${{ github.run_number }}
dockerfile: ./python-packages/green_light_ui/Dockerfile
84 changes: 84 additions & 0 deletions .github/workflows/deploy-docker-images-on-new-tag.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
name: Build and deploy Docker images to Hub on new Tag creation

on:
push:
tags:
- 'v*.*.*'
jobs:
DeployRoadAccidentsDatabaseIngestionDockerImage:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set env
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV

- name: GetTagVersion
run: |
echo $RELEASE_VERSION
echo ${{ env.RELEASE_VERSION }}

- name: Login to the Docker Hub
uses: docker/login-action@v1
with:
username: roadaccidentsmlops24
password: ${{ secrets.DOCKER_HUB_PASS }}

- name: Build and push the road_accidents_database_ingestion Docker image to the roadaccidentsmlops24 DockerHub
uses: docker/build-push-action@v2
with:
context: ./python-packages/
file: ./python-packages/airflowdb.Dockerfile
push: true
tags: roadaccidentsmlops24/airflowdb:latest, roadaccidentsmlops24/airflowdb:${{ env.RELEASE_VERSION }}

DeployModelApiDockerImage:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set env
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV

- name: GetTagVersion
run: |
echo $RELEASE_VERSION
echo ${{ env.RELEASE_VERSION }}

- name: Login to the Docker Hub
uses: docker/login-action@v1
with:
username: roadaccidentsmlops24
password: ${{ secrets.DOCKER_HUB_PASS }}

- name: Build and push the model_api Docker image to the roadaccidentsmlops24 DockerHub
uses: docker/build-push-action@v2
with:
context: ./python-packages/model_api/
push: true
tags: roadaccidentsmlops24/model_api:latest, roadaccidentsmlops24/model_api:${{ env.RELEASE_VERSION }}
dockerfile: ./python-packages/model_api/Dockerfile

DeployGreenLightUiImage:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set env
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV

- name: GetTagVersion
run: |
echo $RELEASE_VERSION
echo ${{ env.RELEASE_VERSION }}

- name: Login to the Docker Hub
uses: docker/login-action@v1
with:
username: roadaccidentsmlops24
password: ${{ secrets.DOCKER_HUB_PASS }}

- name: Build and push the green_light_ui Docker image to the roadaccidentsmlops24 DockerHub
uses: docker/build-push-action@v2
with:
context: ./python-packages/green_light_ui/
push: true
tags: roadaccidentsmlops24/accidents_ui:latest, roadaccidentsmlops24/accidents_ui:${{ env.RELEASE_VERSION }}
dockerfile: ./python-packages/green_light_ui/Dockerfile
135 changes: 112 additions & 23 deletions .github/workflows/python-app.yml
Original file line number Diff line number Diff line change
@@ -1,40 +1,129 @@
# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
'''
name: Python application

# https://www.youtube.com/watch?v=R8_veQiYBjI&ab_channel=TechWorldwithNana

name: Continuous Integration

on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]

# DOCKER_HUB_PASS

permissions:
contents: read

jobs:
build:
RoadAccidentsDatabaseIngestion:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Set up Python 3.12
uses: actions/setup-python@v3
with:
python-version: "3.12"

- name: Update pip
run: |
python -m pip install --upgrade pip

- name: Install road_accidents_database_ingestion package
run: |
python -m pip install -e python-packages/road_accidents_database_ingestion

- name: Test road_accidents_database_ingestion package
run: |
pytest python-packages/road_accidents_database_ingestion/tests

- name: Login to the Docker Hub
uses: docker/login-action@v1
with:
username: roadaccidentsmlops24
password: ${{ secrets.DOCKER_HUB_PASS }}

- name: Build the road_accidents_database_ingestion Docker image
uses: docker/build-push-action@v2
with:
context: ./python-packages/
file: ./python-packages/airflowdb.Dockerfile
push: false
tags: roadaccidentsmlops24/airflowdb:latest, roadaccidentsmlops24/airflowdb:${{ github.run_number }}

ModelApi:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Set up Python 3.10
uses: actions/setup-python@v3
with:
python-version: "3.10"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8 pytest
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Test with pytest
run: |
pytest
'''
- uses: actions/checkout@v3

- name: Set up Python 3.12
uses: actions/setup-python@v3
with:
python-version: "3.12"

- name: Update pip
run: |
python -m pip install --upgrade pip

- name: Install model_api package
run: |
python -m pip install -e python-packages/model_api

- name: Test model_api package
run: |
pytest python-packages/model_api/tests

- name: Login to the Docker Hub
uses: docker/login-action@v1
with:
username: roadaccidentsmlops24
password: ${{ secrets.DOCKER_HUB_PASS }}

- name: Build the model_api Docker image
uses: docker/build-push-action@v2
with:
context: ./python-packages/model_api/
push: false
tags: roadaccidentsmlops24/model_api:latest, roadaccidentsmlops24/model_api:${{ github.run_number }}
dockerfile: ./python-packages/model_api/Dockerfile

GreenLightUi:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Set up Python 3.12
uses: actions/setup-python@v3
with:
python-version: "3.12"

- name: Update pip
run: |
python -m pip install --upgrade pip

- name: Install green_light_ui package
run: |
python -m pip install -e python-packages/green_light_ui

- name: Test green_light_ui package
run: |
pytest python-packages/green_light_ui/tests

- name: Login to the Docker Hub
uses: docker/login-action@v1
with:
username: roadaccidentsmlops24
password: ${{ secrets.DOCKER_HUB_PASS }}

- name: Build the green_light_ui Docker image
uses: docker/build-push-action@v2
with:
context: ./python-packages/green_light_ui/
push: false
tags: roadaccidentsmlops24/accidents_ui:latest, roadaccidentsmlops24/accidents_ui:${{ github.run_number }}
dockerfile: ./python-packages/green_light_ui/Dockerfile
Loading