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

chore: backport ci/e2e fixes to v19 #2605

Merged
merged 5 commits into from
Jul 31, 2024
Merged
Show file tree
Hide file tree
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
8 changes: 0 additions & 8 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,6 @@ on:
- release/*
merge_group:
pull_request:
branches:
- "*"
types:
- synchronize
- opened
- reopened

concurrency:
group: pr-testing-${{ github.head_ref || github.run_id }}
Expand All @@ -28,8 +22,6 @@ jobs:
build-and-test:
runs-on: ubuntu-20.04
timeout-minutes: 15
concurrency:
group: "build-and-test"
steps:
- uses: actions/checkout@v4

Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ on:
- develop
- release/*
pull_request:
branches:
- "*"
merge_group:
schedule:
# run at 6AM UTC Daily
Expand Down
3 changes: 0 additions & 3 deletions .github/workflows/sast-linters.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@ on:
- "*"
merge_group:
pull_request:
types:
- opened
- synchronize

concurrency:
group: linters-${{ github.head_ref || github.run_id }}
Expand Down
1 change: 1 addition & 0 deletions Dockerfile-localnet
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ ENV PATH /root/.zetacored/cosmovisor/current/bin/:/root/.zetaclientd/upgrades/cu
COPY contrib/localnet/scripts /root
COPY contrib/localnet/ssh_config /etc/ssh/ssh_config.d/localnet.conf
COPY contrib/localnet/zetacored /root/zetacored
COPY contrib/localnet/preparams /root/static-preparams
COPY cmd/zetae2e/config/localnet.yml /root/config.yml

RUN chmod 755 /root/*.sh && \
Expand Down
42 changes: 16 additions & 26 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ VERSION := $(shell ./version.sh)
COMMIT := $(shell [ -z "${COMMIT_ID}" ] && git log -1 --format='%H' || echo ${COMMIT_ID} )
BUILDTIME := $(shell date -u +"%Y%m%d.%H%M%S" )
DOCKER ?= docker
# allow setting of DOCKER_COMPOSE_ARGS to pass additional args to docker compose
# useful for setting profiles
DOCKER_COMPOSE ?= $(DOCKER) compose $(COMPOSE_ARGS)
DOCKER_BUF := $(DOCKER) run --rm -v $(CURDIR):/workspace --workdir /workspace bufbuild/buf
GOFLAGS:=""

Expand Down Expand Up @@ -209,11 +212,11 @@ start-localnet: zetanode start-localnet-skip-build
start-localnet-skip-build:
@echo "--> Starting localnet"
export LOCALNET_MODE=setup-only && \
cd contrib/localnet/ && $(DOCKER) compose -f docker-compose.yml up -d
cd contrib/localnet/ && $(DOCKER_COMPOSE) -f docker-compose.yml up -d

# stop-localnet should include all profiles so other containers are also removed
stop-localnet:
cd contrib/localnet/ && $(DOCKER) compose --profile all down --remove-orphans
cd contrib/localnet/ && $(DOCKER_COMPOSE) --profile all down --remove-orphans

###############################################################################
### E2E tests ###
Expand All @@ -236,37 +239,37 @@ solana:

start-e2e-test: zetanode
@echo "--> Starting e2e test"
cd contrib/localnet/ && $(DOCKER) compose up -d
cd contrib/localnet/ && $(DOCKER_COMPOSE) up -d

start-e2e-admin-test: zetanode
@echo "--> Starting e2e admin test"
export E2E_ARGS="--skip-regular --test-admin" && \
cd contrib/localnet/ && $(DOCKER) compose --profile eth2 -f docker-compose.yml up -d
cd contrib/localnet/ && $(DOCKER_COMPOSE) --profile eth2 -f docker-compose.yml up -d

start-e2e-performance-test: zetanode
@echo "--> Starting e2e performance test"
export E2E_ARGS="--test-performance" && \
cd contrib/localnet/ && $(DOCKER) compose -f docker-compose.yml up -d
cd contrib/localnet/ && $(DOCKER_COMPOSE) --profile stress -f docker-compose.yml up -d

start-e2e-import-mainnet-test: zetanode
@echo "--> Starting e2e import-data test"
export ZETACORED_IMPORT_GENESIS_DATA=true && \
export ZETACORED_START_PERIOD=15m && \
cd contrib/localnet/ && ./scripts/import-data.sh mainnet && $(DOCKER) compose -f docker-compose.yml up -d
cd contrib/localnet/ && ./scripts/import-data.sh mainnet && $(DOCKER_COMPOSE) -f docker-compose.yml up -d

start-stress-test: zetanode
@echo "--> Starting stress test"
cd contrib/localnet/ && $(DOCKER) compose --profile stress -f docker-compose.yml up -d
cd contrib/localnet/ && $(DOCKER_COMPOSE) --profile stress -f docker-compose.yml up -d

start-tss-migration-test: zetanode
@echo "--> Starting migration test"
export E2E_ARGS="--test-tss-migration" && \
cd contrib/localnet/ && $(DOCKER) compose up -d
cd contrib/localnet/ && $(DOCKER_COMPOSE) up -d

start-solana-test: zetanode solana
@echo "--> Starting solana test"
export E2E_ARGS="--skip-regular --test-solana" && \
cd contrib/localnet/ && $(DOCKER) compose --profile solana -f docker-compose.yml up -d
cd contrib/localnet/ && $(DOCKER_COMPOSE) --profile solana -f docker-compose.yml up -d

###############################################################################
### Upgrade Tests ###
Expand All @@ -290,42 +293,29 @@ start-upgrade-test: zetanode-upgrade
@echo "--> Starting upgrade test"
export LOCALNET_MODE=upgrade && \
export UPGRADE_HEIGHT=225 && \
cd contrib/localnet/ && $(DOCKER) compose --profile upgrade -f docker-compose.yml -f docker-compose-upgrade.yml up -d
cd contrib/localnet/ && $(DOCKER_COMPOSE) --profile upgrade -f docker-compose.yml -f docker-compose-upgrade.yml up -d

start-upgrade-test-light: zetanode-upgrade
@echo "--> Starting light upgrade test (no ZetaChain state populating before upgrade)"
export LOCALNET_MODE=upgrade && \
export UPGRADE_HEIGHT=90 && \
cd contrib/localnet/ && $(DOCKER) compose --profile upgrade -f docker-compose.yml -f docker-compose-upgrade.yml up -d
cd contrib/localnet/ && $(DOCKER_COMPOSE) --profile upgrade -f docker-compose.yml -f docker-compose-upgrade.yml up -d


start-upgrade-test-admin: zetanode-upgrade
@echo "--> Starting admin upgrade test"
export LOCALNET_MODE=upgrade && \
export UPGRADE_HEIGHT=90 && \
export E2E_ARGS="--skip-regular --test-admin" && \
cd contrib/localnet/ && $(DOCKER) compose --profile upgrade -f docker-compose.yml -f docker-compose-upgrade.yml up -d
cd contrib/localnet/ && $(DOCKER_COMPOSE) --profile upgrade -f docker-compose.yml -f docker-compose-upgrade.yml up -d

start-upgrade-import-mainnet-test: zetanode-upgrade
@echo "--> Starting import-data upgrade test"
export LOCALNET_MODE=upgrade && \
export ZETACORED_IMPORT_GENESIS_DATA=true && \
export ZETACORED_START_PERIOD=15m && \
export UPGRADE_HEIGHT=225 && \
cd contrib/localnet/ && ./scripts/import-data.sh mainnet && $(DOCKER) compose --profile upgrade -f docker-compose.yml -f docker-compose-upgrade.yml up -d

###############################################################################
### Monitoring ###
###############################################################################

start-monitoring:
@echo "Starting monitoring services"
cd contrib/localnet/grafana/ && ./get-tss-address.sh
cd contrib/localnet/ && $(DOCKER) compose -f docker-compose-monitoring.yml up -d

stop-monitoring:
@echo "Stopping monitoring services"
cd contrib/localnet/ && $(DOCKER) compose -f docker-compose-monitoring.yml down
cd contrib/localnet/ && ./scripts/import-data.sh mainnet && $(DOCKER_COMPOSE) --profile upgrade -f docker-compose.yml -f docker-compose-upgrade.yml up -d

###############################################################################
### GoReleaser ###
Expand Down
7 changes: 7 additions & 0 deletions cmd/zetae2e/local/performance.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,13 @@ func ethereumWithdrawPerformanceRoutine(
return err
}

if r.ReceiptTimeout == 0 {
r.ReceiptTimeout = 15 * time.Minute
}
if r.CctxTimeout == 0 {
r.CctxTimeout = 15 * time.Minute
}

r.Logger.Print("🏃 starting Ethereum withdraw performance tests")
startTime := time.Now()

Expand Down
4 changes: 4 additions & 0 deletions cmd/zetae2e/local/test_runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ func initTestRunner(
return nil, err
}

// copy timeouts from deployer runner
testRunner.CctxTimeout = deployerRunner.ReceiptTimeout
testRunner.ReceiptTimeout = deployerRunner.ReceiptTimeout

// copy contracts from deployer runner
if err := testRunner.CopyAddressesFrom(deployerRunner); err != nil {
return nil, err
Expand Down
43 changes: 0 additions & 43 deletions contrib/localnet/docker-compose-monitoring.yml

This file was deleted.

91 changes: 91 additions & 0 deletions contrib/localnet/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,97 @@ services:
- UPGRADE_HEIGHT=${UPGRADE_HEIGHT-}
volumes:
- ssh:/root/.ssh

grafana:
image: grafana/grafana:9.1.7
container_name: grafana
hostname: grafana
profiles:
- monitoring
- all
volumes:
- ./grafana/datasource.yaml:/etc/grafana/provisioning/datasources/datasource.yaml
- ./grafana/dashboards/:/etc/grafana/provisioning/dashboards
- grafana_storage:/var/lib/grafana
ports:
- "3000:3000"
networks:
mynetwork:
ipv4_address: 172.20.0.30
depends_on:
- prometheus

prometheus:
image: prom/prometheus:v2.53.1
container_name: prometheus
hostname: prometheus
profiles:
- monitoring
- all
volumes:
- ./prometheus/prometheus.yml:/etc/prometheus/prometheus.yml
networks:
mynetwork:
ipv4_address: 172.20.0.31
depends_on:
zetacore0:
condition: service_healthy

zetachain-exporter:
image: zetachain/zetachain-exporter:v2.0.6
container_name: zetachain-exporter
hostname: zetachain-exporter
profiles:
- monitoring
- all
ports:
- "9015:9015"
networks:
mynetwork:
ipv4_address: 172.20.0.32
environment:
- ETH_EVM_URL=http://eth:8545
- ZETA_EVM_URL=http://zetacore0:8545
- ZETA_LCD_URL=http://zetacore0:1317
- ZETA_TENDERMINT_URL=http://zetacore0:26657
- ETH_CHAIN_ID=1337
- ZETA_CHAIN_ID=7001
- REFRESH_INTERVAL=15
- FAST_REFRESH_INTERVAL=1
depends_on:
zetacore0:
condition: service_healthy
eth:
condition: service_started

loki:
container_name: loki
image: grafana/loki:3.1.0
hostname: loki
profiles:
- monitoring
- all
networks:
mynetwork:
ipv4_address: 172.20.0.33
command: -config.file=/etc/loki/local-config.yaml

promtail:
container_name: promtail
image: grafana/promtail:2.9.9
hostname: promtail
profiles:
- monitoring
- all
networks:
mynetwork:
ipv4_address: 172.20.0.34
volumes:
- ./promtail/config.yaml:/etc/promtail/config.yaml:ro
- /var/run/docker.sock:/var/run/docker.sock
command: -config.file=/etc/promtail/config.yaml

volumes:
ssh:
preparams:
grafana_storage:
Loading
Loading