precice / systemtests

Testing preCICE / solver combinations using Docker
GNU General Public License v3.0
3 stars 4 forks source link

Add image with preCICE dependencies and reuse it #145

Closed BenjaminRodenberg closed 4 years ago

BenjaminRodenberg commented 4 years ago

Currently, we use ubuntu:18.04 and ubuntu:16.04 as a basis for building our different precice images. This approach is slow and has quite some code duplication. I would propose to provide a dockerimages precice-dependencies:18.04 and precice-dependencies:16.04 that comes with the minimal dependencies and that are built nightly.

Example of current state

Let's look at the example file Dockerfile.Ubuntu1604.home:

https://github.com/precice/systemtests/blob/ff457bed2521c9ab78f7f6e490c7785219151c1e/precice/Dockerfile.Ubuntu1604.home#L3-L4

A large part of the time is spent installing dependencies:

https://github.com/precice/systemtests/blob/ff457bed2521c9ab78f7f6e490c7785219151c1e/precice/Dockerfile.Ubuntu1604.home#L6-L31

Additionally, we are configuring our environment:

https://github.com/precice/systemtests/blob/ff457bed2521c9ab78f7f6e490c7785219151c1e/precice/Dockerfile.Ubuntu1604.home#L33-L42

These steps are very similar for most files in systemtests/precice/. Therefore, I would propose to factor them out into a common baseimage.

The "interesting" part comes later, when we actually build preCICE:

https://github.com/precice/systemtests/blob/ff457bed2521c9ab78f7f6e490c7785219151c1e/precice/Dockerfile.Ubuntu1604.home#L44-L83

Build and use precice-dependencies:18.04

In the following a rough draft of what I have in mind:

Dockerfile for precice-dependencies:16.04

# Using ubuntu 16.04 as basis
FROM ubuntu:16.04

# Installing necessary dependacies for preCICE
RUN apt-get -qq update && apt-get -qq install \
    build-essential \ 
    ....

# Installing cmake
    ....
# Installing boost from source
    ....
# create user precice
    ....

Modified precice/Dockerfile.Ubuntu1604.home

FROM precice-dependencies:16.04

# Building preCICE
...

How does this help us?

BenjaminRodenberg commented 4 years ago

Duplicate of #36