From eb7f9452742a98fad22d807b0bce6a7e2cff21ec Mon Sep 17 00:00:00 2001 From: ranchodeluxe Date: Sun, 17 Sep 2023 09:44:30 -0700 Subject: [PATCH 1/2] figure out stac resourcing problem --- .github/workflows/helm-tests.yml | 5 ++++- helm-chart/eoapi/templates/db/configmap.yaml | 1 + helm-chart/eoapi/templates/db/deployment.yaml | 7 +++++++ helm-chart/eoapi/test-unittest-values.yaml | 19 ++++++++++++++----- helm-chart/eoapi/tests/deploy_tests.yaml | 2 +- helm-chart/eoapi/values.yaml | 9 +++++++-- 6 files changed, 34 insertions(+), 9 deletions(-) diff --git a/.github/workflows/helm-tests.yml b/.github/workflows/helm-tests.yml index e3d84080..8b82795d 100644 --- a/.github/workflows/helm-tests.yml +++ b/.github/workflows/helm-tests.yml @@ -103,9 +103,10 @@ jobs: shell: bash run: sleep 10s - - id: watchservices + name: watch services boot timeout-minutes: 10 + continue-on-error: true run: | kubectl config set-context --current --namespace=eoapitest while [[ -z "$(kubectl get pod | grep "^raster-$RELEASE_NAME-.*$" | cut -d' ' -f1 | xargs -I{} kubectl logs pod/{} | grep "GET /healthz" | head -n 1)" ]]; do @@ -129,6 +130,8 @@ jobs: run: | echo "The previous step failed or timed out. Running cleanup logic..." helm uninstall $RELEASE_NAME + # force GH action to show failed result + exit 128 - name: install python unit-test dependencies run: | diff --git a/helm-chart/eoapi/templates/db/configmap.yaml b/helm-chart/eoapi/templates/db/configmap.yaml index 9ec2b2a5..e9f29009 100644 --- a/helm-chart/eoapi/templates/db/configmap.yaml +++ b/helm-chart/eoapi/templates/db/configmap.yaml @@ -30,5 +30,6 @@ data: pypgstac load collections /opt/initdb/json-data/noaa-emergency-response.json --dsn $DSN --method insert_ignore pypgstac load items /opt/initdb/json-data/noaa-eri-nashville2020.json --dsn $DSN --method insert_ignore psql $DSN -f /opt/initdb/sql-data/initdb.sql + echo "DONE LOADING!!!!!!" # run it forever like a docker process should tail -f /dev/null diff --git a/helm-chart/eoapi/templates/db/deployment.yaml b/helm-chart/eoapi/templates/db/deployment.yaml index 7c58b069..b6dfb070 100644 --- a/helm-chart/eoapi/templates/db/deployment.yaml +++ b/helm-chart/eoapi/templates/db/deployment.yaml @@ -27,6 +27,13 @@ spec: name: pgstac-secrets-{{ $.Release.Name }} ports: - containerPort: 5432 + resources: + limits: + cpu: {{ .Values.db.settings.resources.limits.cpu }} + memory: {{ .Values.db.settings.resources.limits.memory }} + requests: + cpu: {{ .Values.db.settings.resources.requests.cpu }} + memory: {{ .Values.db.settings.resources.requests.memory }} {{- if not (eq .Values.providerContext "minikube") }} volumeMounts: - mountPath: /var/lib/postgresql/data diff --git a/helm-chart/eoapi/test-unittest-values.yaml b/helm-chart/eoapi/test-unittest-values.yaml index 9ecd4a72..cab1145a 100644 --- a/helm-chart/eoapi/test-unittest-values.yaml +++ b/helm-chart/eoapi/test-unittest-values.yaml @@ -5,6 +5,15 @@ ingress: className: "nginx" db: enabled: true + settings: + resources: + requests: + storage: "100Mi" + cpu: "256m" + memory: "1024Mi" + limits: + cpu: "512m" + memory: "1024Mi" raster: enabled: true settings: @@ -14,17 +23,17 @@ raster: memory: "4096Mi" requests: cpu: "256m" - memory: "1048Mi" + memory: "1024Mi" stac: enabled: true settings: resources: limits: - cpu: "256m" - memory: "512Mi" + cpu: "512m" + memory: "1024Mi" requests: - cpu: "256m" - memory: "512Mi" + cpu: "512m" + memory: "1024Mi" vector: enabled: true settings: diff --git a/helm-chart/eoapi/tests/deploy_tests.yaml b/helm-chart/eoapi/tests/deploy_tests.yaml index b9687aa4..e653035b 100644 --- a/helm-chart/eoapi/tests/deploy_tests.yaml +++ b/helm-chart/eoapi/tests/deploy_tests.yaml @@ -85,7 +85,7 @@ tests: value: "1024Mi" - equal: path: spec.template.spec.containers[0].resources.requests.memory - value: "256Mi" + value: "1024Mi" - equal: path: metadata.labels.gitsha value: "ABC123" diff --git a/helm-chart/eoapi/values.yaml b/helm-chart/eoapi/values.yaml index f8491b3d..8f0484f2 100644 --- a/helm-chart/eoapi/values.yaml +++ b/helm-chart/eoapi/values.yaml @@ -47,6 +47,11 @@ db: resources: requests: storage: "100Mi" + cpu: "512m" + memory: "1024Mi" + limits: + cpu: "512m" + memory: "1024Mi" secrets: POSTGRES_DB: "postgis" POSTGRES_USER: "" @@ -56,7 +61,7 @@ db: POSTGRES_HOST_READER: "pgstac" POSTGRES_HOST_WRITER: "pgstac" DB_MIN_CONN_SIZE: "1" - DB_MAX_CONN_SIZE: "10" + DB_MAX_CONN_SIZE: "15" # default connect: https://www.postgresql.org/docs/current/libpq-envars.html PGDATA: "/var/lib/postgresql/data/pgdata" PGUSER: "" @@ -143,7 +148,7 @@ stac: memory: "1024Mi" requests: cpu: "256m" - memory: "256Mi" + memory: "1024Mi" envVars: ############## # uvicorn From 8da1c3a6fa51c3b98e24969576da5b037398f923 Mon Sep 17 00:00:00 2001 From: ranchodeluxe Date: Sun, 17 Sep 2023 09:57:30 -0700 Subject: [PATCH 2/2] upgrade Chart versions --- helm-chart/eoapi/Chart.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/helm-chart/eoapi/Chart.yaml b/helm-chart/eoapi/Chart.yaml index 420e92b9..f7b48ff6 100644 --- a/helm-chart/eoapi/Chart.yaml +++ b/helm-chart/eoapi/Chart.yaml @@ -17,10 +17,10 @@ kubeVersion: ">=1.23.0-0" # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: "0.1.6" +version: "0.1.7" # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to # follow Semantic Versioning. They should reflect the version the application is using. # It is recommended to use it with quotes. -appVersion: "0.1.4" +appVersion: "0.1.5"