Update Dev Container setup with SoftSqueeze support#1552
Update Dev Container setup with SoftSqueeze support#1552mipa87 wants to merge 3 commits intoLMS-Community:public/9.2from
Conversation
- Updated devcontainer.json to include environment variables and commands for initialization and startup. - Configured editor settings and added necessary files for Perl Language Server integration. - Developed a standalone SoftSqueeze container with VNC support, including entrypoint and management scripts. - Added initialization script to create a shared network for containers. - Implemented post-create and post-start scripts for LMS setup and auto-start functionality. - Introduced a clean-up script to remove runtime-generated folders. - Enhanced documentation for Dev Container usage, SoftSqueeze setup, and troubleshooting. Signed-off-by: mipa87 <62723159+mipa87@users.noreply.github.com>
|
Thanks! I had seen your branch and it intrigued me. I never really used dev containers, and running them on Github directly showed quite a few limitations with a free account. But this should still be a good addition. Before I go into great details: why Softsqueeze, but no squeezelite of Squeezeplay? I believe the latter are way more popular (and important nowadays) than the former. |
|
The advantage of Dev Containers is that you don't need any additional tools for local development—everything is included in a single "package." Yes, you’re right, SoftSqueeze isn’t popular anymore, but I’m working on an improvement regarding bitmap fonts, and SoftSqueeze is perfect for that. And I didn’t want to install it locally. I can set up other containers, but there are certainly sound issues, especially when the host is Windows. |
michaelherger
left a comment
There was a problem hiding this comment.
Thanks a lot! I will definitely have to give this a try! I've never been able to debug LMS... this would be a first.
Maybe you could add a section to DEVCONTAIERS.md explaining how to map a music folder to the container? Or did I miss that?
| - `Cache/` | ||
| - `Logs/` | ||
| - `prefs/` |
There was a problem hiding this comment.
Would these folders live in the clone's root? Any way to move this elsewhere?
There was a problem hiding this comment.
Yes, it is possible to mount this paths as volume. I can add this as option to the image
There was a problem hiding this comment.
It depends on what you want—whether to use the project's root directory or something else. I prefer the project's root directory, which is slimserver's default behavior.
| cd "$REPO_ROOT" | ||
|
|
||
| if [[ "$FORCE" != "1" ]]; then | ||
| echo "[INFO] This will delete: ${FOLDERS_TO_CLEAN[*]}" |
There was a problem hiding this comment.
Would be good to show the full list. Just to not get nervous about it.
There was a problem hiding this comment.
Good point, I'll do that
| "/workspaces/slimserver/CPAN/arch/5.40/x86_64-linux-thread-multi", | ||
| "/workspaces/slimserver/CPAN/arch/5.40/x86_64-linux-thread-multi/auto", |
There was a problem hiding this comment.
Can this be made platform independent? I'm a Mac user...
There was a problem hiding this comment.
I'll give it a try. I was worried it wouldn't work for everyone, but I don't have a way to test it—I'm on Windows.
There was a problem hiding this comment.
Updated, you can try.
| @@ -0,0 +1,2 @@ | |||
| # Normalize all text files to LF in this repository (fix issues with line endings with Dev Containers on Windows) | |||
| * text=auto eol=lf | |||
There was a problem hiding this comment.
Will this cause any file change to change line endings, potentially "modifying" a full name just for the line endings?
There was a problem hiding this comment.
I've updated the definition; after that, we can run this script and see what changes
git add --renormalize .
git status
There was a problem hiding this comment.
The following files will be modified:
- Firmware/receiver.version
- Graphics/CODE2000.HTM
- HTML/EN/html/ext/ext-all-debug.js
- Slim/Plugin/CLI/Settings.pm
- Slim/Plugin/DateTime/Settings.pm
- Slim/Plugin/MusicMagic/HTML/EN/plugins/MusicMagic/html/docs/customtags.html
- Slim/Plugin/MusicMagic/HTML/EN/plugins/MusicMagic/html/docs/httpprotocol.html
- Slim/Plugin/MusicMagic/HTML/EN/plugins/MusicMagic/html/docs/powersearch.html
- Slim/Plugin/MusicMagic/HTML/EN/plugins/MusicMagic/html/docs/powerwords.html
- Slim/Plugin/Podcast/ProtocolHandler.pm
- Slim/Plugin/Podcast/Settings.pm
- Slim/Plugin/RS232/Settings.pm
- Slim/Plugin/Rescan/Settings.pm
- Slim/Plugin/UPnP/HTML/EN/plugins/UPnP/MediaServer/MediaReceiverRegistrar.xml
- Slim/Plugin/iTunes/Settings.pm
- Slim/Plugin/xPL/Settings.pm
Is this okay, or should I add some exceptions to the .gitattributes file?
|
First attempt failed. Trying to run using F5 would bring up the debug panel, but no output whatsoever. And after a second or two it stops. Might be the platform is an issue here? The container was created for ARM (Apple Silicon). I tried tweaking all x86_64 paths to use the aarch64 version instead. But still: no feedback, no LMS running. Then tried to run LMS manually (inside the container): Would probably be good to add |
|
It must be challenging to develop without debugging. Yes, the "issue" is the platform. I'll try to fix it, but I don't have a way to test it, so it's good that you have a Mac. I'll also add the music paths as volume mount. |
- Updated Dockerfile to include necessary packages and environment variables. - Improved clean-folders.sh to provide clearer output on folder deletion. - Modified devcontainer.json to include optional mounts for host folders. - Added engine-utils.sh for better container engine detection. - Refactored initialize.sh to utilize engine-utils for container engine selection. - Updated post-start.sh to execute a new start-lyrion.sh script for starting LMS. - Enhanced SOFTSQUEEZE.md with clearer instructions and tips for SoftSqueeze usage. - Improved softsqueeze.sh to support both podman and docker with compose. - Created start-lyrion.sh for streamlined LMS startup process. - Updated .gitattributes and .gitignore for better file handling. - Refined PerlLanguageServerBootstrap.pm for improved module loading. - Updated extensions.json and launch.json for better VS Code integration. - Enhanced DEVCONTAINERS.md with clearer instructions for running and stopping Lyrion. Signed-off-by: mipa87 <62723159+mipa87@users.noreply.github.com>
|
Updated—I hope it works for you too. |
There was a problem hiding this comment.
Something about this configuration file must be wrong/incomplete: after I had tried out your PR my indenting was set to spaces all over the place. Not in VSCode, but something overrode the setting I have in VSCode. All my existing code which was using tabs before (incl. LMS) suddenly started using spaces. Did this not happen to you?
There was a problem hiding this comment.
Perhaps the "editorconfig.editorconfig" extension has been installed (see .vscode/extensions.json), so every project you open uses this extension? The files are formatted correctly in the LMS, right?
| # Ignore cache, logs and prefs files | ||
| Cache/* | ||
| Logs/* | ||
| prefs/* | ||
| Plugins/* |
There was a problem hiding this comment.
Reverted; the project root is used for these folders.
| "/config/prefs" | ||
| "/config/logs" | ||
| "/config/cache" |
There was a problem hiding this comment.
These can't really be put in the root folder, can they? It's my (likely incorrect) understanding that this script would be run outside the container on the system host?
There was a problem hiding this comment.
This script is intended to be used within the Dev Container, so yes. But you're right that it could confuse users if they're using it without Dev Container, so I've changed it to the project's root directory.
…and enhance documentation Signed-off-by: mipa87 <62723159+mipa87@users.noreply.github.com>
Everything has been tested - Docker Compose and Dockerfile, GitHub Codespaces and Dev Containers, Podman (Docker should be compatible) — on both Windows and GitHub Codespaces on Linux.
I hope this makes development easier for new Perl developers like me 🙂