-
Notifications
You must be signed in to change notification settings - Fork 51
118 lines (95 loc) · 3.2 KB
/
harmony-in-a-box.yml
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
name: Harmony in a box
on: [push]
jobs:
harmony-in-a-box:
# TODO this is locked to macos-12 to fix an issue with the gdal dependency
# We will go back to macos-latest in HARMONY-1765
runs-on: macos-12
strategy:
matrix:
node-version: [22.x]
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Install setuptools
run: sudo -H pip install setuptools
- name: Install docker
run: |
brew update
brew install docker
brew install kubectl
- name: Install awslocal
run: |
pip install awscli-local
- name: Set up npm dependency caching
uses: actions/setup-node@v4
with:
node-version: 22
cache: 'npm'
cache-dependency-path: '**/package-lock.json'
- name: Create netrc
run: bin/create-netrc
env:
EDL_USER: ${{ secrets.LEO_EDL_USER }}
EDL_PASSWORD: ${{ secrets.LEO_EDL_PASSWORD }}
- name: Install dependencies
run: |
source bin/helper
retry_command 10 npm ci
- name: Start colima
run: colima start --cpu 2 --memory 12 --with-kubernetes
- name: Check colima status
run: colima status
- name: Pull down basic harmony docker images
run: bin/pull-harmony-images
- name: Build harmony image
run: |
source bin/helper
retry_command 10 npm run build
- name: Build all other images
run: |
source bin/helper
retry_command 10 npm run build-sequential
- name: list images
run: docker images
- name: Check kubernetes status
run: |
source bin/helper
retry_command 5 kubectl cluster-info
- name: Start harmony in a box
run: |
source bin/helper
export KUBE_CONTEXT=colima
export EXEC_CONTEXT=workflow
retry_command 5 bin/bootstrap-harmony
env:
OAUTH_CLIENT_ID: ${{ secrets.OAUTH_CLIENT_ID }}
OAUTH_UID: ${{ secrets.OAUTH_UID }}
OAUTH_PASSWORD: ${{ secrets.OAUTH_PASSWORD }}
- name: debug pods
run: |
kubectl -n harmony get pods
- name: Check if harmony server is up
run: |
HTTP_STATUS=$(curl -I -s -o /dev/null -w "%{http_code}" "http://localhost:3000")
echo "harmony server status code: $HTTP_STATUS"
- name: Run harmony request
id: curl
run: |
HTTP_STATUS=$(curl -Ln -bj -w "%{http_code}" "http://localhost:3000/C1233800302-EEDTEST/ogc-api-coverages/1.0.0/collections/all/coverage/rangeset?granuleId=G1233800343-EEDTEST&format=image/tiff" -o /dev/null)
echo "http_status=$HTTP_STATUS" >> "$GITHUB_OUTPUT"
- name: Check HTTP status code
env:
HTTP_STATUS: ${{ steps.curl.outputs.http_status }}
run: |
if [[ "$HTTP_STATUS" -eq 200 ]]; then
echo "HTTP request was successful!"
else
echo "HTTP request failed with status code $HTTP_STATUS"
kubectl -n harmony get pods
harmony_pod=$(kubectl get pods -n harmony -l app=harmony | grep -v NAME | awk '{print $1;}')
kubectl -n harmony describe pod $harmony_pod
echo "Harmony pod log:"
kubectl -n harmony logs $harmony_pod
exit 1
fi