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 vscode dev container #414

Merged
merged 4 commits into from
Jan 28, 2024
Merged

Conversation

0x-a6
Copy link
Contributor

@0x-a6 0x-a6 commented Jan 24, 2024

Describe your changes

Add's a MS dev container for ubuntu 22.04 - gcc version 11.3.0-1ubuntu1~22.04.1

How has this been tested?

Tested on Ubuntu 23.10 desktop,
Docker version 24.0.7, build afdd53b,
vscode 1.85.2,
Dev containers version 2023-12-09, 06:02:20

Ran build as per CONTRIBUTING.md without examples.

update 2024-01-25

Added can-utils. Ran the ./scripts/setup_vcan.sh on the host. Opened two teminal tty's inside vscode, worked sending and seeing message on candump.
image

@GwnDaan
Copy link
Member

GwnDaan commented Jan 24, 2024

Hmm this is cool, I tested it on Windows and without too much hassle I got a working ubuntu image running. I'm wondering if it would be possible to automatically setup a isolated vcan bus inside the container. Do you have any experience with that?

@GwnDaan
Copy link
Member

GwnDaan commented Jan 24, 2024

Out-of-scope for this PR, but on the topic of vscode, would it be nice to provide a list of recommended extensions to get new users up and running? Which we can also install in the dev container

@0x-a6
Copy link
Contributor Author

0x-a6 commented Jan 24, 2024

I wanted to submit a separate PR for a vxcan setup - but basically, as you know first hand, vcan is a host operating system feature where the networking needs to be --network host, which reminds me, that needs to be in this PR 😂

The reason it's on the host networking is because it uses a networking interface (on Linux), I also think it's not great because that's privilaged system access (to your host network) to just to run virtual CAN. So I'd like to explore a docker container option, which keeps it all in the user space. The option I've found so far is to do it with vxcan connections and gateways. Very easy for one container as it would be just xvcan to eth bridge, but I'm imagining you want to bring up two containers, one is a vt server and the other has vt client for example. And that's a bit more tricky. Obviously this would be an example code that could be inside a tutorial for the library, or developer options. Here's a great article I found on the issue: https://www.systec-electronic.com/en/demo/blog/article/news-socketcan-docker-the-solution

I'll add networking host to this PR.

@0x-a6
Copy link
Contributor Author

0x-a6 commented Jan 24, 2024

I've tested this on Apple M2 macOS 14.3, docker desktop 4.26.1, which meant I had to run softwareupdate --install-rosetta from terminal before installing docker following this installation guide: https://docs.docker.com/desktop/install/mac-install/

It built against the gcc 11.3 from the container fine, again without examples nor a can test.

@0x-a6 0x-a6 marked this pull request as ready for review January 24, 2024 19:33
@GwnDaan
Copy link
Member

GwnDaan commented Jan 25, 2024

Nice! I assume the vxcan / vcan won't work on host systems other than linux?

@GwnDaan GwnDaan added enhancement New feature or request os: windows Related to usage on Windows os: linux Related to usage on Linux os: mac Related to usage on MacOS labels Jan 25, 2024
@GwnDaan GwnDaan merged commit df5cf57 into Open-Agriculture:main Jan 28, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request os: linux Related to usage on Linux os: mac Related to usage on MacOS os: windows Related to usage on Windows
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants