Skip to content

Commit

Permalink
feature: add faucet.concurrency directive, add to tests (#164)
Browse files Browse the repository at this point in the history
* add faucet.concurrency directive, add to tests

* update docs for faucet

* add resources to faucet, add resources to node

* fetch node id seperately, exit early

* add condition to exit early

* upgrade starship-action version

* add concurrency for faucet

* update resources for faucet
  • Loading branch information
Anmol1696 committed Aug 8, 2023
1 parent 11d5c03 commit 5051292
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pr-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
- name: Setup Test infra
id: starship-action
uses: cosmology-tech/starship-action@0.2.11
uses: cosmology-tech/starship-action@0.2.12
with:
values: ${{ env.CONFIG_FILE }}
port-forward: true
Expand Down
2 changes: 1 addition & 1 deletion charts/devnet/templates/chains/cosmos/genesis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ spec:
imagePullPolicy: Always
env:
- name: FAUCET_CONCURRENCY
value: "10"
value: "{{ $faucet.concurrency }}"
- name: FAUCET_PORT
value: "{{ $faucet.ports.rest }}"
- name: FAUCET_MEMO
Expand Down
8 changes: 7 additions & 1 deletion charts/devnet/templates/chains/cosmos/validator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,13 @@ spec:
echo "Setup config files"
bash -e /scripts/setup_config.sh
GENESIS_NODE_P2P=$(curl -s http://$GENESIS_HOST.$NAMESPACE.svc.cluster.local:$GENESIS_PORT/node_id | jq -r ".node_id")@$GENESIS_HOST.$NAMESPACE.svc.cluster.local:26656
curl -s http://$GENESIS_HOST.$NAMESPACE.svc.cluster.local:$GENESIS_PORT/node_id
NODE_ID=$(curl -s http://$GENESIS_HOST.$NAMESPACE.svc.cluster.local:$GENESIS_PORT/node_id | jq -r ".node_id")
if [[ $NODE_ID == "" ]]; then
echo "Node ID is null, exiting early"
exit 1
fi
GENESIS_NODE_P2P=$NODE_ID@$GENESIS_HOST.$NAMESPACE.svc.cluster.local:26656
echo "Node P2P: $GENESIS_NODE_P2P"
sed -i "s/persistent_peers = \"\"/persistent_peers = \"$GENESIS_NODE_P2P\"/g" $CHAIN_DIR/config/config.toml
Expand Down
1 change: 1 addition & 0 deletions charts/devnet/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ exposer:

faucet:
image: ghcr.io/cosmology-tech/starship/cosmjs-faucet:v0.31.0
concurrency: 10
ports:
rest: 8000
resources:
Expand Down
5 changes: 5 additions & 0 deletions docs/pages/config/chains.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -154,11 +154,16 @@ chains:
numValidators: 1
faucet:
image: ghcr.io/cosmology-tech/starship/cosmjs-faucet:v0.30.1
concurrency: 2 # default is 10
resources:
cpu: "0.3"
memory: "600M"
```

Note `concurrency` in `faucet` is the number of concurrent requests the faucet can handle.
If you are running a chain with less resources, or want faster startup time,
then you can reduce the `concurrency` to a lower number.

## `build` (optional)
With the `build` directive in the chain, one can basically build chain binaries on the fly before starting the chain.
When the directive is `enabled`, then the docker image is set to a [`runner` docker image](https://github.com/cosmology-tech/starship/blob/main/docker/starship/runner/Dockerfile)
Expand Down
14 changes: 7 additions & 7 deletions tests/configs/multi-validator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,13 @@ chains:
rpc: 26653
exposer: 38083
resources:
cpu: "0.2"
memory: 400M
cpu: "0.3"
memory: 600M
faucet:
concurrency: 2
resources:
cpu: "0.1"
memory: "300M"

registry:
enabled: true
Expand All @@ -28,8 +33,3 @@ exposer:
resources:
cpu: "0.1"
memory: 100M

faucet:
resources:
cpu: "0.1"
memory: "300M"
2 changes: 2 additions & 0 deletions tests/configs/one-chain.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ chains:
resources:
cpu: "0.5"
memory: 500M
faucet:
concurrency: 2

registry:
enabled: true
Expand Down

0 comments on commit 5051292

Please sign in to comment.