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

Install addons/plugins #194

Open
mircsicz opened this issue Jan 20, 2025 · 4 comments
Open

Install addons/plugins #194

mircsicz opened this issue Jan 20, 2025 · 4 comments

Comments

@mircsicz
Copy link

Hi Markus, erstmal 1000 Dank für Dein tolles Projekt! <3

Thanks to prind I could klipper my Kobra 2 Neo in a breeze...

But after I've started with Kiauh to build my firmware and for first test and also install the OctoApp-Plugin and a few others. But as a fellow DevOps I had to switch to Docker to run my environment! But now I can't find a single hint on how to install stuff like:

I would expect them to be installed in specific dir but I can't see where... Except for config there's not a single Volume/Dir that would make sense to me.

So I guess one could come up with a new Volume to be mounted into the klipper-image... Hope you have a hint for me ;-)

@mkuf
Copy link
Owner

mkuf commented Jan 20, 2025

Hi there,

that depends on how that "plugin" interacts with moonraker/klipper.

If files need to be placed in a specific directory of one of the services, like the gcode_shell_command, its best do add a build section to your docker-compose.override.yaml and write a short dockerfile that references the prind image.

services:
  klipper:
    image: klipper:gsc
    build:
      dockerfile_inline: |
        FROM alpine/curl AS download
        RUN curl https://raw.githubusercontent.com/dw-0/kiauh/refs/heads/master/resources/gcode_shell_command.py -o /tmp/gcode_shell_command.py

        FROM mkuf/klipper:latest
        COPY --chown=klipper:klipper --from=download /tmp/gcode_shell_command.py /opt/klipper/klippy/extras/

Other "plugins" like crowsnest are separate processes that would run alongside klipper/moonraker.
The cleanest solution for this case is to contribute a Dockerfile / Image build pipeline to the upstream project.
We can then add a new service to the compose file referencing that image.

I did something like that for mobileraker_companion in Clon1998/mobileraker_companion#29
If the upstream project has no interest in maintaining a docker image, like it was the case with klipper an moonraker, we can think about adding it to prind itself and publish these images for everyone to use.

Aside from that, I'm not really familiar with crowsnest and its usecases.
Prind has a way to set up multiple webcams, as described here https://github.com/mkuf/prind?tab=readme-ov-file#multiple-webcams
I'd be happy to hear about your specific usecase and if it can be covered by the webcam templating.

I also had a quick glance at the OctoApp companion but couldn't identify what the installer is doing without having to test it myself. If you have insights on that, I may be able to also provide an example on how to implement it.

@mircsicz
Copy link
Author

mircsicz commented Jan 20, 2025

Another day later I took the chance to look into the OctoApp Companion, specifically as it seems OctoApp Companion caused a problem I had to iron out first!

I had my last (and first since migrating to prind) two prints fail with MCU timing issues...

mircsicz@piz2:/srv/docker/prind $ ps ax|grep octoapp
    496 ?        Ssl   30:39 /home/mircsicz/octoapp-env/bin/python3 -m moonraker_octoapp FOO
 307980 pts/1    S+     0:00 grep --color=auto octoapp

As this service seemed to have caused my mcu timeout failures it's now disabled!

mirco@piz2:/srv/docker/prind $ systemctl list-units |grep octo
  octoapp.service                                                                                       loaded active running   OctoApp For Moonraker
mircsicz@piz2:/srv/docker/prind $ systemctl disable octoapp
Removed "/etc/systemd/system/multi-user.target.wants/octoapp.service".
mircsicz@piz2:/srv/docker/prind $ systemctl stop octoapp
mircsicz@piz2:/srv/docker/prind $ systemctl status octoapp
○ octoapp.service - OctoApp For Moonraker
     Loaded: loaded (/etc/systemd/system/octoapp.service; disabled; preset: enabled)
     Active: inactive (dead)

So this is just a Service running for OctoApp to be able to send notifications... It seems that me trying to load a camera-stream through the App caused my MCU timeouts, while OctoApp Companion was running in the Kiauh context.

Argghhh, just realized I forgot to click the 'Update comment' Button yesterday :-(

@mircsicz
Copy link
Author

Sorry for the delay, family first... Won't be better next days as 2 out of 3 kids will have their birthdays in the next 5 days...

Here's a glance at the install.sh

#
# OctoApp for Klipper!
#
# Use this script to install the plugin on a normal device or a Creality device, or to install the companion!
# For a companion install, use the -companion argument.
#
# Simply run ./install.sh from the git repo root directory to get started!

@mkuf
Copy link
Owner

mkuf commented Jan 23, 2025

Hey again,

so i had a look at the octoapp installer and companion for moonraker and it would probably be possible to package it into its own container as it communicates with moonraker via its network port but it would require upstream code changes to work.

Unfortunately the address and port are hardcoded to localhost in the client, as it assumes it is running on the same host as moonraker itself.
https://github.com/crysxd/OctoApp-Plugin/blob/54f726701b032e15184ca80a0c42aeab5ad93441/moonraker_octoapp/moonrakerclient.py#L83

When running in a different container, it would be required to point the companion to the moonraker container instead of localhost.

I'd suggest giving the mobileraker or moonraker-obico profile a try for now.

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

2 participants