-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from MLOPsStudyGroup/scripts_master
Scripts master
- Loading branch information
Showing
6 changed files
with
73 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
name: model-deploy-on-release | ||
on: | ||
release: | ||
types: | ||
- 'published' | ||
|
||
jobs: | ||
run: | ||
runs-on: [ubuntu-latest] | ||
container: docker://dvcorg/cml-py3:latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: 'Deploy/Update on new release' | ||
shell: bash | ||
|
||
env: | ||
repo_token: ${{ secrets.GITHUB_TOKEN }} | ||
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | ||
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | ||
CRED_SECRET: ${{ secrets.IBM_CREDENTIALS_PASS }} | ||
|
||
run: | | ||
# Install requirements | ||
pip install -r requirements.txt | ||
# Pull data & run-cache from S3 and reproduce pipeline | ||
dvc pull --run-cache | ||
dvc repro | ||
# Decrypt credentials file | ||
gpg --quiet --batch --yes --decrypt --passphrase="$CRED_SECRET" --output credentials.yaml credentials.yaml.gpg | ||
# Check if there is a deployment already, if positive update it, otherwise deploys it for the first time | ||
./src/scripts/Scripts/git_release_pipeline.sh | ||
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
author: guipleite | ||
datetime_creted: 29/03/2021_13:46:23:802394723 | ||
deployment_uid: 59562979-4bb8-4cc4-85f0-fb7a280b8b3c | ||
deployment_uid: 9e70e6bf-49d9-418c-8c7a-cf7c876e9fc9 | ||
model_type: scikit-learn_0.23 | ||
model_uid: 3d5e76dc-a4a3-43a9-ab54-debbdbdc8673 | ||
model_uid: 12439c9c-4999-463d-8c66-57e4927caf70 | ||
project_name: Rain_aus | ||
project_version: v0.3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,3 +4,4 @@ seaborn | |
matplotlib | ||
joblib | ||
numpy | ||
ibm_watson_machine_learning |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import os | ||
import sys | ||
import yaml | ||
|
||
""" | ||
Usage: | ||
python3 model_deploy_pipeline.py ./pickle_model ../path/to/project/ ../credentials.yaml | ||
""" | ||
|
||
PROJ_PATH = os.path.abspath(sys.argv[1]) | ||
META_PATH = PROJ_PATH + "/metadata.yaml" | ||
|
||
with open(META_PATH) as stream: | ||
try: | ||
metadata = yaml.safe_load(stream) | ||
except yaml.YAMLError as exc: | ||
print(exc) | ||
|
||
if "deployment_uid" in metadata.keys(): | ||
sys.exit(1) | ||
|
||
else: | ||
sys.exit(0) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/bin/sh | ||
|
||
if python3 ./src/scripts/Pipelines/git_release_pipeline.py ./ | ||
then | ||
echo " Model already has been deployed, updating it" | ||
python3 ./src/scripts/Pipelines/model_update_pipeline.py ./models/model.joblib ./ ./credentials.yaml | ||
else | ||
echo " Deploying model for the first time" | ||
python3 ./src/scripts/Pipelines/model_deploy_pipeline.py ./models/model.joblib ./ ./credentials.yaml | ||
fi |
71665da
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Metrics
Plots
ROC Curve
Precision and Recall Curve
71665da
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Metrics
Plots
ROC Curve
Precision and Recall Curve