Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
e25c969
Use super.
BenjaminRodenberg Feb 25, 2021
e626b71
Remove incorrect and update correct file.
BenjaminRodenberg Feb 26, 2021
392dd78
Experiment with architecture proposed in https://github.com/haampie-s…
BenjaminRodenberg Mar 2, 2021
d6d1d27
Add workflow for building dependencies from https://github.com/haampi…
BenjaminRodenberg Mar 2, 2021
97c513d
Rename
BenjaminRodenberg Mar 2, 2021
a88bf47
build-env.yml
BenjaminRodenberg Mar 2, 2021
1289eb5
Fix paths and names.
BenjaminRodenberg Mar 2, 2021
cea094c
Manually add pkgconfig
BenjaminRodenberg Mar 2, 2021
63b2248
Remove unneeded file.
BenjaminRodenberg Mar 2, 2021
73faeff
Merge branch 'spack-ci-improvements' of github.com:precice/python-bin…
BenjaminRodenberg Mar 2, 2021
c34d984
Add hotfix for pkgconfig.
BenjaminRodenberg Mar 2, 2021
a898c2e
Don't install pkgconfig manually
BenjaminRodenberg Mar 2, 2021
c891c6d
Use spack dev-build, don't use jinja.
BenjaminRodenberg Mar 3, 2021
3a6b3ff
Use py-pyprecice@devleop
BenjaminRodenberg Mar 3, 2021
aee5bc8
Increase timeout.
BenjaminRodenberg Mar 3, 2021
3c5e2e4
Fix name of env
BenjaminRodenberg Mar 3, 2021
b2c861f
Don't remove environment
BenjaminRodenberg Mar 3, 2021
6d890ec
Fix package.py
BenjaminRodenberg Mar 3, 2021
9691800
Try overwriting package.py
BenjaminRodenberg Mar 3, 2021
ab4d3a9
Only build env on a weekly basis.
BenjaminRodenberg Mar 3, 2021
00c17b9
Fix env name.
BenjaminRodenberg Mar 3, 2021
d4ff597
Comment out install for older versions
BenjaminRodenberg Mar 3, 2021
69fdaac
Go to independent directory to avoid false imports
BenjaminRodenberg Mar 3, 2021
186bd36
Explicitly load py-pyprecice
BenjaminRodenberg Mar 3, 2021
aad7ecd
Load all dependencies.
BenjaminRodenberg Mar 3, 2021
838c18a
Revert changes in install.
BenjaminRodenberg Mar 3, 2021
1048f8d
Update README.md
BenjaminRodenberg Mar 3, 2021
74a5dbf
Remove hotfix from this repository. https://github.com/spack/spack/is…
BenjaminRodenberg Mar 3, 2021
8ee7c76
Merge branch 'develop' into spack-ci-improvements
BenjaminRodenberg Mar 4, 2021
e3371fd
Remove spack.yaml.
BenjaminRodenberg Mar 4, 2021
bad16b0
Only add repo, not all sources.
BenjaminRodenberg Mar 4, 2021
1a61b7e
Remove WORKDIR.
BenjaminRodenberg Mar 4, 2021
6eca69a
Merge branch 'develop' into spack-ci-improvements
BenjaminRodenberg Mar 4, 2021
da23d16
Merge branch 'develop' into spack-ci-improvements
BenjaminRodenberg Mar 4, 2021
5b08b87
Remove py-wheel.
BenjaminRodenberg Mar 4, 2021
14d8a7f
Copy is not necessary due to dev-build.
BenjaminRodenberg Mar 7, 2021
b7e4d5d
Revert "Copy is not necessary due to dev-build."
BenjaminRodenberg Mar 7, 2021
00b9101
Print arch and modules
BenjaminRodenberg Mar 7, 2021
6b37ff6
Build for generic architecture x86_64. #81
BenjaminRodenberg Mar 8, 2021
17dabd8
Specify target.
BenjaminRodenberg Mar 8, 2021
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
28 changes: 28 additions & 0 deletions .github/workflows/build-env.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Update build environment

on:
workflow_dispatch: # Trigger by hand from the UI
schedule:
- cron: '0 0 * * 0' # Schedule it every Sunday

jobs:
build-spack-pyprecice-deps:
name: Builds the baseimage for spack providing 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-deps-1804.dockerfile
tags: precice/ci-spack-pyprecice-deps-1804
27 changes: 6 additions & 21 deletions .github/workflows/build-spack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,32 +9,17 @@ jobs:
name: build_spack
runs-on: ubuntu-latest
timeout-minutes: 15
container: benjaminrueth/ci-spack-pyprecice-deps-1804
container: precice/ci-spack-pyprecice-deps-1804
defaults:
run:
shell: "bash --login -eo pipefail {0}"
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
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: |
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
- 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
- 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 && 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__)"
19 changes: 6 additions & 13 deletions spack/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,13 @@

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:
```
python3 jinja-instantiate.py --branch feature > my_package_script.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`.

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/var/spack/repos/builtin/packages/py-pyprecice/package.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.
* 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.
17 changes: 10 additions & 7 deletions spack/ci-spack-pyprecice-deps-1804.dockerfile
Original file line number Diff line number Diff line change
@@ -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

# Mount the current sources into the build container
# 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 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
15 changes: 0 additions & 15 deletions spack/jinja-instantiate.py

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class PyPyprecice(PythonPackage):
maintainers = ["ajaust", "BenjaminRodenberg"]

# 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")
Expand Down
2 changes: 2 additions & 0 deletions spack/repo/repo.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
repo:
namespace: 'spack'