Run dvc.yaml pipeline #33
Workflow file for this run
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
name: Deploy model (Sagemaker) | |
on: | |
push: | |
tags: | |
- "*" | |
permissions: | |
contents: write | |
id-token: write | |
jobs: | |
parse: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: "Parse GTO tag" | |
id: gto | |
uses: iterative/gto-action@v2 | |
outputs: | |
event: ${{ steps.gto.outputs.event }} | |
name: ${{ steps.gto.outputs.name }} | |
stage: ${{ steps.gto.outputs.stage }} | |
version: ${{ steps.gto.outputs.version }} | |
deploy-model: | |
needs: parse | |
if: "${{ needs.parse.outputs.event == 'assignment' }}" | |
environment: cloud | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- uses: aws-actions/configure-aws-credentials@v4 | |
with: | |
aws-region: us-east-2 | |
role-to-assume: ${{ vars.AWS_SANDBOX_ROLE }} | |
role-duration-seconds: 43200 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.8' | |
cache: 'pip' | |
cache-dependency-path: requirements.txt | |
- run: pip install -r requirements.txt | |
- run: dvc remote add -d --local storage s3://dvc-public/remote/get-started-pools | |
- run: | | |
MODEL_DATA=$(dvc get --show-url . model.tar.gz) | |
python sagemaker/deploy_model.py \ | |
--name ${{ needs.parse.outputs.name }} \ | |
--stage ${{ needs.parse.outputs.stage }} \ | |
--version ${{ needs.parse.outputs.version }} \ | |
--model_data $MODEL_DATA \ | |
--role ${{ vars.AWS_SANDBOX_ROLE }} |