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!
- kkremitzki
- Veteran
- Posts: 2515
- Joined: Thu Mar 03, 2016 9:52 pm
- Location: Illinois
Re: Ticket #3821 - Docker env build container, now with FEM!
I sent a message to support about ownership of the freecad org. I wouldn't be surprised if I created it a while back and just lost the credentials for it.
Re: Ticket #3821 - Docker env build container, now with FEM!
Nice, thank you.kkremitzki wrote: ↑Sun Mar 15, 2020 4:34 am I sent a message to support about ownership of the freecad org. I wouldn't be surprised if I created it a while back and just lost the credentials for it.
Yes, the docker container should would out of the box for this use case. As a proof, I've just chosen a pull request at random, checked it out using this stackoverflow advice, and build their pull request version of FreeCAD. It seems to function fine, and the build succeeded without errors.Kunda1 wrote: ↑Sat Mar 14, 2020 5:17 pm @David_D have you had any experience spinning up Docker with a specific patch or pull request? There's currently a bottleneck in this area when it comes to development workflow, what I've observed is entry level developers have a hard time getting past git, building, compiling and running FC. We have something for app images, but it's still not very clear what the workflow is to generate an app image especially one from a pull request that requires certain libraries installed.
So use case would be, a developer looking through the FC GitHub repo, seeing a pool request that they're interested in testing, getting the URL or the raw .diff URL of the PR, and then throwing it into Docker. Or having some sort of Docker flag that allows for said URL to be used.
Counter to your requested use case, the user would need to handle the git part of that process themselves. This is because when using this docker image, git should operate outside the docker container because the docker container has a very short lifespan. At most, the container would only last as long as a single development session. This is fine, because the docker container can launch anew in less than a second, but all state is lost within the docker container, when it is killed. Consequently, linking the git workflow to the docker container would be a bit self defeating. You'd need to pull the repo each time you start developing.
As an alternative, I'm sure we could write a light weight bash script to handle the git pulling/checking out that you've described there. Alternatively, alternatively, we could provide comprehensive documentation on this process instead. While you know better than I do, I would suspect the "building and dependency management" part of that use case you've described is the harder part of the on-boarding process, when compared to the git part of the process. Wouldn't the git part be mostly dependant on skills easily transferable from other development projects?
Docker Hub 'freecad' account
Hi Admins,
Please DM me if you're interested in taking ownership of the Docker Hub account 'freecad'.
Thanks,
Please DM me if you're interested in taking ownership of the Docker Hub account 'freecad'.
Thanks,
Re: Docker Hub 'freecad' account
Merged thread in to per-existing thread.
Thanks. We're interested.
@kkremitzki is our infrastructure guy.
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!
@kkremitzki - If you could DM me I'll work through the transfer with you.
Thanks
Thanks
Re: Ticket #3821 - Docker env build container, now with FEM!
kkremitzki wrote:
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
- kryptokommunist
- Posts: 70
- Joined: Fri Mar 27, 2020 6:29 pm
- Location: Berlin
- Contact:
Re: Ticket #3821 - Docker env build container, now with FEM!
Hey there guys, very cool project! For me on Ubuntu 16.04 it only works if I run a modified version of the command in the Wiki:
Without the --network host it won't run and log that FreeCAD can't connect to the DISPLAY for me. I got the solution here. I don't know exactly why this is needed, but the command shares the host network with the container (link).
Code: Select all
docker run -it --rm \
-v $fc_source:/mnt/source \
-v $fc_build:/mnt/build \
-v $other_files:/mnt/files \
--network host -e "DISPLAY" -e "QT_X11_NO_MITSHM=1" -v /tmp/.X11-unix:/tmp/.X11-unix:ro \
registry.gitlab.com/daviddaish/freecad_docker_env:latest
Re: Ticket #3821 - Docker env build container, now with FEM!
kryptokommunist wrote: ↑Fri Apr 10, 2020 12:36 am Hey there guys, very cool project! For me on Ubuntu 16.04 it only works if I run a modified version of the command in the Wiki:
Without the --network host it won't run and log that FreeCAD can't connect to the DISPLAY for me. I got the solution here. I don't know exactly why this is needed, but the command shares the host network with the container (link).Code: Select all
docker run -it --rm \ -v $fc_source:/mnt/source \ -v $fc_build:/mnt/build \ -v $other_files:/mnt/files \ --network host -e "DISPLAY" -e "QT_X11_NO_MITSHM=1" -v /tmp/.X11-unix:/tmp/.X11-unix:ro \ registry.gitlab.com/daviddaish/freecad_docker_env:latest
Ah, sorry you ran into such a strange problem. I'll have to look into this. I'd be hesitant to slap that addition right into the standard command in the readme, because it seems like something that the security minded would think twice about. Perhaps I'll include it as a note. Anyway, thanks for the feedback, I hope you find the project useful.
- kryptokommunist
- Posts: 70
- Joined: Fri Mar 27, 2020 6:29 pm
- Location: Berlin
- Contact:
Re: Ticket #3821 - Docker env build container, now with FEM!
It was extremely valuable to me. Since I‘m a new to FreeCAD this saved me so much time on my Ubuntu 16.04 machine. All the compile guides in the Wiki failed me with my setup so far. So thanks for your solution!
Re: Ticket #3821 - Docker env build container, now with FEM!
It's really easy to set up distcc if you have multiple computers to speed up compiling with this too. On whatever computer is going to be helping compile use this dockerfile:
when you run it you have to pass in the env $OPTIONS="--allow ip_range" the ip range is for clients that are allowed to connect. Also you need to forward the exposed ports. Then on your dev machine use a dockerfile like this:
the hosts file is:
put whatever ip's the docker distcc server is running on. build_debug is just the regular build script with:
added to the cmake options (I called it debug because I'm also using it for debug builds, you could call it build_distcc or whatever).
Code: Select all
FROM registry.gitlab.com/daviddaish/freecad_docker_env:latest
RUN chmod 777 /tmp && \
apt-get update && \
apt-get install -y \
distcc g++-6 gcc-6 && \
rm -rf /var/lib/apt/lists/*
# This is the operations port
EXPOSE 3632
# This is the statistics port
EXPOSE 3633
USER distccd
ENTRYPOINT /usr/bin/distccd --no-detach --daemon --stats --log-level info --log-stderr $OPTIONS
Code: Select all
FROM registry.gitlab.com/daviddaish/freecad_docker_env:latest
RUN chmod 777 /tmp && \
apt-get update && \
apt-get install -y \
distcc && \
rm -rf /var/lib/apt/lists/*
COPY hosts /etc/distcc/hosts
COPY build_debug.sh /root/build_debug.sh
Code: Select all
# As described in the distcc manpage, this file can be used for a global
# list of available distcc hosts.
#
# The list from this file will only be used, if neither the
# environment variable DISTCC_HOSTS, nor the file $HOME/.distcc/hosts
# contains a valid list of hosts.
#
# Add a list of hostnames in one line, seperated by spaces, here.
localhost 192.168.0.99
Code: Select all
-D CMAKE_C_COMPILER_LAUNCHER=distcc -D CMAKE_CXX_COMPILER_LAUNCHER=distcc \