Docker and HomeBrew improvements - #81
Merged
Merged
Conversation
HomeBrew being a rolling release, it is not straightforward to know which packages versions were used to build the third party libraries. So we fix a dedicated commit (the 4.0.2 openmpi upgrade) and use it to install our software in brew. For GEOSX to know it, we define this BREW_HASH as a metadata of the tarball of the TPL uploaded in the bucket. GEOSX can therefore know which hash to install against. Two main docker images are used in GEOSX: centos7.5 (with specific LLNL compilers) and ubuntu18.04 in a more standard way. Each image exists in two flavors (clang version 6 or 7, gcc version 7 or 8). I’ve decided to rebuild the docker images from the very beginning every time the TPL repository is modified. I believe this will make the process more readable and easier to maintain. For centos7.5 we spend additional 5min20 per build and 2 more minutes for ubuntu18.04. As a benefit, we do not have to worry building the very initial base images anymore. And only one Dockerfile is enough to build each of our images. The Dockerfiles make use of multi-stage buildings to get rid of temporaries and to provide to GEOSX the very minimum set of tools it needs. This results in lighter images, but most important, this may help preventing additional implicit dependencies that may arise without notice. As part of the docker contract, each docker image defines a GEOSX_TPL_DIR environment variable pointing to the installation directory of the TPL. GEOSX does not need to know this location anymore, it just has to use this variable. An additional dockerBuilds repository also exists, but it is deprecated. This patch merges the last elements in TPL we could therefore remove dockerBuilds. This patch suggest another organization of the docker repositories and tags. There now only exists one repository per flavor (2 flavors per os means 4 images in total). Then we use tags to make the distinction in between the TPL builds. On advantage can also be the cleaning, dockerhub allowing bulk cleaning for tags… For the moment, we use the unique TRAVIS_BUILD_NUMBER as a tag for both OSX tarball and docker images. But this may be improved, taking into account the PR, date, hash… Last, the definition of a dedicated build command for trilinos can ease building and computer with limited memory. And having pt-scotch part of the tplMirror will make things easier when building on an environment without internet.
TotoGaz
pushed a commit
to GEOS-DEV/GEOS
that referenced
this pull request
Nov 13, 2019
We use HomeBrew to install openmpi under osx. To be consistent with the version used during the TPL build, the brew hash is stored as a meta-information of the tarball. We retrieve this infomation and install the proper version (see #620) Some travis-ci simplifications related to GEOS-DEV/thirdPartyLibs#81 are done.
Contributor
Author
|
Hello @rrsettgast @joshua-white, Could you have a look at this PR (you may want to check its twin GEOSX GEOS-DEV/GEOS#647) ? Thanks! |
TotoGaz
marked this pull request as ready for review
November 21, 2019 17:53
corbett5
approved these changes
Nov 21, 2019
rrsettgast
approved these changes
Nov 21, 2019
rrsettgast
requested changes
Nov 21, 2019
rrsettgast
approved these changes
Nov 23, 2019
Contributor
|
@TotoGaz is this ready to merge? |
Contributor
Author
Yes it is. I will squash and merge it myself with the proper merge commit. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
HomeBrew being a rolling release, it is not straightforward to know which packages versions were used to build the third party libraries.
So we fix a dedicated commit (the 4.0.2 openmpi upgrade) and use it to install our software in brew.
For GEOSX to know it, we define this BREW_HASH as a metadata of the tarball of the TPL uploaded in the bucket. GEOSX can therefore know which hash to install against.
Two main docker images are used in GEOSX: centos7.5 (with specific LLNL compilers) and ubuntu18.04 in a more standard way. Each image exists in two flavors (clang version 6 or 7, gcc version 7 or 8).
I’ve decided to rebuild the docker images from the very beginning every time the TPL repository is modified.
I believe this will make the process more readable and easier to maintain.
For centos7.5 we spend additional 5min20 per build and 2 more minutes for ubuntu18.04.
As a benefit, we do not have to worry building the very initial base images anymore.
And only one single Dockerfile is enough to build each of our images, which will make reading and maintenance easier.
The Dockerfiles make use of multi-stage buildings to get rid of temporaries and to provide to GEOSX the very minimum set of tools it needs. This results in lighter images, but most important, this may help preventing additional implicit dependencies that may arise without notice.
As part of the docker contract, each docker image defines a GEOSX_TPL_DIR environment variable pointing to the installation directory of the TPL.
GEOSX does not need to know this location anymore, it just has to use this variable.
An additional dockerBuilds repository also exists, but it is deprecated.
This patch merges the last elements in TPL we could therefore remove dockerBuilds.
This patch suggests another organization of the docker repositories and tags.
There now only exists one repository per flavor (2 flavors per os mean 4 images in total).
Then we use tags to make the distinction in between the builds.
(not that I currently do not push to the official dockerhub but to a temporary one, see https://hub.docker.com/u/totogaz)
It is proposed to use ${TRAVIS_PULL_REQUEST}-${TRAVIS_BUILD_NUMBER} as a unique identifier for both docker images and the osx tarball (giving something like
81-251). GEOSX only has to use it for both systems.The git hashcode and date of build is available as meta-information for both, so we can track easily the origin of the build.
The definition of a dedicated build command for trilinos (set as
make -j 1in our case) can ease building and computer with limited memory (see Very hard to compile with "low" memory computer #43).Having pt-scotch part of the tplMirror will make things easier when building on an environment without internet.
A very little bug in the building system of Umpire (dependency of chai) is patched. The fix was proposed and integrated upstream (Cannot compile Umpire without git llnl/Umpire#282 & Allow compilation without git llnl/Umpire#283)
This PR may solve, #75, #43, GEOS-DEV/GEOS#620 and #74 (but the final pattern needs to be discussed).
This PR is also connected to the EOSX PR GEOS-DEV/GEOS#647.
PS : While I was trying to figure out what was going on with chai, I recloned it at same commit, removed the
.gitdirectory. Not a big deal. I will put it back at previous version and a future version is coming anyway.