Closed cactushydrocodone closed 4 years ago
The script writes where you place it. If you do things like docker, you're supoposed to be able to read bash. besides the full dockerfile in the rt-ps repo,
Hmm. Weird. Maybe i need glasses, but those Commands... idk: They seem pretty static to me. Weird. :/
Esspecially this part tho Do you see the userhome there? I do not lol
Here's a stupidly simple Dockerfile that I use:
FROM python:3
RUN mkdir /app
WORKDIR /app
COPY pyroscope .
RUN pip install -r requirements.txt
The requirements.txt
in question (because I'm a selfish sucker for py3's string/bytes handling):
https://github.com/kannibalox/pyrobase/archive/py3.tar.gz
https://github.com/kannibalox/pyrocore/archive/py3.tar.gz
requests
APScheduler>=2.0.2,<3
Tempita>=0.5.1
Then I mount the configuration in kubernetes as so:
kind: ConfigMap
apiVersion: v1
metadata:
name: pyrocore-config
namespace: rtorrent
data:
config.ini: |
[GLOBAL]
rtorrent_rc = /etc/rtorrent/rtorrent.rc
[CONNECTIONS]
local = scgi:///home/rtorrent/rtorrent/socket
config.py: ""
torque.ini: |
[TORQUE]
apscheduler.threadpool.core_threads = 1
apscheduler.threadpool.max_threads = 1
apscheduler.threadpool.keepalive = 20
apscheduler.misfire_grace_time = 7
apscheduler.coalesce = True
job.exporter.handler = pyroextra.rtorrent_exporter:RtorrentExporter
job.exporter.jobs = system,tracker
# The schedule has no effect here
job.exporter.schedule = hour=*
job.exporter.port = 8000
job.exporter.prefix = rtorrent_
job.exporter.active = True
job.exporter.dry_run = False
job.exporter.quiet = False
Pod spec:
....
volumeMounts:
- name: pyrocore-config
mountPath: /root/.pyroscope
....
volumes:
- name: pyrocore-config
configMap:
name: pyrocore-config
....
Obviously this needs plenty of work (not running as root would be the first step), but hopefully it helps you get started
${foo:-default}
is a syntax found in man bash
. In a Dockerfile, you need to explicitly set HOME because there is no bashrc etc that sets it. You need to understand those tools to be successful.
Hello,
I want to add this to my rtorrent/rutorrent container image. Now im trying around a bit and what is mostly stopping me is the "update-to-head.sh" script, as its always trying to write to /home/rtorrent instead of the directory i provide with the PYRO_CONFIG_DIR ENV variable. Even when i specify it explicitly, it gets ignored.
This is a bit annoying, is there an already made approach?
Do you have any idea what i could do? My current approach is more a workaround than something else...