CI-CD Pipeline With Project Deployment
CI-CD Pipeline With Project Deployment
• C:\Windows\system32>c:
• C:\Windows\system32>cd\
• C:\>mkdir ml-ci-cd-pipeline
• C:\>cd ml-ci-cd-pipeline
➢ C:\ml-ci-cd-pipeline>mkdir data model tests
➢ C:\ml-ci-cd-pipeline>mkdir .github
➢ C:\ml-ci-cd-pipeline>cd .github
➢ C:\ml-ci-cd-pipeline\.github>mkdir workflows
➢ C:\ml-ci-cd-pipeline\.github>cd..
➢ C:\ml-ci-cd-pipeline>
• Add the following content to requirements.txt:
# Generate iris.csv
import pandas as pd
from sklearn.datasets import load_iris
# Save to CSV
df.to_csv(r'C:\ml-ci-cd-pipeline\data\iris.csv', index=False)
import pandas as pd
Step 3: Write the Model Training Script from sklearn.model_selection import train_test_split
from sklearn.ensemble import RandomForestClassifier
In train.py in the model/ directory, import joblib
open the train.py file and add the # Load the dataset
Following code: data = pd.read_csv('data/iris.csv')
self.assertGreaterEqual(len(model.feature_importances_
), 4)
on:
Step 6: Set Up the CI/CD Pipeline push:
branches:
Using GitHub Actions - main
pull_request:
Open the Workflow File: branches:
- main
In the .github/workflows/ jobs: