-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathtest_integration.sh
32 lines (21 loc) · 1.1 KB
/
test_integration.sh
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
#!/bin/bash
set -xe
[[ -n $GOOGLE_APPLICATION_CREDENTIALS ]] && gcloud auth activate-service-account --key-file $GOOGLE_APPLICATION_CREDENTIALS
RUN=gs://vcm-ml-code-testing-data/sample-prognostic-run-output
random=$(openssl rand --hex 6)
OUTPUT=gs://vcm-ml-scratch/test-prognostic-report/$random
cd workflows/prognostic_run_diags
# compute diagnostics/mterics for a short sample prognostic run
mkdir -p /tmp/$random
prognostic_run_diags save $RUN /tmp/$random/diags.nc --n-jobs=4
prognostic_run_diags metrics /tmp/$random/diags.nc > /tmp/$random/metrics.json
gsutil cp /tmp/$random/diags.nc $OUTPUT/run1/diags.nc
gsutil cp /tmp/$random/metrics.json $OUTPUT/run1/metrics.json
# generate movies for short sample prognostic run
prognostic_run_diags movie --n_jobs 1 --n_timesteps 2 $RUN $OUTPUT/run1
# generate report based on diagnostics computed above
prognostic_run_diags report $OUTPUT $OUTPUT
# cleanup
rm -r /tmp/$random
echo "Yay! Prognostic run report integration test passed. You can view the generated report at:"
echo "https://storage.cloud.google.com/vcm-ml-scratch/test-prognostic-report/${random}/index.html"