Skip to content
This repository was archived by the owner on Aug 14, 2025. It is now read-only.
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
153 changes: 17 additions & 136 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,119 +26,63 @@ jobs:
script:
- python build_precice.py --dockerfile precice/Dockerfile.Arch --docker-username $DOCKER_USERNAME
- python push.py --precice precice/Dockerfile.Arch
deploy:
skip_cleanup: true
provider: script
on:
all_branches: true
script: >-
echo $DOCKER_PASSWORD | docker login -u $DOCKER_USERNAME --password-stdin &&
python push_precice.py --dockerfile precice/Dockerfile.Arch --docker-username $DOCKER_USERNAME
- echo $DOCKER_PASSWORD | docker login -u $DOCKER_USERNAME --password-stdin && python push_precice.py --dockerfile precice/Dockerfile.Arch --docker-username $DOCKER_USERNAME

- stage: Building preCICE
name: "Ubuntu 16.04 home"
if: fork = false
script:
- python build_precice.py --dockerfile precice/Dockerfile.Ubuntu1604.home --docker-username $DOCKER_USERNAME
- python push.py --precice 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 &&
python push_precice.py --dockerfile precice/Dockerfile.Ubuntu1604.home --docker-username $DOCKER_USERNAME
- echo $DOCKER_PASSWORD | docker login -u $DOCKER_USERNAME --password-stdin && python push_precice.py --dockerfile precice/Dockerfile.Ubuntu1604.home --docker-username $DOCKER_USERNAME

- stage: Building preCICE
name: "Ubuntu 16.04 home PETSc [Job failure permitted]"
if: fork = false
script:
- python build_precice.py --dockerfile precice/Dockerfile.Ubuntu1604.home --petsc yes --docker-username $DOCKER_USERNAME
- python push.py --precice 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 &&
python push_precice.py --dockerfile precice/Dockerfile.Ubuntu1604.home --petsc yes --docker-username $DOCKER_USERNAME
- echo $DOCKER_PASSWORD | docker login -u $DOCKER_USERNAME --password-stdin && python push_precice.py --dockerfile precice/Dockerfile.Ubuntu1604.home --petsc yes --docker-username $DOCKER_USERNAME

- stage: Building preCICE
name: "Ubuntu 16.04.sudo"
if: type = cron
script:
- python build_precice.py --dockerfile precice/Dockerfile.Ubuntu1604.sudo --docker-username $DOCKER_USERNAME
- python push.py --precice 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 &&
python push_precice.py --dockerfile precice/Dockerfile.Ubuntu1604.sudo --docker-username $DOCKER_USERNAME
- echo $DOCKER_PASSWORD | docker login -u $DOCKER_USERNAME --password-stdin && python push_precice.py --dockerfile precice/Dockerfile.Ubuntu1604.sudo --docker-username $DOCKER_USERNAME

- stage: Building preCICE
name: "Ubuntu 18.04.home"
if: fork = false
script:
- python build_precice.py --dockerfile precice/Dockerfile.Ubuntu1804.home --docker-username $DOCKER_USERNAME
- python push.py --precice 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 &&
python push_precice.py --dockerfile precice/Dockerfile.Ubuntu1804.home --docker-username $DOCKER_USERNAME
- echo $DOCKER_PASSWORD | docker login -u $DOCKER_USERNAME --password-stdin && python push_precice.py --dockerfile precice/Dockerfile.Ubuntu1804.home --docker-username $DOCKER_USERNAME

- stage: Building preCICE
name: "Ubuntu 18.04.sudo"
if: type = cron
script:
- python build_precice.py --dockerfile precice/Dockerfile.Ubuntu1804.sudo --docker-username $DOCKER_USERNAME
- python push.py --precice 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 &&
python push_precice.py --dockerfile precice/Dockerfile.Ubuntu1804.sudo --docker-username $DOCKER_USERNAME
- echo $DOCKER_PASSWORD | docker login -u $DOCKER_USERNAME --password-stdin && python push_precice.py --dockerfile precice/Dockerfile.Ubuntu1804.sudo --docker-username $DOCKER_USERNAME

- stage: Building preCICE
name: "Ubuntu 18.04.sudo.mpich [Job failure permitted]"
if: type = cron
script:
- python build_precice.py --dockerfile precice/Dockerfile.Ubuntu1804.sudo.mpich --docker-username $DOCKER_USERNAME
- python push.py --precice 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 &&
python push_precice.py --dockerfile precice/Dockerfile.Ubuntu1804.sudo.mpich --docker-username $DOCKER_USERNAME
- echo $DOCKER_PASSWORD | docker login -u $DOCKER_USERNAME --password-stdin && python push_precice.py --dockerfile precice/Dockerfile.Ubuntu1804.sudo.mpich --docker-username $DOCKER_USERNAME

- stage: Building preCICE
name: "Ubuntu 18.04.package"
if: fork = false
script:
- python build_precice.py --dockerfile precice/Dockerfile.Ubuntu1804.package --docker-username $DOCKER_USERNAME
- python push.py --precice 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 &&
python push_precice.py --dockerfile precice/Dockerfile.Ubuntu1804.package --docker-username $DOCKER_USERNAME
- echo $DOCKER_PASSWORD | docker login -u $DOCKER_USERNAME --password-stdin && python push_precice.py --dockerfile precice/Dockerfile.Ubuntu1804.package --docker-username $DOCKER_USERNAME

- name: "[Build preCICE on fork] Using cached version"
if: fork = true
Expand All @@ -152,125 +96,62 @@ jobs:
script:
- python build_adapter.py --dockerfile adapters/Dockerfile.su2-adapter --operating-system ubuntu1604 --precice-installation home --docker-username $DOCKER_USERNAME
- python push.py --adapter adapters/Dockerfile.su2-adapter
deploy:
skip_cleanup: true
provider: script
on:
all_branches: true
script: >-
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 --docker-username $DOCKER_USERNAME
- 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 --docker-username $DOCKER_USERNAME

- name: "[16.04] CalculiX adapter"
if: fork = false
script:
- python build_adapter.py --dockerfile adapters/Dockerfile.calculix-adapter --operating-system ubuntu1604 --precice-installation home --docker-username $DOCKER_USERNAME
- python push.py --adapter adapters/Dockerfile.calculix-adapter
deploy:
skip_cleanup: true
provider: script
on:
all_branches: true
script: >-
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 --docker-username $DOCKER_USERNAME
- 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 --docker-username $DOCKER_USERNAME

- name: "[16.04] deal.ii adapter"
if: fork = false
script:
- python build_adapter.py --dockerfile adapters/Dockerfile.dealii-adapter --operating-system ubuntu1604 --precice-installation home --docker-username $DOCKER_USERNAME
- python push.py --adapter adapters/Dockerfile.dealii-adapter
deploy:
skip_cleanup: true
provider: script
on:
all_branches: true
script: >-
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 --docker-username $DOCKER_USERNAME
- 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 --docker-username $DOCKER_USERNAME

- name: "[16.04] OpenFOAM adapter"
if: fork = false
script:
- python build_adapter.py --dockerfile adapters/Dockerfile.openfoam-adapter --operating-system ubuntu1604 --precice-installation home --docker-username $DOCKER_USERNAME
- python push.py --adapter adapters/Dockerfile.openfoam-adapter
deploy:
skip_cleanup: true
provider: script
on:
all_branches: true
script: >-
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 --docker-username $DOCKER_USERNAME
- 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 --docker-username $DOCKER_USERNAME

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

- name: "[18.04] FEniCS adapter"
if: fork = false
script:
- python build_adapter.py --dockerfile adapters/Dockerfile.fenics-adapter --operating-system ubuntu1804 --precice-installation home --docker-username $DOCKER_USERNAME
- python push.py --adapter adapters/Dockerfile.fenics-adapter
deploy:
skip_cleanup: true
provider: script
on:
all_branches: true
script: >-
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 --docker-username $DOCKER_USERNAME
- 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 --docker-username $DOCKER_USERNAME

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

- name: "[16.04] OpenFOAM adapter [PETSc] [Job failure permitted]"
if: fork = false
script:
- python build_adapter.py --dockerfile adapters/Dockerfile.openfoam-adapter --operating-system ubuntu1604 --precice-installation home --petsc yes --docker-username $DOCKER_USERNAME
- python push.py --adapter adapters/Dockerfile.openfoam-adapter
deploy:
skip_cleanup: true
provider: script
on:
all_branches: true
script: >-
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 --docker-username $DOCKER_USERNAME
- 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 --docker-username $DOCKER_USERNAME

- name: "[16.04] CalculiX adapter [PETSc] [Job failure permitted]"
if: fork = false
script:
- python build_adapter.py --dockerfile adapters/Dockerfile.calculix-adapter --operating-system ubuntu1604 --precice-installation home --petsc yes --docker-username $DOCKER_USERNAME
- python push.py --adapter adapters/Dockerfile.calculix-adapter
deploy:
skip_cleanup: true
provider: script
on:
all_branches: true
script: >-
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 --docker-username $DOCKER_USERNAME
- 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 --docker-username $DOCKER_USERNAME


- name: "[Build adapters on fork] Using cached version"
Expand Down
13 changes: 11 additions & 2 deletions push_adapter.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import argparse, docker
import system_testing
import os

if __name__ == "__main__":
# Parsing flags
parser = argparse.ArgumentParser(description='Push local adapter image to Docker Hub.')
Expand Down Expand Up @@ -31,6 +31,15 @@

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

# TravisCI dependent behaviour:
# - If $TRAVIS_TEST_RESULT exists (i.e. we are running in a TravisCI job),
# then check if errors occured while building the image. This is indicated
# by TRAVIS_TEST_RESULT being equal to 1. We then abort the push.
# - If it doesn't, ignore this check and push image normally.
if "TRAVIS_TEST_RESULT" in os.environ:
if os.environ["TRAVIS_TEST_RESULT"] == '1':
print("The TravisCI script failed at a previous command! No image will be pushed.")
exit(1)

docker.push_image(tag=tag,
namespace="")

14 changes: 12 additions & 2 deletions push_precice.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import argparse, docker
import system_testing
import os

if __name__ == "__main__":
# Parsing flags
parser = argparse.ArgumentParser(description='Build local preCICE image to Docker Hub.')
Expand Down Expand Up @@ -34,6 +34,16 @@
features["petsc"] = "yes"

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

# TravisCI dependent behaviour:
# - If $TRAVIS_TEST_RESULT exists (i.e. we are running in a TravisCI job),
# then check if errors occured while building the image. This is indicated
# by TRAVIS_TEST_RESULT being equal to 1. We then abort the push.
# - If it doesn't, ignore this check and push image normally.
if "TRAVIS_TEST_RESULT" in os.environ:
if os.environ["TRAVIS_TEST_RESULT"] == '1':
print("The TravisCI script failed at a previous command! No image will be pushed.")
exit(1)

docker.push_image(tag=tag,
namespace="")

6 changes: 1 addition & 5 deletions system_testing.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,11 +222,7 @@ def compose_tag(docker_username, base, features, branch):
parser.add_argument('-l', '--local', action='store_true', help="Use local preCICE image (default: use remote image)")
parser.add_argument('-s', '--systemtest', type=str, help="Choose system tests you want to use",
choices = common.get_tests(), required = True)
parser.add_argument('-b', '--branch', help="preCICE branch to use", default="develop") # make sure that branch corresponding to system tests branch is used, if no branch is explicitly specified. If we are testing a pull request, will test against develop by default.
# Usage of the branch argument:
# When on a PR, this will by default use the develop versions of preCICE and adapter images.
# This makes it easier to experiment with tests, which are most commonly addressed by PRs
# (otherwise you would need to also create preCICE and adapter images for your branch which are only different in name)
parser.add_argument('-b', '--branch', help="preCICE branch to use", default=os.environ["TRAVIS_BRANCH"] if ("TRAVIS_BRANCH" in os.environ and os.environ["TRAVIS_PULL_REQUEST"] == "false") else (os.environ["TRAVIS_PULL_REQUEST_BRANCH"] if ("TRAVIS_PULL_REQUEST_BRANCH" in os.environ) else "develop")) # make sure that branch corresponding to system tests branch is used, if no branch is explicitly specified. If we are testing a pull request, make sure to test agains branch from which PR originated.
parser.add_argument('-f', '--force_rebuild', nargs='+', help="Force rebuild of variable parts of docker image",
default = [], choices = ["precice", "tests"])
parser.add_argument('--base', type=str,help="Base preCICE image to use",
Expand Down
2 changes: 1 addition & 1 deletion trigger_systemtests.py
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ def generate_failure_callback():
parser.add_argument('--st-branch', type=str, help="Used branch of systemtests", default='develop' )
parser.add_argument('--adapter', type=str, help="Adapter for which you want to trigger systemtests",
required=True, choices = adapters_info.keys() )
parser.add_argument('--output', help="Enable output for the triggered tests", action='store_true')
parser.add_argument('-o', '--output', help="Enable output for the triggered tests", action='store_true')
parser.add_argument('--failure', help="Whether to trigger normal or failure build",
action="store_true")
parser.add_argument('--wait', help='Whether exit only when the triggered build succeeds',
Expand Down