-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
111 additions
and
36 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,49 @@ | ||
name: Deploy MLEM model after GTO Stage assignment | ||
on: | ||
push: | ||
tags: | ||
- "*" | ||
env: | ||
HEROKU_API_KEY: ${{ secrets.HEROKU_API_KEY }} | ||
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | ||
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | ||
|
||
jobs: | ||
parse-git-tag: | ||
name: Figure out what was registered/promoted | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
- name: "GTO: figure out what was registered/promoted and show the Registry state" | ||
id: gto | ||
uses: iterative/gto-action@v1 | ||
with: | ||
show: true | ||
history: true | ||
# we define the Job outputs here to let the next Job use them | ||
outputs: | ||
name: ${{ steps.gto.outputs.name }} | ||
stage: ${{ steps.gto.outputs.stage }} | ||
event: ${{ steps.gto.outputs.event }} | ||
path: ${{ steps.gto.outputs.path }} | ||
deploy-model: | ||
name: Deploy a MLEM model (act on assigning a new stage) | ||
needs: parse-git-tag | ||
if: needs.parse-git-tag.outputs.event == 'assignment' | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
- uses: actions/setup-python@v2 | ||
with: | ||
python-version: '3.10' | ||
- name: Install dependencies | ||
run: | | ||
pip install --upgrade pip setuptools wheel | ||
pip install -r requirements.txt | ||
- name: Run `mlem deploy`` | ||
run: | | ||
mlem deployment run --load deploy/${{ needs.parse-git-tag.outputs.stage }} --model ${{ needs.parse-git-tag.outputs.path }} |
This file was deleted.
Oops, something went wrong.
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,3 @@ | ||
core: | ||
state: | ||
uri: s3://gto-mlem-example/mlem-deployment-state |
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,3 @@ | ||
object_type: deployment | ||
type: heroku | ||
app_name: mlem-dev |
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,3 @@ | ||
object_type: deployment | ||
type: heroku | ||
app_name: mlem-prod |
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,3 @@ | ||
object_type: deployment | ||
type: heroku | ||
app_name: mlem-staging |
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 |
---|---|---|
@@ -0,0 +1,37 @@ | ||
artifacts: | ||
data.pkl: | ||
hash: 2979af88eef40c69250d61efef3d94a0 | ||
size: 319 | ||
uri: churn.pkl | ||
model_type: | ||
io: | ||
type: pickle | ||
methods: | ||
__call__: | ||
args: | ||
- name: data | ||
type_: | ||
ptype: str | ||
type: primitive | ||
name: model | ||
returns: | ||
ptype: str | ||
type: primitive | ||
predict: | ||
args: | ||
- name: data | ||
type_: | ||
ptype: str | ||
type: primitive | ||
name: predict | ||
returns: | ||
ptype: str | ||
type: primitive | ||
type: callable | ||
object_type: model | ||
requirements: | ||
- is_package: false | ||
module: __main__ | ||
name: __main__ | ||
source64zip: eJw1jtEKwyAMRd/9ipCnFoajrwP3I2OEsKadTK2oLezvp5Xdl+SGey6xPm6pQP5mpWzfvRNfzQJEgb0QgTGARJ5tIMKbgqqD3S5gGqg5rcdjekJFnIThfxrhDhOIywIYtk6gOulZFvDbLG6YufDYK5uSlD2Fnu3R9o3maHXmQ4YTugCeM19f75rW8ePwApl9dEKt0GAuyYYVR/UDFWhG0Q== | ||
type: custom |
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 +1,2 @@ | ||
gto | ||
gto | ||
mlem[s3,fastapi,heroku] |
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,11 @@ | ||
import sys | ||
|
||
import mlem | ||
|
||
if __name__ == "__main__": | ||
value = sys.argv[1] if len(sys.argv) > 1 else "no value" | ||
|
||
def model(data): | ||
return value | ||
|
||
mlem.api.save(model, "models/churn.pkl", sample_data="string") |