AWS Cluster Ansible scripts
- To register with stests:
cd stests
stests-register-dw <this_dir>/artifacts/<chain_name>/nodes
- aws-cli
- ansible
- ../casper-node (checkout of casper-node)
- ../casper-node-launcher (checkout of casper-node-launcher)
Build the casper-node
and casper-node-launcher
binaries. Note that setting debug = true
in the top-level Cargo.toml's [profile.release]
node will make results from heaptrack more verbose.
Build the chainspec and config using casper-tool.py
into ./artifacts/aws-chain-1
destructively.
Tool for building the chainspec and config assets for each node. Depends on an ansible inventory file in yaml format resembling example-ansible-inventory.yaml.
Remove all data and binaries from nodes.
Remove data only from nodes.
Deploy assets and binaries to <ansible_host_groups>
.
Deploy only binaries to <ansible_host_groups>
.
Deploy only chainspec and config to <ansible_host_groups>
.
Deploy only systemd service files to <ansible_host_groups>
.
Dumps a list of instances that resemble our test nodes.
Fetch logs from all nodes into ./logs
.
Fetch heaptrack profiling data from all nodes into ./profiling_data
.
Manually rm -rf /storage/*
on all ip addresses passed. This is useful if multiple nodes have reached hard disk capacity and need to be cleaned off before ansible can run again.
Install required debug tools on all machines.
Will build binaries, chainspec, deploy to all nodes in bootstrap, validators, zero_weight
, then start the services on those nodes in order. Doesn't take any arguments.
Start the casper-node.service
on <ansible_host_groups>
.
Start the casper-node-heaptracked.service
on <ansible_host_groups>
.
Manually curl -s
the status endpoint of all the nodes.
Start all casper-node*.service
s on <ansible_host_groups>
.
Using boto3
, rename matching instances (danw-test*
) with danw-test-<PublicIpAddress>
.
Using boto3
, stop/start matching instances (danw-test*
).
Using boto3
and example-ansible-inventory.yaml
(as input) generate a new generated-hosts.yaml
(will overwrite). This can be copied into aws-hosts.yaml
and scripts run from there.
To disable ansible host key checking, set:
Useful to prevent a lot of manual "yes" answers to ssh host key checking:
export ANSIBLE_HOST_KEY_CHECKING=False
./build-binaries
./build-chain
./deploy "bootstrap, validators, zero_weight"
./start-service bootstrap
./start-service validators
./start-service zero_weight
# check memory consumption of the processes, from systemd's point of view:
ansible -u ubuntu --become -i aws-hosts.yaml "bootstrap, validators, zero_weight" -a 'bash -c "systemctl status casper-node-heaptracked.service | grep Memory"'
# check memory consumption using ps:
ansible -u ubuntu --become -i aws-hosts.yaml "bootstrap, validators, zero_weight" -a 'bash -c "ps -o pid,rss,command ax | grep -v \"grep\" | grep -v \"heaptrack\" | grep \"casper-node validator\" | sort -b -k3 -r"'
...
# run stests tests
...
./stop-service bootstrap
./clean bootstrap