Skip to content

Docker and HomeBrew improvements - #81

Merged
TotoGaz merged 17 commits into
masterfrom
feature/TotoGaz/docker
Nov 25, 2019
Merged

TotoGaz merged 17 commits into
masterfrom
feature/TotoGaz/docker

Conversation

@TotoGaz

@TotoGaz TotoGaz commented Nov 12, 2019 •

Copy link
Copy Markdown
Contributor
  • 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 1 in 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 .git directory. Not a big deal. I will put it back at previous version and a future version is coming anyway.

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.
@TotoGaz

TotoGaz commented Nov 13, 2019

Copy link
Copy Markdown
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 TotoGaz self-assigned this Nov 14, 2019
@TotoGaz TotoGaz closed this Nov 20, 2019
@TotoGaz TotoGaz reopened this Nov 20, 2019
@TotoGaz
TotoGaz marked this pull request as ready for review November 21, 2019 17:53
Comment thread .travis.yml Outdated
@rrsettgast

Copy link
Copy Markdown
Contributor

@TotoGaz is this ready to merge?

@TotoGaz

TotoGaz commented Nov 25, 2019

Copy link
Copy Markdown
Contributor Author

@TotoGaz is this ready to merge?

Yes it is. I will squash and merge it myself with the proper merge commit.

@TotoGaz
TotoGaz merged commit e09011e into master Nov 25, 2019
@TotoGaz
TotoGaz deleted the feature/TotoGaz/docker branch November 25, 2019 18:26
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