Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
279 commits
Select commit Hold shift + click to select a range
3ee28b8
Update model_pipeline.yaml
malkarsaidheeraj Nov 16, 2024
d4611f9
Update README.md
DhananJayKumarMV Nov 17, 2024
4203509
updating commits
DhananJayKumarMV Nov 17, 2024
d78a304
Updating logs
DhananJayKumarMV Nov 17, 2024
a338a76
Updating branch to be captured
DhananJayKumarMV Nov 17, 2024
f460ded
Reverting the changes
DhananJayKumarMV Nov 17, 2024
e3ef012
Removing redundant lines
DhananJayKumarMV Nov 17, 2024
4bd0109
moving folders
SravyaKodati Nov 18, 2024
5487806
mlflow ipynb files
SravyaKodati Nov 18, 2024
fd531e9
.py file for mlflow
SravyaKodati Nov 18, 2024
a3ca170
git
SravyaKodati Nov 18, 2024
af1b374
Add files via upload
malkarsaidheeraj Nov 18, 2024
a7dcbdd
Update model_with_grid_mlflow.py
malkarsaidheeraj Nov 18, 2024
d8628a0
Update Dockerfilemodel
malkarsaidheeraj Nov 18, 2024
12ceba4
Update model_requirements.txt
malkarsaidheeraj Nov 18, 2024
506a761
Update model_pipeline.yaml
malkarsaidheeraj Nov 18, 2024
b53b9e7
Update model_with_grid_mlflow.py
malkarsaidheeraj Nov 18, 2024
dcf06a2
Update model_with_grid_mlflow.py
malkarsaidheeraj Nov 18, 2024
3b1db59
Update model_pipeline.yaml
malkarsaidheeraj Nov 18, 2024
7066095
Update Dockerfilemodel
malkarsaidheeraj Nov 18, 2024
1a9584a
Update model_pipeline.yaml
malkarsaidheeraj Nov 18, 2024
9bb6902
Update model_pipeline.yaml
malkarsaidheeraj Nov 18, 2024
129696e
Update Dockerfilemodel
malkarsaidheeraj Nov 18, 2024
582c7a5
Update model_with_grid_mlflow.py
malkarsaidheeraj Nov 18, 2024
7b448f4
Update model_with_grid_mlflow.py
malkarsaidheeraj Nov 19, 2024
6e9d6ac
Update model_with_grid_mlflow.py
malkarsaidheeraj Nov 19, 2024
bffa8b9
Update Dockerfilemodel
malkarsaidheeraj Nov 19, 2024
03059b5
Update model_pipeline.yaml
malkarsaidheeraj Nov 19, 2024
ec4bfce
Update model_pipeline.yaml
malkarsaidheeraj Nov 19, 2024
8c6b473
Update model_with_grid_mlflow.py
malkarsaidheeraj Nov 19, 2024
d18caeb
Update model_with_grid_mlflow.py
malkarsaidheeraj Nov 19, 2024
fa41d6b
Update model_pipeline.yaml
malkarsaidheeraj Nov 19, 2024
aba2dcc
Updating files to capture
DhananJayKumarMV Nov 23, 2024
2c04618
Updating correct path
DhananJayKumarMV Nov 23, 2024
2787b47
Merge branch 'satwik' of https://github.com/SatwikReddySripathi/Multi…
SatwikReddySripathi Nov 27, 2024
4bb0b0d
Create final_model.py
malkarsaidheeraj Nov 27, 2024
b8c1430
Delete final_model.py
malkarsaidheeraj Nov 27, 2024
fd88d25
Create final_model.py
malkarsaidheeraj Nov 27, 2024
f02ad30
Update Dockerfilemodel
malkarsaidheeraj Nov 27, 2024
a4a7f2c
Update model_pipeline.yaml
malkarsaidheeraj Nov 27, 2024
2d45e19
Update final_model.py
malkarsaidheeraj Nov 27, 2024
cbfde3a
Update final_model.py
malkarsaidheeraj Nov 27, 2024
b681508
Update Dockerfilemodel
malkarsaidheeraj Nov 27, 2024
40237ae
Update model_pipeline.yaml
malkarsaidheeraj Nov 27, 2024
32891ae
Update Dockerfilemodel
malkarsaidheeraj Nov 27, 2024
7b81935
Update model_pipeline.yaml
malkarsaidheeraj Nov 27, 2024
42d2900
Update Dockerfilemodel
malkarsaidheeraj Nov 27, 2024
45e65a7
Update model_pipeline.yaml
malkarsaidheeraj Nov 27, 2024
a4ee795
Update Dockerfilemodel
malkarsaidheeraj Nov 27, 2024
f80bc5d
Update model_pipeline.yaml
malkarsaidheeraj Nov 27, 2024
37b4e7d
Update model_pipeline.yaml
malkarsaidheeraj Nov 27, 2024
9ab7ac4
Update model_pipeline.yaml
malkarsaidheeraj Nov 27, 2024
3c9b380
Update model_pipeline.yaml
malkarsaidheeraj Nov 27, 2024
d70c8f6
Update model_pipeline.yaml
malkarsaidheeraj Nov 27, 2024
0e21269
Update Dockerfilemodel
malkarsaidheeraj Nov 27, 2024
51cb2e6
Update model_pipeline.yaml
malkarsaidheeraj Nov 27, 2024
6949577
Update final_model.py
malkarsaidheeraj Nov 27, 2024
bff95b3
Update final_model.py
malkarsaidheeraj Nov 27, 2024
d7f917c
Update model_pipeline.yaml
malkarsaidheeraj Nov 28, 2024
bb5d116
Update model_pipeline.yaml
malkarsaidheeraj Nov 28, 2024
788ff6c
Update model_pipeline.yaml
malkarsaidheeraj Nov 28, 2024
d227214
Update model_pipeline.yaml
malkarsaidheeraj Nov 28, 2024
d1b24c4
Update model_pipeline.yaml
malkarsaidheeraj Nov 28, 2024
0cae246
Update Dockerfilemodel
malkarsaidheeraj Nov 28, 2024
72d0641
Update model_pipeline.yaml
malkarsaidheeraj Nov 28, 2024
03dcb83
Update final_model.py
malkarsaidheeraj Nov 28, 2024
49cc1d8
Update final_model.py
malkarsaidheeraj Nov 28, 2024
662b459
Add files via upload
malkarsaidheeraj Nov 28, 2024
2b4b96f
third version_db
malkarsaidheeraj Nov 28, 2024
0fd7fe0
Delete Data/sampled_data_entry.csv.dvc
malkarsaidheeraj Nov 28, 2024
8c6e437
Merge pull request #46 from SatwikReddySripathi/satwik
malkarsaidheeraj Nov 28, 2024
515fce8
Update final_model.py
DhanushAkula Nov 28, 2024
10029a7
Update final_model.py
DhanushAkula Nov 28, 2024
a6fad33
Update final_model.py
DhanushAkula Nov 28, 2024
59d2220
Update final_model.py
DhanushAkula Nov 29, 2024
48326f4
Update final_model.py
DhanushAkula Nov 29, 2024
6b00af6
Update final_model.py
DhanushAkula Nov 29, 2024
a2f0019
Update final_model.py
DhanushAkula Nov 29, 2024
bf3b5aa
Update final_model.py
DhanushAkula Nov 29, 2024
7590963
Update final_model.py
DhanushAkula Nov 29, 2024
50abf96
Update final_model.py
DhanushAkula Nov 29, 2024
c3beac2
Update final_model.py
DhanushAkula Nov 29, 2024
ac83ee3
Update model_pipeline.yaml
DhanushAkula Nov 29, 2024
1c008e3
Update final_model.py
DhanushAkula Nov 29, 2024
55a4594
Update final_model.py
DhanushAkula Nov 29, 2024
bce749e
Update final_model.py
DhanushAkula Nov 29, 2024
68420fc
Update model_pipeline.yaml
DhanushAkula Nov 29, 2024
9df83f2
Update docker-compose.yaml
SatwikReddySripathi Nov 29, 2024
93df494
Inference files
SravyaKodati Nov 30, 2024
9de1562
Changes in splitting the data
SravyaKodati Nov 30, 2024
f52daf9
Changes in splitting the data
SravyaKodati Nov 30, 2024
02ded8e
Capturing one hot encoding
DhananJayKumarMV Nov 30, 2024
282f239
Minor fix
DhananJayKumarMV Nov 30, 2024
a9544c1
logs
DhananJayKumarMV Nov 30, 2024
eaefa31
MInor fix
DhananJayKumarMV Nov 30, 2024
7e80a5b
uploading stats file and params file(grid search)
SravyaKodati Nov 30, 2024
28ba398
Merge branch 'main' of https://github.com/SatwikReddySripathi/Multicl…
SravyaKodati Nov 30, 2024
3f76d49
made some changes in param reading
SravyaKodati Nov 30, 2024
6a6e295
uploading test file
SravyaKodati Nov 30, 2024
f1be624
changed the caps in age and gender
SravyaKodati Dec 1, 2024
6220dd3
Add files via upload
DhanushAkula Dec 1, 2024
5902576
Splitting code
SravyaKodati Dec 1, 2024
0ce1f73
Update and rename model_handler (1).py to model_handler.py
DhanushAkula Dec 1, 2024
43d344b
Add files via upload
DhanushAkula Dec 1, 2024
2b639f3
Update model_handler.py
DhanushAkula Dec 2, 2024
5ff44ee
Update model_requirements.txt
DhanushAkula Dec 2, 2024
5f15816
Update model_requirements.txt
DhanushAkula Dec 2, 2024
64d8f30
Update final_model.py
DhanushAkula Dec 2, 2024
7cd0d05
Update model_pipeline.yaml
DhanushAkula Dec 2, 2024
73c873f
Update final_model.py
DhanushAkula Dec 2, 2024
addb2e3
Update model_pipeline.yaml
DhanushAkula Dec 2, 2024
3a36bf6
Update model_requirements.txt
DhanushAkula Dec 2, 2024
def05b3
Add files via upload
DhanushAkula Dec 2, 2024
b716e39
Add files via upload
DhanushAkula Dec 2, 2024
9eb7331
Update model_handler.py
DhanushAkula Dec 2, 2024
d09debe
Update final_model.py
DhanushAkula Dec 2, 2024
4027178
Splitting data to test and train
DhananJayKumarMV Dec 2, 2024
9ef2076
Update model_requirements.txt
DhanushAkula Dec 2, 2024
e94adc5
Merge branch 'main_model' of https://github.com/SatwikReddySripathi/M…
DhananJayKumarMV Dec 2, 2024
e914f03
Update final_model.py
DhanushAkula Dec 2, 2024
a7c1582
Update final_model.py
DhanushAkula Dec 2, 2024
dc39ad3
minor fix
DhananJayKumarMV Dec 2, 2024
79dae57
adding splitting block to pipeline
DhananJayKumarMV Dec 2, 2024
42b7286
pushing testing and preprocessed training to data
DhananJayKumarMV Dec 2, 2024
918ced7
preprocessing training data
DhananJayKumarMV Dec 2, 2024
3dca46c
Update final_model.py
DhanushAkula Dec 2, 2024
a806743
Update final_model.py
DhanushAkula Dec 2, 2024
d947f60
Update final_model.py
DhanushAkula Dec 2, 2024
23db226
Update final_model.py
DhanushAkula Dec 2, 2024
ea4dbf5
Update model_pipeline.yaml
DhanushAkula Dec 2, 2024
9c6ec13
Update final_model.py
DhanushAkula Dec 2, 2024
b19d144
Update model_pipeline.yaml
DhanushAkula Dec 2, 2024
6f635bd
Update final_model.py
DhanushAkula Dec 2, 2024
5c04e91
Merge branch 'satwik' of https://github.com/SatwikReddySripathi/Multi…
SatwikReddySripathi Dec 2, 2024
6b71bd5
Merge pull request #49 from SatwikReddySripathi/satwik
SatwikReddySripathi Dec 2, 2024
96ec9fa
Update final_model.py
malkarsaidheeraj Dec 2, 2024
eb56ad1
Update final_model.py
malkarsaidheeraj Dec 2, 2024
c8d8088
Update final_model.py
malkarsaidheeraj Dec 2, 2024
d974b9b
Update final_model.py
malkarsaidheeraj Dec 2, 2024
1138fc4
Update model_pipeline.yaml
malkarsaidheeraj Dec 2, 2024
91630e7
Update model_pipeline.yaml
malkarsaidheeraj Dec 2, 2024
05c5969
retraining file which expects 2 preprocessed files as input
SravyaKodati Dec 3, 2024
267ab99
Clearning files
DhananJayKumarMV Dec 3, 2024
f32b9c4
Update docker-compose.yaml
SatwikReddySripathi Dec 3, 2024
1030155
Update Dockerfile
SatwikReddySripathi Dec 3, 2024
9157a00
Update requirements.txt
SatwikReddySripathi Dec 3, 2024
46cc2f4
Merge branch 'main_model' of https://github.com/SatwikReddySripathi/M…
SatwikReddySripathi Dec 3, 2024
b634a3e
best parameters
SravyaKodati Dec 3, 2024
0a69a24
best parameters
SravyaKodati Dec 3, 2024
4639b1c
Merge pull request #56 from SatwikReddySripathi/main
DhananJayKumarMV Dec 4, 2024
8b48924
Update final_model.py
DhanushAkula Dec 4, 2024
31a0be3
Update model_pipeline.yaml
DhanushAkula Dec 4, 2024
fa9bfe0
Update final_model.py
DhanushAkula Dec 4, 2024
11b33d3
Update final_model.py
DhanushAkula Dec 4, 2024
6dc2afa
Update final_model.py
DhanushAkula Dec 4, 2024
6da1e1f
Update final_model.py
DhanushAkula Dec 4, 2024
a3b685e
Including logs and testing log based metrics
DhananJayKumarMV Dec 4, 2024
db04542
Testing logs for models
DhananJayKumarMV Dec 4, 2024
38f775c
minor fix
DhananJayKumarMV Dec 4, 2024
c87a9d0
commenting model_pipeline.yaml for testing purpose
DhananJayKumarMV Dec 4, 2024
1d677f6
Minor fix
DhananJayKumarMV Dec 4, 2024
a8afce6
Retraining pipeline
SravyaKodati Dec 4, 2024
34173a2
colab files
SravyaKodati Dec 4, 2024
ca2b37b
hopefully the final model
SravyaKodati Dec 4, 2024
db0ebd9
hopefully the final model
SravyaKodati Dec 4, 2024
2560aee
deleted this file
SravyaKodati Dec 4, 2024
5e47e92
uploaded inference files with confidence
SravyaKodati Dec 5, 2024
9a9d242
Update testing_monitoring_model_dep.yaml
DhanushAkula Dec 6, 2024
6f6f15c
Update model_pipeline.yaml
DhanushAkula Dec 6, 2024
a3bb7c2
Update model_pipeline.yaml
DhanushAkula Dec 6, 2024
c9b353e
Update model_requirements.txt
DhanushAkula Dec 6, 2024
40fdcf0
Saving schema model as tfrecord
DhananJayKumarMV Dec 6, 2024
2f24e0b
Update model_pipeline.yaml
DhanushAkula Dec 6, 2024
cc30376
Create app.py
SatwikReddySripathi Dec 6, 2024
df94530
Create custom_resnet.py
SatwikReddySripathi Dec 6, 2024
7d050f3
Create deploy_streamlit.py
SatwikReddySripathi Dec 6, 2024
f129d67
Create disease_details_page.py
SatwikReddySripathi Dec 6, 2024
f0f8b02
Create main_page.py
SatwikReddySripathi Dec 6, 2024
7a4b8c7
Create page.py
SatwikReddySripathi Dec 6, 2024
fd01a6a
Create test.py
SatwikReddySripathi Dec 6, 2024
8635c17
Updating readme
DhananJayKumarMV Dec 6, 2024
a936e47
Merge branch 'main_model' of https://github.com/SatwikReddySripathi/M…
DhananJayKumarMV Dec 6, 2024
af27622
Updating deployment setup info
DhananJayKumarMV Dec 6, 2024
c7fac63
Updating deployment readme and adding Inference and retraining readme
DhananJayKumarMV Dec 6, 2024
cef7694
Add files via upload
vamsijilla Dec 6, 2024
c8aaf11
Add files via upload
vamsijilla Dec 6, 2024
7beaf5c
Add files via upload
vamsijilla Dec 6, 2024
2d6288e
Adding spaces
DhananJayKumarMV Dec 6, 2024
05931d8
Update model_pipeline.yaml
DhanushAkula Dec 6, 2024
c579cd1
Update retraining.py
DhanushAkula Dec 7, 2024
adba932
Update retraining.py
DhanushAkula Dec 7, 2024
6839597
Update final_model.py
DhanushAkula Dec 7, 2024
7734cbb
Update model_pipeline.yaml
DhanushAkula Dec 7, 2024
40fc39a
Update final_model.py
DhanushAkula Dec 7, 2024
bdcb303
Update final_model.py
DhanushAkula Dec 7, 2024
d5daeba
Update model_pipeline.yaml
DhanushAkula Dec 7, 2024
f22e554
Update model_pipeline.yaml
DhanushAkula Dec 7, 2024
53c9798
Create retraining_model.yaml
DhanushAkula Dec 7, 2024
6c70045
Update model_requirements.txt
DhanushAkula Dec 7, 2024
76e0aa6
Create DockerfileRetraining
DhanushAkula Dec 7, 2024
29bf475
Update retraining_model.yaml
DhanushAkula Dec 7, 2024
43c4ddc
Update retraining.py
DhanushAkula Dec 8, 2024
b7df86f
Update best_params.txt
DhanushAkula Dec 8, 2024
5d733a1
Update retraining_model.yaml
DhanushAkula Dec 8, 2024
90cc033
Update model_requirements.txt
DhanushAkula Dec 8, 2024
fe73a5e
Update model_requirements.txt
DhanushAkula Dec 8, 2024
80744c9
Update retraining.py
DhanushAkula Dec 8, 2024
6981bce
Update model_requirements.txt
DhanushAkula Dec 8, 2024
ca5f3ff
Update retraining.py
DhanushAkula Dec 8, 2024
b0db9e7
Update model_requirements.txt
DhanushAkula Dec 8, 2024
a344d97
Update retraining.py
DhanushAkula Dec 8, 2024
8d54f70
Update retraining.py
DhanushAkula Dec 8, 2024
1429ece
Update retraining.py
DhanushAkula Dec 8, 2024
480ea59
Update retraining.py
DhanushAkula Dec 8, 2024
774e9d9
Update retraining.py
DhanushAkula Dec 8, 2024
9f0d841
Update retraining.py
DhanushAkula Dec 8, 2024
b4dc00c
Update retraining.py
DhanushAkula Dec 8, 2024
962ffbc
Update retraining.py
DhanushAkula Dec 8, 2024
0793b6a
Update retraining.py
DhanushAkula Dec 8, 2024
ffe15a9
Update retraining_model.yaml
DhanushAkula Dec 8, 2024
f828334
Update final_model.py
DhanushAkula Dec 8, 2024
9820d8e
Update model_pipeline.yaml
DhanushAkula Dec 8, 2024
c6fd63d
Update final_model.py
SatwikReddySripathi Dec 8, 2024
a5b864f
new flowchart
SravyaKodati Dec 9, 2024
59b6cb8
new flowchart
SravyaKodati Dec 9, 2024
784d22c
new flowchart
SravyaKodati Dec 9, 2024
f3592b0
editing flowchart
SravyaKodati Dec 9, 2024
6d5f223
Update best_params.txt
DhanushAkula Dec 9, 2024
01e28d0
Update model_pipeline.yaml
DhanushAkula Dec 9, 2024
2d1a5dc
Delete hello.py
DhanushAkula Dec 9, 2024
fa9d4ed
Delete requirements1.txt
DhanushAkula Dec 9, 2024
b3fff71
Create Home_Page.py
SatwikReddySripathi Dec 9, 2024
79749fa
Create Disease_Prediction.py
SatwikReddySripathi Dec 9, 2024
dba0279
Create config.toml
SatwikReddySripathi Dec 9, 2024
e0dc370
Create temp.txt
SatwikReddySripathi Dec 9, 2024
899a461
Add files via upload
SatwikReddySripathi Dec 9, 2024
8c5deb8
Add files via upload
SatwikReddySripathi Dec 9, 2024
bdafbcb
Add files via upload
SatwikReddySripathi Dec 9, 2024
4c6e4c4
Update requirements.txt
SatwikReddySripathi Dec 9, 2024
7a7aa9c
Create analysis.py
SatwikReddySripathi Dec 9, 2024
5688909
Add files via upload
SatwikReddySripathi Dec 9, 2024
57aa555
Update model_pipeline.yaml
DhanushAkula Dec 9, 2024
0abb43e
Delete .github/workflows/stream.yaml
DhanushAkula Dec 9, 2024
1186970
Delete .github/workflows/model_pipeline.yaml
DhanushAkula Dec 9, 2024
80b79c9
Delete model/model_handler.py
DhanushAkula Dec 9, 2024
e35f6f9
Delete model/retraining.py
DhanushAkula Dec 9, 2024
4d65962
Delete model/model_with_grid_mlflow.py
DhanushAkula Dec 9, 2024
b1a10e9
Create model_pipeline.yaml
SatwikReddySripathi Dec 9, 2024
b8f2411
Merge branch 'main_model' into dheeraj_model
SatwikReddySripathi Dec 9, 2024
8e238f5
Update analysis.py
SatwikReddySripathi Dec 9, 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
247 changes: 121 additions & 126 deletions .github/workflows/model_pipeline.yaml
Original file line number Diff line number Diff line change
@@ -1,126 +1,121 @@

name: Model Pipeline v1

on:
push:
branches:
- dheeraj_model
pull_request:
branches:
- dheeraj_model
workflow_dispatch:

env:
GCP_PROJECT_ID: ${{ secrets.GCP_PROJECT_ID }} # Your GCP Project ID
GCP_SA_KEY: ${{ secrets.GCP_SA_KEY }} # The service account key stored as a secret
IMAGE_NAME: "hello-world-image"
REGISTRY: "us-central1-docker.pkg.dev/${{ secrets.GCP_PROJECT_ID }}/ml-models"

jobs:
model_pipeline:
runs-on: ubuntu-latest

steps:
# Step 1: Checkout repository
- name: Checkout Repository
uses: actions/checkout@v2

# Step 2: Clean docker image
- name: Clean up Docker to free space
run: docker system prune -af --volumes

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

# Step 4: Login to GCP Artifact Registry
- name: Login to GCP Artifact Registry
uses: docker/login-action@v1
with:
registry: us-central1-docker.pkg.dev
username: _json_key
password: ${{ secrets.GCP_SA_KEY }}

# Step 5: Build and Push Docker Image
- name: Build and Push Docker Image
run: |
docker build -f Dockerfilemodel -t $REGISTRY/$IMAGE_NAME:latest .
docker push $REGISTRY/$IMAGE_NAME:latest

# Step 6: Run Model with Raytuner from Docker Image
- name: Run Model development file
run: |
docker run --rm $REGISTRY/$IMAGE_NAME:latest python model/model_development_refined.py

- name: Notify on success
if: success()
run: echo "Unit tests passed successfully"

- name: Notify on failure
if: failure()
run: echo "Unit tests failed"

# - name: Set up Python
# uses: actions/setup-python@v2
# with:
# python-version: "3.8"

# - name: Install Dependencies
# run: |
# python -m pip install --upgrade pip
# pip install -r requirements.txt

# - name: Run Model Training Script
# env:
# GCP_CREDENTIALS: ${{ secrets.GCP_CREDENTIALS }}
# run: |
# python train_model.py

# - name: Validate Model
# run: |
# python validate_model.py

# - name: Check Validation Results
# run: |
# ACCURACY=$(jq .accuracy validation_metrics.json)
# if (( $(echo "$ACCURACY < 0.85" | bc -l) )); then
# echo "Model validation failed!"
# exit 1
# fi

# - name: Run Bias Detection
# run: |
# python detect_bias.py

# - name: Check Bias Results
# run: |
# BIAS=$(jq .bias_score bias_metrics.json)
# if (( $(echo "$BIAS > 0.2" | bc -l) )); then
# echo "Significant bias detected!"
# exit 1
# fi

# - name: Push Model to Artifact Registry
# run: |
# gcloud auth activate-service-account --key-file=$GCP_CREDENTIALS
# gsutil cp model.pkl gs://my-model-bucket/models/model-$(date +%Y%m%d%H%M%S).pkl

# - name: Notify on Slack
# uses: slackapi/slack-github-action@v1.23
# with:
# payload: |
# {
# "channel": "#mlopsgrp10",
# "text": "Model training pipeline completed with status ${{ job.status }}."
# }
# env:
# SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}

# - name: Compare with Previous Model
# run: |
# python compare_models.py

# - name: Rollback if New Model is Worse
# if: failure()
# run: |
# gsutil cp gs://my-model-bucket/models/previous_model.pkl model.pkl
# name: Deploy model to Vertex AI
# on:
# push:
# branches:
# - dhanush_model
# pull_request:
# branches:
# - dhanush_model
# workflow_dispatch:
# env:
# GCP_PROJECT_ID: ${{ secrets.GCP_PROJECT_ID }}
# GCP_SA_KEY: ${{ secrets.GCP_SA_KEY }}
# IMAGE_NAME: "ml-model-image"
# REGISTRY: "us-east1-docker.pkg.dev/${{ secrets.GCP_PROJECT_ID }}/ml-models-new"
# GCS_BUCKET: "nih-dataset-mlops"

# jobs:
# deploy-to-vertex-ai:
# runs-on: ubuntu-latest

# steps:
# # Step 1: Check out the repository
# - name: Checkout Code
# uses: actions/checkout@v3


# #Google Cloud Authentication
# - id: 'auth'
# name: 'Authenticate to Google Cloud'
# uses: 'google-github-actions/auth@v1'
# with:
# credentials_json: "${{ secrets.GCP_SA_KEY }}"

# - name: 'Set up Cloud SDK'
# uses: 'google-github-actions/setup-gcloud@v1'

# # Step 4: Create a model in Vertex AI Model Registry
# - name: Create or check for Existing Model Registry in Vertex AI
# id: create-model
# run: |
# MODEL_NAME="gitmodel"
# REGION="us-east1"
# MODEL_URI="gs://nih-dataset-mlops/Testing"
# echo "Checking if model exists in Vertex AI Model Registry..."
# MODEL_ID=$(gcloud ai models list --region=$REGION --filter="display_name='gitmodel'" --format="value(name)")

# if [ -z "$MODEL_ID" ]; then
# echo "Model does not exist. Creating a new model..."
# gcloud ai models upload \
# --region=$REGION \
# --display-name=$MODEL_NAME \
# --artifact-uri=$MODEL_URI \
# --container-image-uri=us-docker.pkg.dev/vertex-ai/prediction/pytorch-cpu.2-1:latest
# MODEL_ID=$(gcloud ai models list --region=$REGION --filter="display_name='gitmodel'" --format="value(name)")
# else
# echo "Model already exists: $MODEL_ID"
# fi
# echo "MODEL_ID=$MODEL_ID"
# echo "MODEL_ID=$MODEL_ID" >> $GITHUB_ENV

# # Step 7: Create or Reuse an Endpoint
# - name: Create or Reuse Endpoint
# id: create_endpoint
# run: |
# echo "Checking for existing endpoint..."
# REGION="us-east1"
# ENDPOINT_NAME=$(gcloud ai endpoints list --region=$REGION --filter="display_name='gitmodelendpoint'" --format="value(name)")

# if [ -z "$ENDPOINT_NAME" ]; then
# echo "No existing endpoint found. Creating a new one..."
# ENDPOINT_NAME=$(gcloud ai endpoints create --region=$REGION --display-name=gitmodelendpoint --format="value(name)")
# fi

# if [ -z "$ENDPOINT_NAME" ]; then
# echo "ERROR: Failed to create or retrieve endpoint. Exiting workflow."
# exit 1
# fi

# echo "ENDPOINT_NAME=$ENDPOINT_NAME"
# echo "Retrieved or created ENDPOINT_NAME: $ENDPOINT_NAME"
# echo "ENDPOINT_NAME=$ENDPOINT_NAME" >> $GITHUB_ENV


# # Step 8: Deploy Model to Endpoint
# - name: Deploy Model to Endpoint
# run: |
# echo "Deploying model $MODEL_ID to endpoint $ENDPOINT_NAME..."
# gcloud ai endpoints deploy-model $ENDPOINT_NAME --region=us-east1 --model=$MODEL_ID --display-name=gitmodelendpoint-deployment --machine-type=n1-standard-2 --traffic-split=0=100


# # Step 9: Get Endpoint URI
# - name: Get Endpoint URI
# run: |
# GCP_PROJECT_ID='812555529114'
# REGION="us-east1"
# ENDPOINT=$(gcloud ai endpoints list --region us-east1 --filter="displayName='gitmodelendpoint'" --format="value(name)")
# echo "Endpoint URI: https://us-east1-aiplatform.googleapis.com/v1/projects/${GCP_PROJECT_ID}/locations/${REGION}/endpoints/$ENDPOINT_NAME:predict"

# - name: Build Streamlit Docker Image
# run: |
# docker build \
# -t ${{ env.REGISTRY }}/streamlit_app:${{ env.IMAGE_TAG }} \
# -f Dockerfilestream .

# - name: Push Streamlit Docker Image
# run: |
# docker push ${{ env.REGISTRY }}/streamlit_app:${{ env.IMAGE_TAG }}

# - name: Deploy Streamlit App to Cloud Run
# run: |
# gcloud run deploy streamlit-app \
# --image ${{ env.REGISTRY }}/streamlit_app:${{ env.IMAGE_TAG }} \
# --platform managed \
# --region us-east1 \
# --allow-unauthenticated \
# --port 8080 \
# --cpu 1 \
# --memory 512Mi \
# --verbosity=debug \
# --timeout 600s

Loading