Skip to content

Update spack recipe for v2.4.0.0 #148

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 24 commits into from
Aug 25, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
2476f37
Add checksum of v2.4.0.0
IshaanDesai Jul 22, 2022
a8d1c82
Changes to package.py as recommended by Spack devs
IshaanDesai Jul 25, 2022
9e89811
Remove unnecessary preCICE dependency line
IshaanDesai Jul 25, 2022
ac8c9ce
Fix import statement and update outdated copyright header
IshaanDesai Jul 25, 2022
18c2853
Correct lower bound of bindings version in the preCICE dependency line
IshaanDesai Jul 25, 2022
36776a8
Change lib. folder to lib in spack execution command in the build_spa…
IshaanDesai Jul 25, 2022
bb4d5bb
Trying out lib/
IshaanDesai Jul 25, 2022
a15b4f3
Revert pip dependency lower bound
IshaanDesai Jul 25, 2022
241e2c2
Reverting version in preCICE dependency to 2.4.0.1
IshaanDesai Jul 25, 2022
4b9388f
Revert to adding the when condition to packaging and pip dependencies
IshaanDesai Jul 25, 2022
d6a48ec
Correct package version in depends_on command
IshaanDesai Aug 22, 2022
a7cf42d
Correct bindings version ranges in command for preCICE
IshaanDesai Aug 22, 2022
4533ba3
Removing all trial changes and reverting package.py to what it is in …
IshaanDesai Aug 22, 2022
c19bad0
Try to upload spack build log file as artifact
IshaanDesai Aug 22, 2022
b6aa2b1
Segregating building and testing in build_spack workflow
IshaanDesai Aug 22, 2022
1eda440
Update Dockerfile for Spack build and test to Ubuntu 20.04
IshaanDesai Aug 23, 2022
ca5b721
Reverting build-spack.yml to its original state
IshaanDesai Aug 24, 2022
9c6d1c2
Use Ubuntu 20.04 container
IshaanDesai Aug 24, 2022
ab2236c
Install and load py-pyprecice package before testing it in the build_…
IshaanDesai Aug 24, 2022
475610c
Simplifying the build-spack Action
IshaanDesai Aug 24, 2022
094c14a
Furhter simplifying workflow
IshaanDesai Aug 25, 2022
8bd9e14
Updating ci-spack-pyprecice-deps container to Ubuntu 22.04
IshaanDesai Aug 25, 2022
3d3d297
Update to Ubuntu 22.04 image in build-env
IshaanDesai Aug 25, 2022
0324deb
Finally build_spack works
IshaanDesai Aug 25, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/build-env.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,5 @@ jobs:
with:
push: true
context: .
file: spack/ci-spack-pyprecice-deps-1804.dockerfile
tags: precice/ci-spack-pyprecice-deps-1804
file: spack/ci-spack-pyprecice-deps-2204.dockerfile
tags: precice/ci-spack-pyprecice-deps-2204
12 changes: 10 additions & 2 deletions .github/workflows/build-spack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
name: build_spack
runs-on: ubuntu-latest
timeout-minutes: 15
container: precice/ci-spack-pyprecice-deps-1804
container: precice/ci-spack-pyprecice-deps-2204
defaults:
run:
shell: "bash --login -eo pipefail {0}"
Expand All @@ -26,4 +26,12 @@ 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 find && spack dev-build pyprecice.test.py-pyprecice@develop target=x86_64 && spack load precice py-numpy py-mpi4py py-cython openssh openmpi && export PYTHONPATH=${PWD}/build/$(ls build | grep lib.):${PYTHONPATH} && mkdir runner && cd runner && BINDINGS_VERSION=$(python3 -c "import precice; print(precice.__version__)") && echo "Installed version of bindings is ${BINDINGS_VERSION}"
apt-get -yy update
apt-get install -y lsb-release
. /opt/spack/share/spack/setup-env.sh
spack env activate ci && spack arch
spack develop pyprecice.test.py-pyprecice@develop target=x86_64
spack install
spack find
spack load py-pyprecice
BINDINGS_VERSION=$(python3 -c "import precice; print(precice.__version__)") && echo "Installed version of bindings is ${BINDINGS_VERSION}"
8 changes: 4 additions & 4 deletions spack/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

The Spack package `py-pyprecice` provides the python bindings via Spack and was submitted via [pull request 19558](https://github.com/spack/spack/pull/19558) in the Spack repository. This folder contains the Spack package script that can be used for testing whether the Spack installation works.

## Docker image `precice/ci-spack-pyprecice-deps-1804`
## Docker image `precice/ci-spack-pyprecice-deps-2204`

The workflow `build-spack-pyprecice-deps` in `.github/workflows/build-env.yml` creates the image `precice/ci-spack-pyprecice-deps-1804`. This image contains all dependencies of `py-pyprecice@develop`.
The workflow `build-spack-pyprecice-deps` in `.github/workflows/build-env.yml` creates the image `precice/ci-spack-pyprecice-deps-2204`. This image contains all dependencies of `py-pyprecice@develop`.

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 workflow `build_spack` in `.github/workflows/build-spack.yml` uses the image `precice/ci-spack-pyprecice-deps-2204` 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.

## When a new Spack release is necessary

Expand Down Expand Up @@ -62,4 +62,4 @@ The workflow `build_spack` in `.github/workflows/build-spack.yml` uses the image
7. Ideally one runs the solverdummy with the freshly installed Python bindings.
* 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.
* After the pull request in the Spack repository is merged, merge the current package configuration into the repository of the Python bindings if necessery.
* After the pull request in the Spack repository is merged, merge the current package configuration into the repository of the Python bindings if necessery.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Build stage with Spack pre-installed and ready to be used
FROM spack/ubuntu-bionic:latest
FROM spack/ubuntu-jammy:latest

# Mount the current sources into the build container
# and build the default environment
Expand Down
26 changes: 13 additions & 13 deletions spack/repo/packages/py-pyprecice/package.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Copyright 2013-2022 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 *
from spack.package import *


class PyPyprecice(PythonPackage):
Expand All @@ -14,16 +14,17 @@ class PyPyprecice(PythonPackage):

homepage = "https://precice.org"
git = "https://github.com/precice/python-bindings.git"
url = "https://github.com/precice/python-bindings/archive/v2.0.0.1.tar.gz"
url = "https://github.com/precice/python-bindings/archive/v2.4.0.0.tar.gz"
maintainers = ["ajaust", "BenjaminRodenberg", "IshaanDesai"]

# Always prefer final version of release candidate
version("develop", branch="develop")
version('2.3.0.1', sha256='ed4e48729b662680beaa4ee2a9aff724a79e760534c6c58181be739988da2789')
version('2.2.1.1', sha256='139bac5077c3807e1b7b83d8d0da5ca0fc8c17393fd0df4bc5999cd63a351b78')
version('2.2.0.2', sha256='2287185f9ad7500dced53459543d27bb66bd2438c2e4bf81ee3317e6a00513d5')
version('2.2.0.1', sha256='229625e2e6df03987ababce5abe2021b0974cbe5a588b936a9cba653f4908d4b')
version('2.1.1.2', sha256='363eb3eeccf964fd5ee87012c1032353dd1518662868f2b51f04a6d8a7154045')
version("2.4.0.0", sha256="8877da85df97d66966892440c7e777b667d8e6a33747304ed3762f4c33b729ec")
version("2.3.0.1", sha256="ed4e48729b662680beaa4ee2a9aff724a79e760534c6c58181be739988da2789")
version("2.2.1.1", sha256="139bac5077c3807e1b7b83d8d0da5ca0fc8c17393fd0df4bc5999cd63a351b78")
version("2.2.0.2", sha256="2287185f9ad7500dced53459543d27bb66bd2438c2e4bf81ee3317e6a00513d5")
version("2.2.0.1", sha256="229625e2e6df03987ababce5abe2021b0974cbe5a588b936a9cba653f4908d4b")
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")
Expand All @@ -32,6 +33,7 @@ class PyPyprecice(PythonPackage):
version("2.0.0.1", sha256="96eafdf421ec61ad6fcf0ab1d3cf210831a815272984c470b2aea57d4d0c9e0e")

depends_on("precice@develop", when="@develop")
depends_on("[email protected]", when="@2.4.0.1:2.4.0")
depends_on("[email protected]", when="@2.3.0.1:2.3.1")
depends_on("[email protected]", when="@2.2.1.1:2.2.1")
depends_on("[email protected]", when="@2.2.0.1:2.2.0")
Expand All @@ -46,11 +48,9 @@ class PyPyprecice(PythonPackage):
depends_on("py-numpy", type=("build", "link", "run"))
depends_on("py-mpi4py", type=("build", "run"))
depends_on("[email protected]:", type="build")
depends_on("py-packaging", when="@:2.1", type="build")
depends_on("py-pip", when="@:2.1", type="build")
depends_on("py-packaging", type="build")
depends_on("py-pip@19.0.0:", type="build")

@when("@:2.1")
def patch(self):
filter_file(
"distutils.command.install", "setuptools.command.install", "setup.py"
)
filter_file("distutils.command.install", "setuptools.command.install", "setup.py")