Skip to content

Commit

Permalink
Merge branch '4/deploy_model_api' of https://github.com/FrancoisLbrn/…
Browse files Browse the repository at this point in the history
…xhec-mlops-project-student into 4/deploy_model_api
  • Loading branch information
benjamincerf57 committed Oct 24, 2024
2 parents 03812a1 + c864390 commit e73d16d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
4 changes: 2 additions & 2 deletions Dockerfile.app
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ RUN pip install --upgrade pip
COPY requirements.txt ./
RUN pip install -r requirements.txt

# Copy the application into the /web_service folder
COPY ./src/web_service /web_service
# Copy all of src into the /src folder
COPY ./src /src

# Copy the run_services.sh script into the /bin folder
COPY ./bin/run_services.sh /bin/run_services.sh
Expand Down
11 changes: 9 additions & 2 deletions bin/run_services.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,14 @@ prefect config set PREFECT_API_URL=http://0.0.0.0:4200/api
prefect server start --host 0.0.0.0 --port 4200 &

# Navigate to the correct directory
cd /web_service # Make sure this path is correct
cd /src/web_service # Make sure this path is correct

# Start FastAPI with Uvicorn on port 8001
uvicorn main:app --host 0.0.0.0 --port 8001
uvicorn main:app --host 0.0.0.0 --port 8001 &

# Wait for Prefect server to be live before running deployment.py
sleep 10

# Run deployment.py to train model regularly in Prefect
cd /src/modelling
python3 deployment.py

0 comments on commit e73d16d

Please sign in to comment.