Skip to content

Commit

Permalink
Restyled by prettier (#4988)
Browse files Browse the repository at this point in the history
Co-authored-by: Restyled.io <[email protected]>
  • Loading branch information
restyled-io[bot] and restyled-commits authored Nov 16, 2023
1 parent 82c7cd8 commit 62c85dd
Showing 1 changed file with 25 additions and 14 deletions.
39 changes: 25 additions & 14 deletions content/docs/start/model-management/model-cicd.md
Original file line number Diff line number Diff line change
Expand Up @@ -145,15 +145,15 @@ was assignment to the "prod" stage, it proceeds with the rest of the workflow.
```yaml
deploy-model:
needs: parse
if: ${{ needs.parse.outputs.event == 'assignment' && needs.parse.outputs.stage == 'prod' }}

if:
${{ needs.parse.outputs.event == 'assignment' && needs.parse.outputs.stage
== 'prod' }}
```
The next step of the workflow sets up
DVC (using a GitHub Action, but this can also be done manually, for example with
pip).
The next step of the workflow sets up DVC (using a GitHub Action, but this can
also be done manually, for example with pip).
also be done manually, for example with pip). The next step of the workflow sets
up DVC (using a GitHub Action, but this can also be done manually, for example
with pip).
This allows us to run `dvc artifacts get` in the last step of the workflow to
download the correct version of the model which can then be deployed or
Expand All @@ -165,17 +165,28 @@ otherwise used in our CICD.
dvc config --global studio.token ${{ secrets.DVC_STUDIO_TOKEN }}
dvc artifacts get ${{ github.server_url }}/${{ github.repository }} ${{ needs.parse.outputs.name }} --rev ${{ needs.parse.outputs.version }}
echo "The right model is available and you can use the rest of this command to deploy it. Good job!"
```

Here, we are using the outputs of the `parse` job to specify the correct model
version. We are then setting up the DVC Studio token which we stored in our GitHub repository as a [secret](https://docs.github.com/en/actions/security-guides/using-secrets-in-github-actions) to manage authentication with the [DVC remote storage](https://dvc.org/doc/user-guide/data-management/remote-storage#remote-storage). This way we only need to keep the Studio token saved on GitHub and let Studio manage the specific storage credentials for us.

Finally, `github.server_url` and `github.repository` are [default environmental variables in GitHub](https://docs.github.com/en/actions/learn-github-actions/contexts#github-context) which together form the URL of our repository on GitHub. We could of course also specify the URL manually.

If you don't use Studio, you can still use `dvc artifacts get` but you will need to keep your remote storage credentials on GitHub and use them to configure DVC in the CICD workflow.

You can use the following template to create your own Model Registry CICD actions on GitHub!
version. We are then setting up the DVC Studio token which we stored in our
GitHub repository as a
[secret](https://docs.github.com/en/actions/security-guides/using-secrets-in-github-actions)
to manage authentication with the
[DVC remote storage](https://dvc.org/doc/user-guide/data-management/remote-storage#remote-storage).
This way we only need to keep the Studio token saved on GitHub and let Studio
manage the specific storage credentials for us.

Finally, `github.server_url` and `github.repository` are
[default environmental variables in GitHub](https://docs.github.com/en/actions/learn-github-actions/contexts#github-context)
which together form the URL of our repository on GitHub. We could of course also
specify the URL manually.

If you don't use Studio, you can still use `dvc artifacts get` but you will need
to keep your remote storage credentials on GitHub and use them to configure DVC
in the CICD workflow.

You can use the following template to create your own Model Registry CICD
actions on GitHub!

```yaml
name: Template CICD Action for DVC Model Registry
Expand Down

0 comments on commit 62c85dd

Please sign in to comment.