on merging pull request created by "cml pr" triger CI again
See original GitHub issueI’m using this GitHub action for model training and some report generation. After training is complete it creates a PR with the required files with this command cml pr --skip-ci train_outputs/final-model.pt.dvc dvc.lock report.md evaluation.json
And it creates an autogenerated PR like (main-cml-pr-4c32c5a9)
) with I merge it with the main
brain it triggers a new GitHub action. Is there anything I’m missing?
name: NER Model CI [dev]
on:
push:
branches:
- 'main'
jobs:
deploy-runner:
runs-on: ubuntu-20.04
steps:
- uses: iterative/setup-cml@v1
- uses: actions/checkout@v2
- name: 'Authenticate to Google Cloud'
uses: 'google-github-actions/auth@v0'
with:
credentials_json: ${{ secrets.GOOGLE_APPLICATION_CREDENTIALS_DATA }}
- name: Deploy runner on GCP
env:
REPO_TOKEN: ${{ secrets.REPO_ACCESS_TOKEN }}
run: |
cml runner \
--cloud=gcp \
--cloud-region=us-central1-a \
--cloud-type=n1-standard-2 \
--labels=gpu_runner \
--single=true \
--cloud-gpu=nvidia-tesla-t4 \
--cloud-spot=false \
--cloud-hdd-size=128
training:
name: Training and Reporting
needs:
- deploy-runner
runs-on: [self-hosted, gpu_runner]
steps:
- uses: actions/checkout@v2
- uses: iterative/setup-cml@v1
- uses: iterative/setup-dvc@v1
- uses: actions/setup-python@v2
with:
python-version: '3.8'
- name: 'Authenticate to Google Cloud'
uses: 'google-github-actions/auth@v0'
with:
credentials_json: ${{ secrets.GOOGLE_APPLICATION_CREDENTIALS_DATA }}
- name: 'Install requirements'
run: |
pip install -r requirements.txt
- name: Training
env:
repo_token: ${{ secrets.REPO_ACCESS_TOKEN }}
run: |
# Pull dataset with DVC
dvc pull data
# Reproduce pipeline if any changes detected in dependencies
dvc repro
# Upload model go GCS bucket
ls -al train_outputs
git status
dvc add train_outputs/final-model.pt
dvc push train_outputs/final-model.pt -r gcs_model_store
- name: Create report
env:
repo_token: ${{ secrets.REPO_ACCESS_TOKEN }}
run: |
ls train_outputs/*
CODEBLOCK_START="\`\`\`sh"
CODEBLOCK_END="\`\`\`"
echo "## NER report" > report.md
echo "### Loss" >> report.md
echo $CODEBLOCK_START >> report.md
cat train_outputs/loss.tsv >> report.md
printf "\n" >> report.md
echo $CODEBLOCK_END >> report.md
printf "\n" >> report.md
echo "### Training logs" >> report.md
echo $CODEBLOCK_START >> report.md
cat train_outputs/training.log >> report.md
echo $CODEBLOCK_END >> report.md
printf "\n" >> report.md
cml pr --skip-ci train_outputs/final-model.pt.dvc dvc.lock report.md evaluation.json
Issue Analytics
- State:
- Created a year ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
pr
Pull requests created with cml pr won't trigger a new CI/CD run, ... or --squash : Try to merge, rebase, or squash-merge the...
Read more >Duplicate CI Builds because of Pull Request Trigger and CI ...
When we create a pull request, a build is triggered by the PR trigger. After the pull request complete merging changes to master...
Read more >Azurepipeline CI is triggering for every pull request - i want ...
I only want the build to trigger when I merge the PR, not when a user submits it. It's currently trigger on the...
Read more >MLOps for Conversational AI with Rasa, DVC, and CML ( ...
In this case we choose push but there are more complex scenarios where we might only want to execute the job when a...
Read more >Run the CI Pipeline during a Pull Request
To do that, I will show in this post how to protect the master branch with a policy that enforces a pull request...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
You can still use the GItHub merge button, but choosing the rebase or squash options in the dropdown menu.
@0x2b3bfa0 Thanks. It solve my issue