Skip to content

Commit

Permalink
feat: Add smoke test
Browse files Browse the repository at this point in the history
  • Loading branch information
samcm committed Jan 10, 2024
1 parent 42ccdcc commit 85229e4
Show file tree
Hide file tree
Showing 2 changed files with 102 additions and 102 deletions.
202 changes: 101 additions & 101 deletions .github/workflows/smoke-test.yaml
Original file line number Diff line number Diff line change
@@ -1,114 +1,114 @@
name: Smoke Test
# name: Smoke Test

on:
pull_request:
# on:
# pull_request:

jobs:
smoke-test:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Build xatu image
run: |
docker build -t ethpandaops/xatu:latest .
echo "Xatu image is built."
- name: Install Kurtosis
run: |
echo "deb [trusted=yes] https://apt.fury.io/kurtosis-tech/ /" | sudo tee /etc/apt/sources.list.d/kurtosis.list
sudo apt update
sudo apt install kurtosis-cli
- name: Create Kurtosis config file
run: |
cat <<EOF > network_params.yaml
participants:
- el_client_type: geth
cl_client_type: teku
- el_client_type: nethermind
cl_client_type: prysm
- el_client_type: erigon
cl_client_type: lighthouse
- el_client_type: besu
cl_client_type: lighthouse
- el_client_type: reth
cl_client_type: lodestar
- el_client_type: ethereumjs
cl_client_type: nimbus
additional_services: []
network_parans:
genesis_delay: 60
<<EOF
- name: Start Ethereum network with Kurtosis
run: |
kurtosis run --enclave xatu github.com/kurtosis-tech/ethereum-package "$(cat network_params.yaml)"
- name: Run Xatu stack
run: |
docker compose up --detach --quiet-pull;
echo "Xatu stack is running."
- name: Create Xatu Sentry for every participant
run: |
export services=$(kurtosis enclave inspect xatu | grep cl- | grep http | awk '{ print $2 }' | grep -v validator)
readarray -t BEACON_SERVICES <<< "$services";
echo "Beacon nodes discovered: $BEACON_SERVICES"
# jobs:
# smoke-test:
# runs-on: ubuntu-latest
# steps:
# - name: Checkout repository
# uses: actions/checkout@v2
# - name: Build xatu image
# run: |
# docker build -t ethpandaops/xatu:latest .
# echo "Xatu image is built."
# - name: Install Kurtosis
# run: |
# echo "deb [trusted=yes] https://apt.fury.io/kurtosis-tech/ /" | sudo tee /etc/apt/sources.list.d/kurtosis.list
# sudo apt update
# sudo apt install kurtosis-cli
# - name: Create Kurtosis config file
# run: |
# cat <<EOF > network_params.yaml
# participants:
# - el_client_type: geth
# cl_client_type: teku
# - el_client_type: nethermind
# cl_client_type: prysm
# - el_client_type: erigon
# cl_client_type: lighthouse
# - el_client_type: besu
# cl_client_type: lighthouse
# - el_client_type: reth
# cl_client_type: lodestar
# - el_client_type: ethereumjs
# cl_client_type: nimbus
# additional_services: []
# network_parans:
# genesis_delay: 60
# <<EOF
# - name: Start Ethereum network with Kurtosis
# run: |
# kurtosis run --enclave xatu github.com/kurtosis-tech/ethereum-package "$(cat network_params.yaml)"
# - name: Run Xatu stack
# run: |
# docker compose up --detach --quiet-pull;
# echo "Xatu stack is running."
# - name: Create Xatu Sentry for every participant
# run: |
# export services=$(kurtosis enclave inspect xatu | grep cl- | grep http | awk '{ print $2 }' | grep -v validator)
# readarray -t BEACON_SERVICES <<< "$services";
# echo "Beacon nodes discovered: $BEACON_SERVICES"

for service in "${BEACON_SERVICES[@]}"; do
port=$(kurtosis port print xatu $service http)
echo "Creating Xatu Sentry for $service which is running at $port..."
cat <<EOF > "${service}.yaml"
name: $service
ethereum:
beaconNodeAddress: $port
overrideNetworkName: "xatu-devnet"
forkChoice:
enabled: true
# for service in "${BEACON_SERVICES[@]}"; do
# port=$(kurtosis port print xatu $service http)
# echo "Creating Xatu Sentry for $service which is running at $port..."
# cat <<EOF > "${service}.yaml"
# name: $service
# ethereum:
# beaconNodeAddress: $port
# overrideNetworkName: "xatu-devnet"
# forkChoice:
# enabled: true

onReOrgEvent:
enabled: true
# onReOrgEvent:
# enabled: true

at:
enabled: true
slotTimes:
- 4s
# at:
# enabled: true
# slotTimes:
# - 4s

attestationData:
enabled: true
# attestationData:
# enabled: true

at:
enabled: true
slotTimes:
- 4s
# at:
# enabled: true
# slotTimes:
# - 4s

beaconCommittees:
enabled: true
output:
- name: xatu
type: xatu
config:
address: xatu-server:8080
tls: false
<<EOF
# beaconCommittees:
# enabled: true
# output:
# - name: xatu
# type: xatu
# config:
# address: xatu-server:8080
# tls: false
# <<EOF

cat "${service}.yaml";
# cat "${service}.yaml";

docker run -d -v "$(pwd)/${service}.yaml:/opt/config.yaml" --network=xatu_xatu-net ethpandaops/xatu:latest sentry --config /opt/config.yaml;
# docker run -d -v "$(pwd)/${service}.yaml:/opt/config.yaml" --network=xatu_xatu-net ethpandaops/xatu:latest sentry --config /opt/config.yaml;

done
- name: Check Clickhouse for attestation data from every participant
run: |
export services=$(kurtosis enclave inspect xatu | grep cl- | grep http | awk '{ print $2 }' | grep -v validator)
readarray -t BEACON_SERVICES <<< "$services";
# done
# - name: Check Clickhouse for attestation data from every participant
# run: |
# export services=$(kurtosis enclave inspect xatu | grep cl- | grep http | awk '{ print $2 }' | grep -v validator)
# readarray -t BEACON_SERVICES <<< "$services";

for service in "${BEACON_SERVICES[@]}"; do
echo "Checking Clickhouse for attestation data from $service..."
while true; do
if docker --network xatu_xatu-net exec clickhouse-01 clickhouse-client --query "SELECT COUNT(*) FROM default.beacon_api_eth_v1_events_attestation WHERE event_date_time > now() - INTERVAL 1 HOUR AND meta_client_name == '$service"; then
echo "Attestations table has data."
break
else
echo "Attestations table is empty. Checking again in 2 seconds..."
sleep 2
fi
done
echo "Attestation data from $service is present"
done
# for service in "${BEACON_SERVICES[@]}"; do
# echo "Checking Clickhouse for attestation data from $service..."
# while true; do
# if docker --network xatu_xatu-net exec clickhouse-01 clickhouse-client --query "SELECT COUNT(*) FROM default.beacon_api_eth_v1_events_attestation WHERE event_date_time > now() - INTERVAL 1 HOUR AND meta_client_name == '$service"; then
# echo "Attestations table has data."
# break
# else
# echo "Attestations table is empty. Checking again in 2 seconds..."
# sleep 2
# fi
# done
# echo "Attestation data from $service is present"
# done

2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ services:
retries: 5
start_period: 5s
zookeeper:
image: wurstmeister/zookeeper
image: zookeeper
container_name: zookeeper
environment:
ZOO_LOG4J_PROP: 'ERROR,CONSOLE'
Expand Down

0 comments on commit 85229e4

Please sign in to comment.