Skip to content

Commit 617aad6

Browse files
Merge pull request #11 from vectornguyen76/develop
Clean and format code
2 parents 47d0ef8 + 5b08c50 commit 617aad6

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+1670
-1486
lines changed

.dockerignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,4 +262,4 @@ secring.*
262262
services/
263263

264264
# BBDD
265-
*.db
265+
*.db

.env

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@ FLASK_RUN_PORT="5000"
1212

1313
# Database service configuration
1414
DATABASE_URL="postgresql://db_user:db_password@localhost/db_dev"
15-
DATABASE_TEST_URL="postgresql://db_user:db_password@localhost/db_test"
15+
DATABASE_TEST_URL="postgresql://db_user:db_password@localhost/db_test"

.env.api.local

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@ POSTGRES_USER=db_user
2020
PGPASSWORD=db_password
2121

2222
DATABASE_TEST_URL=postgresql+psycopg2://db_user:db_password@db_service:5432/db_test
23-
DATABASE_URL=postgresql+psycopg2://db_user:db_password@db_service:5432/db_dev
23+
DATABASE_URL=postgresql+psycopg2://db_user:db_password@db_service:5432/db_dev

.env.db.local

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# Database service configuration
22
POSTGRES_USER=db_user
33
POSTGRES_PASSWORD=db_password
4-
POSTGRES_DB=db_dev
4+
POSTGRES_DB=db_dev

.env.pro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@ API_PORT=5000
1414
DATABASE_URL=sqlite:///production.db
1515

1616
# Deployment platform
17-
PLATFORM_DEPLOY=AWS
17+
PLATFORM_DEPLOY=AWS

.flake8

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
[flake8]
2+
ignore = F401
3+
max-line-length = 100
4+
max-complexity = 18
5+
select = B,C,E,F,W,T4,B9

.github/workflows/README.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,9 @@ File: [development_pipeline.yml](development_pipeline.yml)
77
Event: On **Pull Request** → any branch into **develop**
88

99
Jobs:
10+
1011
- Build
11-
- Unit Test
12+
- Unit Test
1213

1314
### Description:
1415

@@ -19,6 +20,7 @@ File: [staging_pipeline.yml](staging_pipeline.yml)
1920
Event: On **Pull Request** → any branch into **staging**
2021

2122
Jobs:
23+
2224
- Build
2325
- Unit Test
2426
- Deploy
@@ -32,8 +34,9 @@ File: [production_pipeline.yml](production_pipeline.yml)
3234
Event: On **Pull Request** → any branch into **main**
3335

3436
Jobs:
37+
3538
- Build
36-
- Test
39+
- Test
3740
- Deploy
3841

39-
### Description:
42+
### Description:

.github/workflows/ansible/deploy-app.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
---
2-
3-
- name: "configuration play."
2+
- name: "configuration play."
43
hosts: web
54
user: ubuntu
65
become: true
76
gather_facts: false
8-
vars:
7+
vars:
98
- ansible_python_interpreter: /usr/bin/python3
109
- ansible_host_key_checking: false
1110
- ansible_stdout_callback: yaml
@@ -18,7 +17,7 @@
1817
pre_tasks:
1918
- name: "wait 600 seconds for target connection to become reachable/usable."
2019
wait_for_connection:
21-
20+
2221
- name: Install aptitude
2322
apt:
2423
name: aptitude

.github/workflows/ansible/roles/deploy/tasks/main.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
remote_src: yes
1515
src: "/home/ubuntu/server/artifact-app.tar.gz"
1616
dest: "/home/ubuntu/server"
17-
17+
1818
- name: Pull mlflow image
1919
community.docker.docker_image:
2020
name: "{{ mlflow_image_name }}"
@@ -37,4 +37,4 @@
3737
become: True
3838
shell:
3939
chdir: /home/ubuntu/server
40-
cmd: "bash deployment/deploy.sh deploy_run_predictor data/model_config/phase-1/prob-1/model-1.yml data/model_config/phase-1/prob-2/model-1.yml 5040"
40+
cmd: "bash deployment/deploy.sh deploy_run_predictor data/model_config/phase-1/prob-1/model-1.yml data/model_config/phase-1/prob-2/model-1.yml 5040"

.github/workflows/development_pipeline.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: development
2-
on:
2+
on:
33
pull_request:
44
branches: develop
55

@@ -30,7 +30,7 @@ jobs:
3030
key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }}
3131
restore-keys: |
3232
${{ runner.os }}-pip-
33-
33+
3434
- name: Set up Python 3.9
3535
uses: actions/setup-python@v2
3636
with:
@@ -47,10 +47,10 @@ jobs:
4747
deploy-service:
4848
needs: build-test
4949
runs-on: ubuntu-latest
50-
env:
50+
env:
5151
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
5252
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
53-
AWS_REGION: 'us-east-1'
53+
AWS_REGION: "us-east-1"
5454
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
5555
DOCKERHUB_PASSWORD: ${{ secrets.DOCKERHUB_PASSWORD }}
5656
steps:
@@ -61,14 +61,14 @@ jobs:
6161
id: docker_hub_auth
6262
uses: docker/login-action@v1
6363
with:
64-
username: ${{ secrets.DOCKERHUB_USERNAME }}
65-
password: ${{ secrets.DOCKERHUB_PASSWORD }}
64+
username: ${{ secrets.DOCKERHUB_USERNAME }}
65+
password: ${{ secrets.DOCKERHUB_PASSWORD }}
6666

6767
- name: Build Docker Image
6868
id: build_docker
6969
run: |
7070
docker compose build api_service
71-
71+
7272
# Add tag
7373
docker tag api_image:latest ${{ secrets.DOCKERHUB_USERNAME }}/api_image:latest
7474
@@ -81,4 +81,4 @@ jobs:
8181
with:
8282
name: MyStackEC2
8383
template: myStack.yaml
84-
parameter-overrides: "MyParam1=myValue,MyParam2=${{ secrets.MY_SECRET_VALUE }}"
84+
parameter-overrides: "MyParam1=myValue,MyParam2=${{ secrets.MY_SECRET_VALUE }}"

0 commit comments

Comments
 (0)