Skip to content

Commit

Permalink
bug fixes & improvement in cicd
Browse files Browse the repository at this point in the history
  • Loading branch information
ronylpatil committed May 5, 2024
1 parent 546c6b7 commit 24e5797
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
15 changes: 8 additions & 7 deletions .github/workflows/cicd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,23 +31,23 @@ jobs:
- name: Checkout Code
uses: actions/checkout@v2

- name: Install AWS CLI
- name: Install AWS CLI # install aws cli in runner space
run: |
sudo apt-get update
sudo apt-get install -y awscli
- name: Configure AWS CLI
- name: Configure AWS CLI # configure aws cli so that we can access there services via cmd line or scripts
run: |
aws configure set aws_access_key_id ${{ secrets.AWS_ACCESS_KEY_ID }}
aws configure set aws_secret_access_key ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws configure set region ${{ secrets.AWS_REGION }}
- name: Install Utilities
- name: Install Utilities # install utilities required to fetch model from backend
run: |
python -m pip install --upgrade pip
if [ -f model_requirements.txt ]; then pip install -r model_requirements.txt; fi
- name: Fetch Model From Mlflow
- name: Fetch Model From Mlflow # below script will executed and fetch the prod model
run: |
python ./prod/mlflowdb.py ${{ secrets.TRACKING_URI }}
Expand Down Expand Up @@ -82,12 +82,13 @@ jobs:
- name: Print Current Directory af-down # for debugging
run: ls /home/runner/work/cicd/cicd

- name: Build Docker Image
- name: Build Docker Image
run: |
docker build -t ${{ secrets.DOCKER_USERNAME }}/wineqcicd:v1.1 .
- name: Log-in to Docker Hub
- name: Log-in to Docker Hub
run: docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }}

- name: Push Docker Img
- name: Push Docker Img # push the previously built img to dockerhub
run: docker push ${{ secrets.DOCKER_USERNAME }}/wineqcicd:v1.1

4 changes: 2 additions & 2 deletions prod/mlflowdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from mlflow.sklearn import load_model

def get_model(tracking_uri) :
# Define your machine learning model class
# Define your machine learning model class
mlflow.set_tracking_uri(tracking_uri)
# tracking_uri = params['mlflow_config']['mlflow_tracking_uri']
client = MlflowClient()
Expand All @@ -23,7 +23,7 @@ def save_model(uri) -> None:
model, details = get_model(uri)
joblib.dump(model, './model.joblib')

with open('model_details.json', 'w') as jsn :
with open('./model_details.json', 'w') as jsn :
json.dump({'name': details.name,
'version': details.version,
'alias': details.aliases,
Expand Down

0 comments on commit 24e5797

Please sign in to comment.