Train models easily with Allegro Trains from your repo!
This action will help you to run your experiments with Trains from Github directly. Just comment from any issue or pull request with
/train-model branch <brach name>
/train-model tag <tag_name>
/train-model commit <commit_id>
This will add an action to your workflow that will clone task TASK_ID
and will enqueue it to selected queue (QUEUE_NAME
input parameter).
Will work in both github issues and github pull requests comments.
name: Train model
on: [issue_comment]
jobs:
train-model:
if: contains(github.event.comment.body, '/train-model')
runs-on: ubuntu-latest
steps:
- name: Train model
uses: shomratalon/trains-train-model@master
id: train
with:
TRAINS_API_ACCESS_KEY: ${{ secrets.ACCESS_KEY }}
TRAINS_API_SECRET_KEY: ${{ secrets.SECRET_KEY }}
TRAINS_API_HOST: ${{ secrets.TRAINS_API_HOST }}
TASK_ID: "e4623efdfa1d461e9101615728fdc52e"
QUEUE_NAME: "train_queue"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Example how you can use outputs from the train action
- name: Print task status
run: |
echo "Task stats is ${TASK_STATUS} for task ${CLONED_TASK}"
env:
TASK_STATUS: ${{ steps.train.outputs.TASK_STATUS }}
CLONED_TASK: ${{ steps.train.outputs.CLONED_TASK }}
TRAINS_API_ACCESS_KEY
: Your trains api access key. You can find it in your trains.conf file under api.credentials.access_key section, read more.TRAINS_API_SECRET_KEY
: Your trains api secret key. You can find it in your trains.conf file under api.credentials.secret_key section, read more.TRAINS_API_HOST
: The Trains api server address. You can find it in your trains.conf file under api.api_server section, read more.TASK_ID
: Id of the task you would like to clone.
QUEUE_NAME
: Queue for the cloned task (default value:default
). You can read more about queues here.
CLONED_TASK
: The cloned task id.TASK_STATUS
: The cloned task status (not updating).