Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(provider): improve pattern detection (#217) #244

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading