-
Notifications
You must be signed in to change notification settings - Fork 3
212 lines (175 loc) · 6.14 KB
/
ubuntu-ci-x86_64.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
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
name: test-ufs-bundle-pcluster
# Controls when the workflow will run
on:
schedule:
- cron: '0 4 * * *'
pull_request:
# pull request to develop
branches: [develop]
workflow_dispatch:
defaults:
run:
shell: bash
env:
JEDI_ENV: /home/ubuntu/ufs-bundle/jedi-run
jobs:
test-ufs-bundle:
runs-on: [ubuntu-ci-c6a-x86_64]
steps:
- name: cleanup
if: ${{ github.event_name == 'schedule' }}
run: |
# Remove and prepare run directory
rm -fr ${JEDI_ENV}
mkdir -p ${JEDI_ENV}
cd ${JEDI_ENV}
pwd
ls -lart
- name: checkout
uses: actions/checkout@v3
# DH* Skip all this, since Skylab CI runs on same system and does that already
#
## Either this worked, or manually running the docker build as user ubuntu from
## the ravsamhq/notify-slack-action@v1 action below
#- name: ubuntu-docker
# run: |
# echo "Checking if user ubuntu can run docker"
# if id -nG ubuntu | grep -qw docker; then
# echo "User ubuntu already belongs to group docker"
# else
# echo "Adding user ubuntu to group docker"
# sudo gpasswd -a ubuntu docker
# newgrp docker
# docker run hello-world
# fi
#
#- name: set-credentials
# env:
# GH_USERNAME: ${{ secrets.JCSDABOT_USERNAME }}
# GH_TOKEN: ${{ secrets.JCSDABOT_TOKEN }}
# run: |
# # git config and credentials
# git config --global user.name "Luke Skywalker"
# git config --global user.email "[email protected]"
# git config --global credential.helper store
# touch ~/.git-credentials
# chmod 0700 ~/.git-credentials
# echo "https://$GH_USERNAME:[email protected]" > ~/.git-credentials
# *DH
- name: create-env-setup-script
run: |
# In run directory
cd ${JEDI_ENV}
cat <<EOF > setup.sh
#!/bin/bash
echo "Loading ufs-bundle environment using spack-stack-1.7.0"
ulimit -s unlimited
ulimit -c unlimited
source /etc/profile.d/modules.sh
source /opt/intel/oneapi/compiler/2023.2.3/env/vars.sh
source /opt/intel/oneapi/mpi/2021.10.0/env/vars.sh
module use /home/ubuntu/spack-stack/modulefiles
module load ecflow/5.11.4
module use /home/ubuntu/spack-stack-1.7.0/envs/ue-intel-2021.10.0/install/modulefiles/Core/
module load stack-intel/2021.10.0
module load stack-intel-oneapi-mpi/2021.10.0
module load stack-python/3.10.13
module load sp/2.5.0
module load awscli-v2
module load jedi-ufs-env
module load fms/2023.04
module li
export KMP_AFFINITY=compact
export KMP_STACKSIZE=2048m
export OMP_NUM_THREADS=1
export I_MPI_FABRICS=shm
export I_MPI_DEBUG=5
EOF
- name: clone-bundle
env:
UFS_BUNDLE_BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
run: |
# In run directory
cd ${JEDI_ENV}
# Set environment
source setup.sh
echo "Using branch ${UFS_BUNDLE_BRANCH_NAME} for ufs-bundle"
if [ -d ufs-bundle ] ; then
echo "Update existing copy of ufs-bundle"
cd ufs-bundle
git remote update
git checkout origin/${UFS_BUNDLE_BRANCH_NAME}
cd ..
else
echo "Check out a fresh copy of ufs-bundle"
git clone -b ${UFS_BUNDLE_BRANCH_NAME} https://github.com/jcsda/ufs-bundle
fi
### DO WE REALLY NEED THIS ??? rm -fr build-*
- name: build-atm
run: |
# In run directory
cd ${JEDI_ENV}
# Set environment
source setup.sh
mkdir -p build-atm
cd build-atm
cmake -DUFS_APP=ATM ../ufs-bundle
make update
make -j8
# Runs mandatory ctests on the head node
rm -rf fv3-jedi/test/Data/ModelRunDirs/UFS_warmstart/*
rm -rf fv3-jedi/test/Data/ModelRunDirs/UFS_warmstart_2/*
ctest -V -R ufs_
- name: build-atmaero
run: |
# In run directory
cd ${JEDI_ENV}
# Set environment
source setup.sh
mkdir -p build-atmaero
cd build-atmaero
cmake -DUFS_APP=ATMAERO ../ufs-bundle
make update
make -j8
- name: build-ng-godas
run: |
# In run directory
cd ${JEDI_ENV}
# Set environment
source setup.sh
mkdir -p build-ng-godas
cd build-ng-godas
cmake -DUFS_APP=NG-GODAS ../ufs-bundle
make update
make -j8
- name: build-s2s
run: |
# In run directory
cd ${JEDI_ENV}
# Set environment
source setup.sh
mkdir -p build-s2s
cd build-s2s
cmake -DUFS_APP=S2S ../ufs-bundle
make update
make -j8
- name: Report Status
if: always()
uses: ravsamhq/notify-slack-action@v1
env:
SLACK_WEBHOOK_URL: ${{ secrets.ACTION_MONITORING_SLACK }}
with:
# https://www.ravsam.in/blog/send-slack-notification-when-github-actions-fails/#getting-a-webhook-url
# https://www.ravsam.in/blog/collect-form-responses-using-google-apps-script
# https://github.com/marketplace/actions/notify-slack-action
status: ${{ job.status }}
notify_when: 'success,failure,warnings'
notification_title: '{workflow} has {status_message}'
message_format: '{emoji} *{workflow}* {status_message} for branch {branch} in <{repo_url}|{repo}>'
footer: ${{ github.event.pull_request.number || github.event_name || 'workflow dispatched manually' }}
# For testing: only notify user Dom
#mention_users: 'U02NLGXF5HV'
#mention_users_when: 'failure,warnings'
# Default: notify channel
mention_groups: '!channel'
mention_groups_when: 'failure,warnings'