From 747300965cf81f82d657dfed4d3fd804598c2d2c Mon Sep 17 00:00:00 2001 From: Michal Strug Date: Thu, 20 Feb 2025 15:10:05 +0100 Subject: [PATCH 1/5] Checking RPC node step --- .github/workflows/playground-check.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/playground-check.yaml b/.github/workflows/playground-check.yaml index 0ae0645391..e876180adb 100644 --- a/.github/workflows/playground-check.yaml +++ b/.github/workflows/playground-check.yaml @@ -37,6 +37,8 @@ jobs: cp playground/.env.example playground/.env sed -i -e 's/ETH_RPC_URL=.*/ETH_RPC_URL=$FORK_URL_MAINNET/g' playground/.env cat playground/.env + # check if RPC node is working on specified URL + curl $FORK_URL_MAINNET -X POST -H "Content-Type: application/json" --data '{"jsonrpc": "2.0", "method": "eth_blockNumber", "params": [],"id":1}' - name: Start docker containers id: containers From f169827e4ec83557a881bad308ab9028d806f26d Mon Sep 17 00:00:00 2001 From: Michal Strug Date: Thu, 20 Feb 2025 15:21:36 +0100 Subject: [PATCH 2/5] Disabled use of NX cloud build --- playground/Dockerfile.cowswap | 2 ++ 1 file changed, 2 insertions(+) diff --git a/playground/Dockerfile.cowswap b/playground/Dockerfile.cowswap index 723697badf..ceef253faa 100644 --- a/playground/Dockerfile.cowswap +++ b/playground/Dockerfile.cowswap @@ -35,6 +35,8 @@ ENV REACT_APP_NETWORK_URL_5=$REACT_APP_NETWORK_URL_5 ENV REACT_APP_NETWORK_URL_100=$REACT_APP_NETWORK_URL_100 ENV REACT_APP_ORDER_BOOK_URLS=$REACT_APP_ORDER_BOOK_URLS +ENV NX_NO_CLOUD=true + # Update environment variables based on "chain" and "ETH_RPC_URL" and build the frontend RUN if [ -n "$ETH_RPC_URL" ]; then \ case "$CHAIN" in \ From c1a7e955751b46fdb1eb820b26e46be7ab20d7d2 Mon Sep 17 00:00:00 2001 From: Michal Strug Date: Thu, 20 Feb 2025 18:57:22 +0100 Subject: [PATCH 3/5] Added chain-1 health log storing --- .github/workflows/playground-check.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/playground-check.yaml b/.github/workflows/playground-check.yaml index e876180adb..12c453f5eb 100644 --- a/.github/workflows/playground-check.yaml +++ b/.github/workflows/playground-check.yaml @@ -60,6 +60,10 @@ jobs: with: dest: './logs' + - name: Collect chain container health logs on failure + if: failure() + run: docker inspect --format='{{json .State.Health}}' playground-chain-1 > ./logs/health-playground-chain-1.json + - name: Tar logs if: failure() run: tar cvzf ./logs.tgz ./logs From 137c1f8ca02cd7e6939aa1b3d5e69f5190691234 Mon Sep 17 00:00:00 2001 From: Michal Strug Date: Thu, 20 Feb 2025 19:24:34 +0100 Subject: [PATCH 4/5] Added separate dockerfile for the chain service --- playground/Dockerfile.chain | 3 +++ playground/Dockerfile.cowswap | 4 +--- playground/docker-compose.fork.yml | 5 +++-- 3 files changed, 7 insertions(+), 5 deletions(-) create mode 100644 playground/Dockerfile.chain diff --git a/playground/Dockerfile.chain b/playground/Dockerfile.chain new file mode 100644 index 0000000000..3f68ba949d --- /dev/null +++ b/playground/Dockerfile.chain @@ -0,0 +1,3 @@ +FROM ghcr.io/foundry-rs/foundry:stable +USER root +RUN apt-get update && apt-get install -y wget diff --git a/playground/Dockerfile.cowswap b/playground/Dockerfile.cowswap index ceef253faa..87872a04e4 100644 --- a/playground/Dockerfile.cowswap +++ b/playground/Dockerfile.cowswap @@ -35,8 +35,6 @@ ENV REACT_APP_NETWORK_URL_5=$REACT_APP_NETWORK_URL_5 ENV REACT_APP_NETWORK_URL_100=$REACT_APP_NETWORK_URL_100 ENV REACT_APP_ORDER_BOOK_URLS=$REACT_APP_ORDER_BOOK_URLS -ENV NX_NO_CLOUD=true - # Update environment variables based on "chain" and "ETH_RPC_URL" and build the frontend RUN if [ -n "$ETH_RPC_URL" ]; then \ case "$CHAIN" in \ @@ -53,7 +51,7 @@ RUN if [ -n "$ETH_RPC_URL" ]; then \ REACT_APP_ORDER_BOOK_URLS=$(echo $REACT_APP_ORDER_BOOK_URLS | jq --arg chain "100" '.[$chain]="http://127.0.0.1:8080"') \ ;; \ esac; \ - yarn build --env REACT_APP_NETWORK_URL_1=$REACT_APP_NETWORK_URL_1 \ + NODE_OPTIONS="--max-old-space-size=4096" NX_NO_CLOUD=true yarn build --env REACT_APP_NETWORK_URL_1=$REACT_APP_NETWORK_URL_1 \ --env REACT_APP_NETWORK_URL_5=$REACT_APP_NETWORK_URL_5 \ --env REACT_APP_NETWORK_URL_100=$REACT_APP_NETWORK_URL_100 \ --env REACT_APP_ORDER_BOOK_URLS="$REACT_APP_ORDER_BOOK_URLS"; \ diff --git a/playground/docker-compose.fork.yml b/playground/docker-compose.fork.yml index d604cb5e14..c8c06bfdf7 100644 --- a/playground/docker-compose.fork.yml +++ b/playground/docker-compose.fork.yml @@ -1,7 +1,8 @@ -version: "3.9" services: chain: - image: ghcr.io/foundry-rs/foundry:stable + build: + context: . + dockerfile: Dockerfile.chain restart: always entrypoint: /usr/local/bin/anvil command: --fork-url ${ETH_RPC_URL} --block-time 12 From 1c64fa81174acca56fa488c965e2bdbdfffdcc4e Mon Sep 17 00:00:00 2001 From: Michal Strug Date: Thu, 20 Feb 2025 21:58:52 +0100 Subject: [PATCH 5/5] Cleanup --- .github/workflows/playground-check.yaml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/playground-check.yaml b/.github/workflows/playground-check.yaml index 12c453f5eb..cdd56d4031 100644 --- a/.github/workflows/playground-check.yaml +++ b/.github/workflows/playground-check.yaml @@ -37,8 +37,6 @@ jobs: cp playground/.env.example playground/.env sed -i -e 's/ETH_RPC_URL=.*/ETH_RPC_URL=$FORK_URL_MAINNET/g' playground/.env cat playground/.env - # check if RPC node is working on specified URL - curl $FORK_URL_MAINNET -X POST -H "Content-Type: application/json" --data '{"jsonrpc": "2.0", "method": "eth_blockNumber", "params": [],"id":1}' - name: Start docker containers id: containers @@ -60,9 +58,9 @@ jobs: with: dest: './logs' - - name: Collect chain container health logs on failure + - name: Collect playground-chain-1 container health logs on failure if: failure() - run: docker inspect --format='{{json .State.Health}}' playground-chain-1 > ./logs/health-playground-chain-1.json + run: docker inspect --format='{{json .State.Health}}' playground-chain-1 > ./logs/playground-chain-1-health-log.json - name: Tar logs if: failure()