This repository was archived by the owner on Sep 12, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
98 lines (83 loc) · 3.08 KB
/
test_upload_model.yml
File metadata and controls
98 lines (83 loc) · 3.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
name: upload_model
on: workflow_dispatch
defaults:
run:
working-directory: .
jobs:
Load_model:
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- uses: szenius/set-timezone@v1.0
with:
timezoneLinux: "Asia/Singapore"
timezoneMacos: "Asia/Singapore"
timezoneWindows: "Singapore Standard Time"
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: 3.6
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Setup Cloud SDK
uses: google-github-actions/setup-gcloud@v0.2.0
with:
service_account_key: ${{ secrets.GOOGLE_APPLICATION_CREDENTIALS }}
service_account_email: ${{ secrets.GCP_COMPUTE_ENGINE_EMAIL }}
project_id: ${{ secrets.GCP_PROJECT_ID }}
export_default_credentials: true
- name: Run load_model.py
env:
MLFLOW_TRACKING_URI: ${{ secrets.MLFLOW_TRACKING_URI }}
MLFLOW_TRACKING_USERNAME: ${{ secrets.MLFLOW_TRACKING_USERNAME }}
MLFLOW_TRACKING_PASSWORD: ${{ secrets.MLFLOW_TRACKING_PASSWORD }}
GSA_PRIVATE_KEY_ID: ${{ secrets.GSA_PRIVATE_KEY_ID }}
GSA_PRIVATE_KEY: ${{ secrets.GSA_PRIVATE_KEY }}
GSA_CLIENT_ID: ${{ secrets.GSA_CLIENT_ID }}
GSA_PRIVATE_GSHEETS_URL: ${{ secrets.GSA_PRIVATE_GSHEETS_URL }}
run: |
python pipeline/load_model.py
- name: Commit files
run: |
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git pull
git add model.pickle
git commit -m "CT - Get `production` model $(date)"
git push --set-upstream origin dev
env:
REPO_KEY: ${{secrets.GITHUB_TOKEN}}
username: github-actions
Update_model:
needs: Load_model
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- uses: szenius/set-timezone@v1.0
with:
timezoneLinux: "Asia/Singapore"
timezoneMacos: "Asia/Singapore"
timezoneWindows: "Singapore Standard Time"
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: 3.6
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Run update.py
env:
GOOGLEDRIVE_ACCESS_TOKEN: ${{ secrets.GOOGLEDRIVE_ACCESS_TOKEN }}
GOOGLEDRIVE_CLIENT_ID: ${{ secrets.GOOGLEDRIVE_CLIENT_ID }}
GOOGLEDRIVE_CLIENT_SECRET: ${{ secrets.GOOGLEDRIVE_CLIENT_SECRET }}
GOOGLEDRIVE_REFRESH_TOKEN: ${{ secrets.GOOGLEDRIVE_REFRESH_TOKEN }}
UPDATE_FILENAME: ${{ 'model.pickle' }}
run: |
python pipeline/update.py
- name: Remove model.pickle
uses: JesseTG/rm@v1.0.0
with:
path: ./model.pickle