Are you sure you want to delete this access key?
Legend |
---|
DVC Managed File |
Git Managed File |
Metric |
Stage File |
External File |
Legend |
---|
DVC Managed File |
Git Managed File |
Metric |
Stage File |
External File |
MLflow for experiment tracking and DVC for ML Pipeline tracking, Data versioning and experiment tracking too. I'm using mlflow for experiment tracking.
Tasks
Clone the repository
git clone https://github.com/MartinKalema/Kidney-Disease-Classification-MLflow-DVC.git
Create a conda environment after opening the repository and activate it
conda create -n kidney python=3.8 -y
conda activate kidney
Install the requirements
pip install -r requirements.txt
This Project is connected to Dagshub so all my experiments are sent to dagshub and can be viewed on dagshub itself or on the mlflow platform integrated there. MLflow is a production grade experiments tracker for managing end-to-end machine learning lifecycle. It helps with experiments tracking, packaging code into reproducible runs and sharing and deploying models.
Do not set the tracking uri using,
mlflow.set_tracking_uri()
All experiments will be stored inside an auto generated folder called mlruns. Use the command below to view them in the mlflow web interface
mlflow ui
Connect your github account to DagsHub @ https://dagshub.com
Whenever you close your editor and open it again, the mlflow uri configs are erased and you must run the commands below in your bash terminal again, otherwise the experiments will be saved on your local machine in a folder called mlruns
export MLFLOW_TRACKING_URI=https://dagshub.com/kalema3502/Kidney-Disease-Classification-MLflow-DVC.mlflow
export MLFLOW_TRACKING_USERNAME=kalema3502
export MLFLOW_TRACKING_PASSWORD=fb3845efcc3b2e46a4157b1d2c977a21e02dd16e
DVC (Data Version Control) is a light weight experiments tracker and it can perform orchestration (creating pipelines)
dvc init
Add the project pipelines to the dvc.yaml file, then run the command below.
dvc repro
To the pipeline structure, use the command below
dvc dag
Login to the AWS console
Create an IAM user for deployment
The user should have EC2 & ECR access. The deployment steps are mentioned below,
Policy
Create EC2 repo to save docker image
save the URI: 566373416292.dkr.ecr.us-east-1.amazonaws.com/chicken
Create Ubuntu EC2 VM
Install Docker on the EC2 Machine
#optional
sudo apt-get update -y
sudo apt-get upgrade
#required
curl -fsSL https://get.docker.com -o get-docker.sh
sudo sh get-docker.sh
sudo usermod -aG docker ubuntu
newgrp docker
Configure EC2 as self-hosted runner
setting > actions > runner > new self hosted runner > choose os >
Setup github secrets
AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
AWS_REGION = us-east-1
AWS_ECR_LOGIN_URI = demo >> 566373416292.dkr.ecr.ap-south-1.amazonaws.com
ECR_REPOSITORY_NAME = kidney
Press p or to see the previous file or, n or to see the next file
Are you sure you want to delete this access key?
Are you sure you want to delete this access key?
Are you sure you want to delete this access key?
Are you sure you want to delete this access key?