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

Add devcontainer #493

Open
wants to merge 11 commits into
base: main
Choose a base branch
from
Open

Add devcontainer #493

wants to merge 11 commits into from

Conversation

ThatKalle
Copy link

Added an initial development container configuration.
Tested on a Windows11 host, Docker Desktop, and a WSL2 Ubuntu installation.

It starts up, installs dependencies needed to run pnpm run rust:dev.
Also installs meshtasticd and meshtastic CLI.

With that it's possible to access the application, see a node.

I did try changing some text in the application and it works.

image

issue #471
issue #472

@matthewCmatt
Copy link
Contributor

matthewCmatt commented Mar 8, 2025

Wow! This is great work. This was attempted in #491 but looks like that PR was closed.
Love the inclusion of meshtasticd, this will be hugely helpful for testing in CI/CD etc.

Could you add something to the readme that states the dev container only works on Linux? I spun it up on my Mac and ran into issues with USB forwarding, and would also probably run into problems with display output from GTK.

Could you also move the config.yaml to a directory other than the root? Maybe into /.devcontainer/? Or give it a more descriptive name?

@ThatKalle
Copy link
Author

Could you also move the config.yaml to a directory other than the root? Maybe into /.devcontainer/? Or give it a more descriptive name?

Sorted! meshtasticd looks for it in the current directory, but it was possible to set a new location with -c path syntax.

Could you add something to the readme that states the dev container only works on Linux? I spun it up on my Mac and ran into issues with USB forwarding, and would also probably run into problems with display output from GTK.

That is quite, interesting.
It's kind of supposed to work everywhere, and it doesn't do any USB forwarding.
I don't have access to Mac or Linux hardware to test on.

I myself run it on a Windows 11 host with Docker Desktop and WSL2 Ubuntu backend.

This was attempted in #491

Oh neat! Didn't see that one.
I've copied most of the README content with some updates.

@matthewCmatt
Copy link
Contributor

I myself run it on a Windows 11 host with Docker Desktop and WSL2 Ubuntu backend.

Ah, great to hear it works with WSL. Probably just needs some tweaking for MacOS/Linux, but that shouldn't hold up this PR!

Could still use a note in the README here about it only working in Windows, just so new devs don't get the wrong idea and get frustrated if things don't work as expected.

@ThatKalle
Copy link
Author

display output from GTK

I have somewhere in the back of my head that playing with the $DISPLAY variable can help that flow.
I've added a RUN step in the Dockerfile, made no difference to me, still works both ways,, but that might very well be some Microsoft magic.

Also added a note at the top of the README, hopefully that can get updated as more devs give it a go 👍

@matthewCmatt
Copy link
Contributor

I have somewhere in the back of my head that playing with the $DISPLAY variable can help that flow.
I've added a RUN step in the Dockerfile, made no difference to me, still works both ways,, but that might very well be some Microsoft magic.

Yeah WSL is pretty well-instrumented from my experience. Looks like this thread has some similar issues to mine, so maybe related to some MacOS docker stuff being more locked down?

Also added a note at the top of the README, hopefully that can get updated as more devs give it a go 👍

This note is perfect, thanks.

@ThatKalle
Copy link
Author

Updated to match meshtastic/firmware#4278, give it a go

@matthewCmatt
Copy link
Contributor

Updated to match meshtastic/firmware#4278, give it a go

Still no dice. I'm getting the same SPI issue when trying to run the standalone meshtasticd container, so this may need some more involvement to debug.

In the meantime I'm spinning this up on an old Ubuntu machine to see if that works. Container build took about 40 minutes, and had to retry a few times to get the VSCode Server to install in the container.
I got a similar Gtk-WARNING **: 15:15:22.896: cannot open display: :0 error

@matthewCmatt
Copy link
Contributor

In the meantime I'm spinning this up on an old Ubuntu machine to see if that works. Container build took about 40 minutes, and had to retry a few times to get the VSCode Server to install in the container. I got a similar Gtk-WARNING **: 15:15:22.896: cannot open display: :0 error

I ran the following on the Ubuntu host:

xhost +

This lets the display output through, but the initial container script fails. On finishing, I was able to run pnpm rust:dev and the app came through fine with the meshtasticd node showing up properly! If we add the above to the README, I think we can list Ubuntu as a tested environment

@takov751
Copy link

I have just tested today on Fedora/Nobara 41 worked as it was meant to be, great work. I used a remote web connection to my node this time.

@ThatKalle
Copy link
Author

Hey @matthewCmatt , if you do find a moment.
I did read somewhere that one is supposed to use debian bullseye on apple silicon.
I don't know if you are running a apple silicon mac, but if so, maybe that change would solve the issues for you?

Adjust line 1 in .devcontainer/Dockerfile from FROM mcr.microsoft.com/devcontainers/base:bookworm to FROM mcr.microsoft.com/devcontainers/base:bullseye and try to Rebuild the container.

@matthewCmatt
Copy link
Contributor

@ThatKalle

Thanks for looking into this! I was able to get the devcontainer working fine by installing XQuartz for the display forwarding. This worked on Apple ARM fine without having to change the Debian version. I had to resize the window manually to get the virtual display to fill the whole window, but otherwise works well!

@matthewCmatt
Copy link
Contributor

Here's the guide I used to get it working https://gist.github.com/sorny/969fe55d85c9b0035b0109a31cbcb088

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

Successfully merging this pull request may close these issues.

3 participants