Skip to content

Commit

Permalink
feat(provider): improve pattern detection (#217)
Browse files Browse the repository at this point in the history
  • Loading branch information
andy108369 committed Nov 23, 2023
1 parent e8e1213 commit 0d270cc
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 24 deletions.
2 changes: 1 addition & 1 deletion charts/akash-provider/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 8 additions & 4 deletions charts/akash-provider/scripts/run.sh
Original file line number Diff line number Diff line change
@@ -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

Expand All @@ -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
15 changes: 0 additions & 15 deletions charts/akash-provider/templates/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 0 additions & 4 deletions charts/akash-provider/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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: ""
Expand Down

0 comments on commit 0d270cc

Please sign in to comment.