Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cml: command not found #1324

Open
Vighnesh1234 opened this issue Jan 19, 2023 · 13 comments
Open

cml: command not found #1324

Vighnesh1234 opened this issue Jan 19, 2023 · 13 comments
Assignees
Labels
awaiting-response Waiting for user feedback ci-gitlab question User requesting support

Comments

@Vighnesh1234
Copy link

Vighnesh1234 commented Jan 19, 2023

I am a new user.
When the ci cd pipeline runs
it throws the error as cml:command not found.

Requirement already satisfied: six>=1.5 in /usr/lib/python3.10/site-packages (from python-dateutil>=2.7->matplotlib->-r requirements.txt (line 3)) (1.16.0)
$ python train.py
0.852
$ cat metrics.txt >> report.md
$ echo '![](./plot.png "Confusion Matrix")' >> report.md
$ cml comment create report.md
bash: cml: command not found
Cleaning up project directory and file based variables
00:00
ERROR: Job failed: exit status 1

my ci cd pipeline as follows

train-and-report:
  image: iterativeai/cml:0-dvc2-base1
  script:
    - pip install -r requirements.txt
    - python train.py # generate plot.png
    # Create CML report
    - cat metrics.txt >> report.md
    - echo '![](./plot.png "Confusion Matrix")' >> report.md
    - cml comment create report.md
  tags:
    - runner-tester
   
@0x2b3bfa0
Copy link
Member

Hello, @Vighnesh1234! Where are you running that code? GitHub Actions, GitLab CI/CD or Bitbucket Pipelines?

@Vighnesh1234
Copy link
Author

Hello, @Vighnesh1234! Where are you running that code? GitHub Actions, GitLab CI/CD or Bitbucket Pipelines?

I am running on gitlab

@0x2b3bfa0
Copy link
Member

The following works as expected on GitLab-hosted runners:

example:
  image: iterativeai/cml:0-dvc2-base1
  script:
    - cml comment create report.md

Maybe your runner-tester self-hosted runner has an outdated (and broken) container image in the cache or is using the shell executor for some reason?

@Vighnesh1234
Copy link
Author

Vighnesh1234 commented Jan 19, 2023

I am learning.

I was initially using shell executor. (using my machine as runner host)

Now tried with docker executor ( provided default image as ruby:2.4), and it still throws the same error.

What would you recommend to use as executor?

I can see the following options :

docker, parallels, docker-ssh+machine, Kubernetes, docker+machine, instance, custom, docker-ssh, shell, ssh, Virtualbox.

@0x2b3bfa0
Copy link
Member

Now tried with docker executor ( provided default image as ruby:2.4), and it still throws the same error.

You're almost there! Please try using both the docker executor in conjunction with image: iterativeai/cml:0-dvc2-base1

@Vighnesh1234
Copy link
Author

Vighnesh1234 commented Jan 19, 2023

@0x2b3bfa0 - I appreciate the inputs

facing new errors

$ cml comment create report.md
{"level":"error","message":"token not found","stack":"Error: token not found\n    at new Gitlab (/usr/lib/node_modules/@dvcorg/cml/src/drivers/gitlab.js:21:23)\n    at CML.getDriver (/usr/lib/node_modules/@dvcorg/cml/src/cml.js:158:35)\n    at CML.commentCreate (/usr/lib/node_modules/@dvcorg/cml/src/cml.js:180: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:8891\n    at /usr/lib/node_modules/@dvcorg/cml/node_modules/yargs/build/index.cjs:1:4949"}
Cleaning up project directory and file based variables
00:01
ERROR: Job failed: exit code 1

@0x2b3bfa0
Copy link
Member

0x2b3bfa0 commented Jan 19, 2023

@Vighnesh1234, please try setting CML_TOKEN as shown in the documentation.1

  1. Navigate to User SettingsAccess Tokens
    • In the "Name" field, type CML_TOKEN
    • Select api, read_repository and write_repository
    • Click "Create personal access token" and copy it
  2. In your GitLab project, navigate to SettingsCI/CDVariablesAdd Variable
    • In the "Key" field, type CML_TOKEN
    • In the "Value" field, paste your Personal Access Token
    • Select "Mask variable"
    • Deselect "Protect variable"
    • Click "Add variable" at the bottom of the dialog box

Footnotes

  1. In fact, the documentation says REPO_TOKEN but that information is outdated; please use CML_TOKEN instead.

@0x2b3bfa0 0x2b3bfa0 added question User requesting support awaiting-response Waiting for user feedback ci-gitlab labels Jan 19, 2023
@0x2b3bfa0 0x2b3bfa0 self-assigned this Jan 19, 2023
@Vighnesh1234
Copy link
Author

Vighnesh1234 commented Jan 25, 2023

Apologies for delay in replying.

I was able to add the CML token.

Facing the following error:

Skipping Git submodules setup
Executing "step_script" stage of the job script
01:50
Using docker image sha256:45e46bace2f30643aed40ec7ba01ea4c777840eff633b414dea82f1be9f074a4 for iterativeai/cml:0-dvc2-base1 with digest iterativeai/cml@sha256:ebbae7b681ba1b54496f2a08bd85c0a6d499e546f31ba7af307b4bf4904f5aa0 ...
$ pip3 install -r requirements.txt
Requirement already satisfied: setuptools in /usr/lib/python3/dist-packages (from -r requirements.txt (line 1)) (45.2.0)
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ReadTimeoutError("HTTPSConnectionPool(host='pypi.org', port=443): Read timed out. (read timeout=15)")': /simple/scikit-learn/
WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ReadTimeoutError("HTTPSConnectionPool(host='pypi.org', port=443): Read timed out. (read timeout=15)")': /simple/scikit-learn/
WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ReadTimeoutError("HTTPSConnectionPool(host='pypi.org', port=443): Read timed out. (read timeout=15)")': /simple/scikit-learn/
WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ReadTimeoutError("HTTPSConnectionPool(host='pypi.org', port=443): Read timed out. (read timeout=15)")': /simple/scikit-learn/
WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ReadTimeoutError("HTTPSConnectionPool(host='pypi.org', port=443): Read timed out. (read timeout=15)")': /simple/scikit-learn/
ERROR: Could not find a version that satisfies the requirement scikit-learn (from versions: none)
ERROR: No matching distribution found for scikit-learn

@0x2b3bfa0
Copy link
Member

Sounds like a PyPI issue; can you retry the workflow? 🤔

@Vighnesh1234
Copy link
Author

Vighnesh1234 commented Jan 26, 2023

I tired adding - pip3 install --default-timeout=100 future , it still times out.

I tried so many times and ended with PyPI timeouts. :(

@RaghavaAlajangi
Copy link

Hai @Vighnesh1234,
have you managed to resolve this issue?

@iddqd-dev
Copy link

I tired adding - pip3 install --default-timeout=100 future , it still times out.

I tried so many times and ended with PyPI timeouts. :(

It's still an issue. Were you able to solve it?

@dacbd
Copy link
Contributor

dacbd commented Feb 29, 2024

Can you share the cml runner command you used? Are you targeting a custom subnet or VPC, have you made any changes to your default VPC?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting-response Waiting for user feedback ci-gitlab question User requesting support
Projects
None yet
Development

No branches or pull requests

5 participants