distcc sounds amazing and very much necessary for FC development! Should we start a separate thread for that?
Ticket #3821 - Docker env build container, now with FEM!
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Be nice to others! Respect the FreeCAD code of conduct!
Re: Ticket #3821 - Docker env build container, now with FEM!
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
Re: Ticket #3821 - Docker env build container, now with FEM!
This is actually my first time using it. The docker container is pretty essential for me because you don't have to worry about setting up the dependencies on the distcc server if you use it. If you want we can put it in another thread though.
Re: Ticket #3821 - Docker env build container, now with FEM!
Has there been any love with this? I'd love to get this going as an official project.
Re: Ticket #3821 - Docker env build container, now with FEM!
hi all!
thanks for your work David, it's VERY useful! I hadn't done any work on the FreeCAD source yet because of the complexity of the "infrastructure" required... and you just totally blew that problem away!
I just installed docker, and tested your image: the building worked flawlessly!
now my concerns:
In any case, any tips would be much appreciated
best regards!
thanks for your work David, it's VERY useful! I hadn't done any work on the FreeCAD source yet because of the complexity of the "infrastructure" required... and you just totally blew that problem away!
I just installed docker, and tested your image: the building worked flawlessly!
now my concerns:
- Python version is older than the version in use (your 3.7m vs FreeCAD team 3.8 older!)
- QT version is newer than the version in use (your Qt_5.13 vs FreeCAD team Qt_5.12.5)
- When I run FreeCAD in my docker, it hangs, but seems a problem with GPU drivers (link)
- My machine is an apple which is running Ubuntu 20.04
- I do many things in this machine, so I need a "container" for separation: for example FreeCAD development
- With your docker image, I can do just that, but I would use it only for compilation, as I'll run the compiled code in the host itself (for maximum performance, with no middle layer at all, to be the "real thing" as much as possible).
- I tend to do "small changes", so my idea was to do them on the docker image and test it on the real machine (for example, change the SketcherGui.so in my host FreeCAD installation for the "corrected version" from my Docker compilation), which I can't because of the dependencies mismatch.
- Executing it in the Docker itself, which I can't because of the gpu-drivers problem
- Executing the hole new compiled version on the host, which I also can't, because the app is not packed as standalone.
In any case, any tips would be much appreciated
best regards!
Re: Ticket #3821 - Docker env build container, now with FEM!
Hello iyd, very glad to hear you're finding the project useful!
As for your GPU driver problem, I believe the problem is that the graphics drivers installed in the docker container are different to the graphics drivers on the host machine. FreeCAD is trying to communicate in one driver's language, but the host can't read them. I'm not really sure how to resolve that issue on an apple machine, but on my box, I resolved it by uninstalling the proprietary nvidia graphics drivers on my host, and instead using the open source Nouveau drivers.
As for running the compiled code on the host, I'd recommend not doing that, as it somewhat defeats the purpose of the docker container. If you're able to resolve the dependencies to run FreeCAD on your host, you're probably better served by just compiling it on the host in the first place . I think you'll find the performance difference to be not that great between running in, or outside the docker container. I'd certainly pursue the option of resolving the GPU problem, if I were you. But hey, more power to you if you figure out a way that works!
In terms of having the most similar experience to the end user by running on the host, in my poorly informed opinion, I think the end user experience of FreeCAD is very dependant on how FreeCAD is packaged and distributed. The visual difference between FreeCAD installed from source, as an appimage, or installed from packages is stark. So if you're looking for the true FreeCAD UX experience, I don't believe such a thing exists.
Also, thanks for pointing out that version mismatch! I'll have to come up with a more rigorous method for choosing versions. I typically just go for whatever is newest at the time I'm refreshing the dependencies.
Re: Ticket #3821 - Docker env build container, now with FEM!
I managed to solve it a few minutes ago, doing the other way around (installing native drivers on the Docker image)David_D wrote: ↑Fri May 22, 2020 8:57 pm As for your GPU driver problem, I believe the problem is that the graphics drivers installed in the docker container are different to the graphics drivers on the host machine. FreeCAD is trying to communicate in one driver's language, but the host can't read them. I'm not really sure how to resolve that issue on an apple machine, but on my box, I resolved it by uninstalling the proprietary nvidia graphics drivers on my host, and instead using the open source Nouveau drivers.
Code: Select all
apt install kmod mesa-utils
wget http://us.download.nvidia.com/XFree86/Linux-x86_64/390.132/NVIDIA-Linux-x86_64-390.132.run
chmod +x NVIDIA-Linux-x86_64-390.132.run
./NVIDIA-Linux-x86_64-390.132.run -a -N --ui=none --no-kernel-module
glxinfo
your docker is very useful to keep my host system as clean as possible (I love FreeCAD, but only now I'm starting to hack into it and didn't want to put all that stuff in my system...) and you were right: the easier choice was to figure out the gpu driver part.As for running the compiled code on the host, I'd recommend not doing that, as it somewhat defeats the purpose of the docker container. If you're able to resolve the dependencies to run FreeCAD on your host, you're probably better served by just compiling it on the host in the first place . I think you'll find the performance difference to be not that great between running in, or outside the docker container. I'd certainly pursue the option of resolving the GPU problem, if I were you. But hey, more power to you if you figure out a way that works!
I disagree: I use FreeCAD at work on a daily basis, and for me, in this context, UX means "how it really works everyday for me in my own computer" (a macBookPro with retina display) more than the install part (which only happens once). And just a few minutes ago I discovered one of those behaviors that annoy me the most: screen resolution in 2x displays (i.e. using the display at half resolution for more clearness to look after my poor getting-older eyes) --> your docker image is doing weird stuff with my display, showing a little tiny cursor, that is normal on my host because I have activated the 200% resolution mode of Ubuntu 20.04, pretty similar to the retina display behavior when using MacOS).In terms of having the most similar experience to the end user by running on the host, in my poorly informed opinion, I think the end user experience of FreeCAD is very dependant on how FreeCAD is packaged and distributed. The visual difference between FreeCAD installed from source, as an appimage, or installed from packages is stark. So if you're looking for the true FreeCAD UX experience, I don't believe such a thing exists.
you're welcome: minor stuff compared to your work. In any case, it would be nice to have the exact same configuration that is used to deploy the (0.19) releases.Also, thanks for pointing out that version mismatch! I'll have to come up with a more rigorous method for choosing versions. I typically just go for whatever is newest at the time I'm refreshing the dependencies.
best regards!
Re: Ticket #3821 - Docker env build container, now with FEM!
Oooh, very nice, I'll have to look into creating a separate image for nvidia! Pretty busy rn though.iyd2019 wrote: ↑Fri May 22, 2020 10:44 pm I managed to solve it a few minutes ago, doing the other way around (installing native drivers on the Docker image)
I put this information together from different pieces, but mostly this one.Code: Select all
apt install kmod mesa-utils wget http://us.download.nvidia.com/XFree86/Linux-x86_64/390.132/NVIDIA-Linux-x86_64-390.132.run chmod +x NVIDIA-Linux-x86_64-390.132.run ./NVIDIA-Linux-x86_64-390.132.run -a -N --ui=none --no-kernel-module glxinfo
Interesting, that's something I hadn't considered. I wonder if there's a better way to transfer host configurations to the docker container... There may be a series of config files on the host that can be mounted to the container in the same place to ensure configurations are transferred.iyd2019 wrote: ↑Fri May 22, 2020 10:44 pm I disagree: I use FreeCAD at work on a daily basis, and for me, in this context, UX means "how it really works everyday for me in my own computer" (a macBookPro with retina display) more than the install part (which only happens once). And just a few minutes ago I discovered one of those behaviors that annoy me the most: screen resolution in 2x displays (i.e. using the display at half resolution for more clearness to look after my poor getting-older eyes) --> your docker image is doing weird stuff with my display, showing a little tiny cursor, that is normal on my host because I have activated the 200% resolution mode of Ubuntu 20.04, pretty similar to the retina display behavior when using MacOS).
Re: Ticket #3821 - Docker env build container, now with FEM!
Hi there!
I have just finished configuring MacOS to get David's FreeCAD Docker image successfully running in my macbookpro, including GUI!!. It was not straight forward, so here are the steps that maybe could be included in the Compile_on_Docker#Mac_OS_users:
basically you have to follow this guide that David already mentions in his repository, but with a couple extra steps:
for step (#6) I leave here my final bash script used to launch David's Docker image with all the tids'n'bits:
docker.sh
note the additional optional line which enables QT debugging (useful to troubleshoot some things, like GL not working )
note also that it's not necessary to launch XQuartz before launching the script: it's automatically invoqued by the system.
hope this helps someone.
regards!
I have just finished configuring MacOS to get David's FreeCAD Docker image successfully running in my macbookpro, including GUI!!. It was not straight forward, so here are the steps that maybe could be included in the Compile_on_Docker#Mac_OS_users:
basically you have to follow this guide that David already mentions in his repository, but with a couple extra steps:
- Install XQuartz
- EXTRA --> update this XQuartz switch to allow OpenGL features enabled at your X11's
- Install Docker for Mac
- Run XQuartz
- Host Machine IP
- Running a container (EXTRA: see my launching script)
Code: Select all
defaults write org.macosforge.xquartz.X11 enable_iglx -bool true
docker.sh
Code: Select all
#!/usr/bin/env bash
# config
fc_source=~/projects/FreeCAD/source
fc_build=~/projects/FreeCAD/build
other_files=~/projects/FreeCAD
# mac and XQuartz
IP=$(ifconfig en0 | grep inet | awk '$1=="inet" {print $2}')
xhost + $IP
docker run -it --rm \
-v $fc_source:/mnt/source \
-v $fc_build:/mnt/build \
-v $other_files:/mnt/files \
-e "DISPLAY=$IP:0" \
-e "QT_X11_NO_MITSHM=1" \
-e "QT_DEBUG_PLUGINS=1" \
-v /tmp/.X11-unix:/tmp/.X11-unix \
registry.gitlab.com/daviddaish/freecad_docker_env:latest
Code: Select all
-e "QT_DEBUG_PLUGINS=1"
note also that it's not necessary to launch XQuartz before launching the script: it's automatically invoqued by the system.
hope this helps someone.
regards!
Re: Ticket #3821 - Docker env build container, now with FEM!
sorry, but my last answer is not working properly...
yes, you get a GUI, but as soon as you try to start a new document, it hangs... I'm looking into it.
any other mac users that could help to test this?
regards!
yes, you get a GUI, but as soon as you try to start a new document, it hangs... I'm looking into it.
any other mac users that could help to test this?
regards!
Re: Ticket #3821 - Docker env build container, now with FEM!
Thank's for all this work ...
I'm new on Docker and when I try your tuto https://wiki.freecadweb.org/Compile_on_Docker/fr with the commands :
and
and
It doesn't works ... In fact, there's nothing in mnt/source directory. The error message is :
There's a mistake somewhere but I don't know where, could you help me ?
I'm new on Docker and when I try your tuto https://wiki.freecadweb.org/Compile_on_Docker/fr with the commands :
Code: Select all
fc_source=~/media/xxx/86ff3cff-2537-4ef6-8bd4-d73e652442b0/BackUpGIT/Freecad/freecad-source/
fc_build=~/media/xxx/86ff3cff-2537-4ef6-8bd4-d73e652442b0/BackUpGIT/Freecad/freecad-build/
other_files=~/
Code: Select all
docker run -it --rm \
-v $fc_source:/mnt/source \
-v $fc_build:/mnt/build \
-v $other_files:/mnt/files \
-e "DISPLAY" -e "QT_X11_NO_MITSHM=1" -v /tmp/.X11-unix:/tmp/.X11-unix:ro \
registry.gitlab.com/daviddaish/freecad_docker_env:latest
Code: Select all
root@b9aaa4749fe8:~# /root/build_script.sh
Code: Select all
CMake Error: The source directory "/mnt/source" does not appear to contain CMakeLists.txt.