Skip to content

Commit 5536c59

Browse files
committed
Merge branch 'master' of github.com:algorithmiaio/algorithmia-modeldeployment-action
2 parents cf2e94f + 1069e5e commit 5536c59

2 files changed

Lines changed: 20 additions & 27 deletions

File tree

README.md

Lines changed: 18 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,27 @@
11
# Github Action for Continuous Deployment from an ML Repo at Github to Algorithmia
22

3-
## When to use?
3+
## When to use it?
44
After you create an algorithm on Algorithmia as the scalable inference endpoint for your ML model, you can incorporate this Github Action to your Github ML repository's workflow file, to automate deploying your model and your inference (algorithm) code.
55

66
This action would be a good fit for your workflow if you are using a Jupyter notebook to train and evaluate your ML model or checking your saved model file into your repository and you have your inference (algorithm) script & dependencies in your ML repo.
77

88

99
## How does it work?
1010

11-
The Github Action will get deploy your model file to a data collection at Algorithmia and create a new build for your inference endpoint to use the new model, whenever you do a Git push to your master branch (or any other triggering event you configure).
11+
Whenever you do a Git push to your master branch (or any other triggering event you configure), your workflow integrating this Github Action will kick off.
1212

1313
![](images/overview.png)
1414

15-
Depending on your model development preference:
15+
If you're developing your ML model in a Jupyter notebook, you can configure the workflow with the notebook path to execute. In this case, the Github Action will:
16+
- Install the required packages in your requirements.txt file on a Github worker machine
17+
- Run your configured Jupyter notebook file on the worker machine's from-scratch environment
18+
19+
If not and if you have an already saved model checked-in to your repository, you can configure the workflow with the existing model file path.
1620

17-
If you're developing your ML model on a Jupyter notebook, you can configure the workflow with the notebook path and tell it where to save the model file. In this case, the workflow will run the notebook on the CI worker machine's from-scratch environment.
18-
If you have an already saved model checked-in to your repository, you can configure the workflow with the existing model file path.
19-
20-
In both scenarios, the workflow will get the model file and upload it to the configured data collection on Algorithmia.
21+
In both scenarios, the Github Action will then:
22+
- Take the ML model file from the configured path and upload it to your data collection at Algorithmia
23+
- Copy your inference (algorithm) script to your algorithm repository
24+
- Update/create a model_manifest.json file, connecting your inference (algorithm) code at Algorithmia with this newly uploaded model file
2125

2226
![](images/flowchart.png)
2327

@@ -29,13 +33,17 @@ In addition to that, the manifest file will contain certain metadata such as:
2933
- What is the Github commit SHA and the commit message resulting in this automated upload?
3034
- When did this upload happen?
3135

32-
By using this manifest, your inference script will know which model to load and use. It can also calculate the loaded model file's MD5 hash with the original MD5 hash that was calculated at the time of the upload, and make sure that the model file hasn't been changed.
36+
By using this manifest, your inference script will know which model to load and use. It can also re-calculate the MD5 hash of the model file at inference time and compare it with the original MD5 hash that was calculated at the time of the upload, and make sure that the model file hasn't been changed.
3337

3438
![](images/model_manifest.png)
3539

36-
## How is it configured?
40+
## How to configure it?
41+
42+
The required / optional inputs to this Github Action are listed below.
43+
44+
Among these, some inputs are required when your Algorithmia algorithm is hosted at (backed by) Github and some will be required when your Algorithmia algorithm is hosted at (backed by) Algorithmia.
3745

38-
The inputs to this Github Action is as follows. Please check the default values of some of them, and make sure to include them in your own ML repo's workflow file if you want a non-default configuration for these.
46+
You'll also notice that some of the inputs have default values, so that you're not bogged down in configuration and can start with reasonable defaults. So make sure to check out the default values first and if you want a non-default configuration for these, you can provide those values in your own ML repo's workflow file.
3947

4048
```
4149
inputs:
@@ -76,21 +84,6 @@ inputs:
7684
description: Git host for the Algorithmia algorithm repository. Change to git.algorithmia.com if the algorithm is hosted on Algorithmia.
7785
required: false
7886
default: 'github.com'
79-
runs:
80-
using: 'docker'
81-
image: 'Dockerfile'
82-
args:
83-
- ${{ inputs.algorithmia_api_key }}
84-
- ${{ inputs.algorithmia_username }}
85-
- ${{ inputs.algorithmia_email }}
86-
- ${{ inputs.algorithmia_algoname }}
87-
- ${{ inputs.algorithmia_password }}
88-
- ${{ inputs.github_username }}
89-
- ${{ inputs.github_pat }}
90-
- ${{ inputs.algorithmia_uploadpath }}
91-
- ${{ inputs.model_path }}
92-
- ${{ inputs.notebook_path }}
93-
- ${{ inputs.git_host }}
9487
```
9588

9689

action.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
name: 'Deploy to Algorithmia'
2-
description: 'TBD'
2+
description: 'Continuous Deployment of ML models and inference scripts from an ML repository to Algorithmia'
33
branding:
44
icon: 'alert-circle'
5-
color: 'yellow'
5+
color: 'purple'
66
inputs:
77
algorithmia_api_key:
88
description: 'Algorithmia API Key, used when uploading the model file'

0 commit comments

Comments
 (0)