Skip to content

Commit

Permalink
Merge branch 'release/v2' into anmol/starship-js-merge
Browse files Browse the repository at this point in the history
  • Loading branch information
Anmol1696 authored Apr 30, 2024
2 parents a5b1939 + 3491eff commit db81921
Show file tree
Hide file tree
Showing 54 changed files with 279 additions and 280 deletions.
4 changes: 2 additions & 2 deletions .github/actions/e2e-test/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,14 @@ runs:

- name: Setup Test infra
id: starship-action
uses: cosmology-tech/starship-action@dda9039c44960084db5955b3ad4720b2255da430
uses: cosmology-tech/starship-action@0.2.19
with:
values: ${{ env.CONFIG_FILE }}
port-forward: true
version: 0.0.0
chart: ./charts/devnet
kubeconfig: ${{ steps.kubeconfig.outputs.content }}
cli-version: d60aa2158bbcd43a3ed8ab3558f50f9618677e05
cli-version: f35dc85407b350077765a0b3c17a4c1632c7d53c

- name: Run tests
run: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/pr-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,13 @@ jobs:

- name: Setup Test infra
id: starship-action
uses: cosmology-tech/starship-action@dda9039c44960084db5955b3ad4720b2255da430
uses: cosmology-tech/starship-action@0.2.19
with:
values: ${{ env.CONFIG_FILE }}
port-forward: true
version: 0.0.0
chart: ./charts/devnet
cli-version: d60aa2158bbcd43a3ed8ab3558f50f9618677e05
cli-version: f35dc85407b350077765a0b3c17a4c1632c7d53c

- name: Run tests
run: |
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/smoke-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,14 @@ jobs:

- name: Setup Test infra
id: starship-action
uses: cosmology-tech/starship-action@dda9039c44960084db5955b3ad4720b2255da430
uses: cosmology-tech/starship-action@0.2.19
with:
values: ${{ env.CONFIG_FILE }}
port-forward: true
version: 0.0.0
chart: ./charts/devnet
timeout: 10m
cli-version: d60aa2158bbcd43a3ed8ab3558f50f9618677e05
cli-version: f35dc85407b350077765a0b3c17a4c1632c7d53c

# todo: change this to be post step of the action
- name: Cleanup cluster
Expand Down Expand Up @@ -67,14 +67,14 @@ jobs:

- name: Setup Test infra
id: starship-action
uses: cosmology-tech/starship-action@dda9039c44960084db5955b3ad4720b2255da430
uses: cosmology-tech/starship-action@0.2.19
with:
values: ${{ env.CONFIG_FILE }}
port-forward: true
version: 0.0.0
chart: ./charts/devnet
timeout: 10m
cli-version: d60aa2158bbcd43a3ed8ab3558f50f9618677e05
cli-version: f35dc85407b350077765a0b3c17a4c1632c7d53c

# todo: change this to be post step of the action
- name: Cleanup cluster
Expand Down Expand Up @@ -105,14 +105,14 @@ jobs:

- name: Setup Test infra
id: starship-action
uses: cosmology-tech/starship-action@dda9039c44960084db5955b3ad4720b2255da430
uses: cosmology-tech/starship-action@0.2.19
with:
values: ${{ env.CONFIG_FILE }}
port-forward: true
version: 0.0.0
chart: ./charts/devnet
timeout: 10m
cli-version: d60aa2158bbcd43a3ed8ab3558f50f9618677e05
cli-version: f35dc85407b350077765a0b3c17a4c1632c7d53c

# todo: change this to be post step of the action
- name: Cleanup cluster
Expand Down
2 changes: 1 addition & 1 deletion charts/devnet/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ type: application
# 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.49-rc1
version: 0.2.0

# 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
8 changes: 4 additions & 4 deletions charts/devnet/templates/_chains.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,18 @@ Usage:
{{- required "default file must have setup" $defaultFile.defaultChains -}}
{{- $chain := dict -}}
{{- range $chainIter := $.context.Values.chains -}}
{{- if eq $chainIter.name $.name -}}
{{- if eq $chainIter.id $.name -}}
{{- $chain = $chainIter | deepCopy -}}
{{- end }}
{{- end }}
{{- required "chain need to exist" $chain.type -}}
{{- required "chain need to exist" $chain.id -}}

{{- $defaultChain := get $defaultFile.defaultChains $chain.type | default dict -}}
{{- $defaultChain := get $defaultFile.defaultChains $chain.name | default dict -}}

{{/* merge defaultChain values into the $chain dict*/}}
{{- $chain = merge $chain $defaultChain -}}

{{ $_ := set $chain "hostname" (include "devnet.chain.name" $chain.name) }}
{{ $_ := set $chain "hostname" (include "devnet.chain.name" $chain.id) }}

{{- $faucet := get $chain "faucet" | default dict -}}
{{- $faucet = mergeOverwrite ($.context.Values.faucet | deepCopy) $faucet -}}
Expand Down
22 changes: 11 additions & 11 deletions charts/devnet/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}

{{/*
Convert $chain.name to name usable by templates
Convert $chain.id to name usable by templates
*/}}
{{- define "devnet.chain.name" -}}
{{- printf "%s" . | replace "_" "-" | trunc 63 }}
Expand Down Expand Up @@ -82,7 +82,7 @@ Environment variables for chain from configmaps
*/}}
{{- define "devnet.evnVars" }}
- name: CHAIN_ID
value: {{ .name }}
value: {{ .id }}
{{- end }}

{{/*
Expand Down Expand Up @@ -159,7 +159,7 @@ Returns a comma seperated list of chain id
{{- define "devnet.chains.ids" -}}
{{- $values := list -}}
{{- range $chain := .Values.chains -}}
{{- $values = $chain.name | append $values -}}
{{- $values = $chain.id | append $values -}}
{{- end -}}
{{ join "," $values }}
{{- end -}}
Expand All @@ -170,7 +170,7 @@ Returns a comma seperated list of urls for the RPC address based on internal DNS
{{- define "devnet.chains.internal.rpc.addrs" -}}
{{- $values := list -}}
{{- range $chain := .Values.chains -}}
{{- $host := include "devnet.chain.name" $chain.name }}
{{- $host := include "devnet.chain.name" $chain.id }}
{{- $values = printf "http://%s-genesis.$(NAMESPACE).svc.cluster.local:26657" $host | append $values -}}
{{- end -}}
{{ join "," $values }}
Expand All @@ -186,9 +186,9 @@ Returns a comma seperated list of urls for the RPC address
{{- if and ($localhost) (($chain.ports).rpc) -}}
{{- $values = printf "http://localhost:%v" $chain.ports.rpc | append $values -}}
{{- else if $.Values.ingress.enabled }}
{{- $values = printf "https://rpc.%s-genesis.%s" $chain.name ($.Values.ingress.host | replace "*." "") | append $values -}}
{{- $values = printf "https://rpc.%s-genesis.%s" $chain.id ($.Values.ingress.host | replace "*." "") | append $values -}}
{{- else -}}
{{- $host := include "devnet.chain.name" $chain.name }}
{{- $host := include "devnet.chain.name" $chain.id }}
{{- $values = printf "http://%s-genesis.$(NAMESPACE).svc.cluster.local:26657" $host | append $values -}}
{{- end -}}
{{- end -}}
Expand All @@ -206,9 +206,9 @@ If registry.localhost is set to true, then use $chain ports
{{- if and ($localhost) (($chain.ports).grpc) -}}
{{- $values = printf "http://localhost:%v" $chain.ports.grpc | append $values -}}
{{- else if $.Values.ingress.enabled }}
{{- $values = printf "https://grpc.%s-genesis.%s" $chain.name ($.Values.ingress.host | replace "*." "") | append $values -}}
{{- $values = printf "https://grpc.%s-genesis.%s" $chain.id ($.Values.ingress.host | replace "*." "") | append $values -}}
{{- else -}}
{{- $host := include "devnet.chain.name" $chain.name }}
{{- $host := include "devnet.chain.name" $chain.id }}
{{- $values = printf "http://%s-genesis.$(NAMESPACE).svc.cluster.local:9091" $host | append $values -}}
{{- end -}}
{{- end -}}
Expand All @@ -226,9 +226,9 @@ If registry.localhost is set to true, then use $chain ports
{{- if and ($localhost) (($chain.ports).rest) -}}
{{- $values = printf "http://localhost:%v" $chain.ports.rest | append $values -}}
{{- else if $.Values.ingress.enabled }}
{{- $values = printf "https://rest.%s-genesis.%s" $chain.name ($.Values.ingress.host | replace "*." "") | append $values -}}
{{- $values = printf "https://rest.%s-genesis.%s" $chain.id ($.Values.ingress.host | replace "*." "") | append $values -}}
{{- else -}}
{{- $host := include "devnet.chain.name" $chain.name }}
{{- $host := include "devnet.chain.name" $chain.id }}
{{- $values = printf "http://%s-genesis.$(NAMESPACE).svc.cluster.local:1317" $host | append $values -}}
{{- end -}}
{{- end -}}
Expand All @@ -242,7 +242,7 @@ Returns a comma seperated list of urls for the Exposer address
{{- $port := ($.Values.exposer.ports.rest | toString | default "8081") }}
{{- $values := list -}}
{{- range $chain := .Values.chains -}}
{{- $host := include "devnet.chain.name" $chain.name }}
{{- $host := include "devnet.chain.name" $chain.id }}
{{- $values = printf "http://%s-genesis.$(NAMESPACE).svc.cluster.local:%s" $host $port | append $values -}}
{{- end -}}
{{ join "," $values }}
Expand Down
24 changes: 12 additions & 12 deletions charts/devnet/templates/chains/cosmos/cometmock.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{{- range $chain := .Values.chains }}
{{- if ne $chain.type "virtual" }}
{{ $dataExposer := dict "chain" $chain.name "port" ($.Values.exposer.ports.rest | quote | default "8081") }}
{{- if ne $chain.name "virtual" }}
{{ $dataExposer := dict "chain" $chain.id "port" ($.Values.exposer.ports.rest | quote | default "8081") }}
{{ $defaultFile := $.Files.Get "defaults.yaml" | fromYaml }}

{{ $chain := include "devnet.fullchain" (dict "name" $chain.name "file" $defaultFile "context" $) | fromJson }}
{{ $chain := include "devnet.fullchain" (dict "name" $chain.id "file" $defaultFile "context" $) | fromJson }}

{{- if ($chain.cometmock.enabled) }}
---
Expand All @@ -12,7 +12,7 @@ kind: Service
metadata:
name: {{ $chain.hostname }}-cometmock
labels:
app.kubernetes.io/name: {{ $chain.name }}-cometmock
app.kubernetes.io/name: {{ $chain.id }}-cometmock
spec:
clusterIP: None
ports:
Expand All @@ -21,7 +21,7 @@ spec:
protocol: TCP
targetPort: 22331
selector:
app.kubernetes.io/name: {{ $chain.name }}-cometmock
app.kubernetes.io/name: {{ $chain.id }}-cometmock
---
apiVersion: apps/v1
kind: StatefulSet
Expand All @@ -33,8 +33,8 @@ spec:
revisionHistoryLimit: 3
selector:
matchLabels:
app.kubernetes.io/instance: {{ $chain.type }}
app.kubernetes.io/name: {{ $chain.name }}-cometmock
app.kubernetes.io/instance: {{ $chain.name }}
app.kubernetes.io/name: {{ $chain.id }}-cometmock
template:
metadata:
annotations:
Expand All @@ -43,10 +43,10 @@ spec:
sla: high
tier: gateway
labels:
app.kubernetes.io/instance: {{ $chain.type }}
app.kubernetes.io/instance: {{ $chain.name }}
app.kubernetes.io/type: cometmock
app.kubernetes.io/name: {{ $chain.name }}-cometmock
app.kubernetes.io/rawname: {{ $chain.name }}-cometmock
app.kubernetes.io/name: {{ $chain.id }}-cometmock
app.kubernetes.io/rawname: {{ $chain.id }}-cometmock
app.kubernetes.io/version: {{ $.Chart.AppVersion }}
spec:
{{- include "imagePullSecrets" $chain | indent 6 }}
Expand Down Expand Up @@ -98,15 +98,15 @@ spec:
- "-c"
- |
while [ $(curl -sw '%{http_code}' http://{{ $chain.hostname }}-genesis.$NAMESPACE.svc.cluster.local:$GENESIS_PORT/priv_keys -o /dev/null) -ne 200 ]; do
echo "Genesis validator does not seem to be ready for: {{ $chain.name }}. Waiting for it to start..."
echo "Genesis validator does not seem to be ready for: {{ $chain.id }}. Waiting for it to start..."
echo "Checking: http://{{ $chain.hostname }}-genesis.$NAMESPACE.svc.cluster.local:$GENESIS_PORT/priv_keys"
sleep 10;
done
{{- if gt $chain.numValidators 1.0}}
for i in $(seq 0 {{ sub $chain.numValidators 2 }});
do
while [ $(curl -sw '%{http_code}' http://{{ $chain.hostname }}-validator-$i.{{ $chain.hostname }}-validator.$NAMESPACE.svc.cluster.local:$GENESIS_PORT/priv_keys -o /dev/null) -ne 200 ]; do
echo "Validator does not seem to be ready for: {{ $chain.name }} validator-$i. Waiting for it to start..."
echo "Validator does not seem to be ready for: {{ $chain.id }} validator-$i. Waiting for it to start..."
echo "Checking: http://{{ $chain.hostname }}-validator-$i.{{ $chain.hostname }}-validator.$NAMESPACE.svc.cluster.local:$GENESIS_PORT/priv_keys"
sleep 10;
done
Expand Down
4 changes: 2 additions & 2 deletions charts/devnet/templates/chains/cosmos/configmap.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{{- range $chain := .Values.chains }}
{{- if ne $chain.type "virtual" }}
{{- if ne $chain.name "virtual" }}
{{ $defaultFile := $.Files.Get "defaults.yaml" | fromYaml }}
{{ $chain := include "devnet.fullchain" (dict "name" $chain.name "file" $defaultFile "context" $) | fromJson }}
{{ $chain := include "devnet.fullchain" (dict "name" $chain.id "file" $defaultFile "context" $) | fromJson }}
---
apiVersion: v1
kind: ConfigMap
Expand Down
26 changes: 13 additions & 13 deletions charts/devnet/templates/chains/cosmos/genesis.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{{- range $chain := .Values.chains }}
{{- if ne $chain.type "virtual" }}
{{ $dataExposer := dict "chain" $chain.name "port" ($.Values.exposer.ports.rest | quote | default "8081") }}
{{- if ne $chain.name "virtual" }}
{{ $dataExposer := dict "chain" $chain.id "port" ($.Values.exposer.ports.rest | quote | default "8081") }}
{{ $defaultFile := $.Files.Get "defaults.yaml" | fromYaml }}

{{ $chain := include "devnet.fullchain" (dict "name" $chain.name "file" $defaultFile "context" $) | fromJson }}
{{ $chain := include "devnet.fullchain" (dict "name" $chain.id "file" $defaultFile "context" $) | fromJson }}
---
apiVersion: apps/v1
kind: StatefulSet
Expand All @@ -15,8 +15,8 @@ spec:
revisionHistoryLimit: 3
selector:
matchLabels:
app.kubernetes.io/instance: {{ $chain.type }}
app.kubernetes.io/name: {{ $chain.name }}-genesis
app.kubernetes.io/instance: {{ $chain.name }}
app.kubernetes.io/name: {{ $chain.id }}-genesis
template:
metadata:
annotations:
Expand All @@ -25,10 +25,10 @@ spec:
sla: high
tier: gateway
labels:
app.kubernetes.io/instance: {{ $chain.type }}
app.kubernetes.io/type: {{ $chain.name }}
app.kubernetes.io/name: {{ $chain.name }}-genesis
app.kubernetes.io/rawname: {{ $chain.name }}
app.kubernetes.io/instance: {{ $chain.name }}
app.kubernetes.io/type: {{ $chain.id }}
app.kubernetes.io/name: {{ $chain.id }}-genesis
app.kubernetes.io/rawname: {{ $chain.id }}
app.kubernetes.io/version: {{ $.Chart.AppVersion }}
spec:
{{- include "imagePullSecrets" $chain | indent 6 }}
Expand Down Expand Up @@ -61,7 +61,7 @@ spec:
- name: GOBIN
value: /go/bin
- name: CHAIN_NAME
value: {{ $chain.name }}
value: {{ $chain.id }}
{{ include "devnet.defaultEvnVars" $chain | indent 12 }}
resources: {{- include "devnet.node.resources" ( dict "node" $chain "context" $ ) | trim | nindent 12 }}
volumeMounts:
Expand Down Expand Up @@ -319,7 +319,7 @@ spec:
- name: FAUCET_CHAIN_BINARY
value: "{{ $chain.binary }}"
- name: FAUCET_CHAIN_ID
value: "{{ $chain.name }}"
value: "{{ $chain.id }}"
- name: COINS
value: "{{ $chain.coins }}"
command:
Expand Down Expand Up @@ -376,11 +376,11 @@ spec:
name: keys
- name: scripts
configMap:
name: setup-scripts-{{- include "devnet.chain.name" $chain.name }}
name: setup-scripts-{{- include "devnet.chain.name" $chain.id }}
{{- if hasKey $chain "genesis" }}
- name: patch
configMap:
name: patch-{{- include "devnet.chain.name" $chain.name }}
name: patch-{{- include "devnet.chain.name" $chain.id }}
{{- end }}
{{- if and ($chain.faucet.enabled) (eq $chain.faucet.type "starship") }}
- name: faucet
Expand Down
Loading

0 comments on commit db81921

Please sign in to comment.