Skip to content

IA1.2 Generate dockers for services #182

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: celo-integration-rebase-13.1
Choose a base branch
from

Conversation

shenkeyao
Copy link
Member

Closes https://app.asana.com/1/1208976916964769/project/1209392461754458/task/1210546932882749?focus=true.

This PR:

  • Create a Dockerfile for the L1 geth service, including the geth installation command for different architectures.
  • Create a Dockerfile for the OP node, batcher, and proposer services.
  • Add an op-geth-init service to avoid manual initialization with the genesis file.
  • Remove instruction from README that's no longer applicable.

How to test this PR:

  • docker compose up --build -d to build.
  • docker compose logs -f to run all services.
  • For more instructions, see the Docker Compose section in README_ESPRESSO.md.

@@ -0,0 +1,112 @@
# OP Stack Dockerfile, simplified from ops/docker/op-stack-go/Dockerfile
Copy link
Member Author

Choose a reason for hiding this comment

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

@Ancient123 Following the pattern in op-stack-go/Dockerfile, I used this file for the OP node, batcher, and proposer, instead of creating one Dockerfile for one service--is this okay?

Copy link
Member

Choose a reason for hiding this comment

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

This is fine.

@philippecamacho
Copy link
Collaborator

Will the other services (Espresso node, Caff node) be implemented in another PR?

mv "$GETH_DIR/geth" /usr/local/bin/geth && \
rm -rf geth.tar.gz "$GETH_DIR" && \
chmod +x /usr/local/bin/geth

Copy link
Collaborator

Choose a reason for hiding this comment

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

We should check the hash GETH_SHA here.

Copy link
Member Author

Choose a reason for hiding this comment

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

Oh, we do! It's located around 10+ lines above, the command starting from GETH_SHA=.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Right, but this variable GETH_SHA does not seem to be used anywhere? Should not we compute the hash of the tar.gz file against GETH_SHA or something similar?


# Rust builder for Espresso crypto libraries
FROM --platform=$BUILDPLATFORM rust:1.84.1-alpine3.20 AS rust-builder
ARG ESPRESSO_NETWORK_GO_VER=0.0.34
Copy link
Collaborator

Choose a reason for hiding this comment

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

Add a TODO to check the hash of the espresso go library when we switch to the new one. cc @dailinsubjam

healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8545"]
interval: 3s
timeout: 2s
retries: 40
build:
context: ../ops/docker/deployment-utils
context: ./dockerfiles/l1-geth
image: l1-geth:espresso
volumes:
- ../config/l1-genesis-devnet.json:/l1-genesis-devnet.json:ro
Copy link
Member Author

Choose a reason for hiding this comment

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

Pasting @Ancient123's comment from Slack:

when doing mounts at runtime don't mount individual files. If the file gets rewritten on the host machine, it won't take affect on the docker, because it can hold onto an older handle for the previous file.

@philippecamacho
Copy link
Collaborator

leloup@leloup-Legion-7-16ITHg6:~/repositories/espressosys/optimism-espresso-integration/espresso$ docker compose logs -f | grep op-batcher
op-batcher-1         | t=2025-06-23T16:31:59+0000 lvl=info msg="Initializing Batch Submitter"
op-batcher-1         | t=2025-06-23T16:31:59+0000 lvl=warn msg="failed to dial address, but may connect later" addr=http://op-node-sequencer:8545
op-batcher-1         | t=2025-06-23T16:32:01+0000 lvl=warn msg="failed to dial address, but may connect later" addr=http://op-node-sequencer:8545
op-batcher-1         | t=2025-06-23T16:32:03+0000 lvl=warn msg="failed to dial address, but may connect later" addr=http://op-node-sequencer:8545
op-batcher-1         | t=2025-06-23T16:32:05+0000 lvl=warn msg="failed to dial address, but may connect later" addr=http://op-node-sequencer:8545
op-batcher-1         | t=2025-06-23T16:32:07+0000 lvl=warn msg="failed to dial address, but may connect later" addr=http://op-node-sequencer:8545
op-batcher-1         | t=2025-06-23T16:32:09+0000 lvl=warn msg="failed to dial address, but may connect later" addr=http://op-node-sequencer:8545
op-batcher-1         | t=2025-06-23T16:32:11+0000 lvl=warn msg="failed to dial address, but may connect later" addr=http://op-node-sequencer:8545
op-batcher-1         | t=2025-06-23T16:32:13+0000 lvl=warn msg="failed to dial address, but may connect later" addr=http://op-node-sequencer:8545
op-batcher-1         | t=2025-06-23T16:32:15+0000 lvl=warn msg="failed to dial address, but may connect later" addr=http://op-node-sequencer:8545
op-batcher-1         | t=2025-06-23T16:32:17+0000 lvl=warn msg="failed to dial address, but may connect later" addr=http://op-node-sequencer:8545
op-batcher-1         | t=2025-06-23T16:32:19+0000 lvl=warn msg="failed to dial address, but may connect later" addr=http://op-node-sequencer:8545
op-batcher-1         | t=2025-06-23T16:32:21+0000 lvl=warn msg="failed to dial address, but may connect later" addr=http://op-node-sequencer:8545
op-batcher-1         | t=2025-06-23T16:32:23+0000 lvl=warn msg="failed to dial address, but may connect later" addr=http://op-node-sequencer:8545
op-batcher-1         | t=2025-06-23T16:32:25+0000 lvl=warn msg="failed to dial address, but may connect later" addr=http://op-node-sequencer:8545
op-batcher-1         | t=2025-06-23T16:32:27+0000 lvl=warn msg="failed to dial address, but may connect later" addr=http://op-node-sequencer:8545
op-batcher-1         | t=2025-06-23T16:32:29+0000 lvl=warn msg="failed to dial address, but may connect later" addr=http://op-node-sequencer:8545
op-batcher-1         | t=2025-06-23T16:32:31+0000 lvl=warn msg="failed to dial address, but may connect later" addr=http://op-node-sequencer:8545
op-batcher-1         | t=2025-06-23T16:32:33+0000 lvl=warn msg="failed to dial address, but may connect later" addr=http://op-node-sequencer:8545
op-batcher-1         | t=2025-06-23T16:32:35+0000 lvl=warn msg="failed to dial address, but may connect later" addr=http://op-node-sequencer:8545
op-batcher-1         | t=2025-06-23T16:32:37+0000 lvl=warn msg="failed to dial address, but may connect later" addr=http://op-node-sequencer:8545
op-batcher-1         | t=2025-06-23T16:32:39+0000 lvl=warn msg="failed to dial address, but may connect later" addr=http://op-node-sequencer:8545
op-batcher-1         | t=2025-06-23T16:32:41+0000 lvl=warn msg="failed to dial address, but may connect later" addr=http://op-node-sequencer:8545
op-batcher-1         | t=2025-06-23T16:32:43+0000 lvl=warn msg="failed to dial address, but may connect later" addr=http://op-node-sequencer:8545
op-batcher-1         | t=2025-06-23T16:32:45+0000 lvl=warn msg="failed to dial address, but may connect later" addr=http://op-node-sequencer:8545
op-batcher-1         | t=2025-06-23T16:32:47+0000 lvl=warn msg="failed to dial address, but may connect later" addr=http://op-node-sequencer:8545
op-batcher-1         | t=2025-06-23T16:32:49+0000 lvl=warn msg="failed to dial address, but may connect later" addr=http://op-node-sequencer:8545
op-batcher-1         | t=2025-06-23T16:32:51+0000 lvl=warn msg="failed to dial address, but may connect later" addr=http://op-node-sequencer:8545
op-batcher-1         | t=2025-06-23T16:32:53+0000 lvl=warn msg="failed to dial address, but may connect later" addr=http://op-node-sequencer:8545
op-batcher-1         | t=2025-06-23T16:32:55+0000 lvl=warn msg="failed to dial address, but may connect later" addr=http://op-node-sequencer:8545
op-batcher-1         | t=2025-06-23T16:32:57+0000 lvl=warn msg="failed to dial address, but may connect later" addr=http://op-node-sequencer:8545
op-batcher-1         | t=2025-06-23T16:32:57+0000 lvl=info msg="Stopping batcher"
op-batcher-1         | t=2025-06-23T16:32:57+0000 lvl=info msg="Batch Submitter stopped"
op-batcher-1         | t=2025-06-23T16:32:57+0000 lvl=crit msg="Application failed" message="failed to setup: failed to build static L2 endpoint provider: operation failed permanently after 30 attempts: address unavailable (http://op-node-sequencer:8545)"

Is this expected?

@shenkeyao
Copy link
Member Author

shenkeyao commented Jun 23, 2025

Will the other services (Espresso node, Caff node) be implemented in another PR?

@philippecamacho The Espresso dev node uses the Espresso pre-built image, so it doesn't need a Dockerfile. The Caff node uses the same target as the OP node does, so we don't need to specify a Dockerfile for it separately.

@shenkeyao
Copy link
Member Author

leloup@leloup-Legion-7-16ITHg6:~/repositories/espressosys/optimism-espresso-integration/espresso$ docker compose logs -f | grep op-batcher
op-batcher-1         | t=2025-06-23T16:31:59+0000 lvl=info msg="Initializing Batch Submitter"
op-batcher-1         | t=2025-06-23T16:31:59+0000 lvl=warn msg="failed to dial address, but may connect later" addr=http://op-node-sequencer:8545
op-batcher-1         | t=2025-06-23T16:32:01+0000 lvl=warn msg="failed to dial address, but may connect later" addr=http://op-node-sequencer:8545
op-batcher-1         | t=2025-06-23T16:32:03+0000 lvl=warn msg="failed to dial address, but may connect later" addr=http://op-node-sequencer:8545
op-batcher-1         | t=2025-06-23T16:32:05+0000 lvl=warn msg="failed to dial address, but may connect later" addr=http://op-node-sequencer:8545
op-batcher-1         | t=2025-06-23T16:32:07+0000 lvl=warn msg="failed to dial address, but may connect later" addr=http://op-node-sequencer:8545
op-batcher-1         | t=2025-06-23T16:32:09+0000 lvl=warn msg="failed to dial address, but may connect later" addr=http://op-node-sequencer:8545
op-batcher-1         | t=2025-06-23T16:32:11+0000 lvl=warn msg="failed to dial address, but may connect later" addr=http://op-node-sequencer:8545
op-batcher-1         | t=2025-06-23T16:32:13+0000 lvl=warn msg="failed to dial address, but may connect later" addr=http://op-node-sequencer:8545
op-batcher-1         | t=2025-06-23T16:32:15+0000 lvl=warn msg="failed to dial address, but may connect later" addr=http://op-node-sequencer:8545
op-batcher-1         | t=2025-06-23T16:32:17+0000 lvl=warn msg="failed to dial address, but may connect later" addr=http://op-node-sequencer:8545
op-batcher-1         | t=2025-06-23T16:32:19+0000 lvl=warn msg="failed to dial address, but may connect later" addr=http://op-node-sequencer:8545
op-batcher-1         | t=2025-06-23T16:32:21+0000 lvl=warn msg="failed to dial address, but may connect later" addr=http://op-node-sequencer:8545
op-batcher-1         | t=2025-06-23T16:32:23+0000 lvl=warn msg="failed to dial address, but may connect later" addr=http://op-node-sequencer:8545
op-batcher-1         | t=2025-06-23T16:32:25+0000 lvl=warn msg="failed to dial address, but may connect later" addr=http://op-node-sequencer:8545
op-batcher-1         | t=2025-06-23T16:32:27+0000 lvl=warn msg="failed to dial address, but may connect later" addr=http://op-node-sequencer:8545
op-batcher-1         | t=2025-06-23T16:32:29+0000 lvl=warn msg="failed to dial address, but may connect later" addr=http://op-node-sequencer:8545
op-batcher-1         | t=2025-06-23T16:32:31+0000 lvl=warn msg="failed to dial address, but may connect later" addr=http://op-node-sequencer:8545
op-batcher-1         | t=2025-06-23T16:32:33+0000 lvl=warn msg="failed to dial address, but may connect later" addr=http://op-node-sequencer:8545
op-batcher-1         | t=2025-06-23T16:32:35+0000 lvl=warn msg="failed to dial address, but may connect later" addr=http://op-node-sequencer:8545
op-batcher-1         | t=2025-06-23T16:32:37+0000 lvl=warn msg="failed to dial address, but may connect later" addr=http://op-node-sequencer:8545
op-batcher-1         | t=2025-06-23T16:32:39+0000 lvl=warn msg="failed to dial address, but may connect later" addr=http://op-node-sequencer:8545
op-batcher-1         | t=2025-06-23T16:32:41+0000 lvl=warn msg="failed to dial address, but may connect later" addr=http://op-node-sequencer:8545
op-batcher-1         | t=2025-06-23T16:32:43+0000 lvl=warn msg="failed to dial address, but may connect later" addr=http://op-node-sequencer:8545
op-batcher-1         | t=2025-06-23T16:32:45+0000 lvl=warn msg="failed to dial address, but may connect later" addr=http://op-node-sequencer:8545
op-batcher-1         | t=2025-06-23T16:32:47+0000 lvl=warn msg="failed to dial address, but may connect later" addr=http://op-node-sequencer:8545
op-batcher-1         | t=2025-06-23T16:32:49+0000 lvl=warn msg="failed to dial address, but may connect later" addr=http://op-node-sequencer:8545
op-batcher-1         | t=2025-06-23T16:32:51+0000 lvl=warn msg="failed to dial address, but may connect later" addr=http://op-node-sequencer:8545
op-batcher-1         | t=2025-06-23T16:32:53+0000 lvl=warn msg="failed to dial address, but may connect later" addr=http://op-node-sequencer:8545
op-batcher-1         | t=2025-06-23T16:32:55+0000 lvl=warn msg="failed to dial address, but may connect later" addr=http://op-node-sequencer:8545
op-batcher-1         | t=2025-06-23T16:32:57+0000 lvl=warn msg="failed to dial address, but may connect later" addr=http://op-node-sequencer:8545
op-batcher-1         | t=2025-06-23T16:32:57+0000 lvl=info msg="Stopping batcher"
op-batcher-1         | t=2025-06-23T16:32:57+0000 lvl=info msg="Batch Submitter stopped"
op-batcher-1         | t=2025-06-23T16:32:57+0000 lvl=crit msg="Application failed" message="failed to setup: failed to build static L2 endpoint provider: operation failed permanently after 30 attempts: address unavailable (http://op-node-sequencer:8545)"

Is this expected?

@philippecamacho Not expected! I'll investigate this.

@shenkeyao
Copy link
Member Author

leloup@leloup-Legion-7-16ITHg6:~/repositories/espressosys/optimism-espresso-integration/espresso$ docker compose logs -f | grep op-batcher
op-batcher-1         | t=2025-06-23T16:31:59+0000 lvl=info msg="Initializing Batch Submitter"
op-batcher-1         | t=2025-06-23T16:31:59+0000 lvl=warn msg="failed to dial address, but may connect later" addr=http://op-node-sequencer:8545
op-batcher-1         | t=2025-06-23T16:32:01+0000 lvl=warn msg="failed to dial address, but may connect later" addr=http://op-node-sequencer:8545
op-batcher-1         | t=2025-06-23T16:32:03+0000 lvl=warn msg="failed to dial address, but may connect later" addr=http://op-node-sequencer:8545
op-batcher-1         | t=2025-06-23T16:32:05+0000 lvl=warn msg="failed to dial address, but may connect later" addr=http://op-node-sequencer:8545
op-batcher-1         | t=2025-06-23T16:32:07+0000 lvl=warn msg="failed to dial address, but may connect later" addr=http://op-node-sequencer:8545
op-batcher-1         | t=2025-06-23T16:32:09+0000 lvl=warn msg="failed to dial address, but may connect later" addr=http://op-node-sequencer:8545
op-batcher-1         | t=2025-06-23T16:32:11+0000 lvl=warn msg="failed to dial address, but may connect later" addr=http://op-node-sequencer:8545
op-batcher-1         | t=2025-06-23T16:32:13+0000 lvl=warn msg="failed to dial address, but may connect later" addr=http://op-node-sequencer:8545
op-batcher-1         | t=2025-06-23T16:32:15+0000 lvl=warn msg="failed to dial address, but may connect later" addr=http://op-node-sequencer:8545
op-batcher-1         | t=2025-06-23T16:32:17+0000 lvl=warn msg="failed to dial address, but may connect later" addr=http://op-node-sequencer:8545
op-batcher-1         | t=2025-06-23T16:32:19+0000 lvl=warn msg="failed to dial address, but may connect later" addr=http://op-node-sequencer:8545
op-batcher-1         | t=2025-06-23T16:32:21+0000 lvl=warn msg="failed to dial address, but may connect later" addr=http://op-node-sequencer:8545
op-batcher-1         | t=2025-06-23T16:32:23+0000 lvl=warn msg="failed to dial address, but may connect later" addr=http://op-node-sequencer:8545
op-batcher-1         | t=2025-06-23T16:32:25+0000 lvl=warn msg="failed to dial address, but may connect later" addr=http://op-node-sequencer:8545
op-batcher-1         | t=2025-06-23T16:32:27+0000 lvl=warn msg="failed to dial address, but may connect later" addr=http://op-node-sequencer:8545
op-batcher-1         | t=2025-06-23T16:32:29+0000 lvl=warn msg="failed to dial address, but may connect later" addr=http://op-node-sequencer:8545
op-batcher-1         | t=2025-06-23T16:32:31+0000 lvl=warn msg="failed to dial address, but may connect later" addr=http://op-node-sequencer:8545
op-batcher-1         | t=2025-06-23T16:32:33+0000 lvl=warn msg="failed to dial address, but may connect later" addr=http://op-node-sequencer:8545
op-batcher-1         | t=2025-06-23T16:32:35+0000 lvl=warn msg="failed to dial address, but may connect later" addr=http://op-node-sequencer:8545
op-batcher-1         | t=2025-06-23T16:32:37+0000 lvl=warn msg="failed to dial address, but may connect later" addr=http://op-node-sequencer:8545
op-batcher-1         | t=2025-06-23T16:32:39+0000 lvl=warn msg="failed to dial address, but may connect later" addr=http://op-node-sequencer:8545
op-batcher-1         | t=2025-06-23T16:32:41+0000 lvl=warn msg="failed to dial address, but may connect later" addr=http://op-node-sequencer:8545
op-batcher-1         | t=2025-06-23T16:32:43+0000 lvl=warn msg="failed to dial address, but may connect later" addr=http://op-node-sequencer:8545
op-batcher-1         | t=2025-06-23T16:32:45+0000 lvl=warn msg="failed to dial address, but may connect later" addr=http://op-node-sequencer:8545
op-batcher-1         | t=2025-06-23T16:32:47+0000 lvl=warn msg="failed to dial address, but may connect later" addr=http://op-node-sequencer:8545
op-batcher-1         | t=2025-06-23T16:32:49+0000 lvl=warn msg="failed to dial address, but may connect later" addr=http://op-node-sequencer:8545
op-batcher-1         | t=2025-06-23T16:32:51+0000 lvl=warn msg="failed to dial address, but may connect later" addr=http://op-node-sequencer:8545
op-batcher-1         | t=2025-06-23T16:32:53+0000 lvl=warn msg="failed to dial address, but may connect later" addr=http://op-node-sequencer:8545
op-batcher-1         | t=2025-06-23T16:32:55+0000 lvl=warn msg="failed to dial address, but may connect later" addr=http://op-node-sequencer:8545
op-batcher-1         | t=2025-06-23T16:32:57+0000 lvl=warn msg="failed to dial address, but may connect later" addr=http://op-node-sequencer:8545
op-batcher-1         | t=2025-06-23T16:32:57+0000 lvl=info msg="Stopping batcher"
op-batcher-1         | t=2025-06-23T16:32:57+0000 lvl=info msg="Batch Submitter stopped"
op-batcher-1         | t=2025-06-23T16:32:57+0000 lvl=crit msg="Application failed" message="failed to setup: failed to build static L2 endpoint provider: operation failed permanently after 30 attempts: address unavailable (http://op-node-sequencer:8545)"

Is this expected?

@philippecamacho Not expected! I'll investigate this.

Made a separate task for this issue because it also occurred on the default branch: https://app.asana.com/1/1208976916964769/project/1209392461754458/task/1210618856384949?focus=true. Will fix it in a separate PR.

Comment on lines +38 to +39
op-geth-init:
image: us-docker.pkg.dev/oplabs-tools-artifacts/images/op-geth:v1.101503.2-rc.3
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is helpful!

Copy link

@jparr721 jparr721 left a comment

Choose a reason for hiding this comment

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

Volumes will all need to be deployed in EFS, heads up that that's decidedly nontrivial. We can talk about that.

- op-geth-data:/data
entrypoint: ""
command: >
sh -c "

Choose a reason for hiding this comment

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

This might be really annoying in terraform. I'd recommend checking how arbitrary scripts work in there. Ideally we'd just make this part of the container instead, so we can fork their container and then add this as a setup step (I think).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants