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

Implement deployment package (flatpak, snap, AppImage, etc...) #9

Open
edurenye opened this issue Aug 30, 2023 · 13 comments
Open

Implement deployment package (flatpak, snap, AppImage, etc...) #9

edurenye opened this issue Aug 30, 2023 · 13 comments
Labels
enhancement New feature or request

Comments

@edurenye
Copy link

Create a docker file to make the installation more easier

@edurenye
Copy link
Author

I thought it was a web UI, sorry.

Well, would be nice to have a web UI

@Quedale
Copy link
Owner

Quedale commented Sep 10, 2023

Related to Issue #10, I'm reopening this issue for tracking.

@Quedale Quedale reopened this Sep 10, 2023
@Quedale
Copy link
Owner

Quedale commented Sep 11, 2023

Yesterday I manage to successfully create a functional PoC.
I just have to refine a few details and should be available soon.

For instance properly mapping ports that would be used by gstreamer for the backchannel.

Unfortunately, achieving this requires modifying the system's display pernission to allow docker to display GUI windows.
Since it uses a GTK window, I doubt this would integrate well as a docker plugin like HomeAssitant.

Regardless, the option will be available to offer a simple way to ensure build compatibilty on unexpected platform.

@Quedale
Copy link
Owner

Quedale commented Sep 14, 2023

Last night I published the PoC Dockerfile.

Unfortunately, I was unable to get the microphone to work since my system uses Pulseaudio.
This isn't my recommended solution, but should provide some guidance if anyone wish to use it.

simply run docker/docker_build_run.sh

Let me know how that goes!

@edurenye
Copy link
Author

The script fails for me on the build, but running manually works, maybe there is a way to move the xhost +Local:* into a docker compose file, would make the instructions more simple and remove the need for that script, or what do you think?
From https://gursimarsm.medium.com/run-gui-applications-in-a-docker-container-ca625bad4638
says should just be:

version: "3"
services:
  onvifmgr:
    build: .
    environment:
      - DISPLAY=${DISPLAY}
    volumes:
      - /tmp/.X11-unix:/tmp/.X11-unix
    network_mode: host

Why do you need the speaker device mapped?

@Quedale
Copy link
Owner

Quedale commented Sep 19, 2023

I will look into later today if I get a chance.
Although after a quick read, I doubt there's a way around xhost configuration.

There's a section entitled Handling X Authentication, which refers to the xauth and xhost utilities.
I will read about xauth given that it seems to be a better alternative to xhost.

Regarding speaker/microphone mapping, it isn't mandatory for the tool to work, but it does support bidirectional audio with cameras that also supports it.
Without access to the hardware, bidirectional audio support is rendered useless.

The script I wrote doesn't have the bash header, which I suppose might cause issues by invoking the wrong default interpreter.
Can you provide additional details about your system, so that I can reproduce a similar environment?

Thanks!

@Quedale
Copy link
Owner

Quedale commented Sep 20, 2023

I had a chance to give it a shot and unfortunately, docker compose doesn't take care of X Authentication.

Not running the xhost command results with the following message:

 ✔ Container onvifmgr_container  Recreated                                                                                                                     0.2s 
Attaching to docker-onvifmgr-1
docker-onvifmgr-1  | Authorization required, but no authorization protocol specified
docker-onvifmgr-1  | 
docker-onvifmgr-1  | (onvifmgr:7): Gtk-WARNING **: 04:35:45.182: cannot open display: :0
docker-onvifmgr-1 exited with code 1

I added the yaml file anyway as an alternative to the script.
Thanks for this contribution.

I will dig around xauth and using token instead of xhost.

@edurenye
Copy link
Author

I'm running Ubuntu 22.04.3 LTS & Docker version 24.0.6.
I guess has something to do with me using zsh, don't nee to worry about that I just run the commands inside the script.
The command xhost "+Local:*" works for me if I add the quotes.
I wonder if giving access to X server to all applications might have security implications, maybe we shoud use VNC instead.
But when I run the docker container I get:

Gtk-Message: Failed to load module "canberra-gtk-module"
Gtk-Message: Failed to load module "canberra-gtk-module"
realloc(): invalid next size
Aborted (core dumped)

I haven't found any issue regarding xhost support for docker compose, and also I was wondering if this will work for other operating systems or X servers like Wayland. Maybe VNC is a better solution after all. What do you think?

@Quedale
Copy link
Owner

Quedale commented Sep 20, 2023

From what I understand about Docker, it uses the system's kernel instead of virtualizing it.
This could lead to different results depending on the system.
What desktop environment are you using?
I imagine it should come out-of-the-box for Gnome and KDE desktop.

You are correct regarding X permissions that it involves a few security implications. That's why I think xauth token might be a better approach.

VNC could be an alternative candidate assuming that it doesn't introduce latency.
VNC might be viable for most application use-case, but this application involves real-time video stream which could potentially add latency or even loose image quality.
I will look into it as well to get familiar with it.

That being said, Docker is most likely not the best fit for what we are trying to achieve here. (Cross-environment deployment)

I honestly didn't look into deployment strategy yet, since I didn't even make an official release.
Something like AppImage or Snap might be a better fit for this purpose.

@edurenye
Copy link
Author

I'm using Gnome.
I agree VNC would add latency so might not be the best solution.
I'm not super familiar neither, so I don't know the best way to architecture this.

@GrueMaster
Copy link

Out of curiosity, why Docker? Since this is a gui app, why not create a snap and/or flatpak for this? These environments integrate with the system desktop better and make them self-contained for some library dependencies.

Docker is better suited for background services.

@edurenye
Copy link
Author

Yes, that would work too, I think snap is more limited, but flatpak would be great.

@Quedale
Copy link
Owner

Quedale commented Jan 3, 2024

I tried docker for s**** and giggles. Turns out it doesn't support GUI application gracefully.
I will definitely consider flatpak once I find this project stable enough.

I'm still finding some bugs and improving overall stability.

You can keep this issue open for tracking for whenever I get around to it.

Thanks for this input!

@Quedale Quedale changed the title Add a docker file Implement deployment package (flatpak, snap, AppImage, etc...) Feb 3, 2024
@Quedale Quedale added the enhancement New feature or request label Feb 3, 2024
@Quedale Quedale mentioned this issue May 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants