green-coding-solutions / eco-ci-energy-estimation

Eco CI Energy estimation for Github Actions Runner VMs
https://metrics.green-coding.io/ci-index.html
MIT License
55 stars 16 forks source link

start-measurement step fails #26

Closed jreimone closed 1 year ago

jreimone commented 1 year ago

In my private repo the following step fails:

name: Daily execution of tests
on:
  schedule:
    - cron: '0 04 * * MON-FRI'

jobs:
  tests:
    name: Run tests
    runs-on: ubuntu-latest
    steps:
      - name: Initialize Energy Estimation
        uses: green-coding-berlin/eco-ci-energy-estimation@v2
        with:
          task: start-measurement

Here is an excerpt of the log I see from the run:

Requirement already satisfied: tqdm==4.65.0 in /tmp/eco-ci/venv/lib/python3.10/site-packages (from -r /tmp/eco-ci/spec-power-model/requirements.txt (line 25)) (4.65.0)
Requirement already satisfied: tzdata==2023.3 in /tmp/eco-ci/venv/lib/python3.10/site-packages (from -r /tmp/eco-ci/spec-power-model/requirements.txt (line 26)) (2023.3)
Requirement already satisfied: xgboost==1.7.5 in /tmp/eco-ci/venv/lib/python3.10/site-packages (from -r /tmp/eco-ci/spec-power-model/requirements.txt (line 27)) (1.7.5)
jq: error (at <stdin>:1): Cannot iterate over null (null)
Error: Process completed with exit code 5.

Unfortunately, I couldn't reproduce it in my public repo in this PR. I know it's hard, but maybe you have an idea what the issue can be?

ArneTR commented 1 year ago

Thanks for the report!

We haven't seen this so far, but getting right to it :)

Can you tell which version of eco-ci you are using and which Mandatory and Optional Variables you have set? (https://github.com/green-coding-berlin/eco-ci-energy-estimation#github-action-mandatory-and-optional-variables)

@dan-mm Can you please take over

ArneTR commented 1 year ago

Also follow up question: Are you using the github default runner, or a self hosted runner?

jreimone commented 1 year ago

I use a default runner and v2 of the action (see screenshot). As of the variables I only set the task variable which you can also see in the linked public PR (where it doesn't fail).

Screenshot 2023-06-30 at 10 02 15
dan-mm commented 1 year ago

Thanks for the report! Taking a look now

dan-mm commented 1 year ago

If this is a private repo, you need to give your actions read permissions (outlined in the ReadMe here: https://github.com/green-coding-berlin/eco-ci-energy-estimation#note-on-private-repos). You can set this on a per-job level:

 test:
   runs-on: ubuntu-latest
   permissions:
     actions: read
   steps:
     - name: Eco CI - Initialize
       uses: green-coding-berlin/eco-ci-energy-estimation@v1
       with:
         task: start-measurement

do you have that set / still see this issue after setting it?

dan-mm commented 1 year ago

@jreimone - are you still experiencing this issue?

ArneTR commented 1 year ago

Closed because of no response

jreimone commented 10 months ago

Sorry for the veeeeeeeryyyyy late follow-up here 😬 I just tried it out again. I can confirm that the error doesn't occur anymore 👍 But setting the permissions to read as you suggested here didn't work. Activating it let my checkout step fail in the private repo. Deleting the following lines was successful then.

permissions:
     actions: read
ArneTR commented 10 months ago

hey @jreimone : Can you state which version of the Action you are using?

jreimone commented 10 months ago
uses: green-coding-berlin/eco-ci-energy-estimation@v2
ArneTR commented 10 months ago

@dan-mm Can you have a look into this