Skip to content

Commit

Permalink
update custom readinessprobe per chain (#560)
Browse files Browse the repository at this point in the history
  • Loading branch information
Anmol1696 authored Oct 1, 2024
1 parent 4663a46 commit f1a336e
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 31 deletions.
16 changes: 16 additions & 0 deletions starship/charts/devnet/defaults.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -673,6 +673,22 @@ defaultChains:
exponent: 6
coingecko_id: inter-stable-token
keywords: [ "inter-stable-token" ]
readinessProbe:
exec:
command:
- bash
- -c
- |
# Try to see if the node is still catching up.
([[ $($CHAIN_BIN status 2>&1 | jq -r .SyncInfo.catching_up) == false ]]) &
tester=$!
# Kill the test if it takes longer than we expect.
(sleep 5; kill $tester 2>/dev/null) &
killer=$!
# Kill the killer before exiting.
trap 'kill $killer 2>/dev/null' EXIT
# Return the test's exit code, whether it succeeded, failed, or was killed.
wait $tester
kujira:
image: ghcr.io/cosmology-tech/starship/kujira:v1.1.0
home: /root/.kujira
Expand Down
25 changes: 9 additions & 16 deletions starship/charts/devnet/templates/chains/cosmos/genesis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -281,23 +281,16 @@ spec:
name: scripts
{{- if not ($chain.cometmock.enabled) }}
readinessProbe:
exec:
command:
- bash
- -c
- |
# Try to see if the node is still catching up.
([[ $($CHAIN_BIN status 2>&1 | jq -r .SyncInfo.catching_up) == false ]]) &
tester=$!
# Kill the test if it takes longer than we expect.
(sleep 5; kill $tester 2>/dev/null) &
killer=$!
# Kill the killer before exiting.
trap 'kill $killer 2>/dev/null' EXIT
# Return the test's exit code, whether it succeeded, failed, or was killed.
wait $tester
{{- if hasKey $chain "readinessProbe" }}
{{- $chain.readinessProbe | toYaml | nindent 12 }}
{{- else }}
httpGet:
path: /status
port: 26657
{{- end }}
initialDelaySeconds: 10
periodSeconds: 10
timeoutSeconds: 15
{{- end }}
- name: exposer
image: {{ $.Values.exposer.image }}
Expand Down Expand Up @@ -401,7 +394,7 @@ spec:
httpGet:
path: /status
port: {{ $chain.faucet.ports.rest }}
initialDelaySeconds: 10
initialDelaySeconds: 15
periodSeconds: 10
{{- else if eq $chain.faucet.type "starship" }}
- name: faucet
Expand Down
23 changes: 8 additions & 15 deletions starship/charts/devnet/templates/chains/cosmos/validator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -286,23 +286,16 @@ spec:
name: scripts
{{- if not ($chain.cometmock.enabled) }}
readinessProbe:
exec:
command:
- bash
- -c
- |
# Try to see if the node is still catching up.
([[ $($CHAIN_BIN status 2>&1 | jq -r .SyncInfo.catching_up) == false ]]) &
tester=$!
# Kill the test if it takes longer than we expect.
(sleep 5; kill $tester 2>/dev/null) &
killer=$!
# Kill the killer before exiting.
trap 'kill $killer 2>/dev/null' EXIT
# Return the test's exit code, whether it succeeded, failed, or was killed.
wait $tester
{{- if hasKey $chain "readinessProbe" }}
{{- $chain.readinessProbe | toYaml | nindent 12 }}
{{- else }}
httpGet:
path: /status
port: 26657
{{- end }}
initialDelaySeconds: 10
periodSeconds: 10
timeoutSeconds: 15
{{- end }}
- name: exposer
image: {{ $.Values.exposer.image }}
Expand Down

0 comments on commit f1a336e

Please sign in to comment.