From 79e14f6d2386008d486c31754727b616ca5d780f Mon Sep 17 00:00:00 2001 From: Andrey Arapov <107317698+andy108369@users.noreply.github.com> Date: Thu, 23 Nov 2023 14:35:31 +0100 Subject: [PATCH] feat(provider): improve pattern detection (#217) (#244) --- charts/akash-provider/Chart.yaml | 2 +- charts/akash-provider/scripts/run.sh | 12 ++++++++---- charts/akash-provider/templates/statefulset.yaml | 15 --------------- charts/akash-provider/values.yaml | 4 ---- 4 files changed, 9 insertions(+), 24 deletions(-) diff --git a/charts/akash-provider/Chart.yaml b/charts/akash-provider/Chart.yaml index 7c666c26..8531456f 100644 --- a/charts/akash-provider/Chart.yaml +++ b/charts/akash-provider/Chart.yaml @@ -17,7 +17,7 @@ type: application # Versions are expected to follow Semantic Versioning (https://semver.org/) # Major version bit highlights the mainnet release (e.g. mainnet4 = 4.x.x, mainnet5 = 5.x.x, ...) -version: 8.0.0 +version: 8.0.1 # 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 diff --git a/charts/akash-provider/scripts/run.sh b/charts/akash-provider/scripts/run.sh index 3594befd..33fc651e 100755 --- a/charts/akash-provider/scripts/run.sh +++ b/charts/akash-provider/scripts/run.sh @@ -1,8 +1,5 @@ #!/bin/bash -# livenessProbe is going to check the provider log for errors -exec &> >(tee -a "/var/log/provider.log") - # Install apps required by the bid price script apt -qq update && DEBIAN_FRONTEND=noninteractive apt -qq -y -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" --no-install-recommends install curl jq bc mawk ca-certificates @@ -12,4 +9,11 @@ type jq || exit 1 type awk || exit 1 type bc || exit 1 -exec provider-services run +# Start provider-services and monitor its output +exec provider-services run | while read line; do + echo "$line" + if [[ "$line" == *"account sequence mismatch"* ]]; then + echo "Pattern 'account sequence mismatch' found. Restarting provider-services..." + exit 2 + fi +done diff --git a/charts/akash-provider/templates/statefulset.yaml b/charts/akash-provider/templates/statefulset.yaml index 90708ac2..d4db613a 100644 --- a/charts/akash-provider/templates/statefulset.yaml +++ b/charts/akash-provider/templates/statefulset.yaml @@ -253,26 +253,11 @@ spec: - name: AKASH_BID_DEPOSIT value: "5000000uakt" - - name: LOG_RESTART_PATTERNS - value: "{{ .Values.log_restart_patterns }}" - ports: - name: api containerPort: 8443 protocol: TCP - livenessProbe: - exec: - command: - - sh - - -c - - | - grep -Eq "$LOG_RESTART_PATTERNS" /var/log/provider.log && exit 1 || : - initialDelaySeconds: 60 - periodSeconds: 10 - failureThreshold: 1 - timeoutSeconds: 10 - volumeMounts: - name: boot mountPath: /boot diff --git a/charts/akash-provider/values.yaml b/charts/akash-provider/values.yaml index a40d53fe..0f251e54 100644 --- a/charts/akash-provider/values.yaml +++ b/charts/akash-provider/values.yaml @@ -97,10 +97,6 @@ overcommit_pct_mem: 0 # Percentage of storage overcommit overcommit_pct_storage: 0 -# When provider pod finds these errors in its logs it will automatically restart. -# You can specify multiple patterns, separated by | character -log_restart_patterns: "account sequence mismatch" - imagePullSecrets: [] nameOverride: "" fullnameOverride: ""