Skip to content

Commit af8145c

Browse files
committed
Removed GCP CI deployment tests.
1 parent d0a6478 commit af8145c

File tree

8 files changed

+15
-222
lines changed

8 files changed

+15
-222
lines changed

.github/workflows/helm-tests.yml

Lines changed: 1 addition & 162 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ jobs:
116116
sleep 1
117117
done
118118
echo "all services have started, moving on..."
119-
119+
120120
- name: cleanup if services fail to boot
121121
if: steps.watchservices.outcome == 'failure'
122122
run: |
@@ -163,164 +163,3 @@ jobs:
163163
- name: helm uninstall eoapi templates
164164
run: |
165165
helm uninstall $RELEASE_NAME
166-
167-
gcp-integration-tests:
168-
# run on:
169-
# - a PR was just labeled 'test-integration-gcp'
170-
# - a PR was just labeled 'test-integration'
171-
# - a PR with 'test-integration' label was opened, reopened, or synchronized
172-
if: |
173-
github.event.label.name == 'test-integration-gcp' ||
174-
contains( github.event.pull_request.labels.*.name, 'test-integration-gcp')
175-
permissions:
176-
contents: 'read'
177-
id-token: 'write'
178-
needs: helm-tests
179-
runs-on: ubuntu-latest
180-
steps:
181-
- uses: actions/checkout@v4
182-
183-
- uses: azure/setup-helm@v4
184-
with:
185-
version: ${{ env.HELM_VERSION }}
186-
#token: ${{ secrets.GITHUB_TOKEN }}
187-
188-
- name: last commit sha if PR
189-
if: ${{ github.event_name == 'pull_request' }}
190-
shell: bash
191-
run: |
192-
echo "LAST_COMMIT_SHA=${{ github.event.pull_request.head.sha }}" >> ${GITHUB_ENV}
193-
194-
- name: last commit sha if push
195-
if: ${{ github.event_name == 'push' }}
196-
shell: bash
197-
run: |
198-
echo "LAST_COMMIT_SHA=${GITHUB_SHA}" >> ${GITHUB_ENV}
199-
200-
- name: set k8s .release.name suffix
201-
run: |
202-
# salt for randomness per test run
203-
COMMITSHA=$(echo $LAST_COMMIT_SHA | cut -c 1-6)
204-
SALT=$(echo "${RANDOM}${RANDOM}${RANDOM}" | cut -c1-3)
205-
echo "RELEASE_NAME=eoapi$COMMITSHA$SALT" >> $GITHUB_ENV
206-
207-
- id: 'auth'
208-
uses: 'google-github-actions/auth@v2'
209-
with:
210-
service_account: '[email protected]'
211-
credentials_json: ${{ secrets.GH_ACTIONS_SA_JSON }}
212-
213-
- name: setup gcloud sdk
214-
uses: google-github-actions/setup-gcloud@v2
215-
with:
216-
version: '>= 363.0.0'
217-
project_id: 'devseed-labs'
218-
219-
- name: configure kubectl context
220-
run: |
221-
gcloud components install gke-gcloud-auth-plugin
222-
gcloud container clusters get-credentials k8seed-labs-cluster --zone us-central1-f
223-
224-
- name: helm install crunchydata postgres operator
225-
run: |
226-
helm upgrade --install \
227-
--set disable_check_for_upgrades=true \
228-
pgo \
229-
oci://registry.developers.crunchydata.com/crunchydata/pgo \
230-
--version ${{ env.PGO_VERSION }}
231-
232-
- name: helm render/install eoapi templates
233-
run: |
234-
HOST='${{ env.RELEASE_NAME }}.k8s.labs.ds.io'
235-
echo $HOST
236-
237-
cd helm-chart
238-
239-
helm dependency build eoapi
240-
241-
helm install $RELEASE_NAME \
242-
--namespace $RELEASE_NAME \
243-
--create-namespace \
244-
--set ingress.host=$HOST \
245-
-f ./eoapi/values.yaml \
246-
-f ./eoapi/test-gcp-unittest-values.yaml \
247-
./eoapi
248-
249-
- name: sleep for 10s seconds while services boot
250-
shell: bash
251-
run: sleep 10s
252-
253-
# - name: Setup upterm session
254-
# uses: lhotari/action-upterm@v1
255-
256-
- id: watchservices
257-
name: watch services boot
258-
timeout-minutes: 10
259-
continue-on-error: true
260-
run: |
261-
kubectl config set-context --current --namespace=$RELEASE_NAME
262-
while [[ -z "$(kubectl get pod | grep "^raster-$RELEASE_NAME-.*$" | cut -d' ' -f1 | xargs -I{} kubectl logs pod/{} | grep "GET /.*/healthz" | head -n 1)" ]]; do
263-
echo "still waiting for raster service to start..."
264-
sleep 1
265-
done
266-
echo "raster service has started, moving on..."
267-
while [[ -z "$(kubectl get pod | grep "^vector-$RELEASE_NAME-.*$" | cut -d' ' -f1 | xargs -I{} kubectl logs pod/{} | grep "GET /healthz" | head -n 1)" ]]; do
268-
echo "still waiting for vector service to start..."
269-
sleep 1
270-
done
271-
echo "vector service has started, moving on..."
272-
while [[ -z "$(kubectl get pod | grep "^stac-$RELEASE_NAME-.*$" | cut -d' ' -f1 | xargs -I{} kubectl logs pod/{} | grep "GET /_mgmt/ping" | head -n 1)" ]]; do
273-
echo "still waiting for stac service to start..."
274-
sleep 1
275-
done
276-
echo "all services have started, moving on..."
277-
278-
- name: cleanup if services fail to boot
279-
if: steps.watchservices.outcome == 'failure'
280-
run: |
281-
echo "The previous step failed or timed out. Running cleanup logic..."
282-
helm uninstall $RELEASE_NAME
283-
284-
kubectl delete ns/$RELEASE_NAME
285-
286-
# force GH action to show failed result
287-
exit 128
288-
289-
- name: install python unit-test dependencies
290-
run: |
291-
python -m pip install pytest httpx
292-
293-
- name: run the tests
294-
id: testrunner
295-
continue-on-error: true
296-
run: |
297-
kubectl config set-context --current --namespace=$RELEASE_NAME
298-
PUBLICIP='https://${{ env.RELEASE_NAME }}.k8s.labs.ds.io'
299-
export VECTOR_ENDPOINT=$PUBLICIP/vector$RELEASE_NAME
300-
export STAC_ENDPOINT=$PUBLICIP/stac$RELEASE_NAME
301-
export RASTER_ENDPOINT=$PUBLICIP/raster$RELEASE_NAME
302-
303-
echo '#################################'
304-
echo $VECTOR_ENDPOINT
305-
echo $STAC_ENDPOINT
306-
echo $RASTER_ENDPOINT
307-
echo '#################################'
308-
309-
pytest .github/workflows/tests/test_vector.py
310-
pytest .github/workflows/tests/test_stac.py
311-
# TODO: fix raster tests
312-
#pytest .github/workflows/tests/test_raster.py
313-
314-
- name: cleanup if tests fail
315-
if: steps.testrunner.outcome == 'failure'
316-
run: |
317-
echo "The previous step failed or timed out. Running cleanup logic..."
318-
helm uninstall $RELEASE_NAME
319-
kubectl delete ns/$RELEASE_NAME
320-
# force GH action to show failed result
321-
exit 128
322-
323-
- name: helm uninstall eoapi templates
324-
run: |
325-
helm uninstall $RELEASE_NAME
326-
kubectl delete ns/$RELEASE_NAME

helm-chart/eoapi/templates/_helpers.tpl

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -61,30 +61,6 @@ Create the name of the service account to use
6161
{{- end }}
6262
{{- end }}
6363

64-
{{/*
65-
Create pgstac host string depending if .Values.testing
66-
*/}}
67-
{{- define "eoapi.pgstacTempDbHostName" -}}
68-
{{- if .Values.testing }}
69-
{{- printf "%s-%s" "pgstac" .Release.Name }}
70-
{{- else }}
71-
{{/* need to match what is default in values.yamls */}}
72-
{{- printf "%s" "pgstac" }}
73-
{{- end }}
74-
{{- end }}
75-
76-
{{/*
77-
Create pgstac host string depending if .Values.testing
78-
*/}}
79-
{{- define "eoapi.pgstacHostName" -}}
80-
{{- if .Values.testing }}
81-
{{- printf "%s-%s" "pgstacbootstrap" .Release.Name }}
82-
{{- else }}
83-
{{/* need to match what is default in values.yamls */}}
84-
{{- printf "%s" "pgstacbootstrap" }}
85-
{{- end }}
86-
{{- end }}
87-
8864
{{/*
8965
Secrets for postgres/postgis access have to be
9066
derived from what the crunchydata operator creates

helm-chart/eoapi/templates/db/deployment.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,19 @@
33
apiVersion: apps/v1
44
kind: Deployment
55
metadata:
6-
name: {{ include "eoapi.pgstacTempDbHostName" . | nindent 8 }}
6+
name: pgstac
77
labels:
8-
app: {{ include "eoapi.pgstacTempDbHostName" . | nindent 10 }}
8+
app: pgstac
99
spec:
1010
selector:
1111
matchLabels:
12-
app: {{ include "eoapi.pgstacTempDbHostName" . | nindent 12 }}
12+
app: pgstac
1313
strategy:
1414
type: Recreate
1515
template:
1616
metadata:
1717
labels:
18-
app: {{ include "eoapi.pgstacTempDbHostName" . | nindent 14 }}
18+
app: pgstac
1919
spec:
2020
restartPolicy: Always
2121
containers:
@@ -73,4 +73,4 @@ spec:
7373
- name: initdb-sh-volume-{{ $.Release.Name }}
7474
configMap:
7575
name: initdb-sh-config-{{ $.Release.Name }}
76-
{{- end }}
76+
{{- end }}

helm-chart/eoapi/templates/db/service.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ apiVersion: v1
44
kind: Service
55
metadata:
66
labels:
7-
app: {{ include "eoapi.pgstacTempDbHostName" . | nindent 10 }}
8-
name: {{ include "eoapi.pgstacTempDbHostName" . | nindent 8 }}
7+
app: pgstac
8+
name: pgstac
99
spec:
1010
ports:
1111
- name: "5432"
1212
port: 5432
1313
targetPort: 5432
1414
selector:
15-
app: {{ include "eoapi.pgstacTempDbHostName" . | nindent 10 }}
16-
{{- end }}
15+
app: pgstac
16+
{{- end }}

helm-chart/eoapi/templates/pgstacboostrap/job.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@
33
apiVersion: batch/v1
44
kind: Job
55
metadata:
6-
name: {{ include "eoapi.pgstacHostName" . | nindent 8 }}
6+
name: pgstacbootstrap
77
labels:
8-
app: {{ include "eoapi.pgstacHostName" . | nindent 10 }}
8+
app: pgstacbootstrap
99
spec:
1010
template:
1111
metadata:
1212
labels:
13-
app: {{ include "eoapi.pgstacHostName" . | nindent 14 }}
13+
app: pgstacbootstrap
1414
spec:
1515
restartPolicy: Never
1616
containers:

helm-chart/eoapi/templates/services/ingress-nginx.yaml

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -32,22 +32,14 @@ spec:
3232
paths:
3333
{{- range $serviceName, $v := .Values }}
3434
{{- if has $serviceName $.Values.apiServices }}
35-
{{- if (and (index $v "enabled") (not $.Values.testing)) }}
35+
{{- if (index $v "enabled") }}
3636
- pathType: Prefix
3737
path: "/{{ $serviceName }}(/|$)(.*)"
3838
backend:
3939
service:
4040
name: {{ $serviceName }}
4141
port:
4242
number: {{ $.Values.service.port }}
43-
{{- else if (and (index $v "enabled") ($.Values.testing)) }}
44-
- pathType: Prefix
45-
path: "/{{ $serviceName }}{{ $.Release.Name }}(/|$)(.*)"
46-
backend:
47-
service:
48-
name: {{ $serviceName }}-{{ $.Release.Name }}
49-
port:
50-
number: {{ $.Values.service.port }}
5143
{{- end }}{{/* END: if index $v "enabled" */}}
5244
{{- end }}{{/* END: if has $serviceName $.Values.apiServices */}}
5345
{{- end }}{{/* END: range $serviceName, $v := .Values*/}}

helm-chart/eoapi/templates/services/ingress-traefik.yaml

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -42,22 +42,14 @@ spec:
4242
paths:
4343
{{- range $serviceName, $v := .Values }}
4444
{{- if has $serviceName $.Values.apiServices }}
45-
{{- if (and (index $v "enabled") (not $.Values.testing)) }}
45+
{{- if (index $v "enabled") }}
4646
- pathType: Prefix
4747
path: "/{{ $serviceName }}"
4848
backend:
4949
service:
5050
name: {{ $serviceName }}
5151
port:
5252
number: {{ $.Values.service.port }}
53-
{{- else if (and (index $v "enabled") ($.Values.testing)) }}
54-
- pathType: Prefix
55-
path: "/{{ $serviceName }}{{ $.Release.Name }}"
56-
backend:
57-
service:
58-
name: {{ $serviceName }}-{{ $.Release.Name }}
59-
port:
60-
number: {{ $.Values.service.port }}
6153
{{- end }}{{/* END: if index $v "enabled" */}}
6254
{{- end }}{{/* END: if has $serviceName $.Values.apiServices */}}
6355
{{- end }}{{/* END: range $serviceName, $v := .Values*/}}

helm-chart/eoapi/templates/services/service.yaml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,9 @@
44
apiVersion: v1
55
kind: Service
66
metadata:
7-
{{- if $.Values.testing }}
8-
labels:
9-
app: {{ $serviceName }}-{{ $.Release.Name }}
10-
name: {{ $serviceName }}-{{ $.Release.Name }}
11-
{{- else }}
127
labels:
138
app: {{ $serviceName }}
149
name: {{ $serviceName }}
15-
{{- end }}
1610
spec:
1711
{{- if (and ($.Values.ingress.className) (eq $.Values.ingress.className "nginx")) }}
1812
type: "ClusterIP"

0 commit comments

Comments
 (0)