55 branches : [ "main" ]
66 pull_request :
77 branches : [ "main" ]
8+ workflow_dispatch :
9+ inputs :
10+ debug_enabled :
11+ type : boolean
12+ description : ' Run with upterm debugging enabled (requires SSH key in secrets)'
13+ required : false
14+ default : false
815
916env :
1017 HELM_VERSION : v3.15.2
2734 version : ${{ env.HELM_VERSION }}
2835
2936 - name : Setup Helm dependencies
30- run : ./scripts/deploy.sh setup
37+ run : ./scripts/deploy.sh setup --deps-only
3138
3239 - name : Install ajv-cli
3340 run : npm install -g ajv-cli ajv-formats
3946 run : make validate-schema
4047
4148 - name : Run Helm unit tests
42- run : make tests
49+ run : make test-helm
4350
4451 integration-tests :
4552 name : Integration tests
4956 steps :
5057 - uses : actions/checkout@v5
5158
59+ - name : Set up Python
60+ uses : actions/setup-python@v5
61+ with :
62+ python-version : ' 3.12'
63+
64+ - name : Install Python dependencies
65+ run : |
66+ python -m pip install --upgrade pip
67+ pip install httpx psycopg2-binary pytest
68+
5269 - name : Start K3s cluster
5370 uses : jupyterhub/action-k3s-helm@v4
5471 with :
@@ -86,24 +103,134 @@ jobs:
86103 - name : Deploy eoAPI
87104 id : deploy
88105 run : |
106+ set -e # Exit on any error
107+
89108 echo "=== eoAPI Deployment ==="
109+ echo "RELEASE_NAME: ${RELEASE_NAME}"
110+ echo "PGO_VERSION: ${{ env.PGO_VERSION }}"
111+
90112 export RELEASE_NAME="${RELEASE_NAME}"
91113 export PGO_VERSION="${{ env.PGO_VERSION }}"
92- export CI_MODE=true
93114
94- # Deploy using consolidated script with CI mode
95- ./scripts/deploy.sh --ci
115+ # Deploy using consolidated script with k3s values for testing
116+ echo "Running deploy script..."
117+ if ! ./scripts/deploy.sh deploy --namespace "${RELEASE_NAME}" --release "${RELEASE_NAME}" \
118+ -f charts/eoapi/local-base-values.yaml \
119+ -f charts/eoapi/local-k3s-values.yaml \
120+ --set ingress.host=eoapi.local \
121+ --set eoapi-notifier.config.sources[0].config.connection.existingSecret.name="${RELEASE_NAME}-pguser-eoapi" \
122+ --debug; then
123+
124+ echo "❌ Deploy script failed"
125+ kubectl get namespaces
126+ kubectl get pods -A
127+ exit 1
128+ fi
129+
130+ # Verify namespace was created
131+ echo "=== Verifying namespace creation ==="
132+ if ! kubectl get namespace "${RELEASE_NAME}" >/dev/null 2>&1; then
133+ echo "❌ Namespace ${RELEASE_NAME} was not created"
134+ kubectl get namespaces
135+ exit 1
136+ fi
137+ echo "✅ Namespace ${RELEASE_NAME} exists"
138+
139+ # List resources in namespace
140+ echo "=== Resources in namespace ${RELEASE_NAME} ==="
141+ kubectl get all -n "${RELEASE_NAME}"
142+
143+ - name : Debug session after deployment
144+ if : ${{ github.event_name == 'workflow_dispatch' && inputs.debug_enabled }}
145+ uses : lhotari/action-upterm@v1
146+ with :
147+ limit-access-to-keys : ${{ secrets.UPTERM_SSH_KEY }}
148+ wait-timeout-minutes : 30
96149
97150 - name : Validate deployment
98151 run : |
99152 echo "=== Post-deployment validation ==="
153+ export NAMESPACE="${RELEASE_NAME}"
100154 ./scripts/test.sh check-deployment
101155
156+ - name : Wait for services to be ready
157+ run : |
158+ set -e # Exit on any error
159+
160+ echo "=== Waiting for Services to be Ready ==="
161+ echo "RELEASE_NAME: ${RELEASE_NAME}"
162+
163+ # Verify namespace exists first
164+ if ! kubectl get namespace "${RELEASE_NAME}" >/dev/null 2>&1; then
165+ echo "❌ Namespace ${RELEASE_NAME} does not exist!"
166+ kubectl get namespaces
167+ exit 1
168+ fi
169+
170+ echo "Waiting for deployments in namespace ${RELEASE_NAME}..."
171+ kubectl wait --for=condition=available deployment/"${RELEASE_NAME}"-stac -n "${RELEASE_NAME}" --timeout=300s
172+ kubectl wait --for=condition=available deployment/"${RELEASE_NAME}"-raster -n "${RELEASE_NAME}" --timeout=300s
173+ kubectl wait --for=condition=available deployment/"${RELEASE_NAME}"-vector -n "${RELEASE_NAME}" --timeout=300s
174+
175+ # Get the K3s node IP and set up host entry
176+ NODE_IP=$(kubectl get nodes -o jsonpath='{.items[0].status.addresses[?(@.type=="InternalIP")].address}')
177+ echo "Node IP: $NODE_IP"
178+
179+ # Add eoapi.local to /etc/hosts for ingress access
180+ echo "$NODE_IP eoapi.local" | sudo tee -a /etc/hosts
181+
182+ # Wait for ingress to be ready
183+ echo "=== Waiting for Ingress to be Ready ==="
184+ kubectl get ingress -n "${RELEASE_NAME}"
185+
186+ # Wait for Traefik to pick up the ingress rules
187+ sleep 10
188+
189+ # Test connectivity through ingress using eoapi.local
190+ echo "=== Testing API connectivity through ingress ==="
191+ for i in {1..30}; do
192+ if curl -s "http://eoapi.local/stac/_mgmt/ping" 2>/dev/null; then
193+ echo "✅ STAC API accessible through ingress"
194+ break
195+ fi
196+ echo "Waiting for STAC API... (attempt $i/30)"
197+ sleep 3
198+ done
199+
200+ for i in {1..30}; do
201+ if curl -s "http://eoapi.local/raster/healthz" 2>/dev/null; then
202+ echo "✅ Raster API accessible through ingress"
203+ break
204+ fi
205+ echo "Waiting for Raster API... (attempt $i/30)"
206+ sleep 3
207+ done
208+
209+ for i in {1..30}; do
210+ if curl -s "http://eoapi.local/vector/healthz" 2>/dev/null; then
211+ echo "✅ Vector API accessible through ingress"
212+ break
213+ fi
214+ echo "Waiting for Vector API... (attempt $i/30)"
215+ sleep 3
216+ done
217+
102218 - name : Run integration tests
103219 run : |
104220 export RELEASE_NAME="$RELEASE_NAME"
221+ export NAMESPACE="$RELEASE_NAME"
222+ export STAC_ENDPOINT="http://eoapi.local/stac"
223+ export RASTER_ENDPOINT="http://eoapi.local/raster"
224+ export VECTOR_ENDPOINT="http://eoapi.local/vector"
105225 ./scripts/test.sh integration --debug
106226
227+ - name : Debug session on test failure
228+ if : ${{ github.event_name == 'workflow_dispatch' && inputs.debug_enabled && failure() }}
229+ uses : lhotari/action-upterm@v1
230+ with :
231+ limit-access-to-keys : ${{ secrets.UPTERM_SSH_KEY }}
232+ wait-timeout-minutes : 30
233+
107234 - name : Debug failed deployment
108235 if : failure()
109236 run : |
@@ -112,8 +239,8 @@ jobs:
112239 - name : Cleanup
113240 if : always()
114241 run : |
115- helm uninstall "$RELEASE_NAME" -n eoapi || true
116- kubectl delete namespace eoapi || true
242+ helm uninstall "$RELEASE_NAME" -n "$RELEASE_NAME" || true
243+ kubectl delete namespace "$RELEASE_NAME" || true
117244 validate-docs :
118245 name : Validate documentation
119246 runs-on : ubuntu-latest
0 commit comments