Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(ci): Fix Xatu Sentry smoke test #327

Merged
merged 5 commits into from
Jun 4, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 17 additions & 38 deletions .github/workflows/sentry-smoke-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,12 @@ jobs:
run: |
docker build -t ethpandaops/xatu:local .
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
cat <<EOF > /tmp/network_params.yaml
participants:
- el_type: geth
cl_type: teku
cl_image: ethpandaops/teku:master-16c4354
- el_type: nethermind
cl_type: prysm
- el_type: erigon
Expand All @@ -56,38 +50,23 @@ jobs:
- voluntary_exit
- contribution_and_proof
<<EOF

- name: Start Ethereum network with Kurtosis and Run Xatu stack in parallel
timeout-minutes: 20
- name: Run Xatu stack
timeout-minutes: 10
shell: bash
run: |
echo "Starting Kurtosis..."
kurtosis run --enclave xatu github.com/kurtosis-tech/ethereum-package --args-file network_params.yaml &
KURTOSIS_PID=$!

echo "Starting Xatu stack..."
docker compose up --detach --quiet-pull &
XATU_STACK_PID=$!

echo "Waiting for Kurtosis to start..."
wait $KURTOSIS_PID
KURTOSIS_EXIT_CODE=$?

if [ $KURTOSIS_EXIT_CODE -ne 0 ]; then
echo "Kurtosis failed to start."
exit $KURTOSIS_EXIT_CODE
fi

echo "Waiting for Xatu stack to start..."
wait $XATU_STACK_PID
XATU_STACK_EXIT_CODE=$?

if [ $XATU_STACK_EXIT_CODE -ne 0 ]; then
echo "Xatu stack failed to start."
exit $XATU_STACK_EXIT_CODE
fi

echo "Kurtosis and Xatu stack have started successfully."
- name: Setup kurtosis testnet and run assertoor tests
id: kurtosis-setup
uses: ethpandaops/kurtosis-assertoor-github-action@v1
with:
ethereum_package_args: /tmp/network_params.yaml
await_assertoor_tests: false
enclave_name: xatu
- name: Show all kurtosis containers
env:
SERVICES: ${{ steps.kurtosis-setup.outputs.services }}
run: |
echo $SERVICES
- name: Add all xatu-sentry containers to the xatu network
run: |
for container in $(docker ps --filter name=xatu-sentry --format "{{.Names}}"); do docker network connect xatu_xatu-net $container; echo $container; docker restart $container; done
Expand Down Expand Up @@ -139,7 +118,7 @@ jobs:
# Check for any data in the tables before digging in to the individual sentries
for table in "${tables[@]}"; do
pretty_print "Checking $table table..." "none"
data_count=$(docker exec clickhouse-01 clickhouse-client --query "SELECT COUNT(*) FROM default.$table" || true)
data_count=$(docker exec xatu-clickhouse-01 clickhouse-client --query "SELECT COUNT(*) FROM default.$table" || true)
if [[ $data_count -gt 0 ]]; then
pretty_print "$table table has $data_count entries" "green"
else
Expand All @@ -155,7 +134,7 @@ jobs:
for sentry in "${all_sentries[@]}"; do
pretty_print "Checking $table table for $sentry..." "none"
while true; do
data_count=$(docker exec clickhouse-01 clickhouse-client --query "SELECT COUNT(*) FROM default.$table WHERE meta_client_name = '$sentry'" || true)
data_count=$(docker exec xatu-clickhouse-01 clickhouse-client --query "SELECT COUNT(*) FROM default.$table WHERE meta_client_name = '$sentry'" || true)
if [[ $data_count -gt 0 ]]; then
pretty_print "$table has $data_count entries from $sentry" "green"
break
Expand Down
Loading