Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
6d051d3
add baseline models, pickle files and analysis tools
759257989 Mar 19, 2025
1390ca4
xgboots baseline mode
759257989 Mar 19, 2025
743e682
trained a ridge baseline model
759257989 Mar 19, 2025
54ea64a
initial baseline models
759257989 Mar 20, 2025
e741e67
Merge pull request #4 from LinhongDai/MLmodels
759257989 Mar 20, 2025
c3b659e
final model
759257989 Mar 20, 2025
55ad551
Merge pull request #8 from LinhongDai/MLmodels
759257989 Mar 20, 2025
6fd8e9f
Implement model manager and prediction endpoint
Troy08 Mar 24, 2025
c24dfe8
Trained Model
Troy08 Mar 24, 2025
7d76bd5
Format backend code using Black
LinhongDai Mar 24, 2025
0f2898e
Add config files for code quality tools
LinhongDai Mar 24, 2025
aba3ebc
Add MLModel
Troy08 Mar 26, 2025
9da70e3
Merge main into julez-code-refactor
LinhongDai Mar 26, 2025
6530e19
reformated code using black
LinhongDai Mar 26, 2025
67c2067
Merge pull request #14 from LinhongDai/julez-code-refactor
LinhongDai Mar 26, 2025
d88962d
update docker file
Troy08 Apr 7, 2025
d19495e
Add initial CI workflow with lint, test, and Docker steps
LinhongDai Apr 7, 2025
e8318ab
docker compose file
759257989 Apr 7, 2025
413c401
Merge remote-tracking branch 'origin/main' into docker_compose
759257989 Apr 7, 2025
1498970
ml model fix
759257989 Apr 7, 2025
eec7cd0
Merge pull request #34 from LinhongDai/docker_compose
759257989 Apr 7, 2025
8835468
Update README with CI pipeline details
Apr 10, 2025
1f122dc
public endpoint
759257989 Apr 14, 2025
0d4002f
Merge changes from origin/main
LinhongDai Apr 16, 2025
b157969
update the cd file to automate the deployment
LinhongDai Apr 16, 2025
e42a2be
:only release can trigger the cd pipeline
LinhongDai Apr 17, 2025
0bce226
replace src/ with app/ in ci.yml
LinhongDai Apr 17, 2025
3896b9e
add black to ci file
LinhongDai Apr 17, 2025
ecaba62
move pylint test after black
LinhongDai Apr 17, 2025
724d709
move black check after black
LinhongDai Apr 17, 2025
7ec217b
move black check after black
LinhongDai Apr 17, 2025
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
6 changes: 6 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
__pycache__/
.git/
*.pyc
.env
.vscode/
.DS_Store
42 changes: 29 additions & 13 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
name: CI/CD Pipeline

on:
push:
branches: [master, main]
pull_request:
branches: [master, main]
release:
types: [published] # Upon every Release,the CD pipeline should run and automagically update

jobs:
test:
Expand Down Expand Up @@ -32,16 +30,34 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Build Docker image
run: docker build -t common-assessment-tool .
- name: Checkout repository
uses: actions/checkout@v4

- name: Run Docker container
- name: Set up SSH key
run: |
docker run -d -p 8000:8000 common-assessment-tool
sleep 10 # Wait for container to start
mkdir -p ~/.ssh
echo "${{ secrets.EC2_KEY }}" > ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
ssh-keyscan -H ${{ secrets.EC2_HOST }} >> ~/.ssh/known_hosts

- name: Test Docker container
- name: Deploy to EC2
run: |
curl http://localhost:8000/docs
ssh ${{ secrets.EC2_HOST }} << 'EOF'
cd ${{ secrets.EC2_PROJECT_PATH }}
git pull origin main
source venv/bin/activate
pkill -f "uvicorn" || true
nohup uvicorn app.main:app --host 0.0.0.0 --port 8000 > out.log 2>&1 &
EOF

# - name: Build Docker image
# run: docker build -t common-assessment-tool .

# - name: Run Docker container
# run: |
# docker run -d -p 8000:8000 common-assessment-tool
# sleep 10 # Wait for container to start

# - name: Test Docker container
# run: |
# curl http://localhost:8000/docs
25 changes: 25 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,36 @@ jobs:
pip install setuptools wheel
pip install -r requirements.txt # Install dependencies from requirements.txt
pip install pylint pytest
pip install black


- name: Run Tests
run: |
python -m pytest tests/

- name: Format code with Black
run: |
black .

- name: Check code formatting with Black
run: |
black --check .


# - name: Run Pylint
# run: |
# pylint app/

- name: Build Docker Image (syntax check)
run: |
docker build -t my-app:test .

- name: Run Docker Container
run: |
docker run --rm -d --name test-container -p 8000:8000 my-app:test
sleep 5 # Give it time to start
docker ps # Verify it's running

- name: Print Success Message
run: |
echo "CI Pipeline completed successfully!"
Expand Down
6 changes: 6 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
repos:
- repo: https://github.com/psf/black
rev: 23.11.0
hooks:
- id: black
language_version: python3
Loading