ethereum-optimism / optimism

Optimism is Ethereum, scaled.
https://optimism.io
MIT License
5.65k stars 3.28k forks source link

Optimism - Release linux/arm64 builds #3606

Open andreclaro opened 2 years ago

andreclaro commented 2 years ago

Description

Releaselinux/arm64 builds for optimism services, such as, batch-submitter-service, data-transport-layer, deployer, fault-detector, gas-oracle, hardhat, l2geth and message-relayer,

Why this feature is important

michaelneuder commented 2 years ago

Taking a look at this!

I see two main options for building linux/arm64 compatible containers:

  1. We add a new job that is similar to docker-publish to the circleci config (call it like docker-arm-publish) https://github.com/ethereum-optimism/optimism/blob/98035730167fd5698d0436f1a170586c4625823b/.circleci/config.yml#L87-L110 The difference is that we use the arm execution environment https://circleci.com/docs/using-arm/. If we set resource class to resource_class: arm.xlarge then we should be provisioning a GCE instance that is compatible with ARM (i think that is what circle is doing under the hood?). I tried this with a test t2a-standard-4 instance and was able to create a test hardhat-node image which is listed as linux/arm64/v8 arch: https://hub.docker.com/layers/mikeneuder/hardhat-node/1.0/images/sha256-08d3fb84f0c4717155abf1fc88eceb094e35a051cc8fa6952225236649a67c9d?context=repo.
  2. We use dockerx in the CI workflow to build cross architecture images: https://www.docker.com/blog/getting-started-with-docker-for-arm-on-linux/. IIUC this builds a single container that can run on either architecture. This doesn't really feel like the problem we are trying to solve, but I am not sure.

IMO option 1 sounds more like what we want to do, but I wanted to touch base here.