Skip to content
This repository was archived by the owner on Apr 11, 2021. It is now read-only.
Open
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
.DS_Store
*.swp
17 changes: 4 additions & 13 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@

SHELL := /bin/bash

pull:
@echo "Pulling & building all remote images..."
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pull.sh is broken so i don't think we should recommend using it until it is fixed

./pull.sh

all:
@echo "Building in parallel in the background"
./build-local.sh
@while :; do [ $$(docker ps --format='{{.Image}}' | grep builder | wc -l) == 0 ] && exit 0; sleep 2; done;

up-local:
./up.sh -l

integration-tests:
./build-local.sh -s integration_tests

Expand All @@ -24,13 +25,3 @@ batch-submitter:

data-transport-layer:
./build-local.sh -s data_transport_layer

# For developing against published docker images
up:
./up.sh

test:
./test.sh

test-%:
./test.sh -p $@
7 changes: 7 additions & 0 deletions optional/local/batch-submitter.local.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
version: "3"

services:
batch_submitter:
image: ethereumoptimism/batch-submitter:${BATCH_SUBMITTER_TAG:-latest}
volumes:
- ./batch-submitter:/opt/batch-submitter
9 changes: 9 additions & 0 deletions optional/local/data-transport-layer.local.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
version: "3"

services:
data_transport_layer:
image: ethereumoptimism/data-transport-layer:${DATA_TRANSPORT_LAYER_TAG:-latest}
volumes:
- ./data-transport-layer:/opt/data-transport-layer
ports:
- 7878:7878
11 changes: 11 additions & 0 deletions optional/local/deployer.local.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
version: "3"

services:
deployer:
image: ethereumoptimism/deployer:${DEPLOYER_TAG:-latest}
working_dir: /contracts
entrypoint: ["/opt/wait-for-l1.sh", "yarn", "run", "--silent", "deploy"]
volumes:
- ./contracts:/contracts
ports:
- 8080:8080
19 changes: 19 additions & 0 deletions optional/local/geth-l2.local.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
version: "3"

services:
geth_l2:
image: ethereumoptimism/go-ethereum:${GETH_L2_TAG:-latest}
volumes:
- ./:/mnt
- geth:/l2-node/l2:rw
# Put modules cache into a separate volume
- go-modules:/go/pkg/mod
# Mount the locally built geth earlier in the PATH
- ./go-ethereum/build/bin/geth:/usr/local/sbin/geth
ports:
- 8545:8545
- 8546:8546

volumes:
geth:
go-modules:
11 changes: 11 additions & 0 deletions optional/local/integration-tests.local.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
version: "3"

services:
integration_tests:
image: ethereumoptimism/integration-tests:${INTEGRATION_TESTS_TAG:-latest}
volumes:
- ./integration-tests:/integration-tests
- ./docker/integration-tests/wait-for-l1-and-l2-and-contract-deployment.sh:/wait.sh
entrypoint: ["/wait.sh", "yarn", "run", "ci"]
environment:
- "PKGS=${PKGS}"
7 changes: 7 additions & 0 deletions optional/local/l1-chain.local.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
version: "3"

services:
l1_chain:
image: ethereumoptimism/hardhat:${L1_CHAIN_TAG:-latest}
ports:
- 9545:9545
2 changes: 1 addition & 1 deletion pull.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash

git pull --recurse-submodules
git pull origin master --recurse-submodules
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs smarter logic about the current head

git submodule update
docker-compose pull
17 changes: 15 additions & 2 deletions test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ set -eou pipefail

PKGS=${PKGS:-""}
DOCKERFILE=docker-compose.yml
LOCAL_SUBMODULES=${LOCAL_SUBMODULES:-""}
SUPPRESS_OUTPUT=${SUPPRESS_OUTPUT:-false}

while (( "$#" )); do
Expand All @@ -22,8 +23,8 @@ while (( "$#" )); do
fi
;;
-l|--local)
DOCKERFILE=docker-compose.local.yml
shift 1
LOCAL_SUBMODULES=$2
shift 2
;;
-s|--suppress-output)
echo "Logs will not be streamed and instead only be available as artifacts"
Expand Down Expand Up @@ -63,6 +64,18 @@ function run {

local cmd
cmd="docker-compose -f $DIR/$DOCKERFILE"
# Load any local submodules specified
variable=abc,def,ghij
for i in $(echo $LOCAL_SUBMODULES | sed "s/,/ /g")
do
dcfile=$DIR/optional/local/$i.local.yml
if test -f "$dcfile"; then
cmd="$cmd -f $dcfile"
else
echo "Error: Docker compose file $dcfile not found! Make sure your local submodule is specified correctly."
exit 1
fi
done
cmd="$cmd -f $DIR/docker-compose.env.yml"
if [ -f "$DIR/optional/$PKGS-service.yml" ]; then
cmd="$cmd -f $DIR/optional/$PKGS-service.yml"
Expand Down
34 changes: 24 additions & 10 deletions up.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ IS_LOCAL=
while (( "$#" )); do
case "$1" in
-l|--local)
DOCKERFILE="docker-compose.local.yml"
IS_LOCAL=true
shift 1
LOCAL_SUBMODULES=$2
shift 2
;;
-s|--services)
SERVICES="$2"
Expand Down Expand Up @@ -49,14 +49,28 @@ if [ ! -z "$IS_LOCAL" ]; then
'
fi

docker-compose \
cmd="docker-compose \
-f $DIR/$DOCKERFILE \
-f $DIR/docker-compose.env.yml \
-f $DIR/optional/x-domain-service.yml \
down -v --remove-orphans
-f $DIR/optional/x-domain-service.yml"

docker-compose \
-f $DIR/$DOCKERFILE \
-f $DIR/docker-compose.env.yml \
-f $DIR/optional/x-domain-service.yml \
up $SERVICES
# docker compose down - to remove old containers and volumes
down="$cmd down -v --remove-orphans"

# docker compose up - to spin up the full system
up="$cmd"
for i in $(echo $LOCAL_SUBMODULES | sed "s/,/ /g")
do
dcfile=$DIR/optional/local/$i.local.yml
if test -f "$dcfile"; then
up="$up -f $dcfile"
else
echo "Error: Docker compose file $dcfile not found! Make sure your local submodule is specified correctly."
exit 1
fi
done
up="$up up $SERVICES"

# execute `dc down` & `dc up`
$down
$up