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

Started on the DockerFiles #21

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

Started on the DockerFiles #21

wants to merge 7 commits into from

Conversation

joris997
Copy link

@joris997 joris997 commented Jul 4, 2024

I started on the dockerfiles with GUI support so that, with minimal effort, anyone can get the SITL simulation running.

Currently, I'm having issues with source commands of setup.bash files which break the docker (returning error code 1).

To use it right now, follow the instructions in the README.md, but be advised that you need to run all commands by copying them from the complete docker file to the terminal in the docker instance.

@joris997
Copy link
Author

Additionally, we should try it with a clean jammy docker from here:
https://hub.docker.com/r/kasmweb/core-ubuntu-jammy

Currently, there are some commands that remove fluff (e.g. zoom etc.) plus their desktop shortcuts, but that's a bit silly.

# rm -f /home/kasm-user/Desktop/sublime_text.desktop && \
# rm -f /home/kasm-user/Desktop/telegram.desktop && \
# rm -f /home/kasm-user/Desktop/Zoom.desktop && \
# rm -f /home/kasm-user/Desktop/thunderbird.desktop
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it worth using kasm if there is so much stuff that is not needed? We are pulling and then deleting stuff again.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree with this @joris997 , is it possible to trim their original docker so that it doesn't install all this by default?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm using kasm for the simple browser GUI support. In a command above, I mention that there is a clean jammy docker with kasm: https://hub.docker.com/r/kasmweb/core-ubuntu-jammy
but I haven't had time to test what will break w.r.t. the installation instructions.

I'm not that familiar with docker, so if there is a more lightweight option to get browser GUI support (or you want to go forward with another interface method), then let me know!

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The best approach would be start barebone and include only the necessary dependencies. This helps a) to identify dependencies so you can maintain them b) decrease the size of the docker, so you can save resources. This is not only on your local system, but has a huge impact when running CI.

If you are overwhelmed by this, PX4 already has a container maintained which includes a minimum set of dependencies: https://github.com/PX4/PX4-containers This may not be the minimum, but quite close.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does that provide a VNC instance ? Joris showed it running next to me and it seems convinient to just open the browser and have a desktop environment.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If it doesn't have one we can add it 😄

Copy link
Author

@joris997 joris997 Jul 16, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that would indeed be a nicer and lightweight solution. I will look into it this week @Jaeyoung-Lim

# Run the Docker container
docker run -itd \
--shm-size 32g \
--runtime=nvidia \
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this mean that we have to have an nvidia gpu? Probably just check whether it exists before running it?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good point. I will take this into account

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've added a check for the existence of the nvidia-smi command.

@joris997
Copy link
Author

I checked out the core-ubuntu-jammy from kasm, which takes only 2.6 GB (without our stuff). I've discussed with Pedro that it might be a good option to have both a GUI-supported docker, and a 'minimal-as-possible' version for CI. What do you think @Jaeyoung-Lim?

I've just committed code for a working core-ubuntu-jammy version that works. Issue is now that the resulting image size is somehow 57 GB :) I will try to fix this as using the bigger ubuntu-jammy-desktop image (with zoom, gimp, etc.) and running the commands manually in the docker led to an image size of 6.7 GB.

@Jaeyoung-Lim
Copy link
Collaborator

@joris997 Why not just use the docker images distributed by docker? I still don't understand what we get from kasm. You can enable GUI without kasm

@joris997
Copy link
Author

@Jaeyoung-Lim do you have an example for this? I haven't worked much with docker + GUI support but just had good experience with kasm.

andre-rebelo-teixeira pushed a commit to SpaceBotsISR/PX4-Space-Systems that referenced this pull request Oct 26, 2024
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