You can use Polyaxon CLI in your Github Actions to lint and check your Polyaxonfiles, pull information about projects and runs, and submit operations remotely from Github.
Lint & Check
In order to automate the process of checking and linting your Polyaxonfile, you can use polyaxon/polyaxon-cli
docker image in your Github Actions similarly to how you would do in your local machine:
name: Test Component
on: [push]
jobs:
check:
runs-on: ubuntu-latest
container: docker://polyaxon/polyaxon-cli:1.x.x.
steps:
- uses: actions/checkout@v4
- name: lint
run: |
polyaxon check -f polyaxonfies/operation.yaml
polyaxon check -f polyaxonfies/component.yaml --lint
- name: validate
run: polyaxon check -f polyaxonfies/component.yaml -P activation=relu -P lr=0.01
Submit runs
In order to submit runs from a Github action, you need to provide information about your host
if you are using Polyaxon CE,
and your token if you are using one of Polyaxon commercial products.
This example assumes that the user changes the operation.yaml
file with new params and/or new information about the environment (e.g. GPU) on every push.
name: Submit Job
on: [push]
jobs:
check:
runs-on: ubuntu-latest
container: docker://polyaxon/polyaxon-cli:1.x.x.
steps:
- uses: actions/checkout@v4
- name: config
run: polyaxon config --host=${{ secrets.POLYAXON_HOST }}
- name: login
run: polyaxon login -t ${{ secrets.POLYAXON_TOKEN }}
- name: submit
run: polyaxon run -p MY-PROJECT -f operation.yaml
Note: You can expose
POLYAXON_TOKEN
,POLYAXON_HOST
, and other configurations as env vars, in that casepolyaxon config
andpolyaxon login
commands are not required.