From 9489057706b8df68acf86e2a5b5fbd5f9582a973 Mon Sep 17 00:00:00 2001 From: Barnabas Busa Date: Mon, 19 Aug 2024 22:19:43 +0200 Subject: [PATCH 1/4] update the contract deployer --- optimism-contract-deployer/Dockerfile | 43 ++++++++++----------------- 1 file changed, 15 insertions(+), 28 deletions(-) diff --git a/optimism-contract-deployer/Dockerfile b/optimism-contract-deployer/Dockerfile index 4ec2925..8e88dd5 100644 --- a/optimism-contract-deployer/Dockerfile +++ b/optimism-contract-deployer/Dockerfile @@ -12,9 +12,8 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ curl \ gcc \ g++ \ - python3 \ - python3-pip \ vim \ + curl \ build-essential \ libusb-1.0-0-dev \ libssl-dev \ @@ -22,37 +21,25 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ && apt-get clean \ && rm -rf /var/lib/apt/lists/* +RUN GO_VERSION=$(curl -s https://raw.githubusercontent.com/ethereum-optimism/optimism/develop/versions.json | jq -r '.go') && curl -sL https://go.dev/dl/go$GO_VERSION.linux-amd64.tar.gz -o go$GO_VERSION.linux-amd64.tar.gz && tar -C /usr/local/ -xzvf go$GO_VERSION.linux-amd64.tar.gz && rm go$GO_VERSION.linux-amd64.tar.gz +ENV GOPATH=/go +ENV PATH=/usr/local/go/bin:$GOPATH/bin:$PATH -# Install Go from the official golang image -# Revert to golang:alpine once https://github.com/ethereum-optimism/optimism/pull/11494 is merged -COPY --from=golang:1.22.6 /usr/local/go/ /usr/local/go/ -ENV PATH="/usr/local/go/bin:${PATH}" - -# Install web3 cli -RUN curl -LSs https://raw.githubusercontent.com/gochain/web3/master/install.sh | sh +# Clone the Optimism monorepo and build the `op-node` binary for L2 genesis generation. +RUN git clone https://github.com/ethereum-optimism/optimism.git && \ + cd optimism && \ + git checkout develop && \ + git pull origin develop && \ + cd op-node && \ + make -# Install Rust and Foundry +# Install foundry RUN curl -L https://foundry.paradigm.xyz | bash ENV PATH="/root/.foundry/bin:${PATH}" -RUN foundryup +RUN FOUNDRY_VERSION=$(curl -s https://raw.githubusercontent.com/ethereum-optimism/optimism/develop/versions.json | jq -r '.foundry') && foundryup -v nightly-$FOUNDRY_VERSION -# RUN git clone --recursive https://github.com/ethereum-optimism/optimism.git && \ -# cd optimism && \ -# git submodule update && \ -# git checkout develop && \ -# git pull origin develop && \ -# git fetch --all && \ -# cd op-node && \ -# make - -RUN git clone --recursive https://github.com/barnabasbusa/optimism.git && \ - cd optimism && \ - git submodule update && \ - git checkout getting-started-update && \ - git pull origin getting-started-update && \ - git fetch --all && \ - cd op-node && \ - make +# Build the Optimism contracts +RUN cd optimism/packages/contracts-bedrock && forge build # Use multi-stage build to keep the final image lean From a6e77103addeef0d20c3cd0325181a33a0ae5e4a Mon Sep 17 00:00:00 2001 From: Barnabas Busa Date: Tue, 20 Aug 2024 09:42:36 +0200 Subject: [PATCH 2/4] fix binary arch --- optimism-contract-deployer/Dockerfile | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/optimism-contract-deployer/Dockerfile b/optimism-contract-deployer/Dockerfile index 8e88dd5..508294d 100644 --- a/optimism-contract-deployer/Dockerfile +++ b/optimism-contract-deployer/Dockerfile @@ -21,7 +21,16 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ && apt-get clean \ && rm -rf /var/lib/apt/lists/* -RUN GO_VERSION=$(curl -s https://raw.githubusercontent.com/ethereum-optimism/optimism/develop/versions.json | jq -r '.go') && curl -sL https://go.dev/dl/go$GO_VERSION.linux-amd64.tar.gz -o go$GO_VERSION.linux-amd64.tar.gz && tar -C /usr/local/ -xzvf go$GO_VERSION.linux-amd64.tar.gz && rm go$GO_VERSION.linux-amd64.tar.gz +ARG TARGETPLATFORM + + +RUN if [ "$TARGETPLATFORM" = "linux/amd64" ]; then BINARCH=amd64; \ + elif [ "$TARGETPLATFORM" = "linux/arm64" ]; then BINARCH=arm64; \ + else BINARCH=amd64; fi; \ + GO_VERSION=$(curl -s https://raw.githubusercontent.com/ethereum-optimism/optimism/develop/versions.json | jq -r '.go') && \ + curl -sL https://go.dev/dl/go$GO_VERSION.linux-$BINARCH.tar.gz -o go$GO_VERSION.linux-$BINARCH.tar.gz && \ + tar -C /usr/local/ -xzvf go$GO_VERSION.linux-$BINARCH.tar.gz && \ + rm go$GO_VERSION.linux-$BINARCH.tar.gz ENV GOPATH=/go ENV PATH=/usr/local/go/bin:$GOPATH/bin:$PATH From 1d376b66eaeaa9af74456f5af1db155e864414de Mon Sep 17 00:00:00 2001 From: Barnabas Busa Date: Tue, 20 Aug 2024 09:54:12 +0200 Subject: [PATCH 3/4] cleanup go arch --- optimism-contract-deployer/Dockerfile | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/optimism-contract-deployer/Dockerfile b/optimism-contract-deployer/Dockerfile index 508294d..116752f 100644 --- a/optimism-contract-deployer/Dockerfile +++ b/optimism-contract-deployer/Dockerfile @@ -24,13 +24,9 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ ARG TARGETPLATFORM -RUN if [ "$TARGETPLATFORM" = "linux/amd64" ]; then BINARCH=amd64; \ - elif [ "$TARGETPLATFORM" = "linux/arm64" ]; then BINARCH=arm64; \ - else BINARCH=amd64; fi; \ - GO_VERSION=$(curl -s https://raw.githubusercontent.com/ethereum-optimism/optimism/develop/versions.json | jq -r '.go') && \ - curl -sL https://go.dev/dl/go$GO_VERSION.linux-$BINARCH.tar.gz -o go$GO_VERSION.linux-$BINARCH.tar.gz && \ - tar -C /usr/local/ -xzvf go$GO_VERSION.linux-$BINARCH.tar.gz && \ - rm go$GO_VERSION.linux-$BINARCH.tar.gz +RUN curl -sL https://go.dev/dl/go$(curl -s https://raw.githubusercontent.com/ethereum-optimism/optimism/develop/versions.json | jq -r '.go').linux-$(dpkg --print-architecture).tar.gz -o go.tar.gz && \ + tar -C /usr/local/ -xzvf go.tar.gz && \ + rm go.tar.gz ENV GOPATH=/go ENV PATH=/usr/local/go/bin:$GOPATH/bin:$PATH From 63af4e427e8a2241fb74c4ed41bd0bc96603fa39 Mon Sep 17 00:00:00 2001 From: Barnabas Busa Date: Thu, 26 Sep 2024 13:04:20 +0200 Subject: [PATCH 4/4] yeet op-contract-deployer --- .../build-push-optimism-contract-deployer.yml | 95 ------------------- README.md | 1 - optimism-contract-deployer/Dockerfile | 76 --------------- platforms.yaml | 3 - 4 files changed, 175 deletions(-) delete mode 100644 .github/workflows/build-push-optimism-contract-deployer.yml delete mode 100644 optimism-contract-deployer/Dockerfile diff --git a/.github/workflows/build-push-optimism-contract-deployer.yml b/.github/workflows/build-push-optimism-contract-deployer.yml deleted file mode 100644 index a3f9533..0000000 --- a/.github/workflows/build-push-optimism-contract-deployer.yml +++ /dev/null @@ -1,95 +0,0 @@ -name: Build optimism-contract-deployer docker image - -on: - workflow_dispatch: - inputs: - repository: - description: The source optimism repository to build from - default: ethereum-optimism/optimism - type: string - required: true - ref: - description: The branch, tag or SHA to checkout and build from - default: develop - type: string - required: true - docker_tag: - description: Override target docker tag (defaults to the above source ref if left blank) - type: string - required: false - -jobs: - prepare: - runs-on: ubuntu-latest - outputs: - platforms: ${{ steps.setup.outputs.platforms }} - target_tag: ${{ steps.tag.outputs.docker_tag }} - steps: - - uses: actions/checkout@v4 - - name: Prepare Matrix - id: setup - uses: ./.github/actions/prepare - with: - client: 'optimism-contract-deployer' - - name: Generate target tag - id: tag - uses: ./.github/actions/docker-tag - with: - input: ${{ inputs.docker_tag || inputs.ref }} - deploy: - needs: - - prepare - runs-on: ${{ matrix.runner }} - continue-on-error: true - strategy: - matrix: - include: ${{fromJson(needs.prepare.outputs.platforms)}} - steps: - - uses: actions/checkout@v4 - - uses: ./.github/actions/install-deps - with: - repository: ${{ inputs.repository }} - - uses: ./.github/actions/deploy - with: - source_repository: ${{ inputs.repository }} - source_ref: ${{ inputs.ref }} - target_dockerfile: ./optimism-contract-deployer/Dockerfile - target_tag: ${{ needs.prepare.outputs.target_tag }}-${{ matrix.slug }} - target_repository: ethpandaops/optimism-contract-deployer - platform: ${{ matrix.platform }} - - DOCKER_USERNAME: "${{ vars.DOCKER_USERNAME }}" - DOCKER_PASSWORD: "${{ secrets.DOCKER_PASSWORD }}" - MACOS_PASSWORD: "${{ secrets.MACOS_PASSWORD }}" - GOPROXY: "${{ vars.GOPROXY }}" - manifest: - needs: - - prepare - - deploy - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: ./.github/actions/manifest - with: - source_repository: ${{ inputs.repository }} - source_ref: ${{ inputs.ref }} - target_tag: ${{ needs.prepare.outputs.target_tag }} - target_repository: ethpandaops/optimism-contract-deployer - platforms: ${{ needs.prepare.outputs.platforms }} - - DOCKER_USERNAME: "${{ vars.DOCKER_USERNAME }}" - DOCKER_PASSWORD: "${{ secrets.DOCKER_PASSWORD }}" - notify: - name: Discord Notification - runs-on: ubuntu-latest - needs: - - prepare - - deploy - - manifest - if: failure() - steps: - - name: Notify - uses: nobrayner/discord-webhook@v1 - with: - github-token: ${{ secrets.github_token }} - discord-webhook: ${{ secrets.DISCORD_WEBHOOK }} diff --git a/README.md b/README.md index 542e41b..f7dd131 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,6 @@ Run the *Build **tooling*** workflow; - [Build goomy-blob](https://github.com/ethpandaops/eth-client-docker-image-builder/actions/workflows/build-push-goomy-blob.yaml) [[source](https://github.com/ethpandaops/goomy-blob)] - [Build ethereum-genesis-generator](https://github.com/ethpandaops/eth-client-docker-image-builder/actions/workflows/build-push-genesis-generator.yml) [[source](https://github.com/ethpandaops/ethereum-genesis-generator)] - [Build mev-rs](https://github.com/ethpandaops/eth-client-docker-image-builder/actions/workflows/build-push-mev-rs.yml) [[source](https://github.com/ralexstokes/mev-rs)] -- [Build optimism-contract-deployer](https://github.com/ethpandaops/eth-client-docker-image-builder/actions/workflows/build-push-optimism-contract-deployer.yml) [[source](https://github.com/ethereum-optimism/optimism)] ## Adding a new image to build on schedule diff --git a/optimism-contract-deployer/Dockerfile b/optimism-contract-deployer/Dockerfile deleted file mode 100644 index 116752f..0000000 --- a/optimism-contract-deployer/Dockerfile +++ /dev/null @@ -1,76 +0,0 @@ -FROM debian:latest as builder - -WORKDIR /workspace - -# Install dependencies using apt -RUN apt-get update && apt-get install -y --no-install-recommends \ - git \ - make \ - jq \ - direnv \ - bash \ - curl \ - gcc \ - g++ \ - vim \ - curl \ - build-essential \ - libusb-1.0-0-dev \ - libssl-dev \ - ca-certificates \ - && apt-get clean \ - && rm -rf /var/lib/apt/lists/* - -ARG TARGETPLATFORM - - -RUN curl -sL https://go.dev/dl/go$(curl -s https://raw.githubusercontent.com/ethereum-optimism/optimism/develop/versions.json | jq -r '.go').linux-$(dpkg --print-architecture).tar.gz -o go.tar.gz && \ - tar -C /usr/local/ -xzvf go.tar.gz && \ - rm go.tar.gz -ENV GOPATH=/go -ENV PATH=/usr/local/go/bin:$GOPATH/bin:$PATH - -# Clone the Optimism monorepo and build the `op-node` binary for L2 genesis generation. -RUN git clone https://github.com/ethereum-optimism/optimism.git && \ - cd optimism && \ - git checkout develop && \ - git pull origin develop && \ - cd op-node && \ - make - -# Install foundry -RUN curl -L https://foundry.paradigm.xyz | bash -ENV PATH="/root/.foundry/bin:${PATH}" -RUN FOUNDRY_VERSION=$(curl -s https://raw.githubusercontent.com/ethereum-optimism/optimism/develop/versions.json | jq -r '.foundry') && foundryup -v nightly-$FOUNDRY_VERSION - -# Build the Optimism contracts -RUN cd optimism/packages/contracts-bedrock && forge build - - -# Use multi-stage build to keep the final image lean -FROM debian:stable-slim - -WORKDIR /workspace - -# Install dependencies using apt -RUN apt-get update && apt-get install -y --no-install-recommends \ - jq \ - direnv \ - git \ - bash \ - curl \ - ca-certificates \ - && apt-get clean \ - && rm -rf /var/lib/apt/lists/* - -COPY --from=builder /usr/local /usr/local -COPY --from=builder /workspace/optimism /workspace/optimism -COPY --from=builder /root/.foundry /root/.foundry - -# Set up environment variables -ENV PATH="/root/.foundry/bin:/usr/local/go/bin:${PATH}" - - -# Set the working directory and default command -WORKDIR /workspace/optimism -CMD ["bash"] diff --git a/platforms.yaml b/platforms.yaml index 3cdfcb8..97b4ab0 100644 --- a/platforms.yaml +++ b/platforms.yaml @@ -73,8 +73,5 @@ grandine: - linux/amd64 - linux/arm64 mev-rs: - - linux/amd64 - - linux/arm64 -optimism-contract-deployer: - linux/amd64 - linux/arm64 \ No newline at end of file