|
[Sponsors] |
[OpenFOAM.org] A Mac OS X of23x Development Environment Using Docker |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
January 8, 2016, 15:53 |
A Mac OS X of23x Development Environment Using Docker
|
#1 |
New Member
Ryan Tunstall
Join Date: Sep 2013
Posts: 10
Rep Power: 13 |
Apologies for the long post.
In summary the idea is to basically have a Docker container which essentially has OpenSUSE (as on my workstation) with all the OpenFOAM dependencies and the basic OpenFOAM install. This can be run on a Mac (from the OS X terminal), with the user’s OpenFOAM files readily shared from a folder in OS X (so we can still browse and edit them using our favourite OS X tools). This is easier to install than native OS X OpenFOAM, and provides an environment that is very similar to that on workstations and clusters. It is a lighter-weight solution and allows for much better OS X integration when compared to running OpenFOAM from a full Linux virtual machine in OS X. I suspect that like many here, my MacBook is really just used for development work (writing code and testing it builds), whilst any cases are run on my workstation or cluster. What I outline below is well suited to this usage profile. Docker See this recent article for a summary of Docker and it's advantages for OpenFOAM https://www.cfdengine.com/blog/how-t...e-with-docker/ - though this seems to be more focused on using a completely standard OpenFOAM build without additional libraries/apps etc by downloading one of several existing Docker containers. I've been thinking about how we can use Docker to make it easier to install OpenFOAM on a Mac, that will:
Practicalities Docker behaves a little differently on OSX than how it does on Linux distros. Docker containers are actually run inside a custom 'docker-machine' virtual machine (using virtualbox) rather than in pure OSX, this virtual machine is however very very light weight. The OSX /Users/[USER NAME] directories are automatically shared to the virtual machine as default and can then be very easily mounted into a Docker container. However due to limitations in virtual box’s file sharing (vboxsf) used by Docker this results in quite a degradation in read/write performance (see http://mitchellh.com/comparing-files...rtual-machines). Hopefully Docker will eventually resolve this by switching from vboxsf to NFS or similar. Due to the virtual machine setup, sharing files which are stored in Docker containers (or Docker volumes) back into OS X is challenging as they are buried somewhere in the docker-machine's virtual disk image. The only way I have found is to ssh into docker-machine and browse/edit files in the terminal (after using a Docker command to look up where they are actually stored) but then we don’t have any real OS X integration (can’t view files in the Finder or access them in apps). I have tried using sshfs and various virtual disk image mounting tools without success. There are various third party add ons that make attempts to address various aspects of this but none are a complete solution and many introduce other problems. There is thus a balance between having good OpenFOAM performance and having good OS X integration. I have considered and tested three options:
Note that if we were to run the same Docker container in a Linux distro this approach would be ideal. There'd be no slow down by mounting the user files in this way (since they don't need to pass through the intermediate docker-machine's vboxsf system) and we'd easily be able to browse the OpenFOAM source code stored in the container on the linux OS (because unlike on a Mac it's not buried in docker-machine's virtual disk image). So this approach is also suitable if you want to use this same OpenFOAM container on your mac and workstations/clusters (to ensure a fully consistent environment). Here is my setup for OpenFOAM 2.3.x, though it could easily be modified to run any other version of OpenFOAM: Prerequisites:
Basic OpenSUSE
of23xfull Docker container
How to actually then do OpenFOAM stuff:
Running multiple of23x containers at once:
Cleanup:
|
|
February 28, 2016, 20:00 |
|
#2 |
Member
Francisco T
Join Date: Nov 2011
Location: Melbourne, Australia
Posts: 64
Blog Entries: 1
Rep Power: 15 |
looks really interesting. I can run now blockMesh...
how can edit files? for example using an osx text editor like "open" I got: open transportProperties bash: open: command not found thanks in advance! |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[OpenFOAM.com] Docker vs Not Docker v2 AND installing editors into Docker | u2berggeist | OpenFOAM Installation | 1 | July 10, 2018 03:58 |
OpenFOAM v3.0+ ?? | SBusch | OpenFOAM | 22 | December 26, 2016 15:24 |
[OpenFOAM.com] Docker OpenFOAM install error on Mac OS X | dersh | OpenFOAM Installation | 10 | May 6, 2016 13:49 |
CFX11 + Fortran compiler ? | Mohan | CFX | 20 | March 30, 2011 19:56 |
Software development environment | jojo | Main CFD Forum | 12 | July 14, 2006 09:14 |