Skip to content

Commit

Permalink
register rollups for native demo (#1871)
Browse files Browse the repository at this point in the history
* dev rollup registration bin

* add to native demo and CI

* register multiple rollups

* update comments

* typos

* fix dockerfile

* change default value of active to false
  • Loading branch information
imabdulbasit authored Aug 15, 2024
1 parent 4c577fb commit 4761a20
Show file tree
Hide file tree
Showing 9 changed files with 299 additions and 9 deletions.
22 changes: 22 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ jobs:
target/release/marketplace-solver
target/release/marketplace-builder
target/release/node-metrics
target/release/dev-rollup
build-arm:
runs-on: buildjet-4vcpu-ubuntu-2204-arm
Expand Down Expand Up @@ -137,6 +138,7 @@ jobs:
target/release/marketplace-solver
target/release/marketplace-builder
target/release/node-metrics
target/release/dev-rollup
build-dockers:
runs-on: ubuntu-latest
Expand All @@ -159,6 +161,7 @@ jobs:
marketplace-solver-tag: ${{ steps.marketplace-solver.outputs.tags }}
marketplace-builder-tag: ${{ steps.marketplace-builder.outputs.tags }}
node-validator-tag: ${{ steps.node-validator.outputs.tags }}
dev-rollup-tag: ${{ steps.dev-rollup.outputs.tags }}
steps:
- name: Checkout Repository
uses: actions/checkout@v4
Expand Down Expand Up @@ -290,6 +293,13 @@ jobs:
with:
images: ghcr.io/espressosystems/espresso-sequencer/node-validator

- name: Generate dev-rollup metadata
uses: docker/metadata-action@v5
id: dev-rollup
with:
images: ghcr.io/espressosystems/espresso-sequencer/dev-rollup


- name: Build and push sequencer docker
uses: docker/build-push-action@v6
with:
Expand Down Expand Up @@ -459,6 +469,16 @@ jobs:
tags: ${{ steps.node-validator.outputs.tags }}
labels: ${{ steps.node-validator.outputs.labels }}

- name: Build and push dev-rollup docker
uses: docker/build-push-action@v6
with:
context: ./
file: ./docker/dev-rollup.Dockerfile
platforms: linux/amd64,linux/arm64
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.dev-rollup.outputs.tags }}
labels: ${{ steps.dev-rollup.outputs.labels }}

test-demo:
if: ${{ github.event_name != 'pull_request' }}
runs-on: ubuntu-latest
Expand Down Expand Up @@ -490,6 +510,7 @@ jobs:
docker pull ${{ needs.build-dockers.outputs.marketplace-solver-tag }}
docker pull ${{ needs.build-dockers.outputs.marketplace-builder-tag }}
docker pull ${{ needs.build-dockers.outputs.node-validator-tag }}
docker pull ${{ needs.build-dockers.outputs.dev-rollup-tag }}
- name: Tag new docker images
run: |
Expand All @@ -509,6 +530,7 @@ jobs:
docker tag ${{ needs.build-dockers.outputs.marketplace-solver-tag }} ghcr.io/espressosystems/espresso-sequencer/marketplace-solver:main
docker tag ${{ needs.build-dockers.outputs.marketplace-builder-tag }} ghcr.io/espressosystems/espresso-sequencer/marketplace-builder:main
docker tag ${{ needs.build-dockers.outputs.node-validator-tag }} ghcr.io/espressosystems/espresso-sequencer/node-validator:main
docker tag ${{ needs.build-dockers.outputs.dev-rollup-tag }} ghcr.io/espressosystems/espresso-sequencer/dev-rollup:main
- name: Test docker demo
run: |
Expand Down
20 changes: 19 additions & 1 deletion .github/workflows/build_static.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ jobs:
${{ env.CARGO_TARGET_DIR }}/${{ env.TARGET_TRIPLET }}/release/marketplace-solver
${{ env.CARGO_TARGET_DIR }}/${{ env.TARGET_TRIPLET }}/release/marketplace-builder
${{ env.CARGO_TARGET_DIR }}/${{ env.TARGET_TRIPLET }}/release/node-metrics
${{ env.CARGO_TARGET_DIR }}/${{ env.TARGET_TRIPLET }}/release/dev-rollup
static-dockers:
runs-on: ubuntu-latest
needs: static-build
Expand Down Expand Up @@ -229,6 +230,13 @@ jobs:
with:
images: ghcr.io/espressosystems/espresso-sequencer/node-validator
flavor: suffix=musl

- name: Generate dev-rollup metadata
uses: docker/metadata-action@v5
id: dev-rollup
with:
images: ghcr.io/espressosystems/espresso-sequencer/dev-rollup
flavor: suffix=musl

- name: Build and push sequencer docker
uses: docker/build-push-action@v6
Expand Down Expand Up @@ -378,4 +386,14 @@ jobs:
platforms: linux/amd64,linux/arm64
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.node-validator.outputs.tags }}
labels: ${{ steps.node-validator.outputs.labels }}
labels: ${{ steps.node-validator.outputs.labels }}

- name: Build and push dev-rollup docker
uses: docker/build-push-action@v6
with:
context: ./
file: ./docker/dev-rollup.Dockerfile
platforms: linux/amd64,linux/arm64
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.dev-rollup.outputs.tags }}
labels: ${{ steps.dev-rollup.outputs.labels }}
14 changes: 12 additions & 2 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -542,7 +542,7 @@ services:
profiles: [marketplace]
environment:
- ESPRESSO_MARKETPLACE_BUILDER_IS_RESERVE=true
- ESPRESSO_MARKETPLACE_BUILDER_SOLVER_URL=http://localhost:$ESPRESSO_MARKETPLACE_SOLVER_API_PORT
- ESPRESSO_MARKETPLACE_SOLVER_API_URL=http://localhost:$ESPRESSO_MARKETPLACE_SOLVER_API_PORT
- ESPRESSO_MARKETPLACE_BUILDER_NAMESPACE=10000
- ESPRESSO_SEQUENCER_HOTSHOT_EVENT_STREAMING_API_URL=http://sequencer0:$ESPRESSO_SEQUENCER_HOTSHOT_EVENT_STREAMING_API_PORT
- ESPRESSO_SEQUENCER_STATE_PEERS=http://sequencer0:$ESPRESSO_SEQUENCER_API_PORT
Expand Down Expand Up @@ -574,7 +574,7 @@ services:
environment:
- ESPRESSO_BUILDER_SERVER_PORT=$ESPRESSO_FALLBACK_BUILDER_SERVER_PORT
- ESPRESSO_MARKETPLACE_BUILDER_IS_RESERVE=false
- ESPRESSO_MARKETPLACE_BUILDER_SOLVER_URL=http://localhost:$ESPRESSO_MARKETPLACE_SOLVER_API_PORT
- ESPRESSO_MARKETPLACE_SOLVER_API_URL=http://localhost:$ESPRESSO_MARKETPLACE_SOLVER_API_PORT
- ESPRESSO_MARKETPLACE_BUILDER_NAMESPACE=10000
- ESPRESSO_SEQUENCER_HOTSHOT_EVENT_STREAMING_API_URL=http://sequencer0:$ESPRESSO_SEQUENCER_HOTSHOT_EVENT_STREAMING_API_PORT
- ESPRESSO_SEQUENCER_STATE_PEERS=http://sequencer0:$ESPRESSO_SEQUENCER_API_PORT
Expand Down Expand Up @@ -741,3 +741,13 @@ services:
depends_on:
sequencer1:
condition: service_healthy

dev-rollup:
image: ghcr.io/espressosystems/dev-rollup:main
command:
dev-rollup register --ns 1; dev-rollup register --ns 2; dev-rollup register --ns 3
environment:
- ESPRESSO_MARKETPLACE_SOLVER_API_URL=http://marketplace-solver:$ESPRESSO_MARKETPLACE_SOLVER_API_PORT
depends_on:
sequencer1:
condition: service_healthy
13 changes: 13 additions & 0 deletions docker/dev-rollup.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FROM ubuntu:jammy

ARG TARGETARCH

RUN apt-get update \
&& apt-get install -y curl libcurl4 wait-for-it tini \
&& rm -rf /var/lib/apt/lists/*
ENTRYPOINT ["tini", "--"]

COPY target/$TARGETARCH/release/dev-rollup /bin/dev-rollup
RUN chmod +x /bin/dev-rollup

CMD [ "/bin/dev-rollup"]
2 changes: 1 addition & 1 deletion marketplace-builder/src/bin/marketplace-builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ struct NonPermissionedBuilderOptions {
pub namespaces: Vec<u32>,

/// Url we will use to communicate to solver
#[clap(long, env = "ESPRESSO_MARKETPLACE_BUILDER_SOLVER_URL")]
#[clap(long, env = "ESPRESSO_MARKETPLACE_SOLVER_API_URL")]
solver_url: Url,

/// Bid amount in WEI.
Expand Down
13 changes: 11 additions & 2 deletions process-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -497,7 +497,7 @@ processes:
- "$ESPRESSO_BUILDER_SERVER_PORT:$ESPRESSO_BUILDER_SERVER_PORT"
environment:
- ESPRESSO_MARKETPLACE_BUILDER_IS_RESERVE=true
- ESPRESSO_MARKETPLACE_BUILDER_SOLVER_URL=http://localhost:$ESPRESSO_MARKETPLACE_SOLVER_API_PORT
- ESPRESSO_MARKETPLACE_SOLVER_API_URL=http://localhost:$ESPRESSO_MARKETPLACE_SOLVER_API_PORT
- ESPRESSO_MARKETPLACE_BUILDER_NAMESPACE=10000
- ESPRESSO_SEQUENCER_STATE_PEERS=http://localhost:$ESPRESSO_SEQUENCER_API_PORT
- ESPRESSO_SEQUENCER_HOTSHOT_EVENT_STREAMING_API_URL=http://localhost:$ESPRESSO_SEQUENCER_HOTSHOT_EVENT_STREAMING_API_PORT
Expand All @@ -523,7 +523,7 @@ processes:
environment:
- ESPRESSO_BUILDER_SERVER_PORT=$ESPRESSO_FALLBACK_BUILDER_SERVER_PORT
- ESPRESSO_MARKETPLACE_BUILDER_IS_RESERVE=false
- ESPRESSO_MARKETPLACE_BUILDER_SOLVER_URL=http://localhost:$ESPRESSO_MARKETPLACE_SOLVER_API_PORT
- ESPRESSO_MARKETPLACE_SOLVER_API_URL=http://localhost:$ESPRESSO_MARKETPLACE_SOLVER_API_PORT
- ESPRESSO_MARKETPLACE_BUILDER_NAMESPACE=10000
- ESPRESSO_SEQUENCER_STATE_PEERS=http://localhost:$ESPRESSO_SEQUENCER_API_PORT
- ESPRESSO_SEQUENCER_HOTSHOT_EVENT_STREAMING_API_URL=http://localhost:$ESPRESSO_SEQUENCER_HOTSHOT_EVENT_STREAMING_API_PORT
Expand Down Expand Up @@ -662,3 +662,12 @@ processes:
depends_on:
sequencer1:
condition: process_healthy

dev-rollup:
command:
dev-rollup register --ns 1; dev-rollup register --ns 2; dev-rollup register --ns 3
environment:
- ESPRESSO_MARKETPLACE_SOLVER_API_URL=http://localhost:$ESPRESSO_MARKETPLACE_SOLVER_API_PORT
depends_on:
marketplace-solver:
condition: process_healthy
5 changes: 3 additions & 2 deletions scripts/build-docker-images
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ for ARCH in "amd64" "arm64"; do
;;
esac
mkdir -p ${WORKDIR}/target/$ARCH/release
for binary in "orchestrator" "cdn-broker" "cdn-marshal" "cdn-whitelist" "sequencer" "commitment-task" "submit-transactions" "reset-storage" "state-relay-server" "state-prover" "deploy" "keygen" "permissionless-builder" "nasty-client" "pub-key" "espresso-bridge" "espresso-dev-node" "marketplace-solver" "marketplace-builder"; do
for binary in "orchestrator" "cdn-broker" "cdn-marshal" "cdn-whitelist" "sequencer" "commitment-task" "submit-transactions" "reset-storage" "state-relay-server" "state-prover" "deploy" "keygen" "permissionless-builder" "nasty-client" "pub-key" "espresso-bridge" "espresso-dev-node" "marketplace-solver" "marketplace-builder" "dev-rollup"; do
cp -v "${CARGO_TARGET_DIR}/${TARGET}/release/$binary" ${WORKDIR}/target/$ARCH/release
done
done
Expand Down Expand Up @@ -64,4 +64,5 @@ docker build -t ghcr.io/espressosystems/espresso-sequencer/espresso-dev-node:mai
docker build -t ghcr.io/espressosystems/espresso-sequencer/bridge:main -f docker/espresso-bridge.Dockerfile ${WORKDIR}
docker build -t ghcr.io/espressosystems/espresso-sequencer/marketplace-solver:main -f docker/marketplace-solver.Dockerfile ${WORKDIR}
docker build -t ghcr.io/espressosystems/espresso-sequencer/marketplace-builder:main -f docker/marketplace-builder.Dockerfile ${WORKDIR}
docker build -t ghcr.io/espressosystems/espresso-sequencer/node-validator:main -f docker/node-validator.Dockerfile ${WORKDIR}
docker build -t ghcr.io/espressosystems/espresso-sequencer/node-validator:main -f docker/node-validator.Dockerfile ${WORKDIR}
docker build -t ghcr.io/espressosystems/espresso-sequencer/dev-rollup:main -f docker/dev-rollup.Dockerfile ${WORKDIR}
3 changes: 2 additions & 1 deletion scripts/build-docker-images-native
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ mkdir -p ${WORKDIR}/data
cp -rv data/genesis ${WORKDIR}/data/

mkdir -p "${WORKDIR}/target/$ARCH/release"
for binary in "orchestrator" "cdn-broker" "cdn-marshal" "cdn-whitelist" "sequencer" "commitment-task" "submit-transactions" "reset-storage" "state-relay-server" "state-prover" "deploy" "keygen" "permissionless-builder" "nasty-client" "pub-key" "espresso-bridge" "espresso-dev-node" "marketplace-solver" "marketplace-builder"; do
for binary in "orchestrator" "cdn-broker" "cdn-marshal" "cdn-whitelist" "sequencer" "commitment-task" "submit-transactions" "reset-storage" "state-relay-server" "state-prover" "deploy" "keygen" "permissionless-builder" "nasty-client" "pub-key" "espresso-bridge" "espresso-dev-node" "marketplace-solver" "marketplace-builder" "dev-rollup"; do
cp -v "${CARGO_TARGET_DIR}/release/$binary" "${WORKDIR}/target/$ARCH/release"
# Patch the interpreter for running without nix inside the ubuntu based docker image.
if [ $KERNEL == "linux" ]; then
Expand Down Expand Up @@ -120,3 +120,4 @@ docker build --platform $PLATFORM -t ghcr.io/espressosystems/espresso-sequencer/
docker build --platform $PLATFORM -t ghcr.io/espressosystems/espresso-sequencer/marketplace-solver:main -f docker/marketplace-solver.Dockerfile ${WORKDIR}
docker build --platform $PLATFORM -t ghcr.io/espressosystems/espresso-sequencer/marketplace-builder:main -f docker/marketplace-builder.Dockerfile ${WORKDIR}
docker build --platform $PLATFORM -t ghcr.io/espressosystems/espresso-sequencer/node-validator:main -f docker/node-validator.Dockerfile ${WORKDIR}
docker build --platform $PLATFORM -t ghcr.io/espressosystems/espresso-sequencer/dev-rollup:main -f docker/dev-rollup.Dockerfile ${WORKDIR}
Loading

0 comments on commit 4761a20

Please sign in to comment.