-
Notifications
You must be signed in to change notification settings - Fork 12
95 lines (83 loc) · 3.05 KB
/
ci-offline-solve.yaml
File metadata and controls
95 lines (83 loc) · 3.05 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
name: Offline Solve Test
on:
# Allow manual triggering of this workflow
workflow_dispatch:
# Run every other day at 3:00am UTC
schedule:
- cron: '0 3 */2 * *'
permissions:
contents: read
jobs:
# Test that solve operations work without network access
# This is critical for HPC environments where compute nodes don't have internet
# Uses Docker with --network none to truly block all network access
test-offline-solve:
if: github.repository == 'Climate-REF/climate-ref'
runs-on: ubuntu-latest
env:
IMAGE: ghcr.io/climate-ref/climate-ref:latest
REF_DIR: /tmp/ref-offline-test
steps:
- name: Checkout (for cache key)
uses: actions/checkout@v6
with:
sparse-checkout: |
packages/climate-ref-esmvaltool/src/climate_ref_esmvaltool/requirements
packages/climate-ref-pmp/src/climate_ref_pmp/requirements
sparse-checkout-cone-mode: false
- name: Pull latest container from main
run: docker pull $IMAGE
# Cache conda environments
- name: Cache conda environments
id: cache-conda
uses: actions/cache@v5
with:
path: /tmp/ref-offline-test/software/conda
key: offline-conda-${{ hashFiles('packages/*/src/*/requirements/conda-lock.yml') }}
# Cache test data (~100MB, quick to download but saves time)
- name: Cache test data
id: cache-data
uses: actions/cache@v5
with:
path: /tmp/ref-offline-test/sample-data
key: offline-sample-data-v1
- name: Create REF directory
run: |
mkdir -p $REF_DIR
# Fix permissions for Docker user (uid 1000)
sudo chown -R 1000:1000 $REF_DIR
- name: Fetch test data
if: steps.cache-data.outputs.cache-hit != 'true'
run: |
docker run --rm \
-v $REF_DIR:/ref \
$IMAGE \
datasets fetch-data --registry sample-data --output-directory /ref/sample-data
- name: Setup provider environments
if: steps.cache-conda.outputs.cache-hit != 'true'
run: |
# Run provider setup (creates conda envs and fetches reference data)
docker run --rm \
-v $REF_DIR:/ref \
$IMAGE \
providers setup
- name: Ingest sample data
run: |
# Always re-ingest since DB is not cached
docker run --rm \
-v $REF_DIR:/ref \
$IMAGE \
datasets ingest --source-type cmip6 /ref/sample-data/CMIP6
docker run --rm \
-v $REF_DIR:/ref \
$IMAGE \
datasets ingest --source-type obs4mips /ref/sample-data/obs4REF
- name: Run solve with no network access
run: |
# Run solve with --network none to verify no network is needed
# This is the actual offline test - if this fails, something needs network
docker run --rm \
--network none \
-v $REF_DIR:/ref \
$IMAGE \
-v solve --one-per-provider --timeout 3600