JBOPS icon indicating copy to clipboard operation
JBOPS copied to clipboard

feat: add container and publish it to GHCR

Open onedr0p opened this issue 1 year ago • 3 comments

👋🏼 @blacktwin

I have created a Dockerfile and a GH workflow to build and push the container to your packages. I have had this working for awhile and build my own image but if you aren't too keen on supporting this I understand.

Usage

I created a helper bash script so people can set the JBOPS_SCRIPT_PATH to the script they want to run (e.g. JBOPS_SCRIPT_PATH=fun/plexapi_haiku.py and any args for the script are passed to the python script. For a complete example, check out this docker compose with ofelia:

services:
  ofelia:
    image: mcuadros/ofelia:latest
    depends_on:
      - jbops-offdeck
    command: daemon --docker
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock:ro
  jbops-offdeck:
    image: ghcr.io/blacktwin/jbops:latest
    container_name: jbops-offdeck
    user: 1000:1000
    volumes:
      - ./config.ini:/config/config.ini:ro
    environment:
      - JBOPS_SCRIPT_PATH=utility/off_deck.py
    labels:
      ofelia.enabled: "true"
      ofelia.job-exec.jbops-offdeck.schedule: "@every 10m"
      ofelia.job-exec.jbops-offdeck.command: "/docker-entrypoint.sh --playlists SleepMix"

Limitations

Currently the maps/requirements.txt will not build. I tried with Python 3.10, 3.11 and 3.12 but it won't build pyproj with the below error so I omitted it for now. Not sure why this is happening but if you have any pointers I am all ears.

#8 223.6 Collecting pyproj<3.7.0,>=1.9.3
#8 223.6   Downloading pyproj-3.6.1.tar.gz (225 kB)
#8 223.6      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 225.1/225.1 kB 33.6 MB/s eta 0:00:00
#8 223.7   Installing build dependencies: started
#8 225.2   Installing build dependencies: finished with status 'done'
#8 225.2   Getting requirements to build wheel: started
#8 225.3   Getting requirements to build wheel: finished with status 'error'
#8 225.3   error: subprocess-exited-with-error
#8 225.3   
#8 225.3   × Getting requirements to build wheel did not run successfully.
#8 225.3   │ exit code: 1
#8 225.3   ╰─> [1 lines of output]
#8 225.3       proj executable not found. Please set the PROJ_DIR variable. For more information see: https://pyproj4.github.io/pyproj/stable/installation.html
#8 225.3       [end of output]
#8 225.3   
#8 225.3   note: This error originates from a subprocess, and is likely not a problem with pip.
#8 225.3 error: subprocess-exited-with-error
#8 225.3 
#8 225.3 × Getting requirements to build wheel did not run successfully.
#8 225.3 │ exit code: 1
#8 225.3 ╰─> See above for output.
#8 225.3 
#8 225.3 note: This error originates from a subprocess, and is likely not a problem with pip.

Hope this finds you well, happy holidays!

onedr0p avatar Dec 13 '23 22:12 onedr0p