From fc75736b06a83a1bf512b2eed528e57de44a2cc1 Mon Sep 17 00:00:00 2001 From: Sheng Lundquist Date: Tue, 11 Jun 2024 11:03:21 -0700 Subject: [PATCH 1/5] Cleanup and update for agent0 --- docker-compose.anvil.yaml | 16 ----- docker-compose.blocktime.yaml | 1 - docker-compose.data.yaml | 13 +--- docker-compose.frontend.yaml | 1 - docker-compose.fuzz-bot.yaml | 47 ------------- docker-compose.ports.yaml | 1 - docker-compose.postgres.yaml | 5 +- docker-compose.rate-bot.yaml | 11 ---- docker-compose.service-bots.yaml | 29 ++++++++ docker-compose.testnet.yaml | 1 - env/env.images | 7 +- env/env.postgres | 2 +- setup_env.sh | 110 ++++++++++++++----------------- 13 files changed, 86 insertions(+), 158 deletions(-) delete mode 100644 docker-compose.fuzz-bot.yaml delete mode 100644 docker-compose.rate-bot.yaml create mode 100644 docker-compose.service-bots.yaml diff --git a/docker-compose.anvil.yaml b/docker-compose.anvil.yaml index c40ed28..a59dd89 100644 --- a/docker-compose.anvil.yaml +++ b/docker-compose.anvil.yaml @@ -1,4 +1,3 @@ -version: "3.9" services: ethereum: image: ${DEVNET_IMAGE} @@ -41,20 +40,5 @@ services: volumes: - artifacts:/var/www/artifacts/ - # TODO make single container for all pools - checkpoint-bot-erc4626: - image: ${AGENT0_IMAGE} - command: | - /bin/sh -c "sleep 1; python scripts/checkpoint_bot.py --pool erc4626_hyperdrive --fund" - env_file: - - .env - - checkpoint-bot-steth: - image: ${AGENT0_IMAGE} - command: | - /bin/sh -c "sleep 1; python scripts/checkpoint_bot.py --pool steth_hyperdrive --fund" - env_file: - - .env - volumes: artifacts: diff --git a/docker-compose.blocktime.yaml b/docker-compose.blocktime.yaml index 1dd434c..d977e67 100644 --- a/docker-compose.blocktime.yaml +++ b/docker-compose.blocktime.yaml @@ -1,4 +1,3 @@ -version: "3.9" services: ethereum: # This file overwrites docker-compose.anvil.yaml diff --git a/docker-compose.data.yaml b/docker-compose.data.yaml index 36c3e60..fd4b088 100644 --- a/docker-compose.data.yaml +++ b/docker-compose.data.yaml @@ -1,4 +1,3 @@ -version: "3.9" services: data: @@ -15,7 +14,7 @@ services: profiles: - "data" working_dir: /app/ - command: /bin/sh -c "python scripts/run_data_analysis.py" + command: /bin/sh -c "python scripts/run_analyze_data.py" env_file: - .env @@ -37,15 +36,5 @@ services: mem_reservation: "1g" restart: always - # Set initial username mappings - init-usernames: - image: ${AGENT0_IMAGE} - profiles: - - "data" - working_dir: /app/ - command: /bin/sh -c "python scripts/update_usernames.py" - env_file: - - .env - volumes: artifacts: diff --git a/docker-compose.frontend.yaml b/docker-compose.frontend.yaml index a15d627..2b1bef4 100644 --- a/docker-compose.frontend.yaml +++ b/docker-compose.frontend.yaml @@ -1,4 +1,3 @@ -version: "3.9" services: frontend: diff --git a/docker-compose.fuzz-bot.yaml b/docker-compose.fuzz-bot.yaml deleted file mode 100644 index 5027cd9..0000000 --- a/docker-compose.fuzz-bot.yaml +++ /dev/null @@ -1,47 +0,0 @@ -version: "3.9" -services: - # TODO make single container for all pools - fuzz-erc4626: - image: ${AGENT0_IMAGE} - profiles: - - "fuzz" - working_dir: /app/ - command: /bin/sh -c "DEVELOP=true python scripts/fuzz_bots.py --pool erc4626_hyperdrive" - env_file: - - .env - volumes: - - .crash_report:/app/.crash_report - - fuzz-steth: - image: ${AGENT0_IMAGE} - profiles: - - "fuzz" - working_dir: /app/ - command: /bin/sh -c "DEVELOP=true python scripts/fuzz_bots.py --pool steth_hyperdrive" - env_file: - - .env - volumes: - - .crash_report:/app/.crash_report - - fuzz-invariant-check-erc4626: - image: ${AGENT0_IMAGE} - profiles: - - "fuzz" - working_dir: /app/ - command: /bin/sh -c "sleep 1; python scripts/fuzz_bot_invariant_checks.py --pool erc4626_hyperdrive" - env_file: - - .env - volumes: - - .crash_report:/app/.crash_report - - - fuzz-invariant-check-steth: - image: ${AGENT0_IMAGE} - profiles: - - "fuzz" - working_dir: /app/ - command: /bin/sh -c "sleep 1; python scripts/fuzz_bot_invariant_checks.py --pool steth_hyperdrive" - env_file: - - .env - volumes: - - .crash_report:/app/.crash_report diff --git a/docker-compose.ports.yaml b/docker-compose.ports.yaml index 45a62c0..30b8297 100644 --- a/docker-compose.ports.yaml +++ b/docker-compose.ports.yaml @@ -1,4 +1,3 @@ -version: "3.9" services: ethereum: diff --git a/docker-compose.postgres.yaml b/docker-compose.postgres.yaml index ef2df05..b1ef98d 100644 --- a/docker-compose.postgres.yaml +++ b/docker-compose.postgres.yaml @@ -1,7 +1,4 @@ -version: '3.9' - services: - db: image: postgres profiles: @@ -10,4 +7,4 @@ services: environment: POSTGRES_PASSWORD: password POSTGRES_USER: admin - POSTGRES_DB: postgres_db + POSTGRES_DB: agent0_db diff --git a/docker-compose.rate-bot.yaml b/docker-compose.rate-bot.yaml deleted file mode 100644 index 44c42b4..0000000 --- a/docker-compose.rate-bot.yaml +++ /dev/null @@ -1,11 +0,0 @@ -version: "3.9" -services: - rate-bot: - image: ${RATE_BOT_IMAGE} - profiles: - - "dynamic-rate" - volumes: - - artifacts:/artifacts/ - -volumes: - artifacts: diff --git a/docker-compose.service-bots.yaml b/docker-compose.service-bots.yaml new file mode 100644 index 0000000..e00caf5 --- /dev/null +++ b/docker-compose.service-bots.yaml @@ -0,0 +1,29 @@ +services: + checkpoint-bot: + image: ${AGENT0_IMAGE} + profiles: + - "service-bots" + command: | + /bin/sh -c "sleep 1; python scripts/checkpoint_bots.py --pool-check-sleep-blocks 30 --infra" + env_file: + - .env + + invariance-check-bot: + image: ${AGENT0_IMAGE} + profiles: + - "service-bots" + command: | + /bin/sh -c "sleep 2; python scripts/fuzz_bot_invariant_checks.py --pool-check-sleep-blocks 30 --infra" + env_file: + - .env + + # TODO rewrite rate bot in agent0 + rate-bot: + image: ${RATE_BOT_IMAGE} + profiles: + - "rate-bot" + volumes: + - artifacts:/artifacts/ + +volumes: + artifacts: diff --git a/docker-compose.testnet.yaml b/docker-compose.testnet.yaml index 6f37839..cd5b609 100644 --- a/docker-compose.testnet.yaml +++ b/docker-compose.testnet.yaml @@ -1,4 +1,3 @@ -version: "3.9" services: ethereum: # This file overwrites docker-compose.anvil.yaml diff --git a/env/env.images b/env/env.images index 566ed3d..df04a8a 100644 --- a/env/env.images +++ b/env/env.images @@ -5,8 +5,8 @@ # - edge = The newest image regardless of stability # Anvil -DEVNET_IMAGE=ghcr.io/delvtech/hyperdrive/devnet:1.0.1 -TESTNET_IMAGE=ghcr.io/delvtech/hyperdrive/testnet:1.0.1 +DEVNET_IMAGE=ghcr.io/delvtech/hyperdrive/devnet:1.0.10 +TESTNET_IMAGE=ghcr.io/delvtech/hyperdrive/devnet:1.0.10 # Infra ARTIFACTS_IMAGE=ghcr.io/delvtech/infra/artifacts:0.0.8 @@ -15,7 +15,8 @@ RATE_BOT_IMAGE=ghcr.io/delvtech/infra/rate-bot:0.0.8 # Agent0 (bots) # TODO cut release and set here -AGENT0_IMAGE=ghcr.io/delvtech/agent0/agent0:0.18.1 +AGENT0_IMAGE=agent0:latest +# AGENT0_IMAGE=ghcr.io/delvtech/agent0/agent0:0.20.0 # Frontend FRONTEND_IMAGE=ghcr.io/delvtech/hyperdrive-frontend/hyperdrive-frontend:1.0.7 diff --git a/env/env.postgres b/env/env.postgres index 4249d7f..bddaa53 100644 --- a/env/env.postgres +++ b/env/env.postgres @@ -1,5 +1,5 @@ POSTGRES_USER=admin POSTGRES_PASSWORD=password -POSTGRES_DB=postgres_db +POSTGRES_DB=agent0_db POSTGRES_HOST="db" POSTGRES_PORT=5432 diff --git a/setup_env.sh b/setup_env.sh index 8273c5e..23b8c78 100755 --- a/setup_env.sh +++ b/setup_env.sh @@ -6,21 +6,20 @@ # Check if no arguments or --help is passed if [[ $# -eq 0 ]] || [[ "$1" == "--help" ]]; then echo "Usage: ./setup_env.sh [flags]" - echo "Flags:" + echo "Flag Groups:" echo " --all : Fund accounts and enable all components: anvil, data, postgres, frontend, and ports." - echo " --competition : Fund accounts and enable anvil on block time with testnet image, data (without postgres), and ports. Use this for a trading competition deployment." echo " --develop : Fund accounts and enable anvil, data, and ports. Suitable for local development work." - echo " --fuzz : Enable anvil on block time, data, and ports. Runs fuzzbots and outputs crash reports." + echo "Flags:" echo " --anvil : Spin up an Anvil node, deploy Hyperdrive to it, and serve artifacts on an nginx server." echo " --blocktime : Sets the anvil node to run in blocktime mode." echo " --testnet : Uses the testnet hyperdrive image with restricted mint access." echo " --frontend : Build the frontend container." - echo " --data : Runs the data framework, querying the chain and writing to postgres." echo " --postgres : Runs a postgres db container for storing data." + echo " --data : Runs the data framework, querying the chain and writing to postgres." + echo " --service-bots : Runs checkpoint bot and invariance check bots on the chain." echo " --ports : Expose docker images to your machine, as specified in env/env.ports." echo " --fund-accounts : Fund accounts from /accounts/balances.json." - echo " --dynamic-rate : Yield source will have a dynamic variable rate." - echo " --fuzzbot : Runs fuzzbots on the chain." + echo " --rate-bot : Yield source will have a dynamic variable rate." exit 0 fi @@ -30,49 +29,37 @@ ANVIL=false BLOCKTIME=false TESTNET=false FRONTEND=false -DATA=false POSTGRES=false +DATA=false PORTS=false +SERVICE_BOTS=false +RATE_BOT=false FUND_ACCOUNTS=false -DYNAMIC_RATE=false -FUZZBOT=false ## Loop through the arguments while [[ $# -gt 0 ]]; do case $1 in + # Flag groups --all) ANVIL=true + # BLOCKTIME=true + # TODO add in testnet image here FRONTEND=true - DATA=true POSTGRES=true - PORTS=true - FUND_ACCOUNTS=true - DYNAMIC_RATE=true - ;; - --competition) - ANVIL=true - BLOCKTIME=true - TESTNET=true DATA=true PORTS=true + SERVICE_BOTS=true + RATE_BOT=true FUND_ACCOUNTS=true - DYNAMIC_RATE=true ;; --develop) ANVIL=true POSTGRES=true - PORTS=true DATA=true - FUND_ACCOUNTS=true - ;; - --fuzz) - ANVIL=true - BLOCKTIME=true - DATA=true - POSTGRES=true PORTS=true - FUZZBOT=true + FUND_ACCOUNTS=true ;; + # Flags --anvil) ANVIL=true ;; @@ -94,14 +81,14 @@ while [[ $# -gt 0 ]]; do --ports) PORTS=true ;; - --fund-accounts) - FUND_ACCOUNTS=true + --service-bots) + SERVICE_BOTS=true ;; - --dynamic-rate) - DYNAMIC_RATE=true + --rate-bot) + RATE_BOT=true ;; - --fuzzbot) - FUZZBOT=true + --fund-accounts) + FUND_ACCOUNTS=true ;; *) echo "Unknown flag: $1" @@ -120,15 +107,17 @@ echo "# Environment for Docker compose" >>.env # all of the services in the compose context. We determine which layers are # turned on using docker compose profiles. anvil_compose="docker-compose.anvil.yaml" -data_compose="docker-compose.data.yaml" -rate_bot_compose="docker-compose.rate-bot.yaml" -fuzz_bot_compose="docker-compose.fuzz-bot.yaml" +blocktime_compose="docker-compose.blocktime.yaml" +testnet_compose="docker-compose.testnet.yaml" frontend_compose="docker-compose.frontend.yaml" postgres_compose="docker-compose.postgres.yaml" -testnet_compose="docker-compose.testnet.yaml" -blocktime_compose="docker-compose.blocktime.yaml" +data_compose="docker-compose.data.yaml" +service_bots_compose="docker-compose.service-bots.yaml" ports_compose="docker-compose.ports.yaml" -full_compose_files="COMPOSE_FILE=$anvil_compose:$data_compose:$frontend_compose:$postgres_compose:$rate_bot_compose:$fuzz_bot_compose:" + +# We default to using profiles to control which services are turned on. +full_compose_files="COMPOSE_FILE=$anvil_compose:$frontend_compose:$postgres_compose:$data_compose:$service_bots_compose:" +# We only add controls here if these compose files update existing services. if $BLOCKTIME; then full_compose_files+="$blocktime_compose:" fi @@ -150,14 +139,17 @@ echo $full_compose_files >>.env # Set up the COMPOSE_PROFILES environment variable. This toggles which layers # should be started. +blocktime_profile="blocktime" frontend_profile="frontend" postgres_profile="postgres" data_profile="data" +service_bots_profile="service-bots" +rate_bot_profile="rate-bot" fund_accounts_profile="fund-accounts" -blocktime_profile="blocktime" -dynamic_rate_profile="dynamic-rate" -fuzz_bot_profile="fuzz" full_compose_profiles="COMPOSE_PROFILES=" +if $BLOCKTIME; then + full_compose_profiles+="$blocktime_profile," +fi if $FRONTEND; then full_compose_profiles+="$frontend_profile," fi @@ -167,17 +159,14 @@ fi if $DATA; then full_compose_profiles+="$data_profile," fi -if $FUND_ACCOUNTS; then - full_compose_profiles+="$fund_accounts_profile," -fi -if $BLOCKTIME; then - full_compose_profiles+="$blocktime_profile," +if $SERVICE_BOTS; then + full_compose_profiles+="$service_bots_profile," fi -if $DYNAMIC_RATE; then - full_compose_profiles+="$dynamic_rate_profile," +if $RATE_BOT; then + full_compose_profiles+="$rate_bot_profile," fi -if $FUZZBOT; then - full_compose_profiles+="$fuzz_bot_profile," +if $FUND_ACCOUNTS; then + full_compose_profiles+="$fund_accounts_profile," fi # Check if "," is at the end of the string if [[ $full_compose_profiles == *"," ]]; then @@ -206,6 +195,12 @@ if $ANVIL; then cat env/env.anvil >>.env fi +# optionally add an env.time to .env file if --blocktime +if $BLOCKTIME; then + echo "" >>.env + cat env/env.time >>.env +fi + # optionally add an env.frontend to .env file if --frontend if $FRONTEND; then echo "" >>.env @@ -213,16 +208,11 @@ if $FRONTEND; then fi # optionally add an env.frontend to .env file if --postgres or --data -# POSTGRES uses these flags to launch postgres, DATA uses these flags to connect -if $POSTGRES || $DATA; then +# POSTGRES uses these flags to launch postgres. +# All agent0 images uses these flags to connect +if $POSTGRES || $DATA || $SERVICE_BOTS; then echo "" >>.env cat env/env.postgres >> .env fi -# optionally add an env.time to .env file if --blocktime -if $BLOCKTIME; then - echo "" >>.env - cat env/env.time >>.env -fi - echo "Environment filed created at .env" From e6e6f8c2a5e39e5970128cb70bede9721249d57e Mon Sep 17 00:00:00 2001 From: Sheng Lundquist Date: Tue, 11 Jun 2024 15:09:39 -0700 Subject: [PATCH 2/5] Renaming bots compose file and adding random bots container --- ...e-bots.yaml => docker-compose.agent0-bots.yaml | 11 ++++++++++- env/env.images | 2 +- setup_env.sh | 15 +++++++++++---- 3 files changed, 22 insertions(+), 6 deletions(-) rename docker-compose.service-bots.yaml => docker-compose.agent0-bots.yaml (67%) diff --git a/docker-compose.service-bots.yaml b/docker-compose.agent0-bots.yaml similarity index 67% rename from docker-compose.service-bots.yaml rename to docker-compose.agent0-bots.yaml index e00caf5..900b8db 100644 --- a/docker-compose.service-bots.yaml +++ b/docker-compose.agent0-bots.yaml @@ -13,7 +13,16 @@ services: profiles: - "service-bots" command: | - /bin/sh -c "sleep 2; python scripts/fuzz_bot_invariant_checks.py --pool-check-sleep-blocks 30 --infra" + /bin/sh -c "sleep 1; python scripts/fuzz_bot_invariant_checks.py --pool-check-sleep-blocks 30 --infra" + env_file: + - .env + + random-bots: + image: ${AGENT0_IMAGE} + profiles: + - "random-bots" + command: | + /bin/sh -c "sleep 1; python scripts/remote_fuzz_bots.py --pool-check-sleep-blocks 10000 --infra" env_file: - .env diff --git a/env/env.images b/env/env.images index df04a8a..956597c 100644 --- a/env/env.images +++ b/env/env.images @@ -19,4 +19,4 @@ AGENT0_IMAGE=agent0:latest # AGENT0_IMAGE=ghcr.io/delvtech/agent0/agent0:0.20.0 # Frontend -FRONTEND_IMAGE=ghcr.io/delvtech/hyperdrive-frontend/hyperdrive-frontend:1.0.7 +FRONTEND_IMAGE=ghcr.io/delvtech/hyperdrive-frontend/hyperdrive-frontend:1.6.5 diff --git a/setup_env.sh b/setup_env.sh index 23b8c78..b48c46b 100755 --- a/setup_env.sh +++ b/setup_env.sh @@ -17,6 +17,7 @@ if [[ $# -eq 0 ]] || [[ "$1" == "--help" ]]; then echo " --postgres : Runs a postgres db container for storing data." echo " --data : Runs the data framework, querying the chain and writing to postgres." echo " --service-bots : Runs checkpoint bot and invariance check bots on the chain." + echo " --random-bots : Runs random bots on the chain." echo " --ports : Expose docker images to your machine, as specified in env/env.ports." echo " --fund-accounts : Fund accounts from /accounts/balances.json." echo " --rate-bot : Yield source will have a dynamic variable rate." @@ -33,6 +34,7 @@ POSTGRES=false DATA=false PORTS=false SERVICE_BOTS=false +RANDOM_BOTS=false RATE_BOT=false FUND_ACCOUNTS=false @@ -42,13 +44,14 @@ while [[ $# -gt 0 ]]; do # Flag groups --all) ANVIL=true - # BLOCKTIME=true - # TODO add in testnet image here + # Don't run blocktime here, we want chain to be in fast mode + # Don't run testnet image here since random bots need to be able to mint FRONTEND=true POSTGRES=true DATA=true PORTS=true SERVICE_BOTS=true + RANDOM_BOTS=true RATE_BOT=true FUND_ACCOUNTS=true ;; @@ -112,7 +115,7 @@ testnet_compose="docker-compose.testnet.yaml" frontend_compose="docker-compose.frontend.yaml" postgres_compose="docker-compose.postgres.yaml" data_compose="docker-compose.data.yaml" -service_bots_compose="docker-compose.service-bots.yaml" +service_bots_compose="docker-compose.agent0-bots.yaml" ports_compose="docker-compose.ports.yaml" # We default to using profiles to control which services are turned on. @@ -144,6 +147,7 @@ frontend_profile="frontend" postgres_profile="postgres" data_profile="data" service_bots_profile="service-bots" +random_bots_profile="random-bots" rate_bot_profile="rate-bot" fund_accounts_profile="fund-accounts" full_compose_profiles="COMPOSE_PROFILES=" @@ -162,6 +166,9 @@ fi if $SERVICE_BOTS; then full_compose_profiles+="$service_bots_profile," fi +if $RANDOM_BOTS; then + full_compose_profiles+="$random_bots_profile," +fi if $RATE_BOT; then full_compose_profiles+="$rate_bot_profile," fi @@ -210,7 +217,7 @@ fi # optionally add an env.frontend to .env file if --postgres or --data # POSTGRES uses these flags to launch postgres. # All agent0 images uses these flags to connect -if $POSTGRES || $DATA || $SERVICE_BOTS; then +if $POSTGRES || $DATA || $SERVICE_BOTS || $RANDOM_BOTS || $RATE_BOT; then echo "" >>.env cat env/env.postgres >> .env fi From 706d564d36ff755094a2f1ceb35ab3c94c4f0693 Mon Sep 17 00:00:00 2001 From: Sheng Lundquist Date: Tue, 11 Jun 2024 15:30:33 -0700 Subject: [PATCH 3/5] Renaming services and updating ci test scripts --- docker-compose.agent0-bots.yaml | 8 ++--- setup_env.sh | 34 +++++++++---------- test/test_compose.sh | 58 +++++++++++++++++++++------------ 3 files changed, 58 insertions(+), 42 deletions(-) diff --git a/docker-compose.agent0-bots.yaml b/docker-compose.agent0-bots.yaml index 900b8db..0fab327 100644 --- a/docker-compose.agent0-bots.yaml +++ b/docker-compose.agent0-bots.yaml @@ -2,7 +2,7 @@ services: checkpoint-bot: image: ${AGENT0_IMAGE} profiles: - - "service-bots" + - "service-bot" command: | /bin/sh -c "sleep 1; python scripts/checkpoint_bots.py --pool-check-sleep-blocks 30 --infra" env_file: @@ -11,16 +11,16 @@ services: invariance-check-bot: image: ${AGENT0_IMAGE} profiles: - - "service-bots" + - "service-bot" command: | /bin/sh -c "sleep 1; python scripts/fuzz_bot_invariant_checks.py --pool-check-sleep-blocks 30 --infra" env_file: - .env - random-bots: + random-bot: image: ${AGENT0_IMAGE} profiles: - - "random-bots" + - "random-bot" command: | /bin/sh -c "sleep 1; python scripts/remote_fuzz_bots.py --pool-check-sleep-blocks 10000 --infra" env_file: diff --git a/setup_env.sh b/setup_env.sh index b48c46b..976f595 100755 --- a/setup_env.sh +++ b/setup_env.sh @@ -16,8 +16,8 @@ if [[ $# -eq 0 ]] || [[ "$1" == "--help" ]]; then echo " --frontend : Build the frontend container." echo " --postgres : Runs a postgres db container for storing data." echo " --data : Runs the data framework, querying the chain and writing to postgres." - echo " --service-bots : Runs checkpoint bot and invariance check bots on the chain." - echo " --random-bots : Runs random bots on the chain." + echo " --service-bot : Runs checkpoint bot and invariance check bots on the chain." + echo " --random-bot : Runs random bots on the chain." echo " --ports : Expose docker images to your machine, as specified in env/env.ports." echo " --fund-accounts : Fund accounts from /accounts/balances.json." echo " --rate-bot : Yield source will have a dynamic variable rate." @@ -33,8 +33,8 @@ FRONTEND=false POSTGRES=false DATA=false PORTS=false -SERVICE_BOTS=false -RANDOM_BOTS=false +SERVICE_BOT=false +RANDOM_BOT=false RATE_BOT=false FUND_ACCOUNTS=false @@ -50,8 +50,8 @@ while [[ $# -gt 0 ]]; do POSTGRES=true DATA=true PORTS=true - SERVICE_BOTS=true - RANDOM_BOTS=true + SERVICE_BOT=true + RANDOM_BOT=true RATE_BOT=true FUND_ACCOUNTS=true ;; @@ -84,8 +84,8 @@ while [[ $# -gt 0 ]]; do --ports) PORTS=true ;; - --service-bots) - SERVICE_BOTS=true + --service-bot) + SERVICE_BOT=true ;; --rate-bot) RATE_BOT=true @@ -115,11 +115,11 @@ testnet_compose="docker-compose.testnet.yaml" frontend_compose="docker-compose.frontend.yaml" postgres_compose="docker-compose.postgres.yaml" data_compose="docker-compose.data.yaml" -service_bots_compose="docker-compose.agent0-bots.yaml" +service_bot_compose="docker-compose.agent0-bots.yaml" ports_compose="docker-compose.ports.yaml" # We default to using profiles to control which services are turned on. -full_compose_files="COMPOSE_FILE=$anvil_compose:$frontend_compose:$postgres_compose:$data_compose:$service_bots_compose:" +full_compose_files="COMPOSE_FILE=$anvil_compose:$frontend_compose:$postgres_compose:$data_compose:$service_bot_compose:" # We only add controls here if these compose files update existing services. if $BLOCKTIME; then full_compose_files+="$blocktime_compose:" @@ -146,8 +146,8 @@ blocktime_profile="blocktime" frontend_profile="frontend" postgres_profile="postgres" data_profile="data" -service_bots_profile="service-bots" -random_bots_profile="random-bots" +service_bot_profile="service-bot" +random_bot_profile="random-bot" rate_bot_profile="rate-bot" fund_accounts_profile="fund-accounts" full_compose_profiles="COMPOSE_PROFILES=" @@ -163,11 +163,11 @@ fi if $DATA; then full_compose_profiles+="$data_profile," fi -if $SERVICE_BOTS; then - full_compose_profiles+="$service_bots_profile," +if $SERVICE_BOT; then + full_compose_profiles+="$service_bot_profile," fi -if $RANDOM_BOTS; then - full_compose_profiles+="$random_bots_profile," +if $RANDOM_BOT; then + full_compose_profiles+="$random_bot_profile," fi if $RATE_BOT; then full_compose_profiles+="$rate_bot_profile," @@ -217,7 +217,7 @@ fi # optionally add an env.frontend to .env file if --postgres or --data # POSTGRES uses these flags to launch postgres. # All agent0 images uses these flags to connect -if $POSTGRES || $DATA || $SERVICE_BOTS || $RANDOM_BOTS || $RATE_BOT; then +if $POSTGRES || $DATA || $SERVICE_BOT || $RANDOM_BOT || $RATE_BOT; then echo "" >>.env cat env/env.postgres >> .env fi diff --git a/test/test_compose.sh b/test/test_compose.sh index b59cffa..e726af0 100644 --- a/test/test_compose.sh +++ b/test/test_compose.sh @@ -38,23 +38,10 @@ if [ -z "$(docker compose ps -q artifacts)" ]; then exit 1 fi -# The checkpoint-bot service should be running. -if [ -z "$(docker compose ps -q checkpoint-bot-erc4626)" ]; then - echo "Checkpoint bot service exited unexpectedly:" - docker logs $dirname-checkpoint-bot-erc4626-1 - exit 1 -fi - -if [ -z "$(docker compose ps -q checkpoint-bot-steth)" ]; then - echo "Checkpoint bot service exited unexpectedly:" - docker logs $dirname-checkpoint-bot-steth-1 - exit 1 -fi - -# The rate-bot service should be running. -if [ -z "$(docker compose ps -q rate-bot)" ]; then - echo "Rate bot service exited unexpectedly:" - docker logs $dirname-rate-bot-1 +# The frontend service should be running. +if [ -z "$(docker compose ps -q frontend)" ]; then + echo "Frontend service exited unexpectedly:" + docker logs $dirname-frontend-1 exit 1 fi @@ -65,6 +52,13 @@ if [ -z "$(docker compose ps -q data)" ]; then exit 1 fi +# The analysis service should be running. +if [ -z "$(docker compose ps -q analysis)" ]; then + echo "Analysis service exited unexpectedly:" + docker logs $dirname-analysis-1 + exit 1 +fi + # The dashboard service should be running. if [ -z "$(docker compose ps -q dashboard)" ]; then echo "Dashboard service exited unexpectedly:" @@ -79,11 +73,33 @@ if [ -z "$(docker compose ps -q db)" ]; then exit 1 fi -# The frontend service should be running. -if [ -z "$(docker compose ps -q frontend)" ]; then - echo "Frontend service exited unexpectedly:" - docker logs $dirname-frontend-1 +# The checkpoint-bot service should be running. +if [ -z "$(docker compose ps -q checkpoint-bot)" ]; then + echo "Checkpoint bot service exited unexpectedly:" + docker logs $dirname-checkpoint-bot-1 + exit 1 +fi + +# The rate-bot service should be running. +if [ -z "$(docker compose ps -q rate-bot)" ]; then + echo "Rate bot service exited unexpectedly:" + docker logs $dirname-rate-bot-1 + exit 1 +fi + +# The invariance-check-bot service should be running. +if [ -z "$(docker compose ps -q invariance-check-bot)" ]; then + echo "Invariance check bot service exited unexpectedly:" + docker logs $dirname-invariance-check-bot-1 exit 1 fi +# The random-bot service should be running. +if [ -z "$(docker compose ps -q random-bot)" ]; then + echo "Random bot service exited unexpectedly:" + docker logs $dirname-random-bot-1 + exit 1 +fi + + echo "Containers ran successfully!" From 16fbe22825ed816f4f2e3d02daf6868a43e223fe Mon Sep 17 00:00:00 2001 From: Sheng Lundquist Date: Tue, 11 Jun 2024 16:57:02 -0700 Subject: [PATCH 4/5] Setting version of agent0 --- env/env.images | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/env/env.images b/env/env.images index 956597c..06cad1e 100644 --- a/env/env.images +++ b/env/env.images @@ -14,9 +14,7 @@ FUND_ACCOUNTS_IMAGE=ghcr.io/delvtech/infra/fund-accounts:0.0.8 RATE_BOT_IMAGE=ghcr.io/delvtech/infra/rate-bot:0.0.8 # Agent0 (bots) -# TODO cut release and set here -AGENT0_IMAGE=agent0:latest -# AGENT0_IMAGE=ghcr.io/delvtech/agent0/agent0:0.20.0 +AGENT0_IMAGE=ghcr.io/delvtech/agent0/agent0:0.20.2 # Frontend FRONTEND_IMAGE=ghcr.io/delvtech/hyperdrive-frontend/hyperdrive-frontend:1.6.5 From 84a3366db768038f1940ad142844760c949645ec Mon Sep 17 00:00:00 2001 From: Sheng Lundquist Date: Tue, 11 Jun 2024 17:04:58 -0700 Subject: [PATCH 5/5] Setting testnet image --- env/env.images | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/env/env.images b/env/env.images index 06cad1e..60095c7 100644 --- a/env/env.images +++ b/env/env.images @@ -6,7 +6,7 @@ # Anvil DEVNET_IMAGE=ghcr.io/delvtech/hyperdrive/devnet:1.0.10 -TESTNET_IMAGE=ghcr.io/delvtech/hyperdrive/devnet:1.0.10 +TESTNET_IMAGE=ghcr.io/delvtech/hyperdrive/testnet:1.0.10 # Infra ARTIFACTS_IMAGE=ghcr.io/delvtech/infra/artifacts:0.0.8