Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
fee0ad5
Update README.md
xyw07 Oct 23, 2024
b35f588
Update README.md
maizhouyuan Oct 23, 2024
a5b8c5c
Update README.md
Amaizzzzz Oct 23, 2024
47b4cf4
Update README.md
Amaizzzzz Oct 23, 2024
90e6e97
adding config.py and database.py for sqLite
MingtianfangLi Nov 6, 2024
32d273b
Merge branch 'ming' of https://github.com/Mingtianfang-Li/CommonAsses…
Mingtianfang-Li Nov 6, 2024
4576b04
adjusting file structures, adding models for database
Mingtianfang-Li Nov 6, 2024
97d6e5f
adding schema folder to support API
Mingtianfang-Li Nov 6, 2024
8f39f9c
adding user crud functions
Mingtianfang-Li Nov 6, 2024
fb78e58
adjusting primary key to its own table, setup forgien key for each ta…
Mingtianfang-Li Nov 6, 2024
6be9678
adding detailed_info_crud
Mingtianfang-Li Nov 6, 2024
c773dfd
adding basic candidates and details_info apis
Mingtianfang-Li Nov 6, 2024
f8c7eeb
adjust main.py, connect to basic apis
Mingtianfang-Li Nov 6, 2024
bd3d4d1
grace edited
gracezhou777 Nov 13, 2024
0d0bdcb
User api
gracezhou777 Nov 13, 2024
a1013e1
user api tested ok
gracezhou777 Nov 13, 2024
0d2bef1
add testcases and bug fixes
Nov 18, 2024
929f3bf
Remove get-pip.py from tracking and add to .gitignore
Nov 18, 2024
291d77f
add try-catch to api
gracezhou777 Nov 19, 2024
379852d
detailed info api updated
gracezhou777 Nov 19, 2024
6e2aba7
delete test.db
gracezhou777 Nov 19, 2024
5df5e0d
adding CI pipeline
Mingtianfang-Li Nov 20, 2024
e4c3710
Merge pull request #10 from Mingtianfang-Li/add-ci-pipeline
Mingtianfang-Li Nov 20, 2024
ccec3ec
Add example Python file for Pylint testing
Mingtianfang-Li Nov 20, 2024
09aaf77
fixing pylint for test purposes
Mingtianfang-Li Nov 20, 2024
f88c4c2
Merge pull request #11 from Mingtianfang-Li/test-ci-pipeline
Mingtianfang-Li Nov 20, 2024
c288937
fixing pylint issus
Mingtianfang-Li Nov 20, 2024
8b4bc60
Merge pull request #12 from Mingtianfang-Li/test-ci-pipeline
Mingtianfang-Li Nov 20, 2024
206acc2
fixing pylint issue from main.py config.py excetion.py and api.api.py
Mingtianfang-Li Nov 20, 2024
86d339c
adding ignore in workflow
Mingtianfang-Li Nov 20, 2024
5e6226a
fixing pyLint for CRUD
Mingtianfang-Li Nov 21, 2024
95caaaa
fixing pylint for models
Mingtianfang-Li Nov 21, 2024
6ae2101
fixing pylint on schema
Mingtianfang-Li Nov 21, 2024
318647c
editing workflow
Mingtianfang-Li Nov 21, 2024
576cfa3
editing workflow
Mingtianfang-Li Nov 21, 2024
b0d7c77
editing workflow
Mingtianfang-Li Nov 21, 2024
8b1e549
editing workflow
Mingtianfang-Li Nov 21, 2024
a7c8385
editing workflow
Mingtianfang-Li Nov 21, 2024
f5d72cf
editing workflow
Mingtianfang-Li Nov 21, 2024
4fce41f
editing workflow
Mingtianfang-Li Nov 21, 2024
afdeebd
editing workflow
Mingtianfang-Li Nov 21, 2024
d7f4e5d
Merge pull request #13 from Mingtianfang-Li/test-ci-pipeline
Mingtianfang-Li Nov 21, 2024
8f59c12
Add Docker and GitHub Actions configuration
maizhouyuan Nov 27, 2024
af256a3
Modified Docker Workflow
maizhouyuan Nov 27, 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
8 changes: 8 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
env/
.venv/
__pycache__/
*.pyc
.git
.gitignore
.env
*.env
88 changes: 88 additions & 0 deletions .github/workflows/ci-pipeline.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
name: CI Pipeline

on:
push:
branches:
- main
paths-ignore:
- 'app/clients/**' # Ignore all changes in the 'clients' directory
pull_request:
branches:
- main
paths-ignore:
- 'app/clients/**' # Ignore all changes in the 'clients' directory

jobs:
lint:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10'

- name: Install dependencies
run: |
pip install -r requirements.txt # Install dependencies directly

- name: Install Pylint
run: |
pip install pylint # Install pylint globally in the current environment

- name: Run Pylint and Save Report
run: |
pylint app/ --ignore=clients || true # Continue even if pylint fails
pylint app/ --ignore=clients > pylint-report.txt # Save the report to a file

- name: Upload Pylint Report
uses: actions/upload-artifact@v3
with:
name: pylint-report
path: pylint-report.txt

- name: Generate Workflow Summary
run: |
echo "## Pylint Results" >> $GITHUB_STEP_SUMMARY
echo "\`\`\`" >> $GITHUB_STEP_SUMMARY
cat pylint-report.txt >> $GITHUB_STEP_SUMMARY
echo "\`\`\`" >> $GITHUB_STEP_SUMMARY

docker:
runs-on: ubuntu-latest
needs: lint # Ensure the lint job runs first

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Cache Docker layers
uses: actions/cache@v3
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-

- name: Build Docker Image
run: docker build -t my_project_image .

- name: Run Docker Container
run: |
docker run -d -p 5000:5000 my_project_image
sleep 10 # Wait for the container to start

- name: Test Docker Container
run: |
curl http://localhost:5000 || exit 1 # Test if the container is running properly

- name: Cleanup Docker Containers
run: |
docker stop $(docker ps -q) # Stop all running containers
docker rm $(docker ps -a -q) # Remove all containers
20 changes: 20 additions & 0 deletions .github/workflows/docker-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Docker CI

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

jobs:
build-and-test:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Build Docker image
run: docker compose build

- name: Run Docker container
run: docker compose up -d
2 changes: 2 additions & 0 deletions .github/workflows/pylint-report.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
************* Module app/
app/:1:0: F0001: No module named app/ (fatal)
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
.idea
__pycache__
.DS_Store
get-pip.py
20 changes: 20 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
FROM python:3.11-slim

WORKDIR /app

# 安装必要的系统包和 Python 开发工具
RUN apt-get update && apt-get install -y \
gcc \
python3-dev \
&& rm -rf /var/lib/apt/lists/*

# 安装 pip 和 setuptools
RUN pip install --no-cache-dir --upgrade pip setuptools

# 复制并安装依赖
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt

COPY . .

CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000"]
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ This will contain the model used for the project that based on the input informa
The model works off of dummy data of several combinations of clients alongside the interventions chosen for them as well as their success rate at finding a job afterward. The model will be updated by the case workers by inputing new data for clients with their updated outcome information, and it can be updated on a daily, weekly, or monthly basis.

This also has an API file to interact with the front end, and logic in order to process the interventions coming from the front end. This includes functions to clean data, create a matrix of all possible combinations in order to get the ones with the highest increase of success, and output the results in a way the front end can interact with.

7 changes: 7 additions & 0 deletions app/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
"""
This module contains initialization functions for the app.
"""

def model():
"""Return a placeholder model, currently returns None."""
return None
Empty file added app/api/__init__.py
Empty file.
Loading