diff --git a/.github/workflows/build-push-trueblocks.yml b/.github/workflows/build-push-trueblocks.yml new file mode 100644 index 0000000..56b2d63 --- /dev/null +++ b/.github/workflows/build-push-trueblocks.yml @@ -0,0 +1,119 @@ +name: Build trueblocks docker image +run-name: "${{ inputs.repository }}@${{ inputs.ref }}${{ inputs.correlation_id && format(' [{0}]', inputs.correlation_id) || '' }}" + +on: + workflow_dispatch: + inputs: + repository: + description: The source trueblocks-core repository to build from + default: TrueBlocks/trueblocks-core + type: string + required: true + ref: + description: The branch, tag or SHA to checkout and build from + default: v5.9.3 + type: string + required: true + docker_tag: + description: Override target docker tag (defaults to the above source ref if left blank) + type: string + required: false + correlation_id: + description: Optional correlation ID passed through to the run name (used by integrations) + 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@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + - name: Prepare Matrix + id: setup + uses: ./.github/actions/prepare + with: + client: 'trueblocks' + repository: ${{ inputs.repository }} + ref: ${{ inputs.ref }} + - name: Generate target tag + id: tag + uses: ./.github/actions/docker-tag + with: + input: ${{ inputs.docker_tag || inputs.ref }} + repository: ${{ inputs.repository }} + upstream_repository: TrueBlocks/trueblocks-core + docker_tag: ${{ inputs.docker_tag }} + deploy: + needs: + - prepare + runs-on: ${{ matrix.runner }} + continue-on-error: true + strategy: + matrix: + include: ${{fromJson(needs.prepare.outputs.platforms)}} + outputs: + git_commit_hash: ${{ steps.set_output.outputs.git_commit_hash }} + steps: + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + - uses: ./.github/actions/install-deps + with: + repository: ${{ inputs.repository }} + - uses: ./.github/actions/deploy + id: deploy + with: + source_repository: ${{ inputs.repository }} + source_ref: ${{ inputs.ref }} + target_tag: ${{ needs.prepare.outputs.target_tag }}-${{ matrix.slug }} + target_repository: ethpandaops/trueblocks + target_dockerfile: ./trueblocks/Dockerfile + platform: ${{ matrix.platform }} + + DOCKER_USERNAME: "${{ vars.DOCKER_USERNAME }}" + DOCKER_PASSWORD: "${{ secrets.DOCKER_PASSWORD }}" + MACOS_PASSWORD: "${{ secrets.MACOS_PASSWORD }}" + GOPROXY: "${{ vars.GOPROXY }}" + HARBOR_USERNAME: "${{ vars.HARBOR_USERNAME }}" + HARBOR_PASSWORD: "${{ secrets.HARBOR_PASSWORD }}" + harbor_registry: ${{ vars.HARBOR_REGISTRY }} + + - name: Set job output + id: set_output + run: echo "git_commit_hash=${{ steps.deploy.outputs.git_commit_hash }}" >> $GITHUB_OUTPUT + shell: bash + manifest: + needs: + - prepare + - deploy + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + - uses: ./.github/actions/manifest + with: + source_repository: ${{ inputs.repository }} + source_ref: ${{ inputs.ref }} + target_tag: ${{ needs.prepare.outputs.target_tag }} + target_repository: ethpandaops/trueblocks + platforms: ${{ needs.prepare.outputs.platforms }} + harbor_registry: ${{ vars.HARBOR_REGISTRY }} + HARBOR_USERNAME: "${{ vars.HARBOR_USERNAME }}" + HARBOR_PASSWORD: "${{ secrets.HARBOR_PASSWORD }}" + git_commit_hash: ${{ needs.deploy.outputs.git_commit_hash }} + 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@1766a33bf571acdcc0678f00da4fb83aad01ebc7 # v1 + with: + github-token: ${{ secrets.github_token }} + discord-webhook: ${{ secrets.DISCORD_WEBHOOK }} diff --git a/README.md b/README.md index 88cd679..f286382 100644 --- a/README.md +++ b/README.md @@ -37,6 +37,7 @@ Run the *Build **tooling*** workflow; - [Build Syncoor](https://github.com/ethpandaops/eth-client-docker-image-builder/actions/workflows/build-push-syncoor.yml) [[source](https://github.com/ethpandaops/syncoor)] - [Build Slashoor](https://github.com/ethpandaops/eth-client-docker-image-builder/actions/workflows/build-push-slashoor.yml) [[source](https://github.com/ethpandaops/slashoor)] - [Build ere-server-zisk](https://github.com/ethpandaops/eth-client-docker-image-builder/actions/workflows/build-push-ere-server-zisk.yml) [[source](https://github.com/eth-act/ere)] +- [Build TrueBlocks](https://github.com/ethpandaops/eth-client-docker-image-builder/actions/workflows/build-push-trueblocks.yml) [[source](https://github.com/TrueBlocks/trueblocks-core)] ## Adding a new image to build on schedule diff --git a/branches.yaml b/branches.yaml index a70911b..e445a4a 100644 --- a/branches.yaml +++ b/branches.yaml @@ -184,6 +184,9 @@ tooling: syncoor: branches: - master + trueblocks: + branches: + - main tx-fuzz: branches: - master diff --git a/generate_config.py b/generate_config.py index ade991a..829bc6f 100755 --- a/generate_config.py +++ b/generate_config.py @@ -44,6 +44,7 @@ 'ere-server-zisk': 'eth-act/ere', 'zkboost': 'eth-act/zkboost', 'fuzztools': 'protocol-security/fuzztools', + 'trueblocks': 'TrueBlocks/trueblocks-core', # Add more defaults as needed } diff --git a/platforms.yaml b/platforms.yaml index a77eb63..83e598b 100644 --- a/platforms.yaml +++ b/platforms.yaml @@ -125,3 +125,6 @@ fuzztools: slashoor: - linux/amd64 - linux/arm64 +trueblocks: + - linux/amd64 + - linux/arm64 diff --git a/trueblocks/Dockerfile b/trueblocks/Dockerfile new file mode 100644 index 0000000..bab9f2c --- /dev/null +++ b/trueblocks/Dockerfile @@ -0,0 +1,45 @@ +# Builds chifra from trueblocks-core source. + +FROM golang:1.25.1-bookworm AS builder + +RUN apt-get update \ + && apt-get install -y --no-install-recommends \ + ca-certificates \ + cmake \ + g++ \ + gcc \ + git \ + libcurl4-openssl-dev \ + make \ + python3 \ + && rm -rf /var/lib/apt/lists/* + +COPY . /src +WORKDIR /src + +RUN git submodule update --init --recursive +RUN scripts/go-work-sync.sh +RUN mkdir build && cd build && cmake ../src && make -j"$(nproc)" + +# --------------------------------------------------------------------------- + +FROM debian:bookworm-slim + +RUN apt-get update \ + && apt-get install -y --no-install-recommends \ + ca-certificates \ + curl \ + libcurl4 \ + && rm -rf /var/lib/apt/lists/* + +COPY --from=builder /src/bin/chifra /usr/local/bin/chifra + +# Tell chifra to look here instead of its default $HOME/.local/share/trueblocks +ENV XDG_CONFIG_HOME=/config + +# Ship chifra's bundled per-chain configs (allocs.csv etc.) for known public +# networks; without them chifra's IsNodeArchive can't validate against block 0. +COPY --from=builder /src/src/other/install/per-chain /config/config + +EXPOSE 8080 +ENTRYPOINT ["chifra"]