Skip to content
This repository has been archived by the owner on Dec 17, 2022. It is now read-only.

Latest commit

 

History

History
45 lines (27 loc) · 1.68 KB

4-deployment.md

File metadata and controls

45 lines (27 loc) · 1.68 KB

Deployment

Now that GitHub has access to our DVC Remote, we can automate the deploymend of our model.

Deployment

In our case, we will create a workflow that builds a docker image and deploys it to GitHub's Container registry.

First, we create a Dockerfile that wraps our model and uses the inference script

Create and fill `Dockerfile`

https://github.com/iterative/workshop-uncool-mlops-solution/blob/main/Dockerfile

Now, we can create a new GitHub workflow that gets the latest model from the DVC remote, builds a new image and publish it to the container registry.

Create and fill `.github/workflows/deploy_model.yml`

https://github.com/iterative/workshop-uncool-mlops-solution/blob/main/.github/workflows/deploy_model.yaml

Once this has been merged and the first image published, we can use it from anywhere:

docker run "ghcr.io/iterative/workshop-uncool-mlops-solution:main" "dvc pull fails when using my S3 remote"
{"label": "data-sync", "score": 0.8273094296455383}

This also allows to use the image inside other GitHub workflows. We can create a new workflow that gets triggered whenever a new issue is created and uses the wrapped model to automatically assign a new label:

Create and fill `.github/workflows/issue_labeler.yml`

https://github.com/iterative/workshop-uncool-mlops-solution/blob/main/.github/workflows/issue_labeler.yaml

Create a new issue and check the workflow and the added label.