From e25c9691e96be5e64132aa91b23d8a60428e5c8c Mon Sep 17 00:00:00 2001 From: BenjaminRodenberg Date: Thu, 25 Feb 2021 23:14:59 +0100 Subject: [PATCH 01/77] Use super. --- spack/package.py | 64 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 spack/package.py diff --git a/spack/package.py b/spack/package.py new file mode 100644 index 00000000..c449ea4b --- /dev/null +++ b/spack/package.py @@ -0,0 +1,64 @@ +# Copyright 2013-2019 Lawrence Livermore National Security, LLC and other +# Spack Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +from spack import * + +class PyPyprecice(PythonPackage): + """ + This package provides python language bindings for the + C++ library preCICE. + """ + + homepage = "https://www.precice.org" + git = "https://github.com/precice/python-bindings.git" + url = "https://github.com/precice/python-bindings/archive/v2.0.0.1.tar.gz" + maintainers = ["ajaust", "BenjaminRueth"] + + # Always prefer final version of release candidate + version("develop", branch="feature") + version('2.1.1.2', sha256='363eb3eeccf964fd5ee87012c1032353dd1518662868f2b51f04a6d8a7154045') + version("2.1.1.1", sha256="972f574549344b6155a8dd415b6d82512e00fa154ca25ae7e36b68d4d2ed2cf4") + version("2.1.0.1", sha256="ac5cb7412c6b96b08a04fa86ea38e52d91ea739a3bd1c209baa93a8275e4e01a") + version("2.0.2.1", sha256="c6fca26332316de041f559aecbf23122a85d6348baa5d3252be4ddcd5e94c09a") + version("2.0.1.1", sha256="2791e7c7e2b04bc918f09f3dfca2d3371e6f8cbb7e57c82bd674703f4fa00be7") + version("2.0.0.2", sha256="5f055d809d65ec2e81f4d001812a250f50418de59990b47d6bcb12b88da5f5d7") + version("2.0.0.1", sha256="96eafdf421ec61ad6fcf0ab1d3cf210831a815272984c470b2aea57d4d0c9e0e") + + # Import module as a test + import_modules = ["precice"] + + patch("deactivate-version-check-via-pip.patch", when="@:2.1.1.1") + + variant("mpi", default=True, description="Enables MPI support") + + depends_on("mpi", when="+mpi") + depends_on("openssh") + depends_on("precice", when="@develop") + depends_on("precice@2.1.1", when="@2.1.1.1:2.1.1.99") + depends_on("precice@2.1.0", when="@2.1.0.1:2.1.0.99") + depends_on("precice@2.0.2", when="@2.0.2.1:2.0.2.99") + depends_on("precice@2.0.1", when="@2.0.1.1:2.0.1.99") + depends_on("precice@2.0.0", when="@2.0.0.1:2.0.0.99") + + depends_on("python@3:", type=("build", "run")) + depends_on("py-setuptools", type="build") + depends_on("py-wheel", type="build") + depends_on("py-numpy", type=("build", "run")) + depends_on("py-mpi4py", type=("build", "run"), when="+mpi") + depends_on("py-cython@0.29:", type=("build")) + + phases = ['build_ext', 'install'] + + def build_ext_args(self, spec, prefix): + return [ + "--include-dirs=" + spec["precice"].headers.directories[0], + "--library-dirs=" + spec["precice"].libs.directories[0] + ] + + def install(self, spec, prefix): + if self.version <= Version("2.1.1.1"): + self.setup_py("install", "--prefix={0}".format(prefix)) + else: + super.install(spec, prefix) From e626b713a95ba7d31168e3099d1c211eaa8d962f Mon Sep 17 00:00:00 2001 From: BenjaminRodenberg Date: Fri, 26 Feb 2021 17:42:57 +0100 Subject: [PATCH 02/77] Remove incorrect and update correct file. --- spack/package.py | 64 ------------------- .../builtin/packages/py-pyprecice/package.py | 4 +- 2 files changed, 3 insertions(+), 65 deletions(-) delete mode 100644 spack/package.py diff --git a/spack/package.py b/spack/package.py deleted file mode 100644 index c449ea4b..00000000 --- a/spack/package.py +++ /dev/null @@ -1,64 +0,0 @@ -# Copyright 2013-2019 Lawrence Livermore National Security, LLC and other -# Spack Project Developers. See the top-level COPYRIGHT file for details. -# -# SPDX-License-Identifier: (Apache-2.0 OR MIT) - -from spack import * - -class PyPyprecice(PythonPackage): - """ - This package provides python language bindings for the - C++ library preCICE. - """ - - homepage = "https://www.precice.org" - git = "https://github.com/precice/python-bindings.git" - url = "https://github.com/precice/python-bindings/archive/v2.0.0.1.tar.gz" - maintainers = ["ajaust", "BenjaminRueth"] - - # Always prefer final version of release candidate - version("develop", branch="feature") - version('2.1.1.2', sha256='363eb3eeccf964fd5ee87012c1032353dd1518662868f2b51f04a6d8a7154045') - version("2.1.1.1", sha256="972f574549344b6155a8dd415b6d82512e00fa154ca25ae7e36b68d4d2ed2cf4") - version("2.1.0.1", sha256="ac5cb7412c6b96b08a04fa86ea38e52d91ea739a3bd1c209baa93a8275e4e01a") - version("2.0.2.1", sha256="c6fca26332316de041f559aecbf23122a85d6348baa5d3252be4ddcd5e94c09a") - version("2.0.1.1", sha256="2791e7c7e2b04bc918f09f3dfca2d3371e6f8cbb7e57c82bd674703f4fa00be7") - version("2.0.0.2", sha256="5f055d809d65ec2e81f4d001812a250f50418de59990b47d6bcb12b88da5f5d7") - version("2.0.0.1", sha256="96eafdf421ec61ad6fcf0ab1d3cf210831a815272984c470b2aea57d4d0c9e0e") - - # Import module as a test - import_modules = ["precice"] - - patch("deactivate-version-check-via-pip.patch", when="@:2.1.1.1") - - variant("mpi", default=True, description="Enables MPI support") - - depends_on("mpi", when="+mpi") - depends_on("openssh") - depends_on("precice", when="@develop") - depends_on("precice@2.1.1", when="@2.1.1.1:2.1.1.99") - depends_on("precice@2.1.0", when="@2.1.0.1:2.1.0.99") - depends_on("precice@2.0.2", when="@2.0.2.1:2.0.2.99") - depends_on("precice@2.0.1", when="@2.0.1.1:2.0.1.99") - depends_on("precice@2.0.0", when="@2.0.0.1:2.0.0.99") - - depends_on("python@3:", type=("build", "run")) - depends_on("py-setuptools", type="build") - depends_on("py-wheel", type="build") - depends_on("py-numpy", type=("build", "run")) - depends_on("py-mpi4py", type=("build", "run"), when="+mpi") - depends_on("py-cython@0.29:", type=("build")) - - phases = ['build_ext', 'install'] - - def build_ext_args(self, spec, prefix): - return [ - "--include-dirs=" + spec["precice"].headers.directories[0], - "--library-dirs=" + spec["precice"].libs.directories[0] - ] - - def install(self, spec, prefix): - if self.version <= Version("2.1.1.1"): - self.setup_py("install", "--prefix={0}".format(prefix)) - else: - super.install(spec, prefix) diff --git a/spack/var/spack/repos/builtin/packages/py-pyprecice/package.py b/spack/var/spack/repos/builtin/packages/py-pyprecice/package.py index 096203a1..6620ac19 100644 --- a/spack/var/spack/repos/builtin/packages/py-pyprecice/package.py +++ b/spack/var/spack/repos/builtin/packages/py-pyprecice/package.py @@ -52,7 +52,7 @@ class PyPyprecice(PythonPackage): depends_on("py-mpi4py", type=("build", "run"), when="+mpi") depends_on("py-cython@0.29:", type=("build")) - phases = ['install_lib', 'build_ext', 'install'] + phases = ['build_ext', 'install'] def build_ext_args(self, spec, prefix): return [ @@ -63,3 +63,5 @@ def build_ext_args(self, spec, prefix): def install(self, spec, prefix): if self.version <= Version("2.1.1.1"): self.setup_py("install", "--prefix={0}".format(prefix)) + else: + super.install(spec, prefix) From 392dd788bc7ed5dda7e681a5d157ed71b1ac5f0e Mon Sep 17 00:00:00 2001 From: BenjaminRodenberg Date: Tue, 2 Mar 2021 16:04:13 +0100 Subject: [PATCH 03/77] Experiment with architecture proposed in https://github.com/haampie-spack/ci-example. --- .github/workflows/build-spack.yml | 6 ++-- spack/README.md | 10 +++--- spack/ci-spack-pyprecice-deps-1804.dockerfile | 17 ++++++---- spack/jinja-instantiate.py | 2 +- .../package.py => package-template.py} | 0 .../deactivate-version-check-via-pip.patch | 32 +++++++++++++++++++ spack/repo/repo.yaml | 2 ++ spack/spack.yaml | 6 ++++ 8 files changed, 59 insertions(+), 16 deletions(-) rename spack/{var/spack/repos/builtin/packages/py-pyprecice/package.py => package-template.py} (100%) create mode 100644 spack/repo/packages/py-pyprecice/deactivate-version-check-via-pip.patch create mode 100644 spack/repo/repo.yaml create mode 100644 spack/spack.yaml diff --git a/.github/workflows/build-spack.yml b/.github/workflows/build-spack.yml index 4ebdcd6a..3418d7d4 100644 --- a/.github/workflows/build-spack.yml +++ b/.github/workflows/build-spack.yml @@ -9,7 +9,7 @@ jobs: name: build_spack runs-on: ubuntu-latest timeout-minutes: 5 - container: benjaminrueth/ci-spack-pyprecice-deps-1804 + container: precice/ci-spack-pyprecice-deps-1804 defaults: run: shell: "bash --login -eo pipefail {0}" @@ -29,9 +29,7 @@ jobs: - name: Specify Package Script run: | python3 spack/jinja-instantiate.py --branch ${{ steps.extract_branch.outputs.branch }} > /opt/spack/var/spack/repos/builtin/packages/py-pyprecice/package.py - ls spack/var/spack/repos/builtin/packages/py-pyprecice - cp spack/var/spack/repos/builtin/packages/py-pyprecice/*.patch /opt/spack/var/spack/repos/builtin/packages/py-pyprecice/ - ls spack/var/spack/repos/builtin/packages/py-pyprecice + cp spack/repo/packages/py-pyprecice/*.patch /opt/spack/var/spack/repos/builtin/packages/py-pyprecice/ - name: Try to build py-pyprecice with spack run: | . /opt/spack/share/spack/setup-env.sh && spack env activate precice && spack add py-pyprecice@develop ^precice@develop && spack concretize -f && spack install -v diff --git a/spack/README.md b/spack/README.md index 0c721e06..4d20ae91 100644 --- a/spack/README.md +++ b/spack/README.md @@ -2,13 +2,15 @@ The Spack package `py-pyprecice` provides the python bindings via Spack and was submitted via https://github.com/spack/spack/pull/19558. This folder contains the Spack package script that can be used for testing whether the Spack installation works. -Note that the file `var/spack/repos/builtin/packages/py-pyprecice/package.py` is a template that can be specified using `jinja2`. Run `python3 jinja-instrantiate.py` to do so. You may use the `--branch` argument to specify a branch. Example: +Note that the file `package-template.py` is a template that can be specified using `jinja2`. Run `python3 jinja-instrantiate.py` to do so. You may use the `--branch` argument to specify a branch. Example: ``` -python3 jinja-instantiate.py --branch feature > my_package_script.py +python3 jinja-instantiate.py --branch feature > package.py ``` ## Docker image ci-spack-pyprecice-deps-1804 +**This section is under construction!** + The test `build_spack` in `.github/workflows/build-spack.yml` uses the image `benjaminrueth/ci-spack-pyprecice-deps-1804` to reduce build time. Use the file `ci-spack-pyprecice-deps-1804.dockerfile` from this folder for building this image: ``` docker build -f ci-spack-pyprecice-deps-1804.dockerfile -t USERNAME/ci-spack-pyprecice-deps-1804.dockerfile . @@ -16,6 +18,6 @@ docker push USERNAME/ci-spack-pyprecice-deps-1804.dockerfile ``` ## When a new spack release is necessary -* Add checksum of newest version(s) to https://github.com/precice/python-bindings/blob/develop/spack/var/spack/repos/builtin/packages/py-pyprecice/package.py. You can get checksum for any released version by running `spack checksum py-pyprecice`. +* Add checksum of newest version(s) to https://github.com/precice/python-bindings/blob/develop/spack/package-template.py. You can get checksum for any released version by running `spack checksum py-pyprecice`. * Run `python3 jinja-instantiate > package.py` to generate the latest version of `package.py`. -* Use `package.py` together with the patches provided in `python-bindings/spack/var/spack/repos/builtin/packages/py-pyprecice` to [create a pull request for Spack](https://github.com/spack/spack/compare) and submit the new release. +* Use `package.py` together with the patches provided in `python-bindings/spack/repo/packages/py-pyprecice` to [create a pull request for Spack](https://github.com/spack/spack/compare) and submit the new release. diff --git a/spack/ci-spack-pyprecice-deps-1804.dockerfile b/spack/ci-spack-pyprecice-deps-1804.dockerfile index ada55360..ebb87d64 100644 --- a/spack/ci-spack-pyprecice-deps-1804.dockerfile +++ b/spack/ci-spack-pyprecice-deps-1804.dockerfile @@ -1,8 +1,11 @@ # Build stage with Spack pre-installed and ready to be used -FROM spack/ubuntu-bionic:latest -RUN spack env create precice -# Install dependencies for precice and py-pyprecice -RUN spack env activate precice \ - && spack add boost@1.74.0 cmake@3.18.4 eigen@3.3.8 openssh petsc@3.14.1 pkgconfig precice@develop py-setuptools py-wheel py-cython py-numpy py-mpi4py \ - && spack concretize -f \ - && spack install +FROM spack/ubuntu-bionic:latest +WORKDIR /sources +# Mount the current sources into the build container +# and build the default environment +ADD . /sources +RUN spack --color=always env create --without-view ci /sources/spack/spack.yaml && \ + spack --color=always -e ci repo add /sources/spack/repo && \ + spack --color=always -e ci install --fail-fast --only=dependencies && \ + spack --color=always env rm -y ci && \ + spack --color=always clean -a diff --git a/spack/jinja-instantiate.py b/spack/jinja-instantiate.py index e26877b0..f8dfc91c 100644 --- a/spack/jinja-instantiate.py +++ b/spack/jinja-instantiate.py @@ -8,7 +8,7 @@ args = parser.parse_args() f = open(path.join(path.dirname(__file__), - "var/spack/repos/builtin/packages/py-pyprecice/package.py"), + "package-template.py"), "r") template = jinja2.Template(f.read()) diff --git a/spack/var/spack/repos/builtin/packages/py-pyprecice/package.py b/spack/package-template.py similarity index 100% rename from spack/var/spack/repos/builtin/packages/py-pyprecice/package.py rename to spack/package-template.py diff --git a/spack/repo/packages/py-pyprecice/deactivate-version-check-via-pip.patch b/spack/repo/packages/py-pyprecice/deactivate-version-check-via-pip.patch new file mode 100644 index 00000000..e7b13aa6 --- /dev/null +++ b/spack/repo/packages/py-pyprecice/deactivate-version-check-via-pip.patch @@ -0,0 +1,32 @@ +diff --git a/setup.py b/setup.py +index 9282639..d69c285 100644 +--- a/setup.py ++++ b/setup.py +@@ -1,15 +1,20 @@ + import os + import subprocess + import warnings +-from packaging import version +-import pip ++from setuptools._vendor.packaging import version ++ ++# If installed with pip we need to check its version ++try: ++ import pip ++ if version.parse(pip.__version__) < version.parse("19.0"): ++ # version 19.0 is required, since we are using pyproject.toml for definition of build-time depdendencies. See https://pip.pypa.io/en/stable/news/#id209 ++ warnings.warn("You are using pip version {}. However, pip version > 19.0 is recommended. You can continue with the installation, but installation problems can occour. Please refer to https://github.com/precice/python-bindings#build-time-dependencies-cython-numpy-defined-in-pyprojecttoml-are-not-installed-automatically for help.".format(pip.__version__)) + +-if version.parse(pip.__version__) < version.parse("19.0"): +- # version 19.0 is required, since we are using pyproject.toml for definition of build-time depdendencies. See https://pip.pypa.io/en/stable/news/#id209 +- warnings.warn("You are using pip version {}. However, pip version > 19.0 is recommended. You can continue with the installation, but installation problems can occour. Please refer to https://github.com/precice/python-bindings#build-time-dependencies-cython-numpy-defined-in-pyprojecttoml-are-not-installed-automatically for help.".format(pip.__version__)) ++ if version.parse(pip.__version__) < version.parse("10.0.1"): ++ warnings.warn("You are using pip version {}. However, pip version > 10.0.1 is required. If you continue with installation it is likely that you will face an error. See https://github.com/precice/python-bindings#version-of-pip3-is-too-old".format(pip.__version__)) ++except: ++ warnings.warn("Assuming that you are not using pip!") + +-if version.parse(pip.__version__) < version.parse("10.0.1"): +- warnings.warn("You are using pip version {}. However, pip version > 10.0.1 is required. If you continue with installation it is likely that you will face an error. See https://github.com/precice/python-bindings#version-of-pip3-is-too-old".format(pip.__version__)) + + from enum import Enum + from setuptools import setup diff --git a/spack/repo/repo.yaml b/spack/repo/repo.yaml new file mode 100644 index 00000000..61517481 --- /dev/null +++ b/spack/repo/repo.yaml @@ -0,0 +1,2 @@ +repo: + namespace: 'spack' diff --git a/spack/spack.yaml b/spack/spack.yaml new file mode 100644 index 00000000..dcbea068 --- /dev/null +++ b/spack/spack.yaml @@ -0,0 +1,6 @@ +spack: + specs: + - py-pyprecice + packages: + all: + target: [x86_64] From d6d1d2708837f93019e98063ce6c76512938fc7a Mon Sep 17 00:00:00 2001 From: BenjaminRodenberg Date: Tue, 2 Mar 2021 16:08:10 +0100 Subject: [PATCH 04/77] Add workflow for building dependencies from https://github.com/haampie-spack/ci-example. --- .github/workflows/build-env.yaml | 39 ++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 .github/workflows/build-env.yaml diff --git a/.github/workflows/build-env.yaml b/.github/workflows/build-env.yaml new file mode 100644 index 00000000..5bfa8630 --- /dev/null +++ b/.github/workflows/build-env.yaml @@ -0,0 +1,39 @@ +name: Update build environment + +on: + workflow_dispatch: # Trigger by hand from the UI + schedule: + - cron: '0 0 * * 0' # Schedule it every Sunday + +jobs: + docker: + runs-on: ubuntu-latest + steps: + - name: Checkout Repository + uses: actions/checkout@v2 + - name: Install pip3 + run: | + curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py + python3 get-pip.py + - name: Install jinja2 + run: pip3 install --user jinja2 + - name: Specify Package Script + run: | + python3 spack/jinja-instantiate.py --branch develop > spack//opt/spack/var/spack/repos/builtin/packages/py-pyprecice/package.py + ls spack/var/spack/repos/builtin/packages/py-pyprecice + cp spack/var/spack/repos/builtin/packages/py-pyprecice/*.patch /opt/spack/var/spack/repos/builtin/packages/py-pyprecice/ + ls spack/var/spack/repos/builtin/packages/py-pyprecice + - name: Set up Docker + uses: docker/setup-buildx-action@v1 + - name: Login to registry + uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + - name: Build and push + uses: docker/build-push-action@v2 + with: + push: true + context: . + file: spack/ci-spack-pyprecice-deps-1804.dockerfile + tags: precice/ci-spack-pyprecice-deps-1804 From 97c513d0f5535d63bc60237bdae0e06e1fe0d0b2 Mon Sep 17 00:00:00 2001 From: BenjaminRodenberg Date: Tue, 2 Mar 2021 16:12:02 +0100 Subject: [PATCH 05/77] Rename --- .github/workflows/{build-env.yaml => build-env.yml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/workflows/{build-env.yaml => build-env.yml} (100%) diff --git a/.github/workflows/build-env.yaml b/.github/workflows/build-env.yml similarity index 100% rename from .github/workflows/build-env.yaml rename to .github/workflows/build-env.yml From a88bf47d5ff6facee853b5a28a7ecf26fb746dfd Mon Sep 17 00:00:00 2001 From: BenjaminRodenberg Date: Tue, 2 Mar 2021 16:17:37 +0100 Subject: [PATCH 06/77] build-env.yml --- .github/workflows/build-env.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-env.yml b/.github/workflows/build-env.yml index 5bfa8630..045ab661 100644 --- a/.github/workflows/build-env.yml +++ b/.github/workflows/build-env.yml @@ -3,7 +3,8 @@ name: Update build environment on: workflow_dispatch: # Trigger by hand from the UI schedule: - - cron: '0 0 * * 0' # Schedule it every Sunday + - cron: '0 0 * * 0' # Schedule it every Sunday + push: # Trigger on push, since dispatch does not work if not on default branch. See https://docs.github.com/en/actions/managing-workflow-runs/manually-running-a-workflow jobs: docker: From 1289eb57d3b6baa547e5e70fa2c7f220a9f2d00e Mon Sep 17 00:00:00 2001 From: BenjaminRodenberg Date: Tue, 2 Mar 2021 16:25:18 +0100 Subject: [PATCH 07/77] Fix paths and names. --- .github/workflows/build-env.yml | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build-env.yml b/.github/workflows/build-env.yml index 045ab661..909c2ade 100644 --- a/.github/workflows/build-env.yml +++ b/.github/workflows/build-env.yml @@ -7,7 +7,8 @@ on: push: # Trigger on push, since dispatch does not work if not on default branch. See https://docs.github.com/en/actions/managing-workflow-runs/manually-running-a-workflow jobs: - docker: + build-spack-pyprecice-deps: + name: Builds the baseimage for spack providing dependencies runs-on: ubuntu-latest steps: - name: Checkout Repository @@ -20,10 +21,7 @@ jobs: run: pip3 install --user jinja2 - name: Specify Package Script run: | - python3 spack/jinja-instantiate.py --branch develop > spack//opt/spack/var/spack/repos/builtin/packages/py-pyprecice/package.py - ls spack/var/spack/repos/builtin/packages/py-pyprecice - cp spack/var/spack/repos/builtin/packages/py-pyprecice/*.patch /opt/spack/var/spack/repos/builtin/packages/py-pyprecice/ - ls spack/var/spack/repos/builtin/packages/py-pyprecice + python3 spack/jinja-instantiate.py --branch develop > spack/repo/packages/py-pyprecice/package.py - name: Set up Docker uses: docker/setup-buildx-action@v1 - name: Login to registry From cea094c849b6a3b8bd0ea5a038ef90da810083a6 Mon Sep 17 00:00:00 2001 From: Benjamin Rodenberg Date: Tue, 2 Mar 2021 19:10:05 +0100 Subject: [PATCH 08/77] Manually add pkgconfig Seems to be missing in precice spack package. See https://github.com/precice/python-bindings/runs/2014465956?check_suite_focus=true#step:8:734 --- spack/spack.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/spack/spack.yaml b/spack/spack.yaml index dcbea068..2434d569 100644 --- a/spack/spack.yaml +++ b/spack/spack.yaml @@ -1,5 +1,6 @@ spack: specs: + - pkgconfig - py-pyprecice packages: all: From 63b22489b477dd0ecee8ed2cff9b6d24472e977f Mon Sep 17 00:00:00 2001 From: BenjaminRodenberg Date: Tue, 2 Mar 2021 20:18:47 +0100 Subject: [PATCH 09/77] Remove unneeded file. --- .../deactivate-version-check-via-pip.patch | 32 ------------------- 1 file changed, 32 deletions(-) delete mode 100644 spack/var/spack/repos/builtin/packages/py-pyprecice/deactivate-version-check-via-pip.patch diff --git a/spack/var/spack/repos/builtin/packages/py-pyprecice/deactivate-version-check-via-pip.patch b/spack/var/spack/repos/builtin/packages/py-pyprecice/deactivate-version-check-via-pip.patch deleted file mode 100644 index e7b13aa6..00000000 --- a/spack/var/spack/repos/builtin/packages/py-pyprecice/deactivate-version-check-via-pip.patch +++ /dev/null @@ -1,32 +0,0 @@ -diff --git a/setup.py b/setup.py -index 9282639..d69c285 100644 ---- a/setup.py -+++ b/setup.py -@@ -1,15 +1,20 @@ - import os - import subprocess - import warnings --from packaging import version --import pip -+from setuptools._vendor.packaging import version -+ -+# If installed with pip we need to check its version -+try: -+ import pip -+ if version.parse(pip.__version__) < version.parse("19.0"): -+ # version 19.0 is required, since we are using pyproject.toml for definition of build-time depdendencies. See https://pip.pypa.io/en/stable/news/#id209 -+ warnings.warn("You are using pip version {}. However, pip version > 19.0 is recommended. You can continue with the installation, but installation problems can occour. Please refer to https://github.com/precice/python-bindings#build-time-dependencies-cython-numpy-defined-in-pyprojecttoml-are-not-installed-automatically for help.".format(pip.__version__)) - --if version.parse(pip.__version__) < version.parse("19.0"): -- # version 19.0 is required, since we are using pyproject.toml for definition of build-time depdendencies. See https://pip.pypa.io/en/stable/news/#id209 -- warnings.warn("You are using pip version {}. However, pip version > 19.0 is recommended. You can continue with the installation, but installation problems can occour. Please refer to https://github.com/precice/python-bindings#build-time-dependencies-cython-numpy-defined-in-pyprojecttoml-are-not-installed-automatically for help.".format(pip.__version__)) -+ if version.parse(pip.__version__) < version.parse("10.0.1"): -+ warnings.warn("You are using pip version {}. However, pip version > 10.0.1 is required. If you continue with installation it is likely that you will face an error. See https://github.com/precice/python-bindings#version-of-pip3-is-too-old".format(pip.__version__)) -+except: -+ warnings.warn("Assuming that you are not using pip!") - --if version.parse(pip.__version__) < version.parse("10.0.1"): -- warnings.warn("You are using pip version {}. However, pip version > 10.0.1 is required. If you continue with installation it is likely that you will face an error. See https://github.com/precice/python-bindings#version-of-pip3-is-too-old".format(pip.__version__)) - - from enum import Enum - from setuptools import setup From c34d98401bcba529d45c148a4260435af7fcb736 Mon Sep 17 00:00:00 2001 From: BenjaminRodenberg Date: Tue, 2 Mar 2021 20:21:04 +0100 Subject: [PATCH 10/77] Add hotfix for pkgconfig. --- spack/repo/packages/precice/package.py | 157 +++++++++++++++++++++++++ 1 file changed, 157 insertions(+) create mode 100644 spack/repo/packages/precice/package.py diff --git a/spack/repo/packages/precice/package.py b/spack/repo/packages/precice/package.py new file mode 100644 index 00000000..037d7b93 --- /dev/null +++ b/spack/repo/packages/precice/package.py @@ -0,0 +1,157 @@ +# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other +# Spack Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +from spack import * + + +class Precice(CMakePackage): + """preCICE (Precise Code Interaction Coupling Environment) is a + coupling library for partitioned multi-physics simulations. + Partitioned means that preCICE couples existing programs (solvers) + capable of simulating a subpart of the complete physics involved in + a simulation.""" + + homepage = 'https://www.precice.org' + git = 'https://github.com/precice/precice.git' + url = 'https://github.com/precice/precice/archive/v1.2.0.tar.gz' + maintainers = ['fsimonis', 'MakisH'] + + version('develop', branch='develop') + version('2.2.0', sha256='f8c4e0810dcaeb6a40a0fcab64b95c899f0121c968e0730416d4d2a97d39d0c4') + version('2.1.1', sha256='729b7c24a7a61b3953bb70d96a954ad3a85729a29a35a288b59ba25661117064') + version('2.1.0', sha256='1e6432724f70d0c6c05fdd645e0026754edbc547719a35bf1d3c12a779b1d00e') + version('2.0.2', sha256='72864480f32696e7b6da94fd404ef5cd6586e2e1640613e46b75f1afac8569ed') + version('2.0.1', sha256='e4fe2d2063042761ab325f8c802f88ae088c90862af288ad1a642967d074bd50') + version('2.0.0', sha256='c8979d366f06e35626a8da08a1c589df77ec13972eb524a1ba99a011e245701f') + version('1.6.1', sha256='7d0c54faa2c69e52304f36608d93c408629868f16f3201f663a0f9b2008f0763') + version('1.6.0', sha256='c3b16376fda9eb3449adb6cc3c1e267c3dc792a5d118e37d93a32a59b5a4bc6f') + version('1.5.2', sha256='051e0d7655a91f8681901e5c92812e48f33a5779309e2f104c99f5a687e1a418') + version('1.5.1', sha256='fbe151f1a9accf9154362c70d15254935d4f594d189982c3a99fdb3dd9d9e665') + version('1.5.0', sha256='a2a794becd08717e3049252134ae35692fed71966ed32e22cca796a169c16c3e') + version('1.4.1', sha256='dde4882edde17882340f9f601941d110d5976340bd71af54c6e6ea22ae56f1a5') + version('1.4.0', sha256='3499bfc0941fb9f004d5e32eb63d64f93e17b4057fab3ada1cde40c8311bd466') + version('1.3.0', sha256='610322ba1b03df8e8f7d060d57a6a5afeabd5db4e8c4a638d04ba4060a3aec96') + version('1.2.0', sha256='0784ecd002092949835151b90393beb6e9e7a3e9bd78ffd40d18302d6da4b05b') + # Skip version 1.1.1 entirely, the cmake was lacking install. + + variant('mpi', default=True, description='Enable MPI support') + variant('petsc', default=True, description='Enable PETSc support') + variant('python', default=False, description='Enable Python support') + variant('shared', default=True, description='Build shared libraries') + + depends_on('cmake@3.5:', type='build') + depends_on('cmake@3.10.2:', type='build', when='@1.4:') + depends_on('pkgconfig', type='build', when='@2.2:') + depends_on('boost@1.60.0:') + depends_on('boost@1.65.1:', when='@1.4:') + depends_on('boost@:1.72.99', when='@:2.0.2') + depends_on('boost@:1.74.99', when='@:2.1.1') + depends_on('eigen@3.2:') + depends_on('eigen@:3.3.7', type='build', when='@:1.5') # bug in prettyprint + depends_on('libxml2') + depends_on('mpi', when='+mpi') + depends_on('petsc@3.6:', when='+petsc') + depends_on('petsc@3.12:', when='+petsc@2.1.0:') + + # Python 3 support was added in version 2.0 + depends_on('python@2.7:2.8', when='@:1.9+python', type=('build', 'run')) + depends_on('python@3:', when='@2:+python', type=('build', 'run')) + + # numpy 1.17+ requires Python 3 + depends_on('py-numpy@:1.16', when='@:1.9+python', type=('build', 'run')) + depends_on('py-numpy@1.17:', when='@2:+python', type=('build', 'run')) + + # We require C++14 compiler support + conflicts('%gcc@:4') + conflicts('%apple-clang@:5') + conflicts('%clang@:3.7') + conflicts('%intel@:16') + conflicts('%pgi@:17.3') + + def cmake_args(self): + """Populate cmake arguments for precice.""" + spec = self.spec + + # The xSDK installation policies were implemented after 1.5.2 + xsdk_mode = spec.satisfies("@1.6:") + + # Select the correct CMake variables by version + mpi_option = "MPI" + if spec.satisfies("@2:"): + mpi_option = "PRECICE_MPICommunication" + petsc_option = "PETSC" + if spec.satisfies("@2:"): + petsc_option = "PRECICE_PETScMapping" + python_option = "PYTHON" + if spec.satisfies("@2:"): + python_option = "PRECICE_PythonActions" + + def variant_bool(feature, on='ON', off='OFF'): + """Ternary for spec variant to ON/OFF string""" + if feature in spec: + return on + return off + + cmake_args = [ + '-DBUILD_SHARED_LIBS:BOOL=%s' % variant_bool('+shared'), + ] + + cmake_args.append('-D%s:BOOL=%s' % (mpi_option, variant_bool('+mpi'))) + + # Boost + if xsdk_mode: + cmake_args.append('-DTPL_ENABLE_BOOST=ON') + cmake_args.append('-DBOOST_ROOT=%s' % spec['boost'].prefix) + + # Eigen3 + if xsdk_mode: + cmake_args.append('-DTPL_ENABLE_EIGEN3=ON') + cmake_args.append( + '-DEIGEN3_INCLUDE_DIR=%s' % spec['eigen'].headers.directories[0]) + + # LibXML2 + if xsdk_mode: + cmake_args.append('-DTPL_ENABLE_LIBXML2=ON') + libxml2_includes = spec['libxml2'].headers.directories[0] + cmake_args.extend([ + '-DLIBXML2_INCLUDE_DIRS=%s' % libxml2_includes, + '-DLIBXML2_LIBRARIES=%s' % spec['libxml2'].libs[0], + ]) + + # PETSc + if '+petsc' in spec: + if xsdk_mode: + cmake_args.append('-DTPL_ENABLE_PETSC:BOOL=ON') + else: + cmake_args.append('-D%s:BOOL=ON' % petsc_option) + cmake_args.extend([ + '-DPETSC_DIR=%s' % spec['petsc'].prefix, + '-DPETSC_ARCH=.' + ]) + else: + cmake_args.append('-D%s:BOOL=OFF' % petsc_option) + + # Python + if '+python' in spec: + python_library = spec['python'].libs[0] + python_include = spec['python'].headers.directories[0] + numpy_include = join_path( + spec['py-numpy'].prefix, + spec['python'].package.site_packages_dir, + 'numpy', 'core', 'include') + if xsdk_mode: + cmake_args.append('-DTPL_ENABLE_PYTHON:BOOL=ON') + else: + cmake_args.append('-D%s:BOOL=ON' % python_option) + cmake_args.extend([ + '-DPYTHON_INCLUDE_DIR=%s' % python_include, + '-DNumPy_INCLUDE_DIR=%s' % numpy_include, + '-DPYTHON_LIBRARY=%s' % python_library + ]) + else: + cmake_args.append('-D%s:BOOL=OFF' % python_option) + + return cmake_args + From a898c2e975dab66dd89ee2097151d2d39b834591 Mon Sep 17 00:00:00 2001 From: BenjaminRodenberg Date: Tue, 2 Mar 2021 20:37:25 +0100 Subject: [PATCH 11/77] Don't install pkgconfig manually --- spack/spack.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/spack/spack.yaml b/spack/spack.yaml index 2434d569..dcbea068 100644 --- a/spack/spack.yaml +++ b/spack/spack.yaml @@ -1,6 +1,5 @@ spack: specs: - - pkgconfig - py-pyprecice packages: all: From c891c6d74961044b18489aacac9ba2e77c3698ca Mon Sep 17 00:00:00 2001 From: BenjaminRodenberg Date: Wed, 3 Mar 2021 12:19:00 +0100 Subject: [PATCH 12/77] Use spack dev-build, don't use jinja. --- .github/workflows/build-env.yml | 9 --------- .github/workflows/build-spack.yml | 16 +++------------- spack/README.md | 3 +-- spack/jinja-instantiate.py | 15 --------------- .../packages/py-pyprecice/package.py} | 2 +- 5 files changed, 5 insertions(+), 40 deletions(-) delete mode 100644 spack/jinja-instantiate.py rename spack/{package-template.py => repo/packages/py-pyprecice/package.py} (98%) diff --git a/.github/workflows/build-env.yml b/.github/workflows/build-env.yml index 909c2ade..3fbd8aaa 100644 --- a/.github/workflows/build-env.yml +++ b/.github/workflows/build-env.yml @@ -13,15 +13,6 @@ jobs: steps: - name: Checkout Repository uses: actions/checkout@v2 - - name: Install pip3 - run: | - curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py - python3 get-pip.py - - name: Install jinja2 - run: pip3 install --user jinja2 - - name: Specify Package Script - run: | - python3 spack/jinja-instantiate.py --branch develop > spack/repo/packages/py-pyprecice/package.py - name: Set up Docker uses: docker/setup-buildx-action@v1 - name: Login to registry diff --git a/.github/workflows/build-spack.yml b/.github/workflows/build-spack.yml index 3418d7d4..377e880d 100644 --- a/.github/workflows/build-spack.yml +++ b/.github/workflows/build-spack.yml @@ -16,23 +16,13 @@ jobs: steps: - name: Checkout Repository uses: actions/checkout@v2 - - name: Install pip3 + - name: Move Package Script run: | - curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py - python3 get-pip.py - - name: Install jinja2 - run: pip3 install --user jinja2 - - name: Extract branch name # from https://stackoverflow.com/a/58035262/5158031 - shell: bash - run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})" - id: extract_branch - - name: Specify Package Script - run: | - python3 spack/jinja-instantiate.py --branch ${{ steps.extract_branch.outputs.branch }} > /opt/spack/var/spack/repos/builtin/packages/py-pyprecice/package.py + cp spack/repo/packages/py-pyprecice/package.py /opt/spack/var/spack/repos/builtin/packages/py-pyprecice/ cp spack/repo/packages/py-pyprecice/*.patch /opt/spack/var/spack/repos/builtin/packages/py-pyprecice/ - name: Try to build py-pyprecice with spack run: | - . /opt/spack/share/spack/setup-env.sh && spack env activate precice && spack add py-pyprecice@develop ^precice@develop && spack concretize -f && spack install -v + . /opt/spack/share/spack/setup-env.sh && spack env activate precice && spack dev-build py-pyprecice@develop - name: Import precice and print version run: | . /opt/spack/share/spack/setup-env.sh && spack env activate precice && python3 -c "import precice; print(precice.__version__)" diff --git a/spack/README.md b/spack/README.md index 4d20ae91..5e516044 100644 --- a/spack/README.md +++ b/spack/README.md @@ -18,6 +18,5 @@ docker push USERNAME/ci-spack-pyprecice-deps-1804.dockerfile ``` ## When a new spack release is necessary -* Add checksum of newest version(s) to https://github.com/precice/python-bindings/blob/develop/spack/package-template.py. You can get checksum for any released version by running `spack checksum py-pyprecice`. -* Run `python3 jinja-instantiate > package.py` to generate the latest version of `package.py`. +* Add checksum of newest version(s) to https://github.com/precice/python-bindings/blob/develop/spack/repo/packages/py-pyprecice/package.py. You can get checksum for any released version by running `spack checksum py-pyprecice`. * Use `package.py` together with the patches provided in `python-bindings/spack/repo/packages/py-pyprecice` to [create a pull request for Spack](https://github.com/spack/spack/compare) and submit the new release. diff --git a/spack/jinja-instantiate.py b/spack/jinja-instantiate.py deleted file mode 100644 index f8dfc91c..00000000 --- a/spack/jinja-instantiate.py +++ /dev/null @@ -1,15 +0,0 @@ -import jinja2 -import argparse -from os import path - -parser = argparse.ArgumentParser() -parser.add_argument('--branch', type=str, help="Branch to be checked out", - default="develop") -args = parser.parse_args() - -f = open(path.join(path.dirname(__file__), - "package-template.py"), - "r") - -template = jinja2.Template(f.read()) -print(template.render(branch=args.branch)) diff --git a/spack/package-template.py b/spack/repo/packages/py-pyprecice/package.py similarity index 98% rename from spack/package-template.py rename to spack/repo/packages/py-pyprecice/package.py index 6620ac19..f6e9a559 100644 --- a/spack/package-template.py +++ b/spack/repo/packages/py-pyprecice/package.py @@ -18,7 +18,7 @@ class PyPyprecice(PythonPackage): maintainers = ["ajaust", "BenjaminRueth"] # Always prefer final version of release candidate - version("develop", branch="{{ branch }}") + version("develop", branch="develop") version('2.2.0.1', sha256='032fa58193cfa69e3be37557977056e8f507d89b40c490a351d17271269b25ad') version('2.1.1.2', sha256='363eb3eeccf964fd5ee87012c1032353dd1518662868f2b51f04a6d8a7154045') version("2.1.1.1", sha256="972f574549344b6155a8dd415b6d82512e00fa154ca25ae7e36b68d4d2ed2cf4") From 3a6b3ff1faff530397884da14ae27d761e4893a8 Mon Sep 17 00:00:00 2001 From: BenjaminRodenberg Date: Wed, 3 Mar 2021 12:19:33 +0100 Subject: [PATCH 13/77] Use py-pyprecice@devleop --- spack/spack.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spack/spack.yaml b/spack/spack.yaml index dcbea068..24a2897f 100644 --- a/spack/spack.yaml +++ b/spack/spack.yaml @@ -1,6 +1,6 @@ spack: specs: - - py-pyprecice + - py-pyprecice@develop packages: all: target: [x86_64] From aee5bc8233e0022068fd3f4c42e6f81675d16015 Mon Sep 17 00:00:00 2001 From: BenjaminRodenberg Date: Wed, 3 Mar 2021 12:20:13 +0100 Subject: [PATCH 14/77] Increase timeout. --- .github/workflows/build-spack.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-spack.yml b/.github/workflows/build-spack.yml index 377e880d..e750a4d6 100644 --- a/.github/workflows/build-spack.yml +++ b/.github/workflows/build-spack.yml @@ -8,7 +8,7 @@ jobs: build_spack: name: build_spack runs-on: ubuntu-latest - timeout-minutes: 5 + timeout-minutes: 15 container: precice/ci-spack-pyprecice-deps-1804 defaults: run: From 3c5e2e47ef5061da561a2894b0de762b1ec3de8c Mon Sep 17 00:00:00 2001 From: Benjamin Rodenberg Date: Wed, 3 Mar 2021 12:28:27 +0100 Subject: [PATCH 15/77] Fix name of env --- .github/workflows/build-spack.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-spack.yml b/.github/workflows/build-spack.yml index e750a4d6..157b309d 100644 --- a/.github/workflows/build-spack.yml +++ b/.github/workflows/build-spack.yml @@ -22,7 +22,7 @@ jobs: cp spack/repo/packages/py-pyprecice/*.patch /opt/spack/var/spack/repos/builtin/packages/py-pyprecice/ - name: Try to build py-pyprecice with spack run: | - . /opt/spack/share/spack/setup-env.sh && spack env activate precice && spack dev-build py-pyprecice@develop + . /opt/spack/share/spack/setup-env.sh && spack env activate ci && spack dev-build py-pyprecice@develop - name: Import precice and print version run: | . /opt/spack/share/spack/setup-env.sh && spack env activate precice && python3 -c "import precice; print(precice.__version__)" From b2c861fe813e373bfe9c3c08febaa39e02b7c60d Mon Sep 17 00:00:00 2001 From: Benjamin Rodenberg Date: Wed, 3 Mar 2021 13:10:47 +0100 Subject: [PATCH 16/77] Don't remove environment --- spack/ci-spack-pyprecice-deps-1804.dockerfile | 1 - 1 file changed, 1 deletion(-) diff --git a/spack/ci-spack-pyprecice-deps-1804.dockerfile b/spack/ci-spack-pyprecice-deps-1804.dockerfile index ebb87d64..8aa18c09 100644 --- a/spack/ci-spack-pyprecice-deps-1804.dockerfile +++ b/spack/ci-spack-pyprecice-deps-1804.dockerfile @@ -7,5 +7,4 @@ ADD . /sources RUN spack --color=always env create --without-view ci /sources/spack/spack.yaml && \ spack --color=always -e ci repo add /sources/spack/repo && \ spack --color=always -e ci install --fail-fast --only=dependencies && \ - spack --color=always env rm -y ci && \ spack --color=always clean -a From 6d890ec6676f3fb1c1fe260bf6b3a3bbaf41211a Mon Sep 17 00:00:00 2001 From: BenjaminRodenberg Date: Wed, 3 Mar 2021 17:28:41 +0100 Subject: [PATCH 17/77] Fix package.py --- spack/repo/packages/py-pyprecice/package.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/spack/repo/packages/py-pyprecice/package.py b/spack/repo/packages/py-pyprecice/package.py index f6e9a559..d3ad9c02 100644 --- a/spack/repo/packages/py-pyprecice/package.py +++ b/spack/repo/packages/py-pyprecice/package.py @@ -52,7 +52,7 @@ class PyPyprecice(PythonPackage): depends_on("py-mpi4py", type=("build", "run"), when="+mpi") depends_on("py-cython@0.29:", type=("build")) - phases = ['build_ext', 'install'] + phases = ['install_lib', 'build_ext', 'install'] def build_ext_args(self, spec, prefix): return [ @@ -63,5 +63,3 @@ def build_ext_args(self, spec, prefix): def install(self, spec, prefix): if self.version <= Version("2.1.1.1"): self.setup_py("install", "--prefix={0}".format(prefix)) - else: - super.install(spec, prefix) From 96918006d92692868fed489091a7fe9c494638bf Mon Sep 17 00:00:00 2001 From: BenjaminRodenberg Date: Wed, 3 Mar 2021 17:44:44 +0100 Subject: [PATCH 18/77] Try overwriting package.py --- .github/workflows/build-spack.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-spack.yml b/.github/workflows/build-spack.yml index 157b309d..3a3b95fa 100644 --- a/.github/workflows/build-spack.yml +++ b/.github/workflows/build-spack.yml @@ -18,8 +18,8 @@ jobs: uses: actions/checkout@v2 - name: Move Package Script run: | - cp spack/repo/packages/py-pyprecice/package.py /opt/spack/var/spack/repos/builtin/packages/py-pyprecice/ - cp spack/repo/packages/py-pyprecice/*.patch /opt/spack/var/spack/repos/builtin/packages/py-pyprecice/ + cp spack/repo/packages/py-pyprecice/package.py /sources/spack/repo/packages/py-pyprecice/ + cp spack/repo/packages/py-pyprecice/*.patch /sources/spack/repo/packages/py-pyprecice/ - name: Try to build py-pyprecice with spack run: | . /opt/spack/share/spack/setup-env.sh && spack env activate ci && spack dev-build py-pyprecice@develop From ab4d3a9c3d9b004272eb662f77d58e173aaf2d28 Mon Sep 17 00:00:00 2001 From: BenjaminRodenberg Date: Wed, 3 Mar 2021 17:45:45 +0100 Subject: [PATCH 19/77] Only build env on a weekly basis. --- .github/workflows/build-env.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/build-env.yml b/.github/workflows/build-env.yml index 3fbd8aaa..273d90f0 100644 --- a/.github/workflows/build-env.yml +++ b/.github/workflows/build-env.yml @@ -4,7 +4,6 @@ on: workflow_dispatch: # Trigger by hand from the UI schedule: - cron: '0 0 * * 0' # Schedule it every Sunday - push: # Trigger on push, since dispatch does not work if not on default branch. See https://docs.github.com/en/actions/managing-workflow-runs/manually-running-a-workflow jobs: build-spack-pyprecice-deps: From 00c17b9b508286ab8924b682f803e0790a14ec54 Mon Sep 17 00:00:00 2001 From: BenjaminRodenberg Date: Wed, 3 Mar 2021 17:47:52 +0100 Subject: [PATCH 20/77] Fix env name. --- .github/workflows/build-spack.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-spack.yml b/.github/workflows/build-spack.yml index 3a3b95fa..44cd9b0f 100644 --- a/.github/workflows/build-spack.yml +++ b/.github/workflows/build-spack.yml @@ -25,4 +25,4 @@ jobs: . /opt/spack/share/spack/setup-env.sh && spack env activate ci && spack dev-build py-pyprecice@develop - name: Import precice and print version run: | - . /opt/spack/share/spack/setup-env.sh && spack env activate precice && python3 -c "import precice; print(precice.__version__)" + . /opt/spack/share/spack/setup-env.sh && spack env activate ci && python3 -c "import precice; print(precice.__version__)" From d4ff5973b3f6f5a06dc1daa664c75a7c44f55cfc Mon Sep 17 00:00:00 2001 From: Benjamin Rodenberg Date: Wed, 3 Mar 2021 18:15:38 +0100 Subject: [PATCH 21/77] Comment out install for older versions --- spack/repo/packages/py-pyprecice/package.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/spack/repo/packages/py-pyprecice/package.py b/spack/repo/packages/py-pyprecice/package.py index d3ad9c02..ed63702e 100644 --- a/spack/repo/packages/py-pyprecice/package.py +++ b/spack/repo/packages/py-pyprecice/package.py @@ -60,6 +60,6 @@ def build_ext_args(self, spec, prefix): "--library-dirs=" + spec["precice"].libs.directories[0] ] - def install(self, spec, prefix): - if self.version <= Version("2.1.1.1"): - self.setup_py("install", "--prefix={0}".format(prefix)) + # def install(self, spec, prefix): + # if self.version <= Version("2.1.1.1"): + # self.setup_py("install", "--prefix={0}".format(prefix)) From 69fdaacb0abc006da5f72c14262c318c0d7d15a6 Mon Sep 17 00:00:00 2001 From: Benjamin Rodenberg Date: Wed, 3 Mar 2021 18:17:15 +0100 Subject: [PATCH 22/77] Go to independent directory to avoid false imports --- .github/workflows/build-spack.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-spack.yml b/.github/workflows/build-spack.yml index 44cd9b0f..b3f05387 100644 --- a/.github/workflows/build-spack.yml +++ b/.github/workflows/build-spack.yml @@ -25,4 +25,4 @@ jobs: . /opt/spack/share/spack/setup-env.sh && spack env activate ci && spack dev-build py-pyprecice@develop - name: Import precice and print version run: | - . /opt/spack/share/spack/setup-env.sh && spack env activate ci && python3 -c "import precice; print(precice.__version__)" + . /opt/spack/share/spack/setup-env.sh && spack env activate ci && mkdir runner && cd runner && python3 -c "import precice; print(precice.__version__)" From 186bd369755cbc8bcc58da6e5d2b7a099c1d16d8 Mon Sep 17 00:00:00 2001 From: Benjamin Rodenberg Date: Wed, 3 Mar 2021 18:58:42 +0100 Subject: [PATCH 23/77] Explicitly load py-pyprecice --- .github/workflows/build-spack.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-spack.yml b/.github/workflows/build-spack.yml index b3f05387..5e36d9e1 100644 --- a/.github/workflows/build-spack.yml +++ b/.github/workflows/build-spack.yml @@ -25,4 +25,4 @@ jobs: . /opt/spack/share/spack/setup-env.sh && spack env activate ci && spack dev-build py-pyprecice@develop - name: Import precice and print version run: | - . /opt/spack/share/spack/setup-env.sh && spack env activate ci && mkdir runner && cd runner && python3 -c "import precice; print(precice.__version__)" + . /opt/spack/share/spack/setup-env.sh && spack env activate ci && spack load py-pyprecice && mkdir runner && cd runner && python3 -c "import precice; print(precice.__version__)" From aad7ecd823ce7e8195c5a6ba098ae16cd9218d0d Mon Sep 17 00:00:00 2001 From: BenjaminRodenberg Date: Wed, 3 Mar 2021 20:48:07 +0100 Subject: [PATCH 24/77] Load all dependencies. --- .github/workflows/build-spack.yml | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build-spack.yml b/.github/workflows/build-spack.yml index 5e36d9e1..7c784ae4 100644 --- a/.github/workflows/build-spack.yml +++ b/.github/workflows/build-spack.yml @@ -20,9 +20,6 @@ jobs: run: | cp spack/repo/packages/py-pyprecice/package.py /sources/spack/repo/packages/py-pyprecice/ cp spack/repo/packages/py-pyprecice/*.patch /sources/spack/repo/packages/py-pyprecice/ - - name: Try to build py-pyprecice with spack + - name: Try to build py-pyprecice with spack and test it run: | - . /opt/spack/share/spack/setup-env.sh && spack env activate ci && spack dev-build py-pyprecice@develop - - name: Import precice and print version - run: | - . /opt/spack/share/spack/setup-env.sh && spack env activate ci && spack load py-pyprecice && mkdir runner && cd runner && python3 -c "import precice; print(precice.__version__)" + . /opt/spack/share/spack/setup-env.sh && spack env activate ci && spack dev-build py-pyprecice@develop && spack load precice py-numpy py-mpi4py py-wheel py-cython openssh openmpi && mkdir runner && cd runner && python3 -c "import precice; print(precice.__version__)" From 838c18a1f8bff082c65778c02034cfe59d8ef8cb Mon Sep 17 00:00:00 2001 From: BenjaminRodenberg Date: Wed, 3 Mar 2021 20:51:41 +0100 Subject: [PATCH 25/77] Revert changes in install. --- spack/repo/packages/py-pyprecice/package.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/spack/repo/packages/py-pyprecice/package.py b/spack/repo/packages/py-pyprecice/package.py index ed63702e..d3ad9c02 100644 --- a/spack/repo/packages/py-pyprecice/package.py +++ b/spack/repo/packages/py-pyprecice/package.py @@ -60,6 +60,6 @@ def build_ext_args(self, spec, prefix): "--library-dirs=" + spec["precice"].libs.directories[0] ] - # def install(self, spec, prefix): - # if self.version <= Version("2.1.1.1"): - # self.setup_py("install", "--prefix={0}".format(prefix)) + def install(self, spec, prefix): + if self.version <= Version("2.1.1.1"): + self.setup_py("install", "--prefix={0}".format(prefix)) From 1048f8d0bd5b864526e5e35139d092835b3a38d5 Mon Sep 17 00:00:00 2001 From: BenjaminRodenberg Date: Wed, 3 Mar 2021 20:57:07 +0100 Subject: [PATCH 26/77] Update README.md --- spack/README.md | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/spack/README.md b/spack/README.md index 5e516044..71c8bc42 100644 --- a/spack/README.md +++ b/spack/README.md @@ -2,20 +2,12 @@ The Spack package `py-pyprecice` provides the python bindings via Spack and was submitted via https://github.com/spack/spack/pull/19558. This folder contains the Spack package script that can be used for testing whether the Spack installation works. -Note that the file `package-template.py` is a template that can be specified using `jinja2`. Run `python3 jinja-instrantiate.py` to do so. You may use the `--branch` argument to specify a branch. Example: -``` -python3 jinja-instantiate.py --branch feature > package.py -``` +## Docker image `precice/ci-spack-pyprecice-deps-1804` -## Docker image ci-spack-pyprecice-deps-1804 +The workflow `build_env` in `.github/workflows/build-spack.yml` creates the image `precice/ci-spack-pyprecice-deps-1804`. This image contains all dependencies of `py-pyprecice@develop`. -**This section is under construction!** +The workflow `build_spack` in `.github/workflows/build-spack.yml` uses the image `precice/ci-spack-pyprecice-deps-1804` to reduce build time. The workflow uses the `package.py` from this repository to build the latest version of the bindings and run a small test on this version. -The test `build_spack` in `.github/workflows/build-spack.yml` uses the image `benjaminrueth/ci-spack-pyprecice-deps-1804` to reduce build time. Use the file `ci-spack-pyprecice-deps-1804.dockerfile` from this folder for building this image: -``` -docker build -f ci-spack-pyprecice-deps-1804.dockerfile -t USERNAME/ci-spack-pyprecice-deps-1804.dockerfile . -docker push USERNAME/ci-spack-pyprecice-deps-1804.dockerfile -``` ## When a new spack release is necessary * Add checksum of newest version(s) to https://github.com/precice/python-bindings/blob/develop/spack/repo/packages/py-pyprecice/package.py. You can get checksum for any released version by running `spack checksum py-pyprecice`. From 74a5dbfad53a25b33bb37791fa1920464e246053 Mon Sep 17 00:00:00 2001 From: BenjaminRodenberg Date: Wed, 3 Mar 2021 21:08:14 +0100 Subject: [PATCH 27/77] Remove hotfix from this repository. https://github.com/spack/spack/issues/22058 --- spack/repo/packages/precice/package.py | 157 ------------------------- 1 file changed, 157 deletions(-) delete mode 100644 spack/repo/packages/precice/package.py diff --git a/spack/repo/packages/precice/package.py b/spack/repo/packages/precice/package.py deleted file mode 100644 index 037d7b93..00000000 --- a/spack/repo/packages/precice/package.py +++ /dev/null @@ -1,157 +0,0 @@ -# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other -# Spack Project Developers. See the top-level COPYRIGHT file for details. -# -# SPDX-License-Identifier: (Apache-2.0 OR MIT) - -from spack import * - - -class Precice(CMakePackage): - """preCICE (Precise Code Interaction Coupling Environment) is a - coupling library for partitioned multi-physics simulations. - Partitioned means that preCICE couples existing programs (solvers) - capable of simulating a subpart of the complete physics involved in - a simulation.""" - - homepage = 'https://www.precice.org' - git = 'https://github.com/precice/precice.git' - url = 'https://github.com/precice/precice/archive/v1.2.0.tar.gz' - maintainers = ['fsimonis', 'MakisH'] - - version('develop', branch='develop') - version('2.2.0', sha256='f8c4e0810dcaeb6a40a0fcab64b95c899f0121c968e0730416d4d2a97d39d0c4') - version('2.1.1', sha256='729b7c24a7a61b3953bb70d96a954ad3a85729a29a35a288b59ba25661117064') - version('2.1.0', sha256='1e6432724f70d0c6c05fdd645e0026754edbc547719a35bf1d3c12a779b1d00e') - version('2.0.2', sha256='72864480f32696e7b6da94fd404ef5cd6586e2e1640613e46b75f1afac8569ed') - version('2.0.1', sha256='e4fe2d2063042761ab325f8c802f88ae088c90862af288ad1a642967d074bd50') - version('2.0.0', sha256='c8979d366f06e35626a8da08a1c589df77ec13972eb524a1ba99a011e245701f') - version('1.6.1', sha256='7d0c54faa2c69e52304f36608d93c408629868f16f3201f663a0f9b2008f0763') - version('1.6.0', sha256='c3b16376fda9eb3449adb6cc3c1e267c3dc792a5d118e37d93a32a59b5a4bc6f') - version('1.5.2', sha256='051e0d7655a91f8681901e5c92812e48f33a5779309e2f104c99f5a687e1a418') - version('1.5.1', sha256='fbe151f1a9accf9154362c70d15254935d4f594d189982c3a99fdb3dd9d9e665') - version('1.5.0', sha256='a2a794becd08717e3049252134ae35692fed71966ed32e22cca796a169c16c3e') - version('1.4.1', sha256='dde4882edde17882340f9f601941d110d5976340bd71af54c6e6ea22ae56f1a5') - version('1.4.0', sha256='3499bfc0941fb9f004d5e32eb63d64f93e17b4057fab3ada1cde40c8311bd466') - version('1.3.0', sha256='610322ba1b03df8e8f7d060d57a6a5afeabd5db4e8c4a638d04ba4060a3aec96') - version('1.2.0', sha256='0784ecd002092949835151b90393beb6e9e7a3e9bd78ffd40d18302d6da4b05b') - # Skip version 1.1.1 entirely, the cmake was lacking install. - - variant('mpi', default=True, description='Enable MPI support') - variant('petsc', default=True, description='Enable PETSc support') - variant('python', default=False, description='Enable Python support') - variant('shared', default=True, description='Build shared libraries') - - depends_on('cmake@3.5:', type='build') - depends_on('cmake@3.10.2:', type='build', when='@1.4:') - depends_on('pkgconfig', type='build', when='@2.2:') - depends_on('boost@1.60.0:') - depends_on('boost@1.65.1:', when='@1.4:') - depends_on('boost@:1.72.99', when='@:2.0.2') - depends_on('boost@:1.74.99', when='@:2.1.1') - depends_on('eigen@3.2:') - depends_on('eigen@:3.3.7', type='build', when='@:1.5') # bug in prettyprint - depends_on('libxml2') - depends_on('mpi', when='+mpi') - depends_on('petsc@3.6:', when='+petsc') - depends_on('petsc@3.12:', when='+petsc@2.1.0:') - - # Python 3 support was added in version 2.0 - depends_on('python@2.7:2.8', when='@:1.9+python', type=('build', 'run')) - depends_on('python@3:', when='@2:+python', type=('build', 'run')) - - # numpy 1.17+ requires Python 3 - depends_on('py-numpy@:1.16', when='@:1.9+python', type=('build', 'run')) - depends_on('py-numpy@1.17:', when='@2:+python', type=('build', 'run')) - - # We require C++14 compiler support - conflicts('%gcc@:4') - conflicts('%apple-clang@:5') - conflicts('%clang@:3.7') - conflicts('%intel@:16') - conflicts('%pgi@:17.3') - - def cmake_args(self): - """Populate cmake arguments for precice.""" - spec = self.spec - - # The xSDK installation policies were implemented after 1.5.2 - xsdk_mode = spec.satisfies("@1.6:") - - # Select the correct CMake variables by version - mpi_option = "MPI" - if spec.satisfies("@2:"): - mpi_option = "PRECICE_MPICommunication" - petsc_option = "PETSC" - if spec.satisfies("@2:"): - petsc_option = "PRECICE_PETScMapping" - python_option = "PYTHON" - if spec.satisfies("@2:"): - python_option = "PRECICE_PythonActions" - - def variant_bool(feature, on='ON', off='OFF'): - """Ternary for spec variant to ON/OFF string""" - if feature in spec: - return on - return off - - cmake_args = [ - '-DBUILD_SHARED_LIBS:BOOL=%s' % variant_bool('+shared'), - ] - - cmake_args.append('-D%s:BOOL=%s' % (mpi_option, variant_bool('+mpi'))) - - # Boost - if xsdk_mode: - cmake_args.append('-DTPL_ENABLE_BOOST=ON') - cmake_args.append('-DBOOST_ROOT=%s' % spec['boost'].prefix) - - # Eigen3 - if xsdk_mode: - cmake_args.append('-DTPL_ENABLE_EIGEN3=ON') - cmake_args.append( - '-DEIGEN3_INCLUDE_DIR=%s' % spec['eigen'].headers.directories[0]) - - # LibXML2 - if xsdk_mode: - cmake_args.append('-DTPL_ENABLE_LIBXML2=ON') - libxml2_includes = spec['libxml2'].headers.directories[0] - cmake_args.extend([ - '-DLIBXML2_INCLUDE_DIRS=%s' % libxml2_includes, - '-DLIBXML2_LIBRARIES=%s' % spec['libxml2'].libs[0], - ]) - - # PETSc - if '+petsc' in spec: - if xsdk_mode: - cmake_args.append('-DTPL_ENABLE_PETSC:BOOL=ON') - else: - cmake_args.append('-D%s:BOOL=ON' % petsc_option) - cmake_args.extend([ - '-DPETSC_DIR=%s' % spec['petsc'].prefix, - '-DPETSC_ARCH=.' - ]) - else: - cmake_args.append('-D%s:BOOL=OFF' % petsc_option) - - # Python - if '+python' in spec: - python_library = spec['python'].libs[0] - python_include = spec['python'].headers.directories[0] - numpy_include = join_path( - spec['py-numpy'].prefix, - spec['python'].package.site_packages_dir, - 'numpy', 'core', 'include') - if xsdk_mode: - cmake_args.append('-DTPL_ENABLE_PYTHON:BOOL=ON') - else: - cmake_args.append('-D%s:BOOL=ON' % python_option) - cmake_args.extend([ - '-DPYTHON_INCLUDE_DIR=%s' % python_include, - '-DNumPy_INCLUDE_DIR=%s' % numpy_include, - '-DPYTHON_LIBRARY=%s' % python_library - ]) - else: - cmake_args.append('-D%s:BOOL=OFF' % python_option) - - return cmake_args - From 1fc84e4b0b215fe1b5fd4955b8595f5e81bc4cc3 Mon Sep 17 00:00:00 2001 From: BenjaminRodenberg Date: Wed, 3 Mar 2021 23:16:28 +0100 Subject: [PATCH 28/77] Add base environment using external dependencies. --- .github/workflows/build-env.yml | 21 +++++++++++++ ...ck-pyprecice-external-deps-1804.dockerfile | 31 +++++++++++++++++++ spack/spack-external.yaml | 14 +++++++++ 3 files changed, 66 insertions(+) create mode 100644 spack/ci-spack-pyprecice-external-deps-1804.dockerfile create mode 100644 spack/spack-external.yaml diff --git a/.github/workflows/build-env.yml b/.github/workflows/build-env.yml index 273d90f0..7894843f 100644 --- a/.github/workflows/build-env.yml +++ b/.github/workflows/build-env.yml @@ -4,6 +4,7 @@ on: workflow_dispatch: # Trigger by hand from the UI schedule: - cron: '0 0 * * 0' # Schedule it every Sunday + push: jobs: build-spack-pyprecice-deps: @@ -26,3 +27,23 @@ jobs: context: . file: spack/ci-spack-pyprecice-deps-1804.dockerfile tags: precice/ci-spack-pyprecice-deps-1804 + build-spack-pyprecice-external-deps: + name: Builds the baseimage for spack using external dependencies + runs-on: ubuntu-latest + steps: + - name: Checkout Repository + uses: actions/checkout@v2 + - name: Set up Docker + uses: docker/setup-buildx-action@v1 + - name: Login to registry + uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + - name: Build and push + uses: docker/build-push-action@v2 + with: + push: true + context: . + file: spack/ci-spack-pyprecice-external-deps-1804.dockerfile + tags: precice/ci-spack-pyprecice-external-deps-1804 diff --git a/spack/ci-spack-pyprecice-external-deps-1804.dockerfile b/spack/ci-spack-pyprecice-external-deps-1804.dockerfile new file mode 100644 index 00000000..aa65b08f --- /dev/null +++ b/spack/ci-spack-pyprecice-external-deps-1804.dockerfile @@ -0,0 +1,31 @@ +# Build stage with Spack pre-installed and ready to be used +FROM spack/ubuntu-bionic:latest +WORKDIR /sources + +# Installing necessary dependacies for preCICE, boost 1.65 from apt-get +RUN apt-get -qq update && apt-get -qq install \ + build-essential \ + locales \ + libopenmpi-dev \ + libopenblas-dev \ + zlib \ + libncurses-dev \ + libeigen3-dev \ + libxml2-dev \ + git \ + python3-numpy \ + python3-dev \ + petsc-dev \ + wget \ + bzip2 \ + cmake && \ + rm -rf /var/lib/apt/lists/* + +# Mount the current sources into the build container +# and build the default environment +ADD . /sources +RUN spack --color=always env create --without-view ci /sources/spack/spack-external.yaml && \ + spack --color=always -e ci repo add /sources/spack/repo && \ + spack --color=always -e ci external find && \ + spack --color=always -e ci install --fail-fast --only=dependencies && \ + spack --color=always clean -a diff --git a/spack/spack-external.yaml b/spack/spack-external.yaml new file mode 100644 index 00000000..fa1eae56 --- /dev/null +++ b/spack/spack-external.yaml @@ -0,0 +1,14 @@ +spack: + specs: + - py-pyprecice@develop + packages: + all: + target: [x86_64] + openmpi: + buildable: False + openblas: + buildable: False + libxml2: + buildable: False + python: + buildable: False From 7905f1fa4ee537e008c9cfe35e9f2f5c5e3bb84b Mon Sep 17 00:00:00 2001 From: BenjaminRodenberg Date: Wed, 3 Mar 2021 23:26:24 +0100 Subject: [PATCH 29/77] Don't install anything with apt-get. Only use dependencies coming with the system. --- ...ck-pyprecice-external-deps-1804.dockerfile | 19 ------------------- spack/spack-external.yaml | 2 -- 2 files changed, 21 deletions(-) diff --git a/spack/ci-spack-pyprecice-external-deps-1804.dockerfile b/spack/ci-spack-pyprecice-external-deps-1804.dockerfile index aa65b08f..6f9adee5 100644 --- a/spack/ci-spack-pyprecice-external-deps-1804.dockerfile +++ b/spack/ci-spack-pyprecice-external-deps-1804.dockerfile @@ -2,25 +2,6 @@ FROM spack/ubuntu-bionic:latest WORKDIR /sources -# Installing necessary dependacies for preCICE, boost 1.65 from apt-get -RUN apt-get -qq update && apt-get -qq install \ - build-essential \ - locales \ - libopenmpi-dev \ - libopenblas-dev \ - zlib \ - libncurses-dev \ - libeigen3-dev \ - libxml2-dev \ - git \ - python3-numpy \ - python3-dev \ - petsc-dev \ - wget \ - bzip2 \ - cmake && \ - rm -rf /var/lib/apt/lists/* - # Mount the current sources into the build container # and build the default environment ADD . /sources diff --git a/spack/spack-external.yaml b/spack/spack-external.yaml index fa1eae56..4c9ce858 100644 --- a/spack/spack-external.yaml +++ b/spack/spack-external.yaml @@ -8,7 +8,5 @@ spack: buildable: False openblas: buildable: False - libxml2: - buildable: False python: buildable: False From dc2772d64ff1419f7b03ebbd8828b7cdc4b65639 Mon Sep 17 00:00:00 2001 From: BenjaminRodenberg Date: Wed, 3 Mar 2021 23:40:32 +0100 Subject: [PATCH 30/77] Debugging. --- spack/ci-spack-pyprecice-external-deps-1804.dockerfile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/spack/ci-spack-pyprecice-external-deps-1804.dockerfile b/spack/ci-spack-pyprecice-external-deps-1804.dockerfile index 6f9adee5..5db14e1d 100644 --- a/spack/ci-spack-pyprecice-external-deps-1804.dockerfile +++ b/spack/ci-spack-pyprecice-external-deps-1804.dockerfile @@ -6,7 +6,7 @@ WORKDIR /sources # and build the default environment ADD . /sources RUN spack --color=always env create --without-view ci /sources/spack/spack-external.yaml && \ - spack --color=always -e ci repo add /sources/spack/repo && \ - spack --color=always -e ci external find && \ - spack --color=always -e ci install --fail-fast --only=dependencies && \ - spack --color=always clean -a +RUN spack --color=always -e ci repo add /sources/spack/repo && \ +RUN spack --color=always -e ci external find && \ +RUN spack --color=always -e ci install --fail-fast --only=dependencies && \ +RUN spack --color=always clean -a From a6fdce9de09367409ff8e2d732d09c3d4da2ae22 Mon Sep 17 00:00:00 2001 From: BenjaminRodenberg Date: Wed, 3 Mar 2021 23:42:18 +0100 Subject: [PATCH 31/77] Debugging. --- spack/ci-spack-pyprecice-external-deps-1804.dockerfile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/spack/ci-spack-pyprecice-external-deps-1804.dockerfile b/spack/ci-spack-pyprecice-external-deps-1804.dockerfile index 5db14e1d..c078cf1b 100644 --- a/spack/ci-spack-pyprecice-external-deps-1804.dockerfile +++ b/spack/ci-spack-pyprecice-external-deps-1804.dockerfile @@ -5,8 +5,8 @@ WORKDIR /sources # Mount the current sources into the build container # and build the default environment ADD . /sources -RUN spack --color=always env create --without-view ci /sources/spack/spack-external.yaml && \ -RUN spack --color=always -e ci repo add /sources/spack/repo && \ -RUN spack --color=always -e ci external find && \ -RUN spack --color=always -e ci install --fail-fast --only=dependencies && \ +RUN spack --color=always env create --without-view ci /sources/spack/spack-external.yaml +RUN spack --color=always -e ci repo add /sources/spack/repo +RUN spack --color=always -e ci external find +RUN spack --color=always -e ci install --fail-fast --only=dependencies RUN spack --color=always clean -a From bf1da8f92c9e9d886627f71fe48537daa0223fce Mon Sep 17 00:00:00 2001 From: BenjaminRodenberg Date: Wed, 3 Mar 2021 23:56:52 +0100 Subject: [PATCH 32/77] Try with manual specification of external deps. --- spack/ci-spack-pyprecice-external-deps-1804.dockerfile | 1 - spack/spack-external.yaml | 7 +++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/spack/ci-spack-pyprecice-external-deps-1804.dockerfile b/spack/ci-spack-pyprecice-external-deps-1804.dockerfile index c078cf1b..e35b876b 100644 --- a/spack/ci-spack-pyprecice-external-deps-1804.dockerfile +++ b/spack/ci-spack-pyprecice-external-deps-1804.dockerfile @@ -7,6 +7,5 @@ WORKDIR /sources ADD . /sources RUN spack --color=always env create --without-view ci /sources/spack/spack-external.yaml RUN spack --color=always -e ci repo add /sources/spack/repo -RUN spack --color=always -e ci external find RUN spack --color=always -e ci install --fail-fast --only=dependencies RUN spack --color=always clean -a diff --git a/spack/spack-external.yaml b/spack/spack-external.yaml index 4c9ce858..bd3def3a 100644 --- a/spack/spack-external.yaml +++ b/spack/spack-external.yaml @@ -4,9 +4,8 @@ spack: packages: all: target: [x86_64] - openmpi: - buildable: False - openblas: - buildable: False python: + externals: + - spec: python@3.6.9+bz2+ctypes+dbm+lzma+nis+pyexpat+readline+sqlite3+ssl~tix~tkinter+uuid+zlib + prefix: /usr buildable: False From 15425c734c649ef202279de61f5175b08bf16376 Mon Sep 17 00:00:00 2001 From: BenjaminRodenberg Date: Thu, 4 Mar 2021 00:04:17 +0100 Subject: [PATCH 33/77] Don't use externals --- spack/spack-external.yaml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/spack/spack-external.yaml b/spack/spack-external.yaml index bd3def3a..24a2897f 100644 --- a/spack/spack-external.yaml +++ b/spack/spack-external.yaml @@ -4,8 +4,3 @@ spack: packages: all: target: [x86_64] - python: - externals: - - spec: python@3.6.9+bz2+ctypes+dbm+lzma+nis+pyexpat+readline+sqlite3+ssl~tix~tkinter+uuid+zlib - prefix: /usr - buildable: False From c8eca35e474115ccaae2fbbfed85d60e890ad4be Mon Sep 17 00:00:00 2001 From: BenjaminRodenberg Date: Thu, 4 Mar 2021 00:13:44 +0100 Subject: [PATCH 34/77] Try a different approch. --- spack/ci-spack-pyprecice-external-deps-1804.dockerfile | 3 ++- spack/spack-external.yaml | 6 ------ 2 files changed, 2 insertions(+), 7 deletions(-) delete mode 100644 spack/spack-external.yaml diff --git a/spack/ci-spack-pyprecice-external-deps-1804.dockerfile b/spack/ci-spack-pyprecice-external-deps-1804.dockerfile index e35b876b..2a0b1e94 100644 --- a/spack/ci-spack-pyprecice-external-deps-1804.dockerfile +++ b/spack/ci-spack-pyprecice-external-deps-1804.dockerfile @@ -5,7 +5,8 @@ WORKDIR /sources # Mount the current sources into the build container # and build the default environment ADD . /sources -RUN spack --color=always env create --without-view ci /sources/spack/spack-external.yaml +RUN spack --color=always env create --without-view ci /sources/spack/spack.yaml RUN spack --color=always -e ci repo add /sources/spack/repo +RUN spack external find --scope user --not-buildable RUN spack --color=always -e ci install --fail-fast --only=dependencies RUN spack --color=always clean -a diff --git a/spack/spack-external.yaml b/spack/spack-external.yaml deleted file mode 100644 index 24a2897f..00000000 --- a/spack/spack-external.yaml +++ /dev/null @@ -1,6 +0,0 @@ -spack: - specs: - - py-pyprecice@develop - packages: - all: - target: [x86_64] From 1f7d09c61fe2e154a85aa1f82b7bfd0043306b7d Mon Sep 17 00:00:00 2001 From: BenjaminRodenberg Date: Thu, 4 Mar 2021 00:17:06 +0100 Subject: [PATCH 35/77] Change order. --- spack/ci-spack-pyprecice-external-deps-1804.dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spack/ci-spack-pyprecice-external-deps-1804.dockerfile b/spack/ci-spack-pyprecice-external-deps-1804.dockerfile index 2a0b1e94..6b459875 100644 --- a/spack/ci-spack-pyprecice-external-deps-1804.dockerfile +++ b/spack/ci-spack-pyprecice-external-deps-1804.dockerfile @@ -5,8 +5,8 @@ WORKDIR /sources # Mount the current sources into the build container # and build the default environment ADD . /sources +RUN spack --color=always external find --scope user --not-buildable RUN spack --color=always env create --without-view ci /sources/spack/spack.yaml RUN spack --color=always -e ci repo add /sources/spack/repo -RUN spack external find --scope user --not-buildable RUN spack --color=always -e ci install --fail-fast --only=dependencies RUN spack --color=always clean -a From bc37fc82e7f2c17662d0e7ac7c307df1297e6238 Mon Sep 17 00:00:00 2001 From: BenjaminRodenberg Date: Thu, 4 Mar 2021 00:23:36 +0100 Subject: [PATCH 36/77] Try different approch. --- .github/workflows/build-env.yml | 4 ++-- .../ci-spack-pyprecice-external-deps-1804.dockerfile | 12 ------------ 2 files changed, 2 insertions(+), 14 deletions(-) delete mode 100644 spack/ci-spack-pyprecice-external-deps-1804.dockerfile diff --git a/.github/workflows/build-env.yml b/.github/workflows/build-env.yml index 7894843f..e81dc946 100644 --- a/.github/workflows/build-env.yml +++ b/.github/workflows/build-env.yml @@ -45,5 +45,5 @@ jobs: with: push: true context: . - file: spack/ci-spack-pyprecice-external-deps-1804.dockerfile - tags: precice/ci-spack-pyprecice-external-deps-1804 + file: spack/ci-spack-pyprecice-external-deps-2004.dockerfile + tags: precice/ci-spack-pyprecice-external-deps-2004 diff --git a/spack/ci-spack-pyprecice-external-deps-1804.dockerfile b/spack/ci-spack-pyprecice-external-deps-1804.dockerfile deleted file mode 100644 index 6b459875..00000000 --- a/spack/ci-spack-pyprecice-external-deps-1804.dockerfile +++ /dev/null @@ -1,12 +0,0 @@ -# Build stage with Spack pre-installed and ready to be used -FROM spack/ubuntu-bionic:latest -WORKDIR /sources - -# Mount the current sources into the build container -# and build the default environment -ADD . /sources -RUN spack --color=always external find --scope user --not-buildable -RUN spack --color=always env create --without-view ci /sources/spack/spack.yaml -RUN spack --color=always -e ci repo add /sources/spack/repo -RUN spack --color=always -e ci install --fail-fast --only=dependencies -RUN spack --color=always clean -a From e2d7f312427a950936f2b43aed2cd73347aa55ad Mon Sep 17 00:00:00 2001 From: BenjaminRodenberg Date: Thu, 4 Mar 2021 00:25:25 +0100 Subject: [PATCH 37/77] Add missing file. --- ...ck-pyprecice-external-deps-2004.dockerfile | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 spack/ci-spack-pyprecice-external-deps-2004.dockerfile diff --git a/spack/ci-spack-pyprecice-external-deps-2004.dockerfile b/spack/ci-spack-pyprecice-external-deps-2004.dockerfile new file mode 100644 index 00000000..ff48b6b1 --- /dev/null +++ b/spack/ci-spack-pyprecice-external-deps-2004.dockerfile @@ -0,0 +1,32 @@ +# Build stage with Spack pre-installed and ready to be used +FROM ubuntu:20.04 + +# Installing necessary dependencies for preCICE, boost 1.71 from apt-get +RUN apt-get -qq update && apt-get -qq install \ + build-essential \ + locales \ + libboost-all-dev \ + libeigen3-dev \ + libxml2-dev \ + git \ + python3-numpy \ + python3-dev \ + petsc-dev \ + wget \ + bzip2 \ + cmake && \ + rm -rf /var/lib/apt/lists/* + +RUN git clone https://github.com/spack/spack.git +RUN source spack/share/spack/setup-env.sh + +WORKDIR /sources + +# Mount the current sources into the build container +# and build the default environment +ADD . /sources +RUN spack --color=always external find --scope user --not-buildable +RUN spack --color=always env create --without-view ci /sources/spack/spack.yaml +RUN spack --color=always -e ci repo add /sources/spack/repo +RUN spack --color=always -e ci install --fail-fast --only=dependencies +RUN spack --color=always clean -a From c34749f8e36295ab330fa2b4e5b85786a929eda4 Mon Sep 17 00:00:00 2001 From: BenjaminRodenberg Date: Thu, 4 Mar 2021 00:34:23 +0100 Subject: [PATCH 38/77] Fix. --- spack/ci-spack-pyprecice-external-deps-2004.dockerfile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/spack/ci-spack-pyprecice-external-deps-2004.dockerfile b/spack/ci-spack-pyprecice-external-deps-2004.dockerfile index ff48b6b1..994d8402 100644 --- a/spack/ci-spack-pyprecice-external-deps-2004.dockerfile +++ b/spack/ci-spack-pyprecice-external-deps-2004.dockerfile @@ -1,6 +1,9 @@ # Build stage with Spack pre-installed and ready to be used FROM ubuntu:20.04 +ARG DEBIAN_FRONTEND=noninteractive +# this is necessary to avoid timeouts during installation due to interactive installs + # Installing necessary dependencies for preCICE, boost 1.71 from apt-get RUN apt-get -qq update && apt-get -qq install \ build-essential \ From 52cfb824a3a90ab6f56a345ed4f31f3bebf93644 Mon Sep 17 00:00:00 2001 From: BenjaminRodenberg Date: Thu, 4 Mar 2021 00:39:51 +0100 Subject: [PATCH 39/77] Use . instead of source. --- spack/ci-spack-pyprecice-external-deps-2004.dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spack/ci-spack-pyprecice-external-deps-2004.dockerfile b/spack/ci-spack-pyprecice-external-deps-2004.dockerfile index 994d8402..a8aad0be 100644 --- a/spack/ci-spack-pyprecice-external-deps-2004.dockerfile +++ b/spack/ci-spack-pyprecice-external-deps-2004.dockerfile @@ -21,7 +21,7 @@ RUN apt-get -qq update && apt-get -qq install \ rm -rf /var/lib/apt/lists/* RUN git clone https://github.com/spack/spack.git -RUN source spack/share/spack/setup-env.sh +RUN . spack/share/spack/setup-env.sh WORKDIR /sources From b43cd185b6bf8e4057f3edef757e6b9fafdacf35 Mon Sep 17 00:00:00 2001 From: BenjaminRodenberg Date: Thu, 4 Mar 2021 00:44:03 +0100 Subject: [PATCH 40/77] Another try. --- spack/ci-spack-pyprecice-external-deps-2004.dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spack/ci-spack-pyprecice-external-deps-2004.dockerfile b/spack/ci-spack-pyprecice-external-deps-2004.dockerfile index a8aad0be..8a9fb2a2 100644 --- a/spack/ci-spack-pyprecice-external-deps-2004.dockerfile +++ b/spack/ci-spack-pyprecice-external-deps-2004.dockerfile @@ -21,7 +21,7 @@ RUN apt-get -qq update && apt-get -qq install \ rm -rf /var/lib/apt/lists/* RUN git clone https://github.com/spack/spack.git -RUN . spack/share/spack/setup-env.sh +RUN /bin/sh spack/share/spack/setup-env.sh WORKDIR /sources From a474ae1c26ff876ad790384d9441dbeeb7fcb5f8 Mon Sep 17 00:00:00 2001 From: BenjaminRodenberg Date: Thu, 4 Mar 2021 17:31:02 +0100 Subject: [PATCH 41/77] Testrun --- ...i-spack-pyprecice-external-deps-2004.dockerfile | 14 +++++++------- spack/spack.yaml | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/spack/ci-spack-pyprecice-external-deps-2004.dockerfile b/spack/ci-spack-pyprecice-external-deps-2004.dockerfile index 8a9fb2a2..2cf6e235 100644 --- a/spack/ci-spack-pyprecice-external-deps-2004.dockerfile +++ b/spack/ci-spack-pyprecice-external-deps-2004.dockerfile @@ -6,6 +6,7 @@ ARG DEBIAN_FRONTEND=noninteractive # Installing necessary dependencies for preCICE, boost 1.71 from apt-get RUN apt-get -qq update && apt-get -qq install \ + curl \ build-essential \ locales \ libboost-all-dev \ @@ -21,15 +22,14 @@ RUN apt-get -qq update && apt-get -qq install \ rm -rf /var/lib/apt/lists/* RUN git clone https://github.com/spack/spack.git -RUN /bin/sh spack/share/spack/setup-env.sh WORKDIR /sources +ADD . /sources # Mount the current sources into the build container # and build the default environment -ADD . /sources -RUN spack --color=always external find --scope user --not-buildable -RUN spack --color=always env create --without-view ci /sources/spack/spack.yaml -RUN spack --color=always -e ci repo add /sources/spack/repo -RUN spack --color=always -e ci install --fail-fast --only=dependencies -RUN spack --color=always clean -a +RUN /spack/bin/spack --color=always external find --not-buildable +RUN /spack/bin/spack --color=always env create --without-view ci /sources/spack/spack.yaml +RUN /spack/bin/spack --color=always -e ci repo add /sources/spack/repo +RUN /spack/bin/spack --color=always -e ci install --fail-fast --only=dependencies +RUN /spack/bin/spack --color=always clean -a diff --git a/spack/spack.yaml b/spack/spack.yaml index 24a2897f..d4253704 100644 --- a/spack/spack.yaml +++ b/spack/spack.yaml @@ -1,6 +1,6 @@ spack: specs: - - py-pyprecice@develop + - py-pyprecice@develop%gcc@9.3.0 packages: all: target: [x86_64] From 454a3428c40e8bc433f9584d5c58e82b8116b3f5 Mon Sep 17 00:00:00 2001 From: BenjaminRodenberg Date: Thu, 4 Mar 2021 17:40:46 +0100 Subject: [PATCH 42/77] Define spec in dockerfile. --- spack/ci-spack-pyprecice-deps-1804.dockerfile | 3 ++- spack/ci-spack-pyprecice-external-deps-2004.dockerfile | 3 ++- spack/spack.yaml | 6 ------ 3 files changed, 4 insertions(+), 8 deletions(-) delete mode 100644 spack/spack.yaml diff --git a/spack/ci-spack-pyprecice-deps-1804.dockerfile b/spack/ci-spack-pyprecice-deps-1804.dockerfile index 8aa18c09..154e8c2b 100644 --- a/spack/ci-spack-pyprecice-deps-1804.dockerfile +++ b/spack/ci-spack-pyprecice-deps-1804.dockerfile @@ -4,7 +4,8 @@ WORKDIR /sources # Mount the current sources into the build container # and build the default environment ADD . /sources -RUN spack --color=always env create --without-view ci /sources/spack/spack.yaml && \ +RUN spack --color=always env create --without-view ci && \ + spack --color=always -e ci spec py-pyprecice@develop && \ spack --color=always -e ci repo add /sources/spack/repo && \ spack --color=always -e ci install --fail-fast --only=dependencies && \ spack --color=always clean -a diff --git a/spack/ci-spack-pyprecice-external-deps-2004.dockerfile b/spack/ci-spack-pyprecice-external-deps-2004.dockerfile index 2cf6e235..4c1d114e 100644 --- a/spack/ci-spack-pyprecice-external-deps-2004.dockerfile +++ b/spack/ci-spack-pyprecice-external-deps-2004.dockerfile @@ -29,7 +29,8 @@ ADD . /sources # Mount the current sources into the build container # and build the default environment RUN /spack/bin/spack --color=always external find --not-buildable -RUN /spack/bin/spack --color=always env create --without-view ci /sources/spack/spack.yaml +RUN /spack/bin/spack --color=always env create --without-view ci +RUN /spack/bin/spack --color=always -e spec py-pyprecice@develop%gcc@9.3.0 RUN /spack/bin/spack --color=always -e ci repo add /sources/spack/repo RUN /spack/bin/spack --color=always -e ci install --fail-fast --only=dependencies RUN /spack/bin/spack --color=always clean -a diff --git a/spack/spack.yaml b/spack/spack.yaml deleted file mode 100644 index d4253704..00000000 --- a/spack/spack.yaml +++ /dev/null @@ -1,6 +0,0 @@ -spack: - specs: - - py-pyprecice@develop%gcc@9.3.0 - packages: - all: - target: [x86_64] From 4624e7dd3da9516603a33d697ba6bd310b363ffb Mon Sep 17 00:00:00 2001 From: BenjaminRodenberg Date: Thu, 4 Mar 2021 17:45:07 +0100 Subject: [PATCH 43/77] Use add, not spec. --- spack/ci-spack-pyprecice-deps-1804.dockerfile | 2 +- spack/ci-spack-pyprecice-external-deps-2004.dockerfile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/spack/ci-spack-pyprecice-deps-1804.dockerfile b/spack/ci-spack-pyprecice-deps-1804.dockerfile index 154e8c2b..0d348f51 100644 --- a/spack/ci-spack-pyprecice-deps-1804.dockerfile +++ b/spack/ci-spack-pyprecice-deps-1804.dockerfile @@ -5,7 +5,7 @@ WORKDIR /sources # and build the default environment ADD . /sources RUN spack --color=always env create --without-view ci && \ - spack --color=always -e ci spec py-pyprecice@develop && \ + spack --color=always -e ci add py-pyprecice@develop && \ spack --color=always -e ci repo add /sources/spack/repo && \ spack --color=always -e ci install --fail-fast --only=dependencies && \ spack --color=always clean -a diff --git a/spack/ci-spack-pyprecice-external-deps-2004.dockerfile b/spack/ci-spack-pyprecice-external-deps-2004.dockerfile index 4c1d114e..4d4c0350 100644 --- a/spack/ci-spack-pyprecice-external-deps-2004.dockerfile +++ b/spack/ci-spack-pyprecice-external-deps-2004.dockerfile @@ -30,7 +30,7 @@ ADD . /sources # and build the default environment RUN /spack/bin/spack --color=always external find --not-buildable RUN /spack/bin/spack --color=always env create --without-view ci -RUN /spack/bin/spack --color=always -e spec py-pyprecice@develop%gcc@9.3.0 +RUN /spack/bin/spack --color=always -e add py-pyprecice@develop%gcc@9.3.0 RUN /spack/bin/spack --color=always -e ci repo add /sources/spack/repo RUN /spack/bin/spack --color=always -e ci install --fail-fast --only=dependencies RUN /spack/bin/spack --color=always clean -a From e3371fd5b947eeb8ef025cc8796798c8c50a2f22 Mon Sep 17 00:00:00 2001 From: BenjaminRodenberg Date: Thu, 4 Mar 2021 17:47:46 +0100 Subject: [PATCH 44/77] Remove spack.yaml. --- spack/ci-spack-pyprecice-deps-1804.dockerfile | 3 ++- spack/spack.yaml | 6 ------ 2 files changed, 2 insertions(+), 7 deletions(-) delete mode 100644 spack/spack.yaml diff --git a/spack/ci-spack-pyprecice-deps-1804.dockerfile b/spack/ci-spack-pyprecice-deps-1804.dockerfile index 8aa18c09..0d348f51 100644 --- a/spack/ci-spack-pyprecice-deps-1804.dockerfile +++ b/spack/ci-spack-pyprecice-deps-1804.dockerfile @@ -4,7 +4,8 @@ WORKDIR /sources # Mount the current sources into the build container # and build the default environment ADD . /sources -RUN spack --color=always env create --without-view ci /sources/spack/spack.yaml && \ +RUN spack --color=always env create --without-view ci && \ + spack --color=always -e ci add py-pyprecice@develop && \ spack --color=always -e ci repo add /sources/spack/repo && \ spack --color=always -e ci install --fail-fast --only=dependencies && \ spack --color=always clean -a diff --git a/spack/spack.yaml b/spack/spack.yaml deleted file mode 100644 index 24a2897f..00000000 --- a/spack/spack.yaml +++ /dev/null @@ -1,6 +0,0 @@ -spack: - specs: - - py-pyprecice@develop - packages: - all: - target: [x86_64] From bad16b05f93929a702536e76227b8e5698b61f80 Mon Sep 17 00:00:00 2001 From: BenjaminRodenberg Date: Thu, 4 Mar 2021 17:51:45 +0100 Subject: [PATCH 45/77] Only add repo, not all sources. --- .github/workflows/build-spack.yml | 4 ++-- spack/ci-spack-pyprecice-deps-1804.dockerfile | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-spack.yml b/.github/workflows/build-spack.yml index 7c784ae4..ca22dc72 100644 --- a/.github/workflows/build-spack.yml +++ b/.github/workflows/build-spack.yml @@ -18,8 +18,8 @@ jobs: uses: actions/checkout@v2 - name: Move Package Script run: | - cp spack/repo/packages/py-pyprecice/package.py /sources/spack/repo/packages/py-pyprecice/ - cp spack/repo/packages/py-pyprecice/*.patch /sources/spack/repo/packages/py-pyprecice/ + cp spack/repo/packages/py-pyprecice/package.py /py-pyprecice-repo/packages/py-pyprecice/ + cp spack/repo/packages/py-pyprecice/*.patch /py-pyprecice-repo/packages/py-pyprecice/ - name: Try to build py-pyprecice with spack and test it run: | . /opt/spack/share/spack/setup-env.sh && spack env activate ci && spack dev-build py-pyprecice@develop && spack load precice py-numpy py-mpi4py py-wheel py-cython openssh openmpi && mkdir runner && cd runner && python3 -c "import precice; print(precice.__version__)" diff --git a/spack/ci-spack-pyprecice-deps-1804.dockerfile b/spack/ci-spack-pyprecice-deps-1804.dockerfile index 0d348f51..4a7a07bb 100644 --- a/spack/ci-spack-pyprecice-deps-1804.dockerfile +++ b/spack/ci-spack-pyprecice-deps-1804.dockerfile @@ -3,9 +3,9 @@ FROM spack/ubuntu-bionic:latest WORKDIR /sources # Mount the current sources into the build container # and build the default environment -ADD . /sources +ADD ./spack/repo /py-pyprecice-repo RUN spack --color=always env create --without-view ci && \ spack --color=always -e ci add py-pyprecice@develop && \ - spack --color=always -e ci repo add /sources/spack/repo && \ + spack --color=always -e ci repo add /py-pyprecice-repo && \ spack --color=always -e ci install --fail-fast --only=dependencies && \ spack --color=always clean -a From 15ef302d5cb727e142002605bc9a5ff64c41fc3e Mon Sep 17 00:00:00 2001 From: BenjaminRodenberg Date: Thu, 4 Mar 2021 17:58:33 +0100 Subject: [PATCH 46/77] Fix dockerfile. --- spack/ci-spack-pyprecice-external-deps-2004.dockerfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/spack/ci-spack-pyprecice-external-deps-2004.dockerfile b/spack/ci-spack-pyprecice-external-deps-2004.dockerfile index 4d4c0350..3006a2d7 100644 --- a/spack/ci-spack-pyprecice-external-deps-2004.dockerfile +++ b/spack/ci-spack-pyprecice-external-deps-2004.dockerfile @@ -24,13 +24,13 @@ RUN apt-get -qq update && apt-get -qq install \ RUN git clone https://github.com/spack/spack.git WORKDIR /sources -ADD . /sources +ADD ./spack/repo /py-pyprecice-repo # Mount the current sources into the build container # and build the default environment RUN /spack/bin/spack --color=always external find --not-buildable RUN /spack/bin/spack --color=always env create --without-view ci -RUN /spack/bin/spack --color=always -e add py-pyprecice@develop%gcc@9.3.0 -RUN /spack/bin/spack --color=always -e ci repo add /sources/spack/repo +RUN /spack/bin/spack --color=always -e ci add py-pyprecice@develop%gcc@9.3.0 +RUN /spack/bin/spack --color=always -e ci repo add /py-pyprecice-repo RUN /spack/bin/spack --color=always -e ci install --fail-fast --only=dependencies RUN /spack/bin/spack --color=always clean -a From adcc948aea4834a29180a6f02d20bd0eb2b411af Mon Sep 17 00:00:00 2001 From: BenjaminRodenberg Date: Thu, 4 Mar 2021 18:28:36 +0100 Subject: [PATCH 47/77] Add missing unzip. --- spack/ci-spack-pyprecice-external-deps-2004.dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/spack/ci-spack-pyprecice-external-deps-2004.dockerfile b/spack/ci-spack-pyprecice-external-deps-2004.dockerfile index 3006a2d7..e74127e1 100644 --- a/spack/ci-spack-pyprecice-external-deps-2004.dockerfile +++ b/spack/ci-spack-pyprecice-external-deps-2004.dockerfile @@ -7,6 +7,7 @@ ARG DEBIAN_FRONTEND=noninteractive # Installing necessary dependencies for preCICE, boost 1.71 from apt-get RUN apt-get -qq update && apt-get -qq install \ curl \ + unzip \ build-essential \ locales \ libboost-all-dev \ From 90de1fa4c2a1b88a4589ef86ec6e2115c1846995 Mon Sep 17 00:00:00 2001 From: Benjamin Rodenberg Date: Thu, 4 Mar 2021 19:46:01 +0100 Subject: [PATCH 48/77] Install py-wheel --- spack/ci-spack-pyprecice-external-deps-2004.dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/spack/ci-spack-pyprecice-external-deps-2004.dockerfile b/spack/ci-spack-pyprecice-external-deps-2004.dockerfile index e74127e1..d41275ce 100644 --- a/spack/ci-spack-pyprecice-external-deps-2004.dockerfile +++ b/spack/ci-spack-pyprecice-external-deps-2004.dockerfile @@ -31,6 +31,7 @@ ADD ./spack/repo /py-pyprecice-repo # and build the default environment RUN /spack/bin/spack --color=always external find --not-buildable RUN /spack/bin/spack --color=always env create --without-view ci +RUN /spack/bin/spack --color=always -e ci install py-wheel RUN /spack/bin/spack --color=always -e ci add py-pyprecice@develop%gcc@9.3.0 RUN /spack/bin/spack --color=always -e ci repo add /py-pyprecice-repo RUN /spack/bin/spack --color=always -e ci install --fail-fast --only=dependencies From b8beb8ebcde50900f334fd3c1433c28c11f87720 Mon Sep 17 00:00:00 2001 From: BenjaminRodenberg Date: Thu, 4 Mar 2021 20:33:47 +0100 Subject: [PATCH 49/77] Use /bin/bash as SHELL. --- ...ck-pyprecice-external-deps-2004.dockerfile | 20 ++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/spack/ci-spack-pyprecice-external-deps-2004.dockerfile b/spack/ci-spack-pyprecice-external-deps-2004.dockerfile index e74127e1..87786161 100644 --- a/spack/ci-spack-pyprecice-external-deps-2004.dockerfile +++ b/spack/ci-spack-pyprecice-external-deps-2004.dockerfile @@ -2,6 +2,7 @@ FROM ubuntu:20.04 ARG DEBIAN_FRONTEND=noninteractive +SHELL ["/bin/bash", "-c"] # this is necessary to avoid timeouts during installation due to interactive installs # Installing necessary dependencies for preCICE, boost 1.71 from apt-get @@ -14,8 +15,10 @@ RUN apt-get -qq update && apt-get -qq install \ libeigen3-dev \ libxml2-dev \ git \ - python3-numpy \ python3-dev \ + python3-setuptools \ + python3-wheel \ + python3-numpy \ petsc-dev \ wget \ bzip2 \ @@ -27,11 +30,10 @@ RUN git clone https://github.com/spack/spack.git WORKDIR /sources ADD ./spack/repo /py-pyprecice-repo -# Mount the current sources into the build container -# and build the default environment -RUN /spack/bin/spack --color=always external find --not-buildable -RUN /spack/bin/spack --color=always env create --without-view ci -RUN /spack/bin/spack --color=always -e ci add py-pyprecice@develop%gcc@9.3.0 -RUN /spack/bin/spack --color=always -e ci repo add /py-pyprecice-repo -RUN /spack/bin/spack --color=always -e ci install --fail-fast --only=dependencies -RUN /spack/bin/spack --color=always clean -a +RUN source /spack/share/spack/setup-env.sh && \ + spack --color=always external find --not-buildable && \ + spack --color=always env create --without-view ci && \ + spack --color=always -e ci add py-pyprecice@develop%gcc@9.3.0 && \ + spack --color=always -e ci repo add /py-pyprecice-repo && \ + spack --color=always -e ci install --fail-fast --only=dependencies && \ + spack --color=always clean -a From 1a61b7e9a0a618be198347623c55fd502ebb3dfd Mon Sep 17 00:00:00 2001 From: BenjaminRodenberg Date: Thu, 4 Mar 2021 21:14:19 +0100 Subject: [PATCH 50/77] Remove WORKDIR. --- spack/ci-spack-pyprecice-deps-1804.dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spack/ci-spack-pyprecice-deps-1804.dockerfile b/spack/ci-spack-pyprecice-deps-1804.dockerfile index 4a7a07bb..92972722 100644 --- a/spack/ci-spack-pyprecice-deps-1804.dockerfile +++ b/spack/ci-spack-pyprecice-deps-1804.dockerfile @@ -1,6 +1,6 @@ # Build stage with Spack pre-installed and ready to be used FROM spack/ubuntu-bionic:latest -WORKDIR /sources + # Mount the current sources into the build container # and build the default environment ADD ./spack/repo /py-pyprecice-repo From 5b08b873a06afe24637b7681d5684bee41e30f25 Mon Sep 17 00:00:00 2001 From: BenjaminRodenberg Date: Thu, 4 Mar 2021 21:58:32 +0100 Subject: [PATCH 51/77] Remove py-wheel. --- .github/workflows/build-spack.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-spack.yml b/.github/workflows/build-spack.yml index ca22dc72..eb86493c 100644 --- a/.github/workflows/build-spack.yml +++ b/.github/workflows/build-spack.yml @@ -22,4 +22,4 @@ jobs: cp spack/repo/packages/py-pyprecice/*.patch /py-pyprecice-repo/packages/py-pyprecice/ - name: Try to build py-pyprecice with spack and test it run: | - . /opt/spack/share/spack/setup-env.sh && spack env activate ci && spack dev-build py-pyprecice@develop && spack load precice py-numpy py-mpi4py py-wheel py-cython openssh openmpi && mkdir runner && cd runner && python3 -c "import precice; print(precice.__version__)" + . /opt/spack/share/spack/setup-env.sh && spack env activate ci && spack dev-build py-pyprecice@develop && spack load precice py-numpy py-mpi4py py-cython openssh openmpi && mkdir runner && cd runner && python3 -c "import precice; print(precice.__version__)" From 5d5b0284d5629361aea4a3a82a0f33840651270e Mon Sep 17 00:00:00 2001 From: BenjaminRodenberg Date: Thu, 4 Mar 2021 22:11:13 +0100 Subject: [PATCH 52/77] Remove unnecessary file. --- ...i-spack-pyprecice-deps-1804.dockerfile.orig | 18 ------------------ 1 file changed, 18 deletions(-) delete mode 100644 spack/ci-spack-pyprecice-deps-1804.dockerfile.orig diff --git a/spack/ci-spack-pyprecice-deps-1804.dockerfile.orig b/spack/ci-spack-pyprecice-deps-1804.dockerfile.orig deleted file mode 100644 index 85b7408a..00000000 --- a/spack/ci-spack-pyprecice-deps-1804.dockerfile.orig +++ /dev/null @@ -1,18 +0,0 @@ -# Build stage with Spack pre-installed and ready to be used -FROM spack/ubuntu-bionic:latest -WORKDIR /sources -# Mount the current sources into the build container -# and build the default environment -<<<<<<< HEAD -ADD . /sources -RUN spack --color=always env create --without-view ci && \ - spack --color=always -e ci add py-pyprecice@develop && \ - spack --color=always -e ci repo add /sources/spack/repo && \ -======= -ADD ./spack/repo /py-pyprecice-repo -RUN spack --color=always env create --without-view ci && \ - spack --color=always -e ci add py-pyprecice@develop && \ - spack --color=always -e ci repo add /py-pyprecice-repo && \ ->>>>>>> spack-ci-improvements - spack --color=always -e ci install --fail-fast --only=dependencies && \ - spack --color=always clean -a From d26a3d6fd13cb346b7434074ee6db515240cb52f Mon Sep 17 00:00:00 2001 From: BenjaminRodenberg Date: Fri, 5 Mar 2021 01:48:09 +0100 Subject: [PATCH 53/77] Install mpich. --- spack/ci-spack-pyprecice-external-deps-2004.dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spack/ci-spack-pyprecice-external-deps-2004.dockerfile b/spack/ci-spack-pyprecice-external-deps-2004.dockerfile index 87786161..c8f3bd49 100644 --- a/spack/ci-spack-pyprecice-external-deps-2004.dockerfile +++ b/spack/ci-spack-pyprecice-external-deps-2004.dockerfile @@ -20,6 +20,7 @@ RUN apt-get -qq update && apt-get -qq install \ python3-wheel \ python3-numpy \ petsc-dev \ + mpich \ wget \ bzip2 \ cmake && \ @@ -27,7 +28,6 @@ RUN apt-get -qq update && apt-get -qq install \ RUN git clone https://github.com/spack/spack.git -WORKDIR /sources ADD ./spack/repo /py-pyprecice-repo RUN source /spack/share/spack/setup-env.sh && \ From 8c144d9c29686c4915d9f59ce4156187ea487720 Mon Sep 17 00:00:00 2001 From: BenjaminRodenberg Date: Fri, 5 Mar 2021 18:43:05 +0100 Subject: [PATCH 54/77] Install pip, wheel and setuptools. Related to https://github.com/spack/spack/issues/22116. --- spack/ci-spack-pyprecice-external-deps-2004.dockerfile | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/spack/ci-spack-pyprecice-external-deps-2004.dockerfile b/spack/ci-spack-pyprecice-external-deps-2004.dockerfile index c8f3bd49..7db00ba3 100644 --- a/spack/ci-spack-pyprecice-external-deps-2004.dockerfile +++ b/spack/ci-spack-pyprecice-external-deps-2004.dockerfile @@ -16,9 +16,7 @@ RUN apt-get -qq update && apt-get -qq install \ libxml2-dev \ git \ python3-dev \ - python3-setuptools \ - python3-wheel \ - python3-numpy \ + python3-pip \ petsc-dev \ mpich \ wget \ From 885f86fd0deb1deb0ab066c332b5bceace06be63 Mon Sep 17 00:00:00 2001 From: BenjaminRodenberg Date: Fri, 5 Mar 2021 21:06:36 +0100 Subject: [PATCH 55/77] Install cython on system. --- spack/ci-spack-pyprecice-external-deps-2004.dockerfile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/spack/ci-spack-pyprecice-external-deps-2004.dockerfile b/spack/ci-spack-pyprecice-external-deps-2004.dockerfile index 7db00ba3..ec2793c1 100644 --- a/spack/ci-spack-pyprecice-external-deps-2004.dockerfile +++ b/spack/ci-spack-pyprecice-external-deps-2004.dockerfile @@ -26,6 +26,8 @@ RUN apt-get -qq update && apt-get -qq install \ RUN git clone https://github.com/spack/spack.git +RUN pip3 install cython # needed for successfully building py-numpy + ADD ./spack/repo /py-pyprecice-repo RUN source /spack/share/spack/setup-env.sh && \ From a6d2fd843af414da02863ca01a079beecd563b67 Mon Sep 17 00:00:00 2001 From: BenjaminRodenberg Date: Sun, 7 Mar 2021 19:39:27 +0100 Subject: [PATCH 56/77] Only build as cron. --- .github/workflows/build-env.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/build-env.yml b/.github/workflows/build-env.yml index e81dc946..5dc4d924 100644 --- a/.github/workflows/build-env.yml +++ b/.github/workflows/build-env.yml @@ -4,7 +4,6 @@ on: workflow_dispatch: # Trigger by hand from the UI schedule: - cron: '0 0 * * 0' # Schedule it every Sunday - push: jobs: build-spack-pyprecice-deps: From 3fb2220281e2711ec1c1b20333aee1442a8612ed Mon Sep 17 00:00:00 2001 From: BenjaminRodenberg Date: Sun, 7 Mar 2021 19:41:01 +0100 Subject: [PATCH 57/77] Test with external deps. --- .github/workflows/build-spack.yml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/.github/workflows/build-spack.yml b/.github/workflows/build-spack.yml index eb86493c..4fc1ce0d 100644 --- a/.github/workflows/build-spack.yml +++ b/.github/workflows/build-spack.yml @@ -23,3 +23,22 @@ jobs: - name: Try to build py-pyprecice with spack and test it run: | . /opt/spack/share/spack/setup-env.sh && spack env activate ci && spack dev-build py-pyprecice@develop && spack load precice py-numpy py-mpi4py py-cython openssh openmpi && mkdir runner && cd runner && python3 -c "import precice; print(precice.__version__)" + + build_spack_external: + name: build_spack + runs-on: ubuntu-latest + timeout-minutes: 15 + container: precice/ci-spack-pyprecice-external-deps-2004 + defaults: + run: + shell: "bash --login -eo pipefail {0}" + steps: + - name: Checkout Repository + uses: actions/checkout@v2 + - name: Move Package Script + run: | + cp spack/repo/packages/py-pyprecice/package.py /py-pyprecice-repo/packages/py-pyprecice/ + cp spack/repo/packages/py-pyprecice/*.patch /py-pyprecice-repo/packages/py-pyprecice/ + - name: Try to build py-pyprecice with spack and test it + run: | + . /opt/spack/share/spack/setup-env.sh && spack env activate ci && spack dev-build py-pyprecice@develop && spack load precice py-numpy py-mpi4py py-cython openssh openmpi && mkdir runner && cd runner && python3 -c "import precice; print(precice.__version__)" From e12d6969b0008140eed75eea9d37a1510045caf2 Mon Sep 17 00:00:00 2001 From: BenjaminRodenberg Date: Sun, 7 Mar 2021 19:44:17 +0100 Subject: [PATCH 58/77] Fix spack path. --- .github/workflows/build-spack.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-spack.yml b/.github/workflows/build-spack.yml index 4fc1ce0d..c8c2fb03 100644 --- a/.github/workflows/build-spack.yml +++ b/.github/workflows/build-spack.yml @@ -37,8 +37,8 @@ jobs: uses: actions/checkout@v2 - name: Move Package Script run: | - cp spack/repo/packages/py-pyprecice/package.py /py-pyprecice-repo/packages/py-pyprecice/ - cp spack/repo/packages/py-pyprecice/*.patch /py-pyprecice-repo/packages/py-pyprecice/ + cp /spack/repo/packages/py-pyprecice/package.py /py-pyprecice-repo/packages/py-pyprecice/ + cp /spack/repo/packages/py-pyprecice/*.patch /py-pyprecice-repo/packages/py-pyprecice/ - name: Try to build py-pyprecice with spack and test it run: | - . /opt/spack/share/spack/setup-env.sh && spack env activate ci && spack dev-build py-pyprecice@develop && spack load precice py-numpy py-mpi4py py-cython openssh openmpi && mkdir runner && cd runner && python3 -c "import precice; print(precice.__version__)" + . /spack/share/spack/setup-env.sh && spack env activate ci && spack dev-build py-pyprecice@develop && spack load precice py-numpy py-mpi4py py-cython openssh openmpi && mkdir runner && cd runner && python3 -c "import precice; print(precice.__version__)" From 14d8a7fd9d02d6a539686fae0edbd6b028c62e03 Mon Sep 17 00:00:00 2001 From: BenjaminRodenberg Date: Sun, 7 Mar 2021 19:55:09 +0100 Subject: [PATCH 59/77] Copy is not necessary due to dev-build. --- .github/workflows/build-spack.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/build-spack.yml b/.github/workflows/build-spack.yml index eb86493c..91589633 100644 --- a/.github/workflows/build-spack.yml +++ b/.github/workflows/build-spack.yml @@ -16,10 +16,6 @@ jobs: steps: - name: Checkout Repository uses: actions/checkout@v2 - - name: Move Package Script - run: | - cp spack/repo/packages/py-pyprecice/package.py /py-pyprecice-repo/packages/py-pyprecice/ - cp spack/repo/packages/py-pyprecice/*.patch /py-pyprecice-repo/packages/py-pyprecice/ - name: Try to build py-pyprecice with spack and test it run: | . /opt/spack/share/spack/setup-env.sh && spack env activate ci && spack dev-build py-pyprecice@develop && spack load precice py-numpy py-mpi4py py-cython openssh openmpi && mkdir runner && cd runner && python3 -c "import precice; print(precice.__version__)" From b7e4d5d892e5cd3cfcf74e4b618370bb95136a66 Mon Sep 17 00:00:00 2001 From: BenjaminRodenberg Date: Sun, 7 Mar 2021 20:01:44 +0100 Subject: [PATCH 60/77] Revert "Copy is not necessary due to dev-build." This reverts commit 14d8a7fd9d02d6a539686fae0edbd6b028c62e03. --- .github/workflows/build-spack.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/build-spack.yml b/.github/workflows/build-spack.yml index 91589633..eb86493c 100644 --- a/.github/workflows/build-spack.yml +++ b/.github/workflows/build-spack.yml @@ -16,6 +16,10 @@ jobs: steps: - name: Checkout Repository uses: actions/checkout@v2 + - name: Move Package Script + run: | + cp spack/repo/packages/py-pyprecice/package.py /py-pyprecice-repo/packages/py-pyprecice/ + cp spack/repo/packages/py-pyprecice/*.patch /py-pyprecice-repo/packages/py-pyprecice/ - name: Try to build py-pyprecice with spack and test it run: | . /opt/spack/share/spack/setup-env.sh && spack env activate ci && spack dev-build py-pyprecice@develop && spack load precice py-numpy py-mpi4py py-cython openssh openmpi && mkdir runner && cd runner && python3 -c "import precice; print(precice.__version__)" From 6f884f595ea77619fd6786ffa6b4e1210eac8bf6 Mon Sep 17 00:00:00 2001 From: BenjaminRodenberg Date: Sun, 7 Mar 2021 20:42:18 +0100 Subject: [PATCH 61/77] Fix path. --- .github/workflows/build-spack.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-spack.yml b/.github/workflows/build-spack.yml index c8c2fb03..be889862 100644 --- a/.github/workflows/build-spack.yml +++ b/.github/workflows/build-spack.yml @@ -37,8 +37,9 @@ jobs: uses: actions/checkout@v2 - name: Move Package Script run: | - cp /spack/repo/packages/py-pyprecice/package.py /py-pyprecice-repo/packages/py-pyprecice/ - cp /spack/repo/packages/py-pyprecice/*.patch /py-pyprecice-repo/packages/py-pyprecice/ + ls + cp spack/repo/packages/py-pyprecice/package.py /py-pyprecice-repo/packages/py-pyprecice/ + cp spack/repo/packages/py-pyprecice/*.patch /py-pyprecice-repo/packages/py-pyprecice/ - name: Try to build py-pyprecice with spack and test it run: | . /spack/share/spack/setup-env.sh && spack env activate ci && spack dev-build py-pyprecice@develop && spack load precice py-numpy py-mpi4py py-cython openssh openmpi && mkdir runner && cd runner && python3 -c "import precice; print(precice.__version__)" From 00b9101ccea89d914a0962af1e7d1cb40b82b463 Mon Sep 17 00:00:00 2001 From: BenjaminRodenberg Date: Sun, 7 Mar 2021 21:20:45 +0100 Subject: [PATCH 62/77] Print arch and modules --- .github/workflows/build-spack.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-spack.yml b/.github/workflows/build-spack.yml index eb86493c..b50be45e 100644 --- a/.github/workflows/build-spack.yml +++ b/.github/workflows/build-spack.yml @@ -22,4 +22,4 @@ jobs: cp spack/repo/packages/py-pyprecice/*.patch /py-pyprecice-repo/packages/py-pyprecice/ - name: Try to build py-pyprecice with spack and test it run: | - . /opt/spack/share/spack/setup-env.sh && spack env activate ci && spack dev-build py-pyprecice@develop && spack load precice py-numpy py-mpi4py py-cython openssh openmpi && mkdir runner && cd runner && python3 -c "import precice; print(precice.__version__)" + . /opt/spack/share/spack/setup-env.sh && spack env activate ci && spack arch && spack find && spack dev-build py-pyprecice@develop && spack load precice py-numpy py-mpi4py py-cython openssh openmpi && mkdir runner && cd runner && python3 -c "import precice; print(precice.__version__)" From bf3f613fe4fa3de17805e6a3a2a0455d94743a61 Mon Sep 17 00:00:00 2001 From: BenjaminRodenberg Date: Sun, 7 Mar 2021 21:41:21 +0100 Subject: [PATCH 63/77] Add arch #81 --- .github/workflows/build-spack.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-spack.yml b/.github/workflows/build-spack.yml index 48fce9dc..823d8a08 100644 --- a/.github/workflows/build-spack.yml +++ b/.github/workflows/build-spack.yml @@ -42,4 +42,4 @@ jobs: cp spack/repo/packages/py-pyprecice/*.patch /py-pyprecice-repo/packages/py-pyprecice/ - name: Try to build py-pyprecice with spack and test it run: | - . /spack/share/spack/setup-env.sh && spack env activate ci && spack dev-build py-pyprecice@develop && spack load precice py-numpy py-mpi4py py-cython openssh openmpi && mkdir runner && cd runner && python3 -c "import precice; print(precice.__version__)" + . /spack/share/spack/setup-env.sh && spack env activate ci && spack arch && spack find && spack dev-build py-pyprecice@develop && spack load precice py-numpy py-mpi4py py-cython openssh openmpi && mkdir runner && cd runner && python3 -c "import precice; print(precice.__version__)" From 6b37ff6c44694e92a3f0c9d16cd928c80b3f5597 Mon Sep 17 00:00:00 2001 From: BenjaminRodenberg Date: Mon, 8 Mar 2021 10:54:37 +0100 Subject: [PATCH 64/77] Build for generic architecture x86_64. #81 --- spack/ci-spack-pyprecice-deps-1804.dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spack/ci-spack-pyprecice-deps-1804.dockerfile b/spack/ci-spack-pyprecice-deps-1804.dockerfile index 92972722..fb7c3cfa 100644 --- a/spack/ci-spack-pyprecice-deps-1804.dockerfile +++ b/spack/ci-spack-pyprecice-deps-1804.dockerfile @@ -5,7 +5,7 @@ FROM spack/ubuntu-bionic:latest # and build the default environment ADD ./spack/repo /py-pyprecice-repo RUN spack --color=always env create --without-view ci && \ - spack --color=always -e ci add py-pyprecice@develop && \ + spack --color=always -e ci add py-pyprecice@develop target=x86_64 && \ spack --color=always -e ci repo add /py-pyprecice-repo && \ spack --color=always -e ci install --fail-fast --only=dependencies && \ spack --color=always clean -a From ad8799a33e36b92d3bae43b9e910e386d65d5128 Mon Sep 17 00:00:00 2001 From: BenjaminRodenberg Date: Mon, 8 Mar 2021 10:55:40 +0100 Subject: [PATCH 65/77] Build for generic architecture x86_64. #81 --- spack/ci-spack-pyprecice-external-deps-2004.dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spack/ci-spack-pyprecice-external-deps-2004.dockerfile b/spack/ci-spack-pyprecice-external-deps-2004.dockerfile index ec2793c1..683751e8 100644 --- a/spack/ci-spack-pyprecice-external-deps-2004.dockerfile +++ b/spack/ci-spack-pyprecice-external-deps-2004.dockerfile @@ -33,7 +33,7 @@ ADD ./spack/repo /py-pyprecice-repo RUN source /spack/share/spack/setup-env.sh && \ spack --color=always external find --not-buildable && \ spack --color=always env create --without-view ci && \ - spack --color=always -e ci add py-pyprecice@develop%gcc@9.3.0 && \ + spack --color=always -e ci add py-pyprecice@develop%gcc@9.3.0 target=x86_64 && \ spack --color=always -e ci repo add /py-pyprecice-repo && \ spack --color=always -e ci install --fail-fast --only=dependencies && \ spack --color=always clean -a From fd292f3946dcb8c4b3c43b54c341fc974c46b762 Mon Sep 17 00:00:00 2001 From: BenjaminRodenberg Date: Mon, 8 Mar 2021 10:56:24 +0100 Subject: [PATCH 66/77] Trigger build of env. --- .github/workflows/build-env.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build-env.yml b/.github/workflows/build-env.yml index 5dc4d924..e81dc946 100644 --- a/.github/workflows/build-env.yml +++ b/.github/workflows/build-env.yml @@ -4,6 +4,7 @@ on: workflow_dispatch: # Trigger by hand from the UI schedule: - cron: '0 0 * * 0' # Schedule it every Sunday + push: jobs: build-spack-pyprecice-deps: From 1a5065a3a393fcdb2461e172550be4e2dcd5a70f Mon Sep 17 00:00:00 2001 From: BenjaminRodenberg Date: Mon, 8 Mar 2021 13:42:18 +0100 Subject: [PATCH 67/77] Remove push tag. --- .github/workflows/build-env.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/build-env.yml b/.github/workflows/build-env.yml index e81dc946..5dc4d924 100644 --- a/.github/workflows/build-env.yml +++ b/.github/workflows/build-env.yml @@ -4,7 +4,6 @@ on: workflow_dispatch: # Trigger by hand from the UI schedule: - cron: '0 0 * * 0' # Schedule it every Sunday - push: jobs: build-spack-pyprecice-deps: From 0368947d2606359bb67674df52ea951a10f32eb6 Mon Sep 17 00:00:00 2001 From: BenjaminRodenberg Date: Mon, 8 Mar 2021 13:58:12 +0100 Subject: [PATCH 68/77] Explicitly specify target. --- .github/workflows/build-spack.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-spack.yml b/.github/workflows/build-spack.yml index 823d8a08..bf0d9bef 100644 --- a/.github/workflows/build-spack.yml +++ b/.github/workflows/build-spack.yml @@ -22,7 +22,7 @@ jobs: cp spack/repo/packages/py-pyprecice/*.patch /py-pyprecice-repo/packages/py-pyprecice/ - name: Try to build py-pyprecice with spack and test it run: | - . /opt/spack/share/spack/setup-env.sh && spack env activate ci && spack arch && spack find && spack dev-build py-pyprecice@develop && spack load precice py-numpy py-mpi4py py-cython openssh openmpi && mkdir runner && cd runner && python3 -c "import precice; print(precice.__version__)" + . /opt/spack/share/spack/setup-env.sh && spack env activate ci && spack arch && spack find && spack dev-build py-pyprecice@develop target=x86_64 && spack load precice py-numpy py-mpi4py py-cython openssh openmpi && mkdir runner && cd runner && python3 -c "import precice; print(precice.__version__)" build_spack_external: name: build_spack @@ -42,4 +42,4 @@ jobs: cp spack/repo/packages/py-pyprecice/*.patch /py-pyprecice-repo/packages/py-pyprecice/ - name: Try to build py-pyprecice with spack and test it run: | - . /spack/share/spack/setup-env.sh && spack env activate ci && spack arch && spack find && spack dev-build py-pyprecice@develop && spack load precice py-numpy py-mpi4py py-cython openssh openmpi && mkdir runner && cd runner && python3 -c "import precice; print(precice.__version__)" + . /spack/share/spack/setup-env.sh && spack env activate ci && spack arch && spack find && spack dev-build py-pyprecice@develop target=x86_64 && spack load precice py-numpy py-mpi4py py-cython openssh openmpi && mkdir runner && cd runner && python3 -c "import precice; print(precice.__version__)" From 17dabd82dac160ee479c9d928b6e12ee90cae56e Mon Sep 17 00:00:00 2001 From: BenjaminRodenberg Date: Mon, 8 Mar 2021 19:02:10 +0100 Subject: [PATCH 69/77] Specify target. --- .github/workflows/build-spack.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-spack.yml b/.github/workflows/build-spack.yml index b50be45e..1d734b7c 100644 --- a/.github/workflows/build-spack.yml +++ b/.github/workflows/build-spack.yml @@ -22,4 +22,4 @@ jobs: cp spack/repo/packages/py-pyprecice/*.patch /py-pyprecice-repo/packages/py-pyprecice/ - name: Try to build py-pyprecice with spack and test it run: | - . /opt/spack/share/spack/setup-env.sh && spack env activate ci && spack arch && spack find && spack dev-build py-pyprecice@develop && spack load precice py-numpy py-mpi4py py-cython openssh openmpi && mkdir runner && cd runner && python3 -c "import precice; print(precice.__version__)" + . /opt/spack/share/spack/setup-env.sh && spack env activate ci && spack arch && spack find && spack dev-build py-pyprecice@develop target=x86_64 && spack load precice py-numpy py-mpi4py py-cython openssh openmpi && mkdir runner && cd runner && python3 -c "import precice; print(precice.__version__)" From e046425485e8d016fea4e885a2f8f3ab0181b2f0 Mon Sep 17 00:00:00 2001 From: BenjaminRodenberg Date: Tue, 9 Mar 2021 11:53:08 +0100 Subject: [PATCH 70/77] Do spack external find. --- .github/workflows/build-spack.yml | 2 +- .github/workflows/build-spack.yml.orig | 48 ++++++++++++++++++++++++++ 2 files changed, 49 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/build-spack.yml.orig diff --git a/.github/workflows/build-spack.yml b/.github/workflows/build-spack.yml index bf0d9bef..44a70b59 100644 --- a/.github/workflows/build-spack.yml +++ b/.github/workflows/build-spack.yml @@ -42,4 +42,4 @@ jobs: cp spack/repo/packages/py-pyprecice/*.patch /py-pyprecice-repo/packages/py-pyprecice/ - name: Try to build py-pyprecice with spack and test it run: | - . /spack/share/spack/setup-env.sh && spack env activate ci && spack arch && spack find && spack dev-build py-pyprecice@develop target=x86_64 && spack load precice py-numpy py-mpi4py py-cython openssh openmpi && mkdir runner && cd runner && python3 -c "import precice; print(precice.__version__)" + . /spack/share/spack/setup-env.sh && spack env activate ci && spack arch && spack external find && spack find && spack dev-build py-pyprecice@develop target=x86_64 && spack load precice py-numpy py-mpi4py py-cython openssh openmpi && mkdir runner && cd runner && python3 -c "import precice; print(precice.__version__)" diff --git a/.github/workflows/build-spack.yml.orig b/.github/workflows/build-spack.yml.orig new file mode 100644 index 00000000..34ec91ca --- /dev/null +++ b/.github/workflows/build-spack.yml.orig @@ -0,0 +1,48 @@ +name: Build Spack +on: + push: + branches: + - "*" + +jobs: + build_spack: + name: build_spack + runs-on: ubuntu-latest + timeout-minutes: 15 + container: precice/ci-spack-pyprecice-deps-1804 + defaults: + run: + shell: "bash --login -eo pipefail {0}" + steps: + - name: Checkout Repository + uses: actions/checkout@v2 + - name: Move Package Script + run: | + cp spack/repo/packages/py-pyprecice/package.py /py-pyprecice-repo/packages/py-pyprecice/ + cp spack/repo/packages/py-pyprecice/*.patch /py-pyprecice-repo/packages/py-pyprecice/ + - name: Try to build py-pyprecice with spack and test it + run: | + . /opt/spack/share/spack/setup-env.sh && spack env activate ci && spack arch && spack find && spack dev-build py-pyprecice@develop target=x86_64 && spack load precice py-numpy py-mpi4py py-cython openssh openmpi && mkdir runner && cd runner && python3 -c "import precice; print(precice.__version__)" +<<<<<<< HEAD + + build_spack_external: + name: build_spack + runs-on: ubuntu-latest + timeout-minutes: 15 + container: precice/ci-spack-pyprecice-external-deps-2004 + defaults: + run: + shell: "bash --login -eo pipefail {0}" + steps: + - name: Checkout Repository + uses: actions/checkout@v2 + - name: Move Package Script + run: | + ls + cp spack/repo/packages/py-pyprecice/package.py /py-pyprecice-repo/packages/py-pyprecice/ + cp spack/repo/packages/py-pyprecice/*.patch /py-pyprecice-repo/packages/py-pyprecice/ + - name: Try to build py-pyprecice with spack and test it + run: | + . /spack/share/spack/setup-env.sh && spack env activate ci && spack arch && spack find && spack dev-build py-pyprecice@develop target=x86_64 && spack load precice py-numpy py-mpi4py py-cython openssh openmpi && mkdir runner && cd runner && python3 -c "import precice; print(precice.__version__)" +======= +>>>>>>> spack-ci-improvements From 68bbca47defd1fb2766ecac6827ecf3169fa06ab Mon Sep 17 00:00:00 2001 From: Benjamin Rodenberg Date: Mon, 30 Aug 2021 21:45:24 +0200 Subject: [PATCH 71/77] Rename job. --- .github/workflows/build-spack.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-spack.yml b/.github/workflows/build-spack.yml index 40cee997..ce0ee58c 100644 --- a/.github/workflows/build-spack.yml +++ b/.github/workflows/build-spack.yml @@ -28,7 +28,7 @@ jobs: run: | . /opt/spack/share/spack/setup-env.sh && spack env activate ci && spack arch && spack find && spack dev-build pyprecice.test.py-pyprecice@develop target=x86_64 && spack load precice py-numpy py-mpi4py py-cython openssh openmpi && mkdir runner && cd runner && python3 -c "import precice; print(precice.__version__)" build_spack_external: - name: build_spack + name: build_spack_external runs-on: ubuntu-latest timeout-minutes: 15 container: precice/ci-spack-pyprecice-external-deps-2004 From 8d4db6d50b6fc89e4ebb192ab99a2c32c23908b6 Mon Sep 17 00:00:00 2001 From: Benjamin Rodenberg Date: Mon, 30 Aug 2021 21:48:51 +0200 Subject: [PATCH 72/77] Update action. --- .github/workflows/build-spack.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-spack.yml b/.github/workflows/build-spack.yml index ce0ee58c..1ca99a7a 100644 --- a/.github/workflows/build-spack.yml +++ b/.github/workflows/build-spack.yml @@ -41,8 +41,7 @@ jobs: - name: Move Package Script run: | ls - cp spack/repo/packages/py-pyprecice/package.py /py-pyprecice-repo/packages/py-pyprecice/ - cp spack/repo/packages/py-pyprecice/*.patch /py-pyprecice-repo/packages/py-pyprecice/ + cp -r spack/repo/packages/py-pyprecice/ /py-pyprecice-repo/packages/ - name: Try to build py-pyprecice with spack and test it run: | - . /spack/share/spack/setup-env.sh && spack env activate ci && spack arch && spack external find && spack find && spack dev-build py-pyprecice@develop target=x86_64 && spack load precice py-numpy py-mpi4py py-cython openssh openmpi && mkdir runner && cd runner && python3 -c "import precice; print(precice.__version__)" + . /opt/spack/share/spack/setup-env.sh && spack env activate ci && spack arch && spack external find && spack find && spack dev-build py-pyprecice.test.py-pyprecice@develop target=x86_64 && spack load precice py-numpy py-mpi4py py-cython openssh openmpi && mkdir runner && cd runner && python3 -c "import precice; print(precice.__version__)" From c44a6679d88dc2aa34d9e834132b6844236651bb Mon Sep 17 00:00:00 2001 From: Benjamin Rodenberg Date: Mon, 30 Aug 2021 22:10:02 +0200 Subject: [PATCH 73/77] Fix path. --- .github/workflows/build-spack.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-spack.yml b/.github/workflows/build-spack.yml index 1ca99a7a..26d870f2 100644 --- a/.github/workflows/build-spack.yml +++ b/.github/workflows/build-spack.yml @@ -44,4 +44,4 @@ jobs: cp -r spack/repo/packages/py-pyprecice/ /py-pyprecice-repo/packages/ - name: Try to build py-pyprecice with spack and test it run: | - . /opt/spack/share/spack/setup-env.sh && spack env activate ci && spack arch && spack external find && spack find && spack dev-build py-pyprecice.test.py-pyprecice@develop target=x86_64 && spack load precice py-numpy py-mpi4py py-cython openssh openmpi && mkdir runner && cd runner && python3 -c "import precice; print(precice.__version__)" + . /spack/share/spack/setup-env.sh && spack env activate ci && spack arch && spack external find && spack find && spack dev-build py-pyprecice.test.py-pyprecice@develop target=x86_64 && spack load precice py-numpy py-mpi4py py-cython openssh openmpi && mkdir runner && cd runner && python3 -c "import precice; print(precice.__version__)" From d8d92b49ecd3c7aa6c5f2672f7afdfcac412e5bc Mon Sep 17 00:00:00 2001 From: Benjamin Rodenberg Date: Tue, 31 Aug 2021 13:27:54 +0200 Subject: [PATCH 74/77] Fix repo name. --- spack/ci-spack-pyprecice-external-deps-2004.dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spack/ci-spack-pyprecice-external-deps-2004.dockerfile b/spack/ci-spack-pyprecice-external-deps-2004.dockerfile index 683751e8..bea7a343 100644 --- a/spack/ci-spack-pyprecice-external-deps-2004.dockerfile +++ b/spack/ci-spack-pyprecice-external-deps-2004.dockerfile @@ -33,7 +33,7 @@ ADD ./spack/repo /py-pyprecice-repo RUN source /spack/share/spack/setup-env.sh && \ spack --color=always external find --not-buildable && \ spack --color=always env create --without-view ci && \ - spack --color=always -e ci add py-pyprecice@develop%gcc@9.3.0 target=x86_64 && \ spack --color=always -e ci repo add /py-pyprecice-repo && \ + spack --color=always -e ci add pyprecice.test.py-pyprecice@develop target=x86_64 && \ spack --color=always -e ci install --fail-fast --only=dependencies && \ spack --color=always clean -a From 4084bd4e3cf431298ca910ef8510828b87dd8461 Mon Sep 17 00:00:00 2001 From: Benjamin Rodenberg Date: Tue, 31 Aug 2021 13:28:21 +0200 Subject: [PATCH 75/77] Remove accidentally added file. --- .github/workflows/build-spack.yml.orig | 48 -------------------------- 1 file changed, 48 deletions(-) delete mode 100644 .github/workflows/build-spack.yml.orig diff --git a/.github/workflows/build-spack.yml.orig b/.github/workflows/build-spack.yml.orig deleted file mode 100644 index 34ec91ca..00000000 --- a/.github/workflows/build-spack.yml.orig +++ /dev/null @@ -1,48 +0,0 @@ -name: Build Spack -on: - push: - branches: - - "*" - -jobs: - build_spack: - name: build_spack - runs-on: ubuntu-latest - timeout-minutes: 15 - container: precice/ci-spack-pyprecice-deps-1804 - defaults: - run: - shell: "bash --login -eo pipefail {0}" - steps: - - name: Checkout Repository - uses: actions/checkout@v2 - - name: Move Package Script - run: | - cp spack/repo/packages/py-pyprecice/package.py /py-pyprecice-repo/packages/py-pyprecice/ - cp spack/repo/packages/py-pyprecice/*.patch /py-pyprecice-repo/packages/py-pyprecice/ - - name: Try to build py-pyprecice with spack and test it - run: | - . /opt/spack/share/spack/setup-env.sh && spack env activate ci && spack arch && spack find && spack dev-build py-pyprecice@develop target=x86_64 && spack load precice py-numpy py-mpi4py py-cython openssh openmpi && mkdir runner && cd runner && python3 -c "import precice; print(precice.__version__)" -<<<<<<< HEAD - - build_spack_external: - name: build_spack - runs-on: ubuntu-latest - timeout-minutes: 15 - container: precice/ci-spack-pyprecice-external-deps-2004 - defaults: - run: - shell: "bash --login -eo pipefail {0}" - steps: - - name: Checkout Repository - uses: actions/checkout@v2 - - name: Move Package Script - run: | - ls - cp spack/repo/packages/py-pyprecice/package.py /py-pyprecice-repo/packages/py-pyprecice/ - cp spack/repo/packages/py-pyprecice/*.patch /py-pyprecice-repo/packages/py-pyprecice/ - - name: Try to build py-pyprecice with spack and test it - run: | - . /spack/share/spack/setup-env.sh && spack env activate ci && spack arch && spack find && spack dev-build py-pyprecice@develop target=x86_64 && spack load precice py-numpy py-mpi4py py-cython openssh openmpi && mkdir runner && cd runner && python3 -c "import precice; print(precice.__version__)" -======= ->>>>>>> spack-ci-improvements From 4aa519bb1cef476b1ed82f40a14c26a869728a92 Mon Sep 17 00:00:00 2001 From: Benjamin Rodenberg Date: Wed, 10 Jul 2024 14:14:46 +0200 Subject: [PATCH 76/77] Apply suggestions from code review --- .github/workflows/build-env.yml | 4 ++-- .github/workflows/build-spack.yml | 2 +- spack/ci-spack-pyprecice-external-deps-2004.dockerfile | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-env.yml b/.github/workflows/build-env.yml index 5dc4d924..d1296417 100644 --- a/.github/workflows/build-env.yml +++ b/.github/workflows/build-env.yml @@ -44,5 +44,5 @@ jobs: with: push: true context: . - file: spack/ci-spack-pyprecice-external-deps-2004.dockerfile - tags: precice/ci-spack-pyprecice-external-deps-2004 + file: spack/ci-spack-pyprecice-external-deps-2404.dockerfile + tags: precice/ci-spack-pyprecice-external-deps-2404 diff --git a/.github/workflows/build-spack.yml b/.github/workflows/build-spack.yml index 26d870f2..a3847e3a 100644 --- a/.github/workflows/build-spack.yml +++ b/.github/workflows/build-spack.yml @@ -31,7 +31,7 @@ jobs: name: build_spack_external runs-on: ubuntu-latest timeout-minutes: 15 - container: precice/ci-spack-pyprecice-external-deps-2004 + container: precice/ci-spack-pyprecice-external-deps-2404 defaults: run: shell: "bash --login -eo pipefail {0}" diff --git a/spack/ci-spack-pyprecice-external-deps-2004.dockerfile b/spack/ci-spack-pyprecice-external-deps-2004.dockerfile index bea7a343..5decd8cf 100644 --- a/spack/ci-spack-pyprecice-external-deps-2004.dockerfile +++ b/spack/ci-spack-pyprecice-external-deps-2004.dockerfile @@ -1,5 +1,5 @@ # Build stage with Spack pre-installed and ready to be used -FROM ubuntu:20.04 +FROM spack/ubuntu-noble:latest ARG DEBIAN_FRONTEND=noninteractive SHELL ["/bin/bash", "-c"] From 7ba7aa2a5afd4c140335cc835912a133cf6074c8 Mon Sep 17 00:00:00 2001 From: Benjamin Rodenberg Date: Wed, 10 Jul 2024 14:23:41 +0200 Subject: [PATCH 77/77] Rename file. --- ...ockerfile => ci-spack-pyprecice-external-deps-2404.dockerfile} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename spack/{ci-spack-pyprecice-external-deps-2004.dockerfile => ci-spack-pyprecice-external-deps-2404.dockerfile} (100%) diff --git a/spack/ci-spack-pyprecice-external-deps-2004.dockerfile b/spack/ci-spack-pyprecice-external-deps-2404.dockerfile similarity index 100% rename from spack/ci-spack-pyprecice-external-deps-2004.dockerfile rename to spack/ci-spack-pyprecice-external-deps-2404.dockerfile