-
Notifications
You must be signed in to change notification settings - Fork 3
191 lines (165 loc) · 6.1 KB
/
run_ec2_pcluster.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
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
jobs:
test-ufs-bundle:
runs-on: [self-hosted, Linux, X64, pcluster-ci-20230717]
steps:
- name: cleanup
if: ${{ github.event_name == 'schedule' }}
env:
JEDI_ENV: /home/ubuntu/ufs-bundle/jedi_run
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
env:
JEDI_ENV: /home/ubuntu/ufs-bundle/jedi_run
run: |
# In run directory
cd ${JEDI_ENV}
cat <<EOF > setup.sh
#!/bin/bash
echo "Loading ufs-bundle environment using spack-stack-1.4.0"
ulimit -s unlimited
ulimit -c unlimited
source /etc/profile.d/z00_lmod.sh
source /etc/profile.d/z01_lmod.sh
source /opt/intel/oneapi/compiler/2022.1.0/env/vars.sh
module use /mnt/experiments-efs/skylab-v5/spack-stack-1.4.0/envs/unified-env-v2/install/modulefiles/Core
module load stack-intel/2022.1.0
module load stack-intel-oneapi-mpi/2021.6.0
module load stack-python/3.10.8
module load jedi-ufs-env/unified-dev
module unload crtm
module li
export I_MPI_DEBUG=5
export I_MPI_FABRICS=shm
export I_MPI_PIN_DOMAIN=omp
export KMP_AFFINITY=compact
export KMP_STACKSIZE=2048m
export OMP_NUM_THREADS=1
export SLURM_EXPORT_ENV=ALL
EOF
- name: clone-build-bundle
env:
JEDI_ENV: /home/ubuntu/ufs-bundle/jedi_run
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
# UFS_APP=ATM
cd ${JEDI_ENV}
mkdir -p build-atm
cd build-atm
ecbuild -DUFS_APP=ATM ../ufs-bundle
make update
make -j8
# Runs mandatory ctests on the head node
ctest -R get_
ctest -R fv3jedi_setup_ufs_rundir_warmstart
ctest -R fv3jedi_setup_ufs_rundir_coldstart
ctest -R fv3jedi_test_tier1_model_ufs_warmstart
#ctest -R fv3jedi_test_tier1_model_ufs_coldstart
ctest -R fv3jedi_test_tier1_forecast_ufs_warmstart
#ctest -R fv3jedi_test_tier1_forecast_ufs_coldstart
# UFS_APP=ATMAERO
cd ${JEDI_ENV}
mkdir -p build-atmaero
cd build-atmaero
ecbuild -DUFS_APP=ATMAERO ../ufs-bundle
make update
make -j8
# Skip those for now - linker errors because of static/dynamic library mix
## UFS_APP=NG-GODAS
#cd ${JEDI_ENV}
#mkdir -p build-ng-godas
#cd build-ng-godas
#ecbuild -DUFS_APP=NG-GODAS ../ufs-bundle
#make update
#make -j8
#
## UFS_APP=S2S
#cd ${JEDI_ENV}
#mkdir -p build-s2s
#cd build-s2s
#ecbuild -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'