Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/release'
Browse files Browse the repository at this point in the history
  • Loading branch information
Tristan-Wilson committed Dec 3, 2024
2 parents fa19e22 + e28b144 commit 64b26a4
Show file tree
Hide file tree
Showing 7 changed files with 85 additions and 20 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ jobs:
pos: [pos, no-pos]
l3node: [l3node, l3node-token-6, no-l3node]
tokenbridge: [tokenbridge, no-tokenbridge]
simple: [simple, no-simple]

steps:
- name: Checkout
Expand All @@ -34,8 +35,8 @@ jobs:
uses: actions/cache@v3
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ hashFiles('Dockerfile') }}
key: ${{ runner.os }}-buildx-${{ hashFiles('**/Dockerfile') }}
restore-keys: ${{ runner.os }}-buildx-

- name: Startup Nitro testnode
run: ${{ github.workspace }}/.github/workflows/testnode.bash --init-force ${{ (matrix.l3node == 'l3node' && '--l3node') || (matrix.l3node == 'l3node-token-6' && '--l3node --l3-fee-token --l3-token-bridge --l3-fee-token-decimals 6') || '' }} ${{ matrix.tokenbridge == 'tokenbridge' && '--tokenbridge' || '--no-tokenbridge' }} --no-simple --detach ${{ matrix.pos == 'pos' && '--pos' || '' }}
run: ${{ github.workspace }}/.github/workflows/testnode.bash --init-force ${{ (matrix.l3node == 'l3node' && '--l3node') || (matrix.l3node == 'l3node-token-6' && '--l3node --l3-fee-token --l3-token-bridge --l3-fee-token-decimals 6') || '' }} ${{ matrix.tokenbridge == 'tokenbridge' && '--tokenbridge' || '--no-tokenbridge' }} --detach ${{ matrix.pos == 'pos' && '--pos' || '' }} --simple ${{ (matrix.simple == 'simple' && '--simple') || (matrix.simple == 'no-simple' && '--no-simple') || '' }}
2 changes: 1 addition & 1 deletion .github/workflows/testnode.bash
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# Start the test node and get PID, to terminate it once send-l2 is done.
cd ${GITHUB_WORKSPACE}

./test-node.bash "$@"
./test-node.bash "$@" --ci

if [ $? -ne 0 ]; then
echo "test-node.bash failed"
Expand Down
37 changes: 37 additions & 0 deletions docker-compose-ci-cache.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"target": {
"scripts": {
"cache-from": [
"type=local,src=/tmp/.buildx-cache"
],
"cache-to": [
"type=local,dest=/tmp/.buildx-cache,mode=max"
],
"output": [
"type=docker"
]
},
"rollupcreator": {
"cache-from": [
"type=local,src=/tmp/.buildx-cache"
],
"cache-to": [
"type=local,dest=/tmp/.buildx-cache,mode=max"
],
"output": [
"type=docker"
]
},
"tokenbridge": {
"cache-from": [
"type=local,src=/tmp/.buildx-cache"
],
"cache-to": [
"type=local,dest=/tmp/.buildx-cache,mode=max"
],
"output": [
"type=docker"
]
}
}
}
2 changes: 1 addition & 1 deletion docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ services:
- "127.0.0.1:6379:6379"

geth:
image: ethereum/client-go:latest
image: ethereum/client-go:stable
ports:
- "127.0.0.1:8545:8545"
- "127.0.0.1:8551:8551"
Expand Down
6 changes: 3 additions & 3 deletions rollupcreator/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
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
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"]
41 changes: 33 additions & 8 deletions test-node.bash
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,10 @@ else
fi

run=true
ci=false
validate=false
detach=false
nowait=false
blockscout=false
tokenbridge=false
l3node=false
Expand Down Expand Up @@ -71,13 +73,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)
Expand Down Expand Up @@ -108,6 +110,10 @@ while [[ $# -gt 0 ]]; do
done
fi
;;
--ci)
ci=true
shift
;;
--build)
build_dev_nitro=true
build_dev_blockscout=true
Expand Down Expand Up @@ -175,6 +181,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
Expand Down Expand Up @@ -344,14 +358,21 @@ 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
UTILS_NOCACHE=""
if $force_build_utils; then

if [ "$ci" == true ]; then
# workaround to cache docker layers and keep using docker-compose in CI
docker buildx bake --file docker-compose.yaml --file docker-compose-ci-cache.json $LOCAL_BUILD_NODES
else
UTILS_NOCACHE=""
if $force_build_utils; then
UTILS_NOCACHE="--no-cache"
fi
docker compose build --no-rm $UTILS_NOCACHE $LOCAL_BUILD_NODES
fi
docker compose build --no-rm $UTILS_NOCACHE $LOCAL_BUILD_NODES
fi

if $dev_nitro; then
Expand All @@ -371,7 +392,7 @@ if $blockscout; then
fi

if $build_node_images; then
docker compose build --no-rm $NODES scripts
docker compose build --no-rm $NODES
fi

if $force_init; then
Expand Down Expand Up @@ -587,7 +608,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
Expand Down
12 changes: 7 additions & 5 deletions tokenbridge/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
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 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="[email protected]" commit -m "Initial commit"
RUN yarn install && yarn cache clean
RUN yarn build
ENTRYPOINT ["yarn"]

0 comments on commit 64b26a4

Please sign in to comment.