-
-
Notifications
You must be signed in to change notification settings - Fork 234
137 lines (132 loc) · 5.66 KB
/
spack.yml
File metadata and controls
137 lines (132 loc) · 5.66 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
name: Test Spack builds
on:
# Uncomment the below 'push' to trigger on push
# push:
# branches:
# - "**"
schedule:
# '*' is a special character in YAML, so string must be quoted
- cron: "0 2 * * *"
workflow_dispatch:
inputs:
spack_package_repo:
description: "Spack package repository to test"
default: "spack/spack-packages"
type: string
spack_package_ref:
description: "Spack package repository branch/tag to test"
default: "develop"
type: string
env:
GITHUB_USER: ${{ github.actor }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
OMPI_ALLOW_RUN_AS_ROOT: 1
OMPI_ALLOW_RUN_AS_ROOT_CONFIRM: 1
PRTE_MCA_rmaps_default_mapping_policy: :oversubscribe # Newer OpenMPI
OMPI_MCA_rmaps_base_oversubscribe: true # Older OpenMPI
jobs:
cpp-main:
name: Build DOLFINx (C++, main)
runs-on: ubuntu-latest
container: ubuntu:24.04
steps:
- name: Install Spack requirements
run: |
apt-get -y update
apt-get install -y bzip2 curl file git gzip make patch python3-minimal tar unzip xz-utils
apt-get install -y g++ gfortran # compilers
- name: Get DOLFINx code (to access Spack config and test files)
uses: actions/checkout@v6
- name: Set up Spack
uses: spack/setup-spack@main
with:
ref: develop # Spack version (examples: develop, releases/v0.23)
color: true # Force color output (SPACK_COLOR=always)
path: spack-src # Where to clone Spack
- name: Add Spack package repository
if: github.event_name == 'workflow_dispatch'
shell: spack-bash {0}
run: |
spack repo update
spack repo add --name test_pkgs https://github.com/${{ github.event.inputs.spack_package_repo }}.git ~/test_pkgs
spack repo update --branch ${{ github.event.inputs.spack_package_ref }} test_pkgs
spack repo list
spack config get repos
- name: Build DOLFINx
shell: spack-bash {0}
run: |
spack env create dolfinx .github/workflows/spack-config/gh-actions-env.yml
spack -e dolfinx install -j4 -p2 --use-buildcache=package:never,dependencies:auto --add fenics-dolfinx@main+petsc
spack repo list
spack config get repos
- name: Run a C++ test
shell: spack-bash {0}
run: |
cat .github/workflows/spack-config/gh-actions-env.yml
spack env create dolfinx-test .github/workflows/spack-config/gh-actions-env.yml
spack -e dolfinx-test install -j4 -p2 --use-buildcache=package:never,dependencies:auto --add fenics-dolfinx@main+petsc py-fenics-ffcx@main
spack env activate dolfinx-test
spack load cmake
cd cpp/demo/poisson
cmake .
make
mpirun -np 2 ./demo_poisson
- name: Push packages and update index
env:
GITHUB_USER: ${{ github.actor }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
spack -e dolfinx buildcache push --base-image ubuntu:24.04 --only dependencies --with-build-dependencies --update-index local-buildcache
if: ${{ !cancelled() }}
python-main:
name: Build DOLFINx (Python, main)
runs-on: ubuntu-latest
container: ubuntu:24.04
steps:
- name: Install Spack requirements
run: |
apt-get -y update
apt-get install -y bzip2 curl file git gzip make patch python3-minimal tar unzip xz-utils
apt-get install -y g++ gfortran # compilers
- name: Get DOLFINx code (to access Spack config and test files)
uses: actions/checkout@v6
- name: Set up Spack
uses: spack/setup-spack@main
with:
ref: develop # Spack version (examples: develop, releases/v0.23)
color: true # Force color output (SPACK_COLOR=always)
path: spack-src # Where to clone Spack
- name: Add Spack package repository
if: github.event_name == 'workflow_dispatch'
shell: spack-bash {0}
run: |
spack repo update
spack repo add --name test_pkgs https://github.com/${{ github.event.inputs.spack_package_repo }}.git ~/test_pkgs
spack repo update --branch ${{ github.event.inputs.spack_package_ref }} test_pkgs
spack repo list
spack config get repos
- name: Build DOLFINx
shell: spack-bash {0}
run: |
cat .github/workflows/spack-config/gh-actions-env.yml
spack env create dolfinx .github/workflows/spack-config/gh-actions-env.yml
spack -e dolfinx install -j4 -p2 --use-buildcache=package:never,dependencies:auto --add py-fenics-dolfinx@main %fenics-dolfinx+petsc~adios2
spack repo list
spack config get repos
- name: Run a Python test
shell: spack-bash {0}
run: |
cat .github/workflows/spack-config/gh-actions-env.yml
spack env create dolfinx-test .github/workflows/spack-config/gh-actions-env.yml
spack -e dolfinx-test install -j4 -p2 --use-buildcache=package:never,dependencies:auto --add py-fenics-dolfinx@main +petsc4py +slepc4py %fenics-dolfinx~adios2 py-setuptools
spack env activate dolfinx-test
spack compiler find
spack load gcc
mpirun -np 2 python python/demo/demo_elasticity.py
- name: Push packages and update index
env:
GITHUB_USER: ${{ github.actor }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
spack -e dolfinx buildcache push --base-image ubuntu:24.04 --only dependencies --with-build-dependencies --update-index local-buildcache
if: ${{ !cancelled() }}