question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

on merging pull request created by "cml pr" triger CI again

See original GitHub issue

I’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:closed
  • Created a year ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
0x2b3bfa0commented, Oct 2, 2022

You can still use the GItHub merge button, but choosing the rebase or squash options in the dropdown menu.

0reactions
mehadi92commented, Oct 3, 2022

@0x2b3bfa0 Thanks. It solve my issue

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found