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

Easy docker way to make it work within a git repo #398

Open
chneau opened this issue Sep 25, 2024 · 3 comments
Open

Easy docker way to make it work within a git repo #398

chneau opened this issue Sep 25, 2024 · 3 comments

Comments

@chneau
Copy link

chneau commented Sep 25, 2024

I couldn't install labours but made it work with this docker command:

docker run --rm -v "$PWD":"$PWD" -w "$PWD" -u 1000 srcd/hercules hercules --burndown --pb . | docker run --rm -i -v "$PWD":"$PWD" -w "$PWD" -u 1000 srcd/hercules labours -f pb -m burndown-project --resample month -o git.png

it will create a ./git/project.png file. Hope that helps save some time to people, I couldn't make the normal install to work but that command does exactly what I wanted.

@RicardoHS
Copy link

Thank you very much. It works!

@EgoPingvina
Copy link

It doesn't work for me. Could you please help, @chneau

My main.yml:

name: Run Hercules Analysis

on:
  push:
    branches:
      - master
jobs:
  run-hercules:
    runs-on: ubuntu-latest

    steps:
    - name: Checkout code
      uses: actions/checkout@v2

    - name: Run Hercules
      run: |
        docker run --rm -v "$PWD":"$PWD" -w "$PWD" -u 1000 srcd/hercules hercules --burndown --pb . | docker run --rm -i -v "$PWD":"$PWD" -w "$PWD" -u 1000 srcd/hercules labours -f pb -m burndown-project --resample month -o git.png
    - name: Upload Artifacts
      uses: actions/upload-artifact@v3
      with:
        name: hercules-output
        path: git.png

An error:

latest: Pulling from srcd/hercules
171[8](https://github.com/EgoPingvina/TravianFarmBot/actions/runs/11599670059/job/32298317693#step:3:8)57c49d0f: Pulling fs layer
419640447d26: Pulling fs layer
61e52f86261[9](https://github.com/EgoPingvina/TravianFarmBot/actions/runs/11599670059/job/32298317693#step:3:9): Pulling fs layer
0bd94767c998: Pulling fs layer
99452a2b707c: Pulling fs layer
38371b41a3c4: Pulling fs layer
0bd94767c998: Waiting
99452a2b707c: Waiting
38371b41a3c4: Waiting
99452a2b707c: 99452a2b707c: Verifying Checksum
Verifying Checksum
99452a2b707c: Download complete
99452a2b707c: Download complete
171857c49d0f: Verifying Checksum
171857c49d0f: Download complete
171857c49d0f: Verifying Checksum
171857c49d0f: Download complete
0bd94767c998: 0bd94767c998: Verifying Checksum
Verifying Checksum
0bd94767c998: Download complete
0bd94767c998: Download complete
171857c49d0f: Pull complete
171857c49d0f: Pull complete
419640447d26: Pull complete
419640447d26: Pull complete
61e52f862619: Pull complete
61e52f862619: Pull complete
0bd94767c998: Pull complete
0bd94767c998: Pull complete
99452a2b707c: Pull complete
99452a2b707c: Pull complete
38371b41a3c4: 38371b41a3c4: Download complete
Download complete
38371b41a3c4: Pull complete
38371b41a3c4: Pull complete
Digest: sha256:f1bb45e6be3f35dedf14dbe7ceaa6d719067570951ede6c301bead96586cde9c
Status: Downloaded newer image for srcd/hercules:latest
Digest: sha256:f1bb45e6be3f35dedf14dbe7ceaa6d719067570951ede6c301bead96586cde9c
Status: Image is up to date for srcd/hercules:latest
git log...
2024/[10](https://github.com/EgoPingvina/TravianFarmBot/actions/runs/11599670059/job/32298317693#step:3:10)/30 18:44:59 failed to list the commits: object not found
Matplotlib created a temporary config/cache directory at /tmp/matplotlib-4mo5y30j because the default path (/.config/matplotlib) is not a writable directory; it is highly recommended to set the MPLCONFIGDIR environment variable to a writable directory, in particular to speed up the import of Matplotlib and to better support multiprocessing.
Traceback (most recent call last):
  File "/usr/local/bin/labours", line 33, in <module>
    sys.exit(load_entry_point('labours==10.7.2', 'console_scripts', 'labours')())
  File "/usr/local/lib/python3.6/dist-packages/labours/cli.py", line [15](https://github.com/EgoPingvina/TravianFarmBot/actions/runs/11599670059/job/32298317693#step:3:15)4, in main
    reader = read_input(args)
  File "/usr/local/lib/python3.6/dist-packages/labours/readers.py", line 439, in read_input
    reader.read(ins)
  File "/usr/local/lib/python3.6/dist-packages/labours/readers.py", line 230, in read
    raise ValueError("empty input")
ValueError: empty input
Reading the input... 
Error: Process completed with exit code 1.

@chneau
Copy link
Author

chneau commented Oct 30, 2024

Could you try the command directly through the command line without GitHub Action? I'm not sure of the specifics on GitHub Action but the first docker command seems to not output anything to the hercule docker command as per the error.

it works well for me on a linux machine on the bash command.

As well, your artifact output might be ./git/project.png

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants