Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
f39261b
Modified pipeline to update image names and add hashes
dijarllozana Aug 28, 2025
33e3dca
Fixed pipeline image
dijarllozana Aug 28, 2025
4d92591
Fixed labels in docker images
dijarllozana Aug 29, 2025
b9ecfa4
feat: deploy array summation contract and refactor docker environment
bagelface Sep 3, 2025
c1842c8
fix: use stable foundry version and mount config file as volume
bagelface Sep 4, 2025
9fc717e
fix: make key extraction more reliable
bagelface Sep 4, 2025
9510147
fix: use more explicit names for array summation envars
bagelface Sep 4, 2025
7f77454
fix: remove array summation deploy and add steps to make key extracti…
bagelface Sep 5, 2025
afaabc0
Nothing commit to force Docker image build action
bagelface Sep 5, 2025
b1dab70
Nothing update to force Docker build action
bagelface Sep 5, 2025
8c5a9a9
fix: reference correct Dockerfile name
bagelface Sep 5, 2025
74c1b16
Add workflow path to paths that will trigger run
bagelface Sep 5, 2025
d9a55e6
build: change context of build command
bagelface Sep 5, 2025
86751f1
fix: add retry logic to increase reliability
bagelface Sep 8, 2025
df5c5be
fix: add additional loggin messages for clearer idea of where script …
bagelface Sep 8, 2025
efd0e09
fix: remove non-interactive command since it never works
bagelface Sep 9, 2025
fca0d56
Merge pull request #18 from BreadchainCoop/feat/deploy-array-summation
bagelface Sep 9, 2025
27e2568
fix: make eigenlayer container exit on completion
RonTuretzky Sep 16, 2025
dc59cc8
feat: build test Docker images for PRs to dev branch
RonTuretzky Sep 16, 2025
62cd631
Merge pull request #19 from BreadchainCoop/make-eigenlayer-container-…
RonTuretzky Sep 16, 2025
2348ec6
Resolve merge conflicts between main and dev
RonTuretzky Oct 2, 2025
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
120 changes: 95 additions & 25 deletions .github/workflows/docker-build.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# .github/workflows/docker-build.yml
name: Build & Push Docker Images

permissions:
Expand All @@ -8,9 +7,18 @@ permissions:
on:
push:
branches:
- main
- dev
- k8s
- staging
paths:
- '.github/workflows/**'
- 'docker/eigenlayer/**'
- 'docker/ethereum/**'
pull_request:
branches:
- dev
paths:
- '.github/workflows/**'
- 'docker/eigenlayer/**'
- 'docker/ethereum/**'
workflow_dispatch:
Expand All @@ -21,12 +29,34 @@ jobs:

steps:
- name: Check out code
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Set up lowercase owner & short SHA
- name: Set build vars
id: vars
shell: sh
run: |
echo "OWNER_LOWER=$(echo '${{ github.repository_owner }}' | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV
echo "SHORT_SHA=${GITHUB_SHA:0:7}" >> $GITHUB_ENV
OWNER_LOWER="$(echo "${GITHUB_REPOSITORY_OWNER}" | tr '[:upper:]' '[:lower:]')"
SHORT_SHA="$(echo "${GITHUB_SHA}" | cut -c1-7)"

# Determine if this is a pull request
if [ "${{ github.event_name }}" = "pull_request" ]; then
# For PRs, use the branch name as the tag
BRANCH_NAME="${{ github.head_ref }}"
# Sanitize branch name for use as Docker tag (replace / with -)
CHANNEL_TAG="pr-$(echo "${BRANCH_NAME}" | sed 's/[^a-zA-Z0-9._-]/-/g')"
else
# For pushes, use channel tag from branch
case "${GITHUB_REF_NAME}" in
main) CHANNEL_TAG="latest" ;;
dev) CHANNEL_TAG="dev" ;;
staging) CHANNEL_TAG="staging" ;;
*) echo "Unsupported branch: ${GITHUB_REF_NAME}"; exit 1 ;;
esac
fi

echo "OWNER_LOWER=${OWNER_LOWER}" >> "$GITHUB_ENV"
echo "SHORT_SHA=${SHORT_SHA}" >> "$GITHUB_ENV"
echo "CHANNEL_TAG=${CHANNEL_TAG}" >> "$GITHUB_ENV"

- name: Detect which Dockerfiles changed
id: changes
Expand All @@ -39,30 +69,70 @@ jobs:
- 'docker/ethereum/**'

- name: Log in to GitHub Container Registry
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build & Push Eigenlayer image
- name: Output image info for PR
if: github.event_name == 'pull_request'
shell: sh
run: |
echo "## Docker Images for this PR" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "Images will be built with the following tags:" >> $GITHUB_STEP_SUMMARY
echo "- \`ghcr.io/${OWNER_LOWER}/eigenlayer:${CHANNEL_TAG}\`" >> $GITHUB_STEP_SUMMARY
echo "- \`ghcr.io/${OWNER_LOWER}/eigenlayer:${CHANNEL_TAG}-${SHORT_SHA}\`" >> $GITHUB_STEP_SUMMARY
echo "- \`ghcr.io/${OWNER_LOWER}/ethereum:${CHANNEL_TAG}\`" >> $GITHUB_STEP_SUMMARY
echo "- \`ghcr.io/${OWNER_LOWER}/ethereum:${CHANNEL_TAG}-${SHORT_SHA}\`" >> $GITHUB_STEP_SUMMARY

# ---------- Eigenlayer ----------
- name: Build eigenlayer (multi-tag)
if: steps.changes.outputs.eigenlayer == 'true'
uses: docker/build-push-action@v3
with:
context: docker/eigenlayer
file: docker/eigenlayer/Dockerfile.eigenlayer
push: true
tags: |
ghcr.io/${{ env.OWNER_LOWER }}/eigenlayer:${{ github.ref_name }}
ghcr.io/${{ env.OWNER_LOWER }}/eigenlayer:${{ github.ref_name }}-${{ env.SHORT_SHA }}
shell: sh
run: |
IMAGE="ghcr.io/${OWNER_LOWER}/eigenlayer"
echo "Building ${IMAGE}:${CHANNEL_TAG}"
docker build \
--label breadchaincoop.eigenlayer.image.revision="${GITHUB_SHA}" \
--label breadchaincoop.eigenlayer.image.source="${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}" \
-t "${IMAGE}:${CHANNEL_TAG}" \
-t "${IMAGE}:${CHANNEL_TAG}-${SHORT_SHA}" \
-f docker/eigenlayer/Dockerfile \
.

- name: Build & Push Ethereum image
- name: Push eigenlayer tags
if: steps.changes.outputs.eigenlayer == 'true'
shell: sh
run: |
IMAGE="ghcr.io/${OWNER_LOWER}/eigenlayer"
for TAG in "${CHANNEL_TAG}" "${CHANNEL_TAG}-${SHORT_SHA}"; do
echo "Pushing ${IMAGE}:${TAG}"
docker push "${IMAGE}:${TAG}"
done

# ---------- Ethereum ----------
- name: Build ethereum (multi-tag)
if: steps.changes.outputs.ethereum == 'true'
uses: docker/build-push-action@v3
with:
context: .
file: docker/ethereum/Dockerfile.ethereum
push: true
tags: |
ghcr.io/${{ env.OWNER_LOWER }}/ethereum:${{ github.ref_name }}
ghcr.io/${{ env.OWNER_LOWER }}/ethereum:${{ github.ref_name }}-${{ env.SHORT_SHA }}
shell: sh
run: |
IMAGE="ghcr.io/${OWNER_LOWER}/ethereum"
echo "Building ${IMAGE}:${CHANNEL_TAG}"
docker build \
--label breadchaincoop.ethereum.image.revision="${GITHUB_SHA}" \
--label breadchaincoop.ethereum.image.source="${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}" \
-t "${IMAGE}:${CHANNEL_TAG}" \
-t "${IMAGE}:${CHANNEL_TAG}-${SHORT_SHA}" \
-f docker/ethereum/Dockerfile \
.

- name: Push ethereum tags
if: steps.changes.outputs.ethereum == 'true'
shell: sh
run: |
IMAGE="ghcr.io/${OWNER_LOWER}/ethereum"
for TAG in "${CHANNEL_TAG}" "${CHANNEL_TAG}-${SHORT_SHA}"; do
echo "Pushing ${IMAGE}:${TAG}"
docker push "${IMAGE}:${TAG}"
done
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Relies on [BLS-middleware](https://github.com/BreadchainCoop/bls-middleware)

## Setup

2. Create a `.env` file in the root directory and add the following environment variables:
1. Create a `.env` file in the root directory and add the following environment variables:
```
cp example.env .env
```
Expand Down Expand Up @@ -54,7 +54,7 @@ Relies on [BLS-middleware](https://github.com/BreadchainCoop/bls-middleware)
RUST_LOG=debug # Set Rust logging level
```

3. Build and start the services:
2. Build and start the services:
```
# First, build the services with no cache
docker-compose build --no-cache
Expand Down
12 changes: 8 additions & 4 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,27 @@
services:
ethereum:
platform: linux/amd64
image: ghcr.io/breadchaincoop/ethereum:dev
build:
context: .
dockerfile: docker/ethereum/Dockerfile
env_file:
- .env
ports:
- "8545:8545"

eigenlayer:
platform: linux/amd64
image: ghcr.io/breadchaincoop/eigenlayer:dev
build:
context: .
dockerfile: docker/eigenlayer/Dockerfile
depends_on:
- ethereum
env_file:
- .env
volumes:
- ./.nodes:/root/.nodes
- ./docker/eigenlayer/config.json:/bls-middleware/contracts/docker/eigenlayer/config.json

signer:
image: ghcr.io/layr-labs/cerberus:0.0.2
platform: linux/amd64
Expand Down
51 changes: 51 additions & 0 deletions docker/eigenlayer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# ============================================================================
# Multi-stage Docker build for EigenLayer BLS Local Setup
# ============================================================================

# Go Builder Stage - Install Go tools
FROM golang:1.21 AS go-builder

# Install EigenLayer CLI
RUN go install github.com/Layr-Labs/eigenlayer-cli/cmd/eigenlayer@v0.10.3

# Install gRPC tools
RUN go install github.com/fullstorydev/grpcurl/cmd/grpcurl@latest

# Foundry Stage - Main application container
FROM ghcr.io/foundry-rs/foundry:stable

# Switch to root user for package installation
USER root

# Install system dependencies
RUN apt-get update && apt-get install -y \
lsof \
jq \
tmux \
bash \
&& rm -rf /var/lib/apt/lists/*

# Copy Go binaries from builder stage
COPY --from=go-builder /go/bin/eigenlayer /usr/local/bin/
COPY --from=go-builder /go/bin/grpcurl /usr/local/bin/

# Clone and build BLS middleware contracts
RUN git clone --recurse-submodules https://github.com/BreadchainCoop/bls-middleware.git && \
cd bls-middleware/contracts && \
forge build

# Set working directory to root (scripts handle navigation internally)
WORKDIR /

# Copy and setup application scripts
COPY docker/eigenlayer/main.sh /main.sh
RUN chmod +x /main.sh

COPY docker/eigenlayer/register.sh /register.sh
RUN chmod +x /register.sh

COPY docker/eigenlayer/eject.sh /eject.sh
RUN chmod +x /eject.sh

# Set entrypoint
ENTRYPOINT ["/main.sh"]
85 changes: 0 additions & 85 deletions docker/eigenlayer/counter_and_sig_check_deploy.sh

This file was deleted.

1 change: 1 addition & 0 deletions docker/eigenlayer/eject.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/bin/sh

if [ -z "$REGISTRY_COORDINATOR_ADDRESS" ]; then
echo "Error: REGISTRY_COORDINATOR_ADDRESS is not set in the environment variables."
exit 1
Expand Down
28 changes: 0 additions & 28 deletions docker/eigenlayer/get_bls_key.sh

This file was deleted.

Loading