Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 33 additions & 35 deletions .github/workflows/deploy_training_script.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,42 +28,40 @@ jobs:
name: Deploy Latest ML Training Script to Desired Org
timeout-minutes: 30
steps:
- name: Check out training script code
uses: actions/checkout@v3
with:
submodules: recursive
token: ${{ secrets.TOKEN || github.token }}
- name: Setup Python3.10
uses: actions/setup-python@v3
with:
python-version: "3.10"
- name: Check out training script code
uses: actions/checkout@v3
with:
submodules: recursive
token: ${{ secrets.TOKEN || github.token }}
- name: Setup Python3.10
uses: actions/setup-python@v3
with:
python-version: "3.10"

- name: Setup Viam CLI
shell: bash
run: |
curl -o /usr/local/bin/viam https://storage.googleapis.com/packages.viam.com/apps/viam-cli/viam-cli-stable-linux-amd64
chmod a+rx /usr/local/bin/viam
viam login api-key --key-id ${{ secrets.VIAM_API_KEY_ID }} --key ${{ secrets.VIAM_API_KEY }}
- name: Setup Viam CLI
shell: bash
run: |
curl -o /usr/local/bin/viam https://storage.googleapis.com/packages.viam.com/apps/viam-cli/viam-cli-stable-linux-amd64
chmod a+rx /usr/local/bin/viam
viam login api-key --key-id ${{ secrets.VIAM_API_KEY_ID }} --key ${{ secrets.VIAM_API_KEY }}

- name: Create training package
shell: bash
run: |
python3 setup.py sdist --formats=gztar

- name: Get name of first file with the correct extension
id: file-extension
shell: bash
run: |
echo "path_name=$(ls dist/*.tar.gz | head -1)" >> $GITHUB_OUTPUT

- name: Push to Viam Registry
shell: bash
run: |
if [ -n "${{ github.event.release.tag_name }}" ]; then
VERSION="${{ github.event.release.tag_name }}"
else
VERSION=$(date -u +'%Y-%m-%dT%H-%M-%S')
fi
viam training-script upload --framework=${{ inputs.framework }} --org-id=${{ secrets.VIAM_ORG_ID }} --path=${{ steps.file-extension.outputs.path_name }} --script-name=${{ inputs.script_name }} --type=${{ inputs.model_type }} --version=$VERSION
- name: Create training package
shell: bash
run: |
python3 setup.py sdist --formats=gztar

- name: Get name of first file with the correct extension
id: file-extension
shell: bash
run: |
echo "path_name=$(ls dist/*.tar.gz | head -1)" >> $GITHUB_OUTPUT

- name: Push to Viam Registry
shell: bash
run: |
if [ -n "${{ github.event.release.tag_name }}" ]; then
VERSION="${{ github.event.release.tag_name }}"
else
VERSION=$(date -u +'%Y-%m-%dT%H-%M-%S')
fi
viam training-script upload --framework=${{ inputs.framework }} --org-id=${{ secrets.VIAM_ORG_ID }} --path=${{ steps.file-extension.outputs.path_name }} --script-name=${{ inputs.script_name }} --type=${{ inputs.model_type }} --version=$VERSION --visibility