Skip to content

Commit

Permalink
sequencer-postgres
Browse files Browse the repository at this point in the history
  • Loading branch information
imabdulbasit committed Nov 22, 2024
1 parent eab37fb commit 8b82038
Show file tree
Hide file tree
Showing 10 changed files with 11,338 additions and 58 deletions.
43 changes: 16 additions & 27 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,14 @@ jobs:
- name: Build
# Build in release without `testing` feature, this should work without `hotshot_example` config.
run: |
export CARGO_TARGET_DIR=${CARGO_TARGET_DIR:-target}
cargo build --locked --release --workspace
- name: Build sequencer-postgres
run: cargo build --locked --release --manifest-path ./sequencer-postgres/Cargo.toml

- name: Build sequencer-sqlite
run: cargo build --locked --release --manifest-path ./sequencer-sqlite/Cargo.toml --target-dir ./target
run: cargo build --locked --release --manifest-path ./sequencer-sqlite/Cargo.toml

- name: Build Espresso Dev Node
# Espresso Dev Node currently requires testing feature, so it is built separately.
Expand All @@ -66,7 +70,8 @@ jobs:
target/release/cdn-whitelist
target/release/state-relay-server
target/release/state-prover
target/release/sequencer
target/release/sequencer-postgres
target/release/sequencer-sqlite
target/release/cli
target/release/submit-transactions
target/release/reset-storage
Expand All @@ -82,8 +87,7 @@ jobs:
target/release/marketplace-builder
target/release/node-metrics
target/release/dev-rollup
target/release/sequencer-sqlite
build-arm:
if: github.event_name != 'pull_request'
runs-on: buildjet-8vcpu-ubuntu-2204-arm
Expand All @@ -102,10 +106,14 @@ jobs:

- name: Build
run: |
export CARGO_TARGET_DIR=${CARGO_TARGET_DIR:-target}
cargo build --locked --release --workspace
- name: Build sequencer-postgres
run: cargo build --locked --release --manifest-path ./sequencer-postgres/Cargo.toml

- name: Build sequencer-sqlite
run: cargo build --locked --release --manifest-path ./sequencer-sqlite/Cargo.toml --target-dir ./target
run: cargo build --locked --release --manifest-path ./sequencer-sqlite/Cargo.toml

- name: Build Espresso Dev Node
# Espresso Dev Node currently requires testing feature, so it is built separately.
Expand All @@ -123,7 +131,8 @@ jobs:
target/release/cdn-whitelist
target/release/state-relay-server
target/release/state-prover
target/release/sequencer
target/release/sequencer-postgres
target/release/sequencer-sqlite
target/release/cli
target/release/submit-transactions
target/release/reset-storage
Expand All @@ -139,7 +148,6 @@ jobs:
target/release/marketplace-builder
target/release/node-metrics
target/release/dev-rollup
target/release/sequencer-sqlite
build-dockers:
runs-on: ubuntu-latest
Expand All @@ -164,7 +172,7 @@ jobs:
marketplace-builder-tag: ${{ steps.marketplace-builder.outputs.tags }}
node-validator-tag: ${{ steps.node-validator.outputs.tags }}
dev-rollup-tag: ${{ steps.dev-rollup.outputs.tags }}
sequencer-sqlite-tag: ${{ steps.sequencer-sqlite.outputs.tags }}

steps:
- name: Checkout Repository
uses: actions/checkout@v4
Expand Down Expand Up @@ -295,13 +303,6 @@ jobs:
with:
images: ghcr.io/espressosystems/espresso-sequencer/dev-rollup

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


- name: Build and push sequencer docker
uses: docker/build-push-action@v6
with:
Expand Down Expand Up @@ -471,16 +472,6 @@ jobs:
tags: ${{ steps.dev-rollup.outputs.tags }}
labels: ${{ steps.dev-rollup.outputs.labels }}

- name: Build and push sequencer-sqlite docker
uses: docker/build-push-action@v6
with:
context: ./
file: ./docker/sequencer-sqlite.Dockerfile
platforms: ${{ env.DOCKER_PLATFORMS }}
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.sequencer-sqlite.outputs.tags }}
labels: ${{ steps.sequencer-sqlite.outputs.labels }}

test-demo:
if: ${{ github.event_name != 'pull_request' }}
runs-on: ubuntu-latest
Expand Down Expand Up @@ -512,7 +503,6 @@ jobs:
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 }}
docker pull ${{ needs.build-dockers.outputs.sequencer-sqlite-tag }}
- name: Tag new docker images
run: |
Expand All @@ -532,7 +522,6 @@ jobs:
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
docker tag ${{ needs.build-dockers.outputs.sequencer-sqlite-tag }} ghcr.io/espressosystems/espresso-sequencer/sequencer-sqlite:main
- name: Test docker demo
run: |
Expand Down
22 changes: 2 additions & 20 deletions .github/workflows/build_static.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,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
${{ env.CARGO_TARGET_DIR }}/${{ env.TARGET_TRIPLET }}/release/sequencer-sqlite
${{ env.CARGO_TARGET_DIR }}/${{ env.TARGET_TRIPLET }}/release/dev-rollup
static-dockers:
runs-on: ubuntu-latest
needs: static-build
Expand Down Expand Up @@ -231,13 +230,6 @@ jobs:
images: ghcr.io/espressosystems/espresso-sequencer/dev-rollup
flavor: suffix=musl

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

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

- name: Build and push sequencer-sqlite docker
uses: docker/build-push-action@v6
with:
context: ./
file: ./docker/sequencer-sqlite.Dockerfile
platforms: linux/amd64,linux/arm64
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.sequencer-sqlite.outputs.tags }}
labels: ${{ steps.sequencer-sqlite.outputs.labels }}
labels: ${{ steps.dev-rollup.outputs.labels }}
10 changes: 6 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,10 @@ jobs:

- name: Build Bins
run: |
export CARGO_TARGET_DIR=${CARGO_TARGET_DIR:-target}
cargo build --locked --profile test --bins
cargo build --manifest-path ./sequencer-sqlite/Cargo.toml --target-dir ./target
cargo build --manifest-path ./sequencer-sqlite/Cargo.toml
cargo build --manifest-path ./sequencer-postgres/Cargo.toml
timeout-minutes: 30

- name: Upload archive to workflow
Expand All @@ -108,7 +110,8 @@ jobs:
target/debug/cdn-whitelist
target/debug/state-relay-server
target/debug/state-prover
target/debug/sequencer
target/debug/sequencer-postgres
target/debug/sequencer-sqlite
target/debug/cli
target/debug/submit-transactions
target/debug/reset-storage
Expand All @@ -124,8 +127,7 @@ jobs:
target/debug/marketplace-builder
target/debug/node-metrics
target/debug/dev-rollup
target/debug/sequencer-sqlite
test-postgres:
needs: build-test-artifacts-postgres
runs-on: ubuntu-latest
Expand Down
3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ members = [
]

exclude = [
"sequencer-sqlite"
"sequencer-sqlite",
"sequencer-postgres"
]

[workspace.dependencies]
Expand Down
1 change: 1 addition & 0 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ build:
export CARGO_TARGET_DIR=${CARGO_TARGET_DIR:-target}
cargo build --profile test
cargo build --profile test --manifest-path ./sequencer-sqlite/Cargo.toml
cargo build --profile test --manifest-path ./sequencer-postgres/Cargo.toml
demo-native *args: build
scripts/demo-native {{args}}
Expand Down
10 changes: 5 additions & 5 deletions process-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ processes:
condition: process_completed

sequencer0:
command: sequencer -- storage-sql -- http -- query -- catchup -- status -- submit -- hotshot-events -- config
command: sequencer-postgres -- storage-sql -- http -- query -- catchup -- status -- submit -- hotshot-events -- config
environment:
- ESPRESSO_SEQUENCER_API_PORT=$ESPRESSO_SEQUENCER_API_PORT
- ESPRESSO_SEQUENCER_LIBP2P_BIND_ADDRESS=0.0.0.0:$ESPRESSO_DEMO_SEQUENCER_LIBP2P_PORT_0
Expand Down Expand Up @@ -165,7 +165,7 @@ processes:
failure_threshold: 100

sequencer1:
command: sequencer -- storage-sql -- http -- query -- catchup -- status -- state -- explorer
command: sequencer-postgres -- storage-sql -- http -- query -- catchup -- status -- state -- explorer
environment:
- ESPRESSO_SEQUENCER_API_PORT=$ESPRESSO_SEQUENCER1_API_PORT
- ESPRESSO_SEQUENCER_LIBP2P_BIND_ADDRESS=0.0.0.0:$ESPRESSO_DEMO_SEQUENCER_LIBP2P_PORT_1
Expand Down Expand Up @@ -219,7 +219,7 @@ processes:
exit_on_skipped: true

sequencer2:
command: sequencer -- http -- catchup -- status
command: sequencer-postgres -- http -- catchup -- status
environment:
- ESPRESSO_SEQUENCER_API_PORT=$ESPRESSO_SEQUENCER2_API_PORT
- ESPRESSO_SEQUENCER_LIBP2P_BIND_ADDRESS=0.0.0.0:$ESPRESSO_DEMO_SEQUENCER_LIBP2P_PORT_2
Expand Down Expand Up @@ -265,7 +265,7 @@ processes:
exit_on_skipped: true

sequencer3:
command: sequencer -- http -- catchup -- status
command: sequencer-postgres -- http -- catchup -- status
environment:
- ESPRESSO_SEQUENCER_API_PORT=$ESPRESSO_SEQUENCER3_API_PORT
- ESPRESSO_SEQUENCER_LIBP2P_BIND_ADDRESS=0.0.0.0:$ESPRESSO_DEMO_SEQUENCER_LIBP2P_PORT_3
Expand Down Expand Up @@ -312,7 +312,7 @@ processes:
exit_on_skipped: true

sequencer4:
command: sequencer -- http -- catchup -- status
command: sequencer-postgres -- http -- catchup -- status
environment:
- ESPRESSO_SEQUENCER_API_PORT=$ESPRESSO_SEQUENCER4_API_PORT
- ESPRESSO_SEQUENCER_STATE_PEERS=http://localhost:$ESPRESSO_SEQUENCER5_API_PORT
Expand Down
Loading

0 comments on commit 8b82038

Please sign in to comment.