iterative / cml

♾️ CML - Continuous Machine Learning | CI/CD for ML
http://cml.dev
Apache License 2.0
3.99k stars 333 forks source link

Error: cml comment create report.md #1424

Closed b00nw33 closed 11 months ago

b00nw33 commented 11 months ago

I was able to get example repo working properly, but when I try to replicate it in my work, I encounter the following error with cml comment create report.md in cml.yaml.

{"level":"error","message":"token not found","stack":"Error: token not found\n at new Github (/usr/lib/node_modules/@dvcorg/cml/src/drivers/github.js:91:23)\n at CML.getDriver (/usr/lib/node_modules/@dvcorg/cml/src/cml.js:161:35)\n at CML.commentCreate (/usr/lib/node_modules/@dvcorg/cml/src/cml.js:184:22)\n at Object.exports.handler (/usr/lib/node_modules/@dvcorg/cml/bin/cml/comment/create.js:11:25)\n at /usr/lib/node_modules/@dvcorg/cml/node_modules/yargs/build/index.cjs:1:8993\n at /usr/lib/node_modules/@dvcorg/cml/node_modules/yargs/build/index.cjs:1:4949"}

0x2b3bfa0 commented 11 months ago

Hello, @b00nw33! Can you please share a copy of your workflow?

b00nw33 commented 11 months ago

@0x2b3bfa0 Sure, thanks for reaching out!

example_cml - working

wine - error

mycaret - error

0x2b3bfa0 commented 11 months ago

On https://github.com/b00nw33/mycaret/actions/runs/6143774135/workflow, you're passing the token to the wrong step.

  name: Auto mycaret
  on: [push]
  jobs:
    train-and-report:
      runs-on: ubuntu-latest
      container: docker://ghcr.io/iterative/cml:0-dvc2-base1
      steps:
        - name: Checkout code
          uses: actions/checkout@v4
        - name: Install dependencies
-         env:
-           REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          run: |
            python -m pip install --upgrade pip
            pip install -r requirements.txt
            pip install pycaret[full]
        - name: Run app.py
+         env:
+           REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          run: |
            python app.py  # generate plot.png
            # Create CML report
            cat metrics.txt >> report.md
            # echo '![](./plot.png "Confusion Matrix")' >> report.md
            cml comment create report.md
        - name: Finalising
          run: |
            echo "Done!"
0x2b3bfa0 commented 11 months ago

On https://github.com/b00nw33/wine/actions/runs/6148077199/job/16680984239#step:5:14, it can't find results.txt, probably because it doesn't exist.

b00nw33 commented 11 months ago

Thanks @0x2b3bfa0 , made changes accordingly.

Now I'm getting this error from the following line:

echo "![](./feature_importance.png)" >> report.md
0x2b3bfa0 commented 11 months ago

Can you please try renaming your image files so they don't contain underscores? I believe there might be some parsing issue with underscores, also on the GitHub flavor of CML.

https://github.com/iterative/cml/issues/1347

b00nw33 commented 11 months ago

Renamed to features.png, and got this error.

dacbd commented 11 months ago

Renamed to features.png, and got this error.

@b00nw33 sorry for the inconvenience, can you try with the actions/setup-node that you have commented out.

b00nw33 commented 11 months ago

Renamed to features.png, and got this error.

@b00nw33 sorry for the inconvenience, can you try with the actions/setup-node that you have commented out.

@dacbd Thanks, working now. Looks like it needs either uses: actions/setup-node@v3 or container: ghcr.io/iterative/cml:0-dvc2-base1 to work.