-
Notifications
You must be signed in to change notification settings - Fork 46
146 lines (121 loc) · 5.59 KB
/
macos-ci-aarch64.yaml
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
138
139
140
141
142
143
144
145
146
name: macos-ci-aarch64-build
on:
pull_request:
paths-ignore:
- 'doc/**'
- '**.md'
- '.github/ISSUE_TEMPLATE/*'
- '.gitignore'
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
defaults:
run:
shell: bash
jobs:
macos-ci-aarch64-build:
runs-on: [macos-ci-aarch64]
steps:
- name: cleanup
run: |
pwd
ls -lart
rm -fr *
- name: checkout
uses: actions/checkout@v2
with:
submodules: true
- name: create-env
run: |
# Set up homebrew and lmod support
eval "$(/opt/homebrew/bin/brew shellenv)"
source /opt/homebrew/opt/lmod/init/profile
# Set up spack-stack
source ./setup.sh
# Important!
export SPACK_PYTHON=/usr/bin/python3
# DH* 20230302 - to avoid using padded_length for build caches,
# always build in the same environment so that the length of the
# path doesn't change - see also other 'DH* 20230302' changes below
#export ENVNAME=${{ inputs.template || 'unified-dev' }}.macos-ci-aarch64
export ENVNAME=ci-env.macos-ci-aarch64
# *DH
export ENVDIR=$PWD/envs/${ENVNAME}
spack stack create env --site macos.default --template ${{ inputs.template || 'unified-dev' }} --name ${ENVNAME}
spack env activate ${ENVDIR}
spack add ${{ inputs.specs || '' }}
export SPACK_SYSTEM_CONFIG_PATH="${ENVDIR}/site"
# Find external packages
spack external find --scope system --exclude bison --exclude openssl
spack external find --scope system perl
spack external find --scope system wget
PATH="/opt/homebrew/opt/curl/bin:$PATH" \
spack external find --scope system curl
PATH="/opt/homebrew/opt/qt5/bin:$PATH" \
spack external find --scope system qt
spack external find --scope system texlive
spack external find --scope system mysql
# Find compilers
spack compiler find --scope system
export -n SPACK_SYSTEM_CONFIG_PATH
# DH* 20230302 - Don't use yet, too many problems
## For buildcaches
#spack config add config:install_tree:padded_length:true
# *DH
# Set compiler and MPI
spack config add "packages:all:providers:mpi:[openmpi@4.1.6]"
spack config add "packages:all:compiler:[apple-clang@14.0.3]"
sed -i '' "s/\['\%aocc', '\%apple-clang', '\%gcc', '\%intel'\]/\['\%apple-clang'\]/g" $ENVDIR/spack.yaml
# Add additional variants for MET packages, different from config/common/packages.yaml
spack config add "packages:met:variants:+python +grib2 +graphics +lidar2nc +modis"
# Concretize and check for duplicates
spack concretize 2>&1 | tee log.concretize.apple-clang-14.0.3
${SPACK_STACK_DIR}/util/show_duplicate_packages.py -d log.concretize.apple-clang-14.0.3 -i fms -i crtm -i esmf -i mapl
# Add and update source cache
spack mirror add local-source file:///Users/ec2-user/spack-stack/source-cache/
spack mirror create -a -d /Users/ec2-user/spack-stack/source-cache/
# Add binary cache and reindex it
spack mirror add local-binary file:///Users/ec2-user/spack-stack/build-cache/
spack buildcache update-index local-binary
echo "Packages in combined spack build caches:"
spack buildcache list
# Break installation up in pieces and create build caches in between
# This allows us to "spin up" builds that altogether take longer than
# six hours, and/or fail later in the build process.
# base-env
echo "base-env ..."
spack install --fail-fast --source --no-check-signature base-env 2>&1 | tee log.install.apple-clang-14.0.3.base-env
spack buildcache create -a -u /Users/ec2-user/spack-stack/build-cache/ base-env
# the rest
echo "${{ inputs.template || 'unified-dev' }} ..."
spack install --fail-fast --source --no-check-signature 2>&1 | tee log.install.apple-clang-14.0.3.${{ inputs.template || 'unified-dev' }}
spack buildcache create -a -u /Users/ec2-user/spack-stack/build-cache/
# Next steps: synchronize source and build cache to a central/combined mirror?
echo "Next steps ..."
spack clean -a
spack module lmod refresh -y
spack stack setup-meta-modules
spack env deactivate
- name: test-env
run: |
# Set up homebrew and lmod support
eval "$(/opt/homebrew/bin/brew shellenv)"
source /opt/homebrew/opt/lmod/init/profile
# DH* 20230302 - to avoid using padded_length for build caches,
# always build in the same environment so that the length of the
# path doesn't change - see also other 'DH* 20230302' changes below
#export ENVNAME=${{ inputs.template || 'unified-dev' }}.macos-ci-aarch64
export ENVNAME=ci-env.macos-ci-aarch64
# *DH
export ENVDIR=$PWD/envs/${ENVNAME}
ls -l ${ENVDIR}/install/modulefiles/Core
module use ${ENVDIR}/install/modulefiles/Core
module load stack-apple-clang/14.0.3
module load stack-openmpi/4.1.6
module load stack-python/3.10.13
module available
module load jedi-ufs-env/1.0.0
module load ewok-env/1.0.0
module load soca-env/1.0.0
module list