From 45d722f8d138db3556212411bd387547b0119367 Mon Sep 17 00:00:00 2001 From: gzeon Date: Tue, 29 Oct 2024 05:14:44 +0900 Subject: [PATCH 1/5] perf: common docker layer --- rollupcreator/Dockerfile | 2 +- tokenbridge/Dockerfile | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/rollupcreator/Dockerfile b/rollupcreator/Dockerfile index f6406dad..622eafb6 100644 --- a/rollupcreator/Dockerfile +++ b/rollupcreator/Dockerfile @@ -1,7 +1,7 @@ FROM node:18-bullseye-slim -ARG NITRO_CONTRACTS_BRANCH=main RUN apt-get update && \ apt-get install -y git docker.io python3 build-essential curl jq +ARG NITRO_CONTRACTS_BRANCH=main WORKDIR /workspace RUN git clone --no-checkout https://github.com/OffchainLabs/nitro-contracts.git ./ RUN git checkout ${NITRO_CONTRACTS_BRANCH} diff --git a/tokenbridge/Dockerfile b/tokenbridge/Dockerfile index dac06fbb..38d417f1 100644 --- a/tokenbridge/Dockerfile +++ b/tokenbridge/Dockerfile @@ -1,7 +1,7 @@ FROM node:18-bullseye-slim -ARG TOKEN_BRIDGE_BRANCH=main RUN apt-get update && \ - apt-get install -y git docker.io python3 build-essential + apt-get install -y git docker.io python3 build-essential curl jq +ARG TOKEN_BRIDGE_BRANCH=main WORKDIR /workspace RUN git clone --no-checkout https://github.com/OffchainLabs/token-bridge-contracts.git ./ RUN git checkout ${TOKEN_BRIDGE_BRANCH} From 904e65d6a1af906be9472a4fb38797b2424e9fe0 Mon Sep 17 00:00:00 2001 From: gzeon Date: Tue, 29 Oct 2024 06:42:32 +0900 Subject: [PATCH 2/5] fix: init --- test-node.bash | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test-node.bash b/test-node.bash index 58cb2ef1..0ea81cb5 100755 --- a/test-node.bash +++ b/test-node.bash @@ -71,13 +71,13 @@ while [[ $# -gt 0 ]]; do read -p "are you sure? [y/n]" -n 1 response if [[ $response == "y" ]] || [[ $response == "Y" ]]; then force_init=true - build_utils=true - build_node_images=true echo else exit 0 fi fi + build_utils=true + build_node_images=true shift ;; --init-force) From a911bc9455c4072a6a2f3ceffa47b4b33819ab93 Mon Sep 17 00:00:00 2001 From: gzeon Date: Tue, 5 Nov 2024 18:58:34 +0900 Subject: [PATCH 3/5] fix: build cache missing tokenbridge --- test-node.bash | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test-node.bash b/test-node.bash index 0ea81cb5..d885ba87 100755 --- a/test-node.bash +++ b/test-node.bash @@ -344,7 +344,8 @@ fi if $build_utils; then LOCAL_BUILD_NODES="scripts rollupcreator" - if $tokenbridge || $l3_token_bridge; then + # always build tokenbridge in CI mode to avoid caching issues + if $tokenbridge || $l3_token_bridge || $ci; then LOCAL_BUILD_NODES="$LOCAL_BUILD_NODES tokenbridge" fi From f40e37dd2ca37c30adfdcdd9105399f6238ac073 Mon Sep 17 00:00:00 2001 From: gzeon Date: Tue, 5 Nov 2024 18:59:43 +0900 Subject: [PATCH 4/5] fix: allow detach without waiting --- test-node.bash | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/test-node.bash b/test-node.bash index d885ba87..91945e0e 100755 --- a/test-node.bash +++ b/test-node.bash @@ -39,6 +39,7 @@ run=true ci=false validate=false detach=false +nowait=false blockscout=false tokenbridge=false l3node=false @@ -179,6 +180,14 @@ while [[ $# -gt 0 ]]; do detach=true shift ;; + --nowait) + if ! $detach; then + echo "Error: --nowait requires --detach to be provided." + exit 1 + fi + nowait=true + shift + ;; --batchposters) simple=false batchposters=$2 @@ -557,7 +566,11 @@ fi if $run; then UP_FLAG="" if $detach; then - UP_FLAG="--wait" + if $nowait; then + UP_FLAG="--detach" + else + UP_FLAG="--wait" + fi fi echo == Launching Sequencer From e096877744268af6eaa1a3cfc16e2c95a9a7299f Mon Sep 17 00:00:00 2001 From: gzeon Date: Tue, 5 Nov 2024 19:00:54 +0900 Subject: [PATCH 5/5] perf: further reduce layer size --- rollupcreator/Dockerfile | 4 ++-- tokenbridge/Dockerfile | 10 ++++++---- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/rollupcreator/Dockerfile b/rollupcreator/Dockerfile index 622eafb6..13150b58 100644 --- a/rollupcreator/Dockerfile +++ b/rollupcreator/Dockerfile @@ -1,14 +1,14 @@ FROM node:18-bullseye-slim RUN apt-get update && \ - apt-get install -y git docker.io python3 build-essential curl jq + apt-get install -y git docker.io python3 make gcc g++ curl jq ARG NITRO_CONTRACTS_BRANCH=main WORKDIR /workspace RUN git clone --no-checkout https://github.com/OffchainLabs/nitro-contracts.git ./ RUN git checkout ${NITRO_CONTRACTS_BRANCH} +RUN yarn install && yarn cache clean RUN curl -L https://foundry.paradigm.xyz | bash ENV PATH="${PATH}:/root/.foundry/bin" RUN foundryup RUN touch scripts/config.ts -RUN yarn install RUN yarn build:all ENTRYPOINT ["yarn"] diff --git a/tokenbridge/Dockerfile b/tokenbridge/Dockerfile index 38d417f1..4adce556 100644 --- a/tokenbridge/Dockerfile +++ b/tokenbridge/Dockerfile @@ -1,10 +1,12 @@ FROM node:18-bullseye-slim RUN apt-get update && \ - apt-get install -y git docker.io python3 build-essential curl jq + apt-get install -y git docker.io python3 make gcc g++ curl jq ARG TOKEN_BRIDGE_BRANCH=main WORKDIR /workspace -RUN git clone --no-checkout https://github.com/OffchainLabs/token-bridge-contracts.git ./ -RUN git checkout ${TOKEN_BRIDGE_BRANCH} -RUN yarn install +RUN git clone --no-checkout https://github.com/OffchainLabs/token-bridge-contracts.git ./ && \ + git checkout ${TOKEN_BRIDGE_BRANCH} && \ + rm -rf .git && \ + git init && git add . && git -c user.name="user" -c user.email="user@example.com" commit -m "Initial commit" +RUN yarn install && yarn cache clean RUN yarn build ENTRYPOINT ["yarn"]