Skip to content
This repository was archived by the owner on Aug 14, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
d061c3a
add system tests for cplscheme
BenjaminRodenberg Jul 1, 2019
e9f4427
add cplscheme test
BenjaminRodenberg Jul 1, 2019
b00e1b1
Merge branch 'master' into debugMasterSockets
BenjaminRodenberg Jul 1, 2019
e8028d5
run cplscheme test as local test
BenjaminRodenberg Jul 1, 2019
1e96cba
use Ubuntu 18.04 as base image
BenjaminRodenberg Jul 1, 2019
50e1d50
Use system_testing.py instead of local_test.py
BenjaminRodenberg Jul 8, 2019
97a35b8
Fix indentation
BenjaminRodenberg Jul 8, 2019
857ee34
Fix --build-arg and add a Ubuntu18.04 build
BenjaminRodenberg Jul 8, 2019
6cfedc8
first draft solution for #77
BenjaminRodenberg Jul 8, 2019
737b8aa
roll out changes to all base images
BenjaminRodenberg Jul 8, 2019
6f299fa
Merge branch 'master' into draft_i77
BenjaminRodenberg Jul 8, 2019
f40f849
remove default docker username to force user to provide it and avoid …
BenjaminRodenberg Jul 8, 2019
f42978e
remove old python bindings. Update tests to only use new bindings
BenjaminRodenberg Nov 26, 2019
f6ac64c
trigger CI
BenjaminRodenberg Nov 28, 2019
030b083
Merge branch 'develop' into draft_i77
BenjaminRodenberg Nov 28, 2019
fabdc4d
add argument to switch petsc on/off
BenjaminRodenberg Nov 28, 2019
59ab5e8
remove unrelated change
BenjaminRodenberg Nov 28, 2019
c4d3006
remove unrelated files
BenjaminRodenberg Nov 28, 2019
28da5a8
modify tag depending on petsc
BenjaminRodenberg Nov 28, 2019
3b2ed1c
Merge branch 'develop' into compatibility_PR_576_on_precice_core
BenjaminRodenberg Nov 28, 2019
ddbe335
Merge branch 'compatibility_PR_576_on_precice_core' into draft_i77
BenjaminRodenberg Nov 28, 2019
4dcb800
Factor out tag composition
Dec 11, 2019
3ce9d01
Add script for pushing
Dec 11, 2019
1b6e3d7
Use benjaminrueth and push_base.py
Dec 11, 2019
901323e
Fix and document tagging
Dec 11, 2019
d915232
temporarily allow failure
BenjaminRodenberg Dec 11, 2019
d533723
Use a more explicit name for script
Dec 11, 2019
8bbf9b5
Extract features in python scripts. Introduces some code duplication,…
Dec 11, 2019
b57fd3c
fix error
Dec 11, 2019
a7da673
Use list to keep track of features, add petsc as feature to list for …
Dec 11, 2019
9a39729
Merge branch 'develop' into draft_i77
Dec 11, 2019
df2c0a9
use python script for building and pushing adapters
Dec 11, 2019
0682008
Fix syntax errors
BenjaminRodenberg Dec 11, 2019
da5deb7
Use dict instead of list
Dec 13, 2019
068a1e8
Merge branch 'draft_i77' of github.com:precice/systemtests into draft…
Dec 13, 2019
9305059
Merge branch 'develop' into draft_i77
Dec 16, 2019
1215a46
Merge branch 'develop' into draft_i77
BenjaminRodenberg Dec 18, 2019
add26c6
Update push_precice.py
BenjaminRodenberg Dec 19, 2019
c5298ce
Update push_adapter.py
BenjaminRodenberg Dec 19, 2019
39b450b
Update build_precice.py
BenjaminRodenberg Dec 19, 2019
1bace3b
Update build_adapter.py
BenjaminRodenberg Dec 19, 2019
af79674
Update build_precice.py
BenjaminRodenberg Dec 19, 2019
1b92a5c
Update build_adapter.py
BenjaminRodenberg Dec 19, 2019
cf9e50f
Merge branch 'develop' into draft_i77
Eder-K Jan 1, 2020
ecc0310
use dict.get for less verbose code
BenjaminRodenberg Jan 8, 2020
add4db9
Fix error
BenjaminRodenberg Jan 8, 2020
56ba8af
Filter away None
BenjaminRodenberg Jan 8, 2020
afc2e4d
Use less verbose approach
BenjaminRodenberg Jan 8, 2020
781de05
Merge branch 'develop' into draft_i77
Eder-K Jan 25, 2020
64d8230
Merge branch 'develop' into draft_i77
BenjaminRodenberg Jan 31, 2020
a9424e7
Merge branch 'develop' into draft_i77
BenjaminRodenberg Feb 11, 2020
8da7477
Merge branch 'develop' into draft_i77
Eder-K Feb 12, 2020
bd8e122
Merge branch 'develop' into draft_i77
Eder-K Feb 12, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
106 changes: 49 additions & 57 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,115 +19,113 @@ jobs:
name: "Arch Linux"
if: fork = false
script:
- docker build -f precice/Dockerfile.Arch -t $DOCKER_USERNAME/precice-arch-develop .
- python build_precice.py --dockerfile precice/Dockerfile.Arch
deploy:
skip_cleanup: true
provider: script
on:
all_branches: true
script: >-
echo "$DOCKER_PASSWORD" | docker login -u $DOCKER_USERNAME --password-stdin &&
docker push $DOCKER_USERNAME/precice-arch-develop:latest
echo $DOCKER_PASSWORD | docker login -u $DOCKER_USERNAME --password-stdin &&
python push_precice.py --dockerfile precice/Dockerfile.Arch

- stage: Building preCICE
name: "Ubuntu 16.04 home"
if: fork = false
script:
- docker build -f precice/Dockerfile.Ubuntu1604.home -t $DOCKER_USERNAME/precice-ubuntu1604.home-develop .
- python build_precice.py --dockerfile precice/Dockerfile.Ubuntu1604.home
deploy:
skip_cleanup: true
provider: script
on:
all_branches: true
script: >-
echo "$DOCKER_PASSWORD" | docker login -u $DOCKER_USERNAME --password-stdin &&
docker push $DOCKER_USERNAME/precice-ubuntu1604.home-develop:latest
echo $DOCKER_PASSWORD | docker login -u $DOCKER_USERNAME --password-stdin &&
python push_precice.py --dockerfile precice/Dockerfile.Ubuntu1604.home

- stage: Building preCICE
name: "Ubuntu 16.04 home PETSc [Job failure permitted]"
if: fork = false
script:
- >
docker build -f precice/Dockerfile.Ubuntu1604.home -t $DOCKER_USERNAME/precice-ubuntu1604.home.petsc-develop .
--build-arg petsc_para=yes
- python build_precice.py --dockerfile precice/Dockerfile.Ubuntu1604.home --petsc yes
deploy:
skip_cleanup: true
provider: script
on:
all_branches: true
script: >-
echo "$DOCKER_PASSWORD" | docker login -u $DOCKER_USERNAME --password-stdin &&
docker push $DOCKER_USERNAME/precice-ubuntu1604.home.petsc-develop:latest
echo $DOCKER_PASSWORD | docker login -u $DOCKER_USERNAME --password-stdin &&
python push_precice.py --dockerfile precice/Dockerfile.Ubuntu1604.home --petsc yes

- stage: Building preCICE
name: "Ubuntu 16.04.sudo"
if: type = cron
script:
- docker build -f precice/Dockerfile.Ubuntu1604.sudo -t $DOCKER_USERNAME/precice-ubuntu1604.sudo-develop .
- python build_precice.py --dockerfile precice/Dockerfile.Ubuntu1604.sudo
deploy:
skip_cleanup: true
provider: script
on:
all_branches: true
script: >-
echo "$DOCKER_PASSWORD" | docker login -u $DOCKER_USERNAME --password-stdin &&
docker push $DOCKER_USERNAME/precice-ubuntu1604.sudo-develop:latest
echo $DOCKER_PASSWORD | docker login -u $DOCKER_USERNAME --password-stdin &&
python push_precice.py --dockerfile precice/Dockerfile.Ubuntu1604.sudo

- stage: Building preCICE
name: "Ubuntu 18.04.home"
if: fork = false
script:
- docker build -f precice/Dockerfile.Ubuntu1804.home -t $DOCKER_USERNAME/precice-ubuntu1804.home-develop .
- python build_precice.py --dockerfile precice/Dockerfile.Ubuntu1804.home
deploy:
skip_cleanup: true
provider: script
on:
all_branches: true
script: >-
echo "$DOCKER_PASSWORD" | docker login -u $DOCKER_USERNAME --password-stdin &&
docker push $DOCKER_USERNAME/precice-ubuntu1804.home-develop:latest
echo $DOCKER_PASSWORD | docker login -u $DOCKER_USERNAME --password-stdin &&
python push_precice.py --dockerfile precice/Dockerfile.Ubuntu1804.home

- stage: Building preCICE
name: "Ubuntu 18.04.sudo"
if: type = cron
script:
- docker build -f precice/Dockerfile.Ubuntu1804.sudo -t $DOCKER_USERNAME/precice-ubuntu1804.sudo-develop .
- python build_precice.py --dockerfile precice/Dockerfile.Ubuntu1804.sudo
deploy:
skip_cleanup: true
provider: script
on:
all_branches: true
script: >-
echo "$DOCKER_PASSWORD" | docker login -u $DOCKER_USERNAME --password-stdin &&
docker push $DOCKER_USERNAME/precice-ubuntu1804.sudo-develop
echo $DOCKER_PASSWORD | docker login -u $DOCKER_USERNAME --password-stdin &&
python push_precice.py --dockerfile precice/Dockerfile.Ubuntu1804.sudo

- stage: Building preCICE
name: "Ubuntu 18.04.sudo.mpich [Job failure permitted]"
if: type = cron
script:
- docker build -f precice/Dockerfile.Ubuntu1804.sudo.mpich -t $DOCKER_USERNAME/precice-ubuntu1804.sudo.mpich-develop .
- python build_precice.py --dockerfile precice/Dockerfile.Ubuntu1804.sudo.mpich
deploy:
skip_cleanup: true
provider: script
on:
all_branches: true
script: >-
echo "$DOCKER_PASSWORD" | docker login -u $DOCKER_USERNAME --password-stdin &&
docker push $DOCKER_USERNAME/precice-ubuntu1804.sudo.mpich-develop:latest
echo $DOCKER_PASSWORD | docker login -u $DOCKER_USERNAME --password-stdin &&
python push_precice.py --dockerfile precice/Dockerfile.Ubuntu1804.sudo.mpich

- stage: Building preCICE
name: "Ubuntu 18.04.package"
if: fork = false
script:
- docker build -f precice/Dockerfile.Ubuntu1804.package -t $DOCKER_USERNAME/precice-ubuntu1804.package-develop .
- python build_precice.py --dockerfile precice/Dockerfile.Ubuntu1804.package
deploy:
skip_cleanup: true
provider: script
on:
all_branches: true
script: >-
echo "$DOCKER_PASSWORD" | docker login -u $DOCKER_USERNAME --password-stdin &&
docker push $DOCKER_USERNAME/precice-ubuntu1804.package-develop
echo $DOCKER_PASSWORD | docker login -u $DOCKER_USERNAME --password-stdin &&
python push_precice.py --dockerfile precice/Dockerfile.Ubuntu1804.package

- name: "[Build preCICE on fork] Using cached version"
if: fork = true
Expand All @@ -139,112 +137,106 @@ jobs:
name: SU2 adapter
if: fork = false
script:
- docker build -f adapters/Dockerfile.su2-adapter -t $DOCKER_USERNAME/su2-adapter-ubuntu1604.home-develop .
- python build_adapter.py --dockerfile adapters/Dockerfile.su2-adapter --operating-system ubuntu1604 --precice-installation home
deploy:
skip_cleanup: true
provider: script
on:
all_branches: true
script: >-
echo "$DOCKER_PASSWORD" | docker login -u $DOCKER_USERNAME --password-stdin &&
docker push $DOCKER_USERNAME/su2-adapter-ubuntu1604.home-develop
echo $DOCKER_PASSWORD | docker login -u $DOCKER_USERNAME --password-stdin &&
python push_adapter.py --dockerfile adapters/Dockerfile.su2-adapter --operating-system ubuntu1604 --precice-installation home

- name: CalculiX adapter
if: fork = false
script:
- docker build -f adapters/Dockerfile.calculix-adapter -t $DOCKER_USERNAME/calculix-adapter-ubuntu1604.home-develop .
- python build_adapter.py --dockerfile adapters/Dockerfile.calculix-adapter --operating-system ubuntu1604 --precice-installation home
deploy:
skip_cleanup: true
provider: script
on:
all_branches: true
script: >-
echo "$DOCKER_PASSWORD" | docker login -u $DOCKER_USERNAME --password-stdin &&
docker push $DOCKER_USERNAME/calculix-adapter-ubuntu1604.home-develop
echo $DOCKER_PASSWORD | docker login -u $DOCKER_USERNAME --password-stdin &&
python push_adapter.py --dockerfile adapters/Dockerfile.calculix-adapter --operating-system ubuntu1604 --precice-installation home

- name: deal.ii adapter
if: fork = false
script:
- docker build -f adapters/Dockerfile.dealii-adapter -t $DOCKER_USERNAME/dealii-adapter-ubuntu1604.home-develop .
- python build_adapter.py --dockerfile adapters/Dockerfile.dealii-adapter --operating-system ubuntu1604 --precice-installation home
deploy:
skip_cleanup: true
provider: script
on:
all_branches: true
script: >-
echo "$DOCKER_PASSWORD" | docker login -u $DOCKER_USERNAME --password-stdin &&
docker push $DOCKER_USERNAME/dealii-adapter-ubuntu1604.home-develop
echo $DOCKER_PASSWORD | docker login -u $DOCKER_USERNAME --password-stdin &&
python push_adapter.py --dockerfile adapters/Dockerfile.dealii-adapter --operating-system ubuntu1604 --precice-installation home

- name: openFOAM adapter
- name: "[16.04] openFOAM adapter"
if: fork = false
script:
- docker build -f adapters/Dockerfile.openfoam-adapter -t $DOCKER_USERNAME/openfoam-adapter-ubuntu1604.home-develop .
- python build_adapter.py --dockerfile adapters/Dockerfile.openfoam-adapter --operating-system ubuntu1604 --precice-installation home
deploy:
skip_cleanup: true
provider: script
on:
all_branches: true
script: >-
echo "$DOCKER_PASSWORD" | docker login -u $DOCKER_USERNAME --password-stdin &&
docker push $DOCKER_USERNAME/openfoam-adapter-ubuntu1604.home-develop
echo $DOCKER_PASSWORD | docker login -u $DOCKER_USERNAME --password-stdin &&
python push_adapter.py --dockerfile adapters/Dockerfile.openfoam-adapter --operating-system ubuntu1604 --precice-installation home

- name: "[18.04] openFOAM adapter"
if: fork = false
script:
- docker build -f adapters/Dockerfile.openfoam-adapter.Ubuntu1804 -t $DOCKER_USERNAME/openfoam-adapter-ubuntu1804.home-develop .
- python build_adapter.py --dockerfile adapters/Dockerfile.openfoam-adapter --operating-system ubuntu1804 --precice-installation home
deploy:
skip_cleanup: true
provider: script
on:
all_branches: true
script: >-
echo "$DOCKER_PASSWORD" | docker login -u "precice" --password-stdin &&
docker push precice/openfoam-adapter-ubuntu1804.home-develop
echo $DOCKER_PASSWORD | docker login -u $DOCKER_USERNAME --password-stdin &&
python push_adapter.py --dockerfile adapters/Dockerfile.openfoam-adapter --operating-system ubuntu1804 --precice-installation home

- name: FEniCS adapter
if: fork = false
script:
- >
docker build -f adapters/Dockerfile.fenics-adapter -t $DOCKER_USERNAME/fenics-adapter-ubuntu1804.home-develop
--build-arg from=$DOCKER_USERNAME/precice-ubuntu1804.home-develop .
- python build_adapter.py --dockerfile adapters/Dockerfile.fenics-adapter --operating-system ubuntu1804 --precice-installation home
deploy:
skip_cleanup: true
provider: script
on:
all_branches: true
script: >-
echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin &&
docker push $DOCKER_USERNAME/fenics-adapter-ubuntu1804.home-develop
echo $DOCKER_PASSWORD | docker login -u $DOCKER_USERNAME --password-stdin &&
python push_adapter.py --dockerfile adapters/Dockerfile.fenics-adapter --operating-system ubuntu1804 --precice-installation home

- name: openFOAM adapter [PETSc] [Job failure permitted]
if: fork = false
script:
- >
docker build -f adapters/Dockerfile.openfoam-adapter -t $DOCKER_USERNAME/openfoam-adapter-ubuntu1604.home.petsc-develop
--build-arg from=$DOCKER_USERNAME/precice-ubuntu1604.home.petsc-develop .
- python build_adapter.py --dockerfile adapters/Dockerfile.openfoam-adapter --operating-system ubuntu1604 --precice-installation home --petsc yes
deploy:
skip_cleanup: true
provider: script
on:
all_branches: true
script: >-
echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin &&
docker push $DOCKER_USERNAME/openfoam-adapter-ubuntu1604.home.petsc-develop
echo $DOCKER_PASSWORD | docker login -u $DOCKER_USERNAME --password-stdin &&
python push_adapter.py --dockerfile adapters/Dockerfile.openfoam-adapter --operating-system ubuntu1604 --precice-installation home --petsc yes

- name: CalculiX adapter [PETSc] [Job failure permitted]
if: fork = false
script:
- >
docker build -f adapters/Dockerfile.calculix-adapter -t $DOCKER_USERNAME/calculix-adapter-ubuntu1604.home.petsc-develop
--build-arg from=$DOCKER_USERNAME/precice-ubuntu1604.home.petsc-develop .
- python build_adapter.py --dockerfile adapters/Dockerfile.calculix-adapter --operating-system ubuntu1604 --precice-installation home --petsc yes
deploy:
skip_cleanup: true
provider: script
on:
all_branches: true
script: >-
echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin &&
docker push $DOCKER_USERNAME/calculix-adapter-ubuntu1604.home.petsc-develop
echo $DOCKER_PASSWORD | docker login -u $DOCKER_USERNAME --password-stdin &&
python push_adapter.py --dockerfile adapters/Dockerfile.calculix-adapter --operating-system ubuntu1604 --precice-installation home --petsc yes

- name: "[Build adapters on fork] Using cached version"
if: fork = true
Expand Down
54 changes: 54 additions & 0 deletions build_adapter.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
import argparse, docker
import system_testing
import os

if __name__ == "__main__":
# Parsing flags
parser = argparse.ArgumentParser(description='Build local docker image of an adapter.')
parser.add_argument('-d', '--dockerfile', type=str, help="Choose Dockerfile you want to build", default="adapters/Dockerfile.fenics-adapter")
parser.add_argument('-b', '--branch', help="preCICE branch to use", default="develop")
parser.add_argument('-u', '--docker-username', help="docker username", default=os.environ["DOCKER_USERNAME"] if "DOCKER_USERNAME" in os.environ else "precice")
parser.add_argument('-os', '--operating-system', help="Operating system used by preCICE base image", default="ubuntu1604")
parser.add_argument('-i', '--precice-installation', help="Installation mode used for preCICE", default="home")
parser.add_argument('-p', '--petsc', help="set 'yes', if you want to use a preCICE base image that was built with PETSc.", default="no", choices={'yes', 'no'})
parser.add_argument('-f', '--force-rebuild', nargs='+', help="Force rebuild of variable parts of docker image", default = [], choices = ["precice", "tests"])
args = parser.parse_args()

dockerfile = os.path.basename(args.dockerfile)
assert(dockerfile.split(".")[0] == "Dockerfile") # We have the convention that our Dockerfiles always start with the term "Dockerfile"

adapter_name = dockerfile.split(".")[1] # Extract adapter name from filename

# converting features provided via command-line to dictionary
features = dict()
assert(args.operating_system)
if args.operating_system: # first feature is mandatory always describes the os
features["os"] = args.operating_system
if args.precice_installation: # second feature is optional if it exists it describes the preCICE installation
features["installation"] = args.precice_installation
if args.petsc == "yes":
features["petsc"] = "yes"

tag = system_testing.compose_tag(args.docker_username, adapter_name, features, args.branch)

# converting features provided via command-line to dictionary
precice_base_features = dict()
assert(args.operating_system)
if args.operating_system: # first feature is mandatory always describes the os
precice_base_features["os"] = args.operating_system
if args.precice_installation: # second feature is optional if it exists it describes the preCICE installation
precice_base_features["installation"] = args.precice_installation
if args.petsc == "yes":
precice_base_features["petsc"] = "yes"

precice_base_tag = system_testing.compose_tag(args.docker_username, "precice", precice_base_features, args.branch)

print("Building {} image with the following features: {}".format(adapter_name, features))

docker.build_image(tag=tag,
dockerfile=args.dockerfile,
build_args={"branch" : args.branch,
"from" : precice_base_tag},
force_rebuild=args.force_rebuild,
namespace="")

45 changes: 45 additions & 0 deletions build_precice.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
import argparse, docker
import system_testing
import os

if __name__ == "__main__":
# Parsing flags
parser = argparse.ArgumentParser(description='Build local docker image of preCICE.')
parser.add_argument('-d', '--dockerfile', type=str, help="Choose Dockerfile you want to build", default="precice/Dockerfile.Ubuntu1604.home")
parser.add_argument('-b', '--branch', help="preCICE branch to use", default="develop")
parser.add_argument('-p', '--petsc', help="set 'yes', if you want to build with PETSc.", default="no", choices={'yes', 'no'})
parser.add_argument('-u', '--docker-username', help="docker username", default=os.environ["DOCKER_USERNAME"] if "DOCKER_USERNAME" in os.environ else "precice")
parser.add_argument('-f', '--force-rebuild', nargs='+', help="Force rebuild of variable parts of docker image", default = [], choices = ["precice", "tests"])
args = parser.parse_args()

dockerfile = os.path.basename(args.dockerfile)
assert(dockerfile.split(".")[0] == "Dockerfile") # We have the convention that our Dockerfiles always start with the term "Dockerfile"

# converting features provided in filename to dictionary
features = dict()
i = 0
for feature in dockerfile.split(".")[1:]: # Extract features from filename and join features with "." as separator.
i += 1
if i == 1: # first feature is mandatory always describes the os
assert(feature in ["Ubuntu1604", "Ubuntu1804", "Arch"]) # we expect that one of the following operating systems is used
features["os"] = feature
if i == 2: # second feature is optional if it exists it describes the preCICE installation
assert(feature in ["package", "home", "sudo"]) # we expect that one of the following installation procedures is used
features["installation"] = feature
if i >= 3: # third and following features are optional
assert(feature in ["mpich"]) # we expect one of these optional features
if feature is "mpich":
features["mpich"] = "yes"
assert(i > 0) # at least one feature (the os) should have been provided
if args.petsc == "yes":
features["petsc"] = "yes"

print("Building preCICE image with the following features: {}".format(features))

tag = system_testing.compose_tag(args.docker_username, "precice", features, args.branch)
docker.build_image(tag=tag,
dockerfile=args.dockerfile,
build_args={"branch" : args.branch, "petsc_para" : args.petsc},
force_rebuild=args.force_rebuild,
namespace="")

Loading