-
Notifications
You must be signed in to change notification settings - Fork 141
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
Dockerized Deployment V2 #403
Conversation
|
Ok, adjusted it to use
|
Not sure if I don't understand docker, but why don't you install pikaraoke via pip instead of pulling the source? Then to run: As for iwconfig, I don't know the exact reasoning behind it. Looks to have something to do with Wifi ap mode detection in raspberry pi devices only. Best to leave it in. If your docker image doesn't have iwconfig, can't it simply be installed? |
So if we eventually end up publishing the image to Docker Hub, you'll want to be publishing the specific version/code you're releasing on Github. If you look at something like MariaDB you can see all the version-specific tags like 11.1.6 and so on. The way they do this is they'll have a CI pipeline that builds the source, packages it as an image, and then publishes it to Docker Hub all as part of the same pipeline. If you start pulling down from some remote package manager (like
It does have it, but it looks like in later versions of Debian linux |
Got it that makes sense in regard to the versioning. One could make the case that you could deploy to docker only after the version is released to pip, then have the docker config pull the proper version via Regarding |
I've fixed the Video playing is not functioning. I thought at first it was because the It looks like something is assembling weird URLs ( Omitting the |
-u / -url overrides the webserver url (splash screen and endpoints). There --ffmpeg-url parameter to override the stream url. Normally these are auto-detected, however in a containerized installation, as you noticed the IP address is invalid. You'd need to ensure that both of these are a set to valid LAN IP address in order for other clients to connect. And that the port forwards correctly. There was some discussion about this here. I think it involved some proxying of the two urls into a single endpoint. maybe you can dig up the solution. |
Ok! Getting somewhere. I can now access and display the On my local web browser the video and sound plays perfectly, on my smart TV the interface displays properly and the sound plays for each video, but the video is black. I'm assuming this means the network is ok (otherwise we would get no sound) but probably some issue with the codec that is being streamed over to the browser? I'm going to try tinkering with some settings to see if I can make it use a more basic codec format that may be supported by more embedded browsers. Edit: adding |
Hmm, yeah embedded browsers might be a whole other thing. You should
probably scope this to being able to get the docker container going.
…On Tue, Oct 8, 2024 at 12:47 PM Tom ***@***.***> wrote:
Ok! Getting somewhere.
I can now access and display the /splash screen locally and on my smart
TV's web browser over the network. My phone can successfully open the
remote control app as well.
On my local web browser the video and sound plays perfectly, on my smart
TV the interface displays properly and the sound plays for each video, but
the video is black. I'm assuming this means the network is ok (otherwise we
would get no sound) but probably some issue with the codec that is being
streamed over to the browser?
I'm going to try tinkering with some settings to see if I can make it use
a more basic codec format that may be supported by more embedded browsers.
—
Reply to this email directly, view it on GitHub
<#403 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AA7KXNXCDLDB4MJUFINB5JDZ2QZGFAVCNFSM6AAAAABPNIRVTGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDIMBQGY4TCNZYG4>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Yep, that makes sense. Would you like to be the owner of the Docker Hub repo? I feel like that makes sense given you own the Github repo too. In which case could you do the setup steps here when you have a moment? Once we have the repo we can add the Github Actions definition to build and publish the image on release. |
Yup, I can own that. In the meantime can you write up some basic instructions on how I can test this myself from your branch? Not too familiar with docker, but I do have it installed. |
Basic instructions to spin it all up locally:
Once the remote repo is up and running, only steps 3 and 4 will be required (and you won't need the repo cloned locally of course). Docker compose will automatically trigger an image |
I had a look. Couldn't get it to work initially, but this command did it (add a .) : I'm now able to run a headless server on localhost in docker. That seems to work fine. However, is there a way to automatically pass the host LAN IP to the entrypoint command in the event of the absence of the URL? Ideally that would all be handled automatically and not be a manual configuration. Running headless server and client on localhost is not a common scenario. |
Side point: I'm moving house over the next week so likely won't have time to make progress on this myself in that time. Will pick it up again when things calm down. |
Thanks for the update, we're definitely close here. I also saw this entry on a promising |
FWIW, I have a WIP branch where I'm trying to have pikaraoke run on a single port 5555, including ffmpeg streams. That would solve these issues. I recall I got mostly there, but forget where I left off. Will revisit when I have the time. |
Tbh I'm not sure this is really a problem. Docker is perfectly happy to expose as many ports as you like. Apologies for not following up on this. I'm still in the chaos of setting up my new apartment so don't have any free time to play around with this stuff. |
Hey @vicwomg! Sorry about the radio silence for the last couple of months. Moving apartment is all-consuming! Coming back to this now and I have good news. In the meantime I have learned about I've tested this by pushing the image to my personal docker repo and deploying it to my pi at home. I can successfully open and interact with the app all without having to tell I think we should be good to move ahead and merge this and start working on the publishing pipeline for images? |
I'm seeing this error when trying to run docker-compose up, any idea?
|
scripts/entrypoint.sh
Outdated
|
||
# Run pikaraoke with necessary parameters | ||
cd pikaraoke | ||
poetry run pikaraoke -d /pikaraoke-songs/ --headless --high-quality |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would prefer not to force the --high-quality
flag. Not sure if there's a way to passthrough command line parameters using docker, but that would be preferred
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can definitely do that, the way you specify features like that is usually via environment variables (the env:
block that is currently not included). Question is, do we want to just have one environment variable that contains all the extra params, or do you want one for each option?
so we'd either have
env:
LAUNCH_OPTIONS: '--high-quality'
or
env:
HIGH_QUALITY: true
I was able to fix it by manually specifying the path to my local pikaraoke-songs dir. But I'm not sure what a more universal cross-platform solution would be.
Also, after launching, it reports my splash screen URL to: |
Are you running this on your laptop? I had the same problem on my mac, but it worked fine on my Pi. My best guess currently is that the logic that tries to guess the IP is currently misinterpreting information on OSX when running inside docker, but is fine on pi. The IP should definitely be available in If you want to test it on a remote machine, I've published the image to my own repo at
So this isn't really something we need to fix I think. It's established with docker containers that you can either:
|
I just wanted to pop in here and thank you both. I tried this on a Synology NAS docker server, Chromecast with Google TV client setup and it worked great! Some notes:
|
I would prefer not to merge a PR that has known incompatibility with one of the major supported OS. Unless that incompatibility is clearly communicated on runtime.
Admittedly I'm not familiar with the conventions. All I know is that the checked-in compose file defaults to Just to give you a sense of where my head is at with both of these issues, with any release I immediately think of the support questions and tickets that will be filed from first-time users, and how to best avoid them. To answer your other question about CLI parameters, I think they should be all specified in one variable, as parting them out to discrete options will ultimately always be a catch up game. |
Ah I see your point, sorry I didn't realise the docker compose was actually broken (it definitely shouldn't be expecting something at the root of the users fs). Will fix it.
Ok will make this change 👍
Understandable. The main issue here is that I don't actually know any Python so it is tricky for me to debug what is going on here and fix it. I can have a go but I may need your help tracing it through. My best guess is that the OS utility currently being called (on OSX) is giving the IP addresses in an unexpected order (first the internal Docker one, then the local network one). |
Pushed a few changes:
|
Here's the relevant line of code: pikaraoke/pikaraoke/karaoke.py Lines 204 to 216 in 6af808a
IP is fetched from the socket library. It seems clear from the comment that reliable host IP-fetching can be elusive. I can probably help investigate, but it would be helpful to know what this SHOULD be reporting vs. what it actually is. I'm seeing a LAN address in the Perhaps @samuelkyl 's comment about allowing the IP overriding is right. We can't be sure what the DNS configuration of the host will be, best to allow folks to configure it manually. |
Yep, makes sense. This is already possible with the I think we can do this in stages maybe? Nobody is going to be able to use the docker container anyway until we:
So we can work on those things in parallel maybe? |
Yeah digging a bit deeper I'm not sure where that IP address is coming from. I looked at the docker network config (which shouldn't even really apply anyway as we're in This answer from ChatGPT might explain it actually:
|
I took a much needed deep dive into Docker yesterday. I think I have a better understanding of the ecosystem. I may open a new PR with some restructuring and enhancements, in which I'll be sure to credit you.
I have discovered some more complications that will hold this project up
Investigating these things in a separate branch which I will share soon |
New PR opened: #439 I found that the python bullseye slim base image can install a version of ffmpeg that supports transposition. It is also 200MB smaller, so there's that! |
I think I have the CI pipeline working! Builds both arm64 and amd64, though I haven't tested the latter. https://hub.docker.com/repository/docker/vicwomg/pikaraoke/general The dockerhub page has a more up to date docker compose file to use |
Wooo exciting! Thanks for getting that all sorted. One comment looking at the docker page currently, I think you might just be pushing |
Closing this PR as the changes were rolled into #439 |
Hey @vicwomg!
So I'm just taking a stab at this. I'm no expert in Python so I'm running into a few problems but I think the image is building mostly correctly. I made a few changes from the other PR:
python:3.12-slim-bookworm
) as most of your setup scripts and instructions assume you're on Debiangit
. This is because eventually we should set up a Docker publish step as part of the Github release. Pulling the code from the local repo ensures that the published version matches and doesn't accidentally pull in code from a different release.entrypoint.sh
script from the other PR, but I changed it to callpython3 /pikaraoke/pikaraoke/app.py
directly rather than using thepikaraoke.sh
script.This is not currently working, as the app startup fails with:
Unfortunately this is where I run into the problem of not really knowing Python that well!