Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix docker-build-images scripts #2355

Merged
merged 2 commits into from
Dec 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ jobs:
- name: Build Espresso Dev Node
# Espresso Dev Node currently requires testing feature, so it is built separately.
run: |
cargo build --locked --release --features testing --bin espresso-dev-node
cargo build --locked --release --features "embedded-db testing" --bin espresso-dev-node

- name: Upload artifacts
uses: actions/upload-artifact@v4
Expand Down
4 changes: 2 additions & 2 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,7 @@ services:
- ESPRESSO_SEQUENCER_API_PORT
- ESPRESSO_SEQUENCER_MAX_CONNECTIONS
- ESPRESSO_SEQUENCER_HOTSHOT_EVENT_STREAMING_API_PORT
- ESPRESSO_SEQUENCER_API_PEERS=http://sequencer1:$ESPRESSO_SEQUENCER_API_PORT
- ESPRESSO_SEQUENCER_STATE_PEERS=http://sequencer1:$ESPRESSO_SEQUENCER_API_PORT
- ESPRESSO_SEQUENCER_POSTGRES_HOST=sequencer-db-0
- ESPRESSO_SEQUENCER_POSTGRES_USER=root
Expand Down Expand Up @@ -285,7 +286,7 @@ services:
- ESPRESSO_SEQUENCER_CDN_ENDPOINT
- ESPRESSO_SEQUENCER_API_PORT
- ESPRESSO_SEQUENCER_MAX_CONNECTIONS
- ESPRESSO_SEQUENCER_API_PEERS=http://sequencer2:$ESPRESSO_SEQUENCER_API_PORT
- ESPRESSO_SEQUENCER_API_PEERS=http://sequencer4:$ESPRESSO_SEQUENCER_API_PORT
- ESPRESSO_SEQUENCER_STATE_PEERS=http://sequencer2:$ESPRESSO_SEQUENCER_API_PORT
- ESPRESSO_SEQUENCER_POSTGRES_HOST=sequencer-db-1
- ESPRESSO_SEQUENCER_POSTGRES_USER=root
Expand Down Expand Up @@ -342,7 +343,6 @@ services:
- ESPRESSO_SEQUENCER_CDN_ENDPOINT
- ESPRESSO_SEQUENCER_API_PORT
- ESPRESSO_SEQUENCER_MAX_CONNECTIONS
- ESPRESSO_SEQUENCER_API_PEERS=http://sequencer4:$ESPRESSO_SEQUENCER_API_PORT
- ESPRESSO_SEQUENCER_STATE_PEERS=http://sequencer3:$ESPRESSO_SEQUENCER_API_PORT
- ESPRESSO_SEQUENCER_L1_PROVIDER
- ESPRESSO_SEQUENCER_L1_EVENTS_MAX_BLOCK_RANGE
Expand Down
11 changes: 9 additions & 2 deletions scripts/build-docker-images-native
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,12 @@ esac
# Compile binaries
case $KERNEL in
linux)
CARGO_TARGET_DIR=target
cargo build --release
# espresso-dev-node requires embedded-db feature to build so we build it separately
cargo build --bin espresso-dev-node --release --all-features
# building sequencer-sqlite binary
cargo build --release --manifest-path ./sequencer-sqlite/Cargo.toml
;;
darwin)
# Use a different target directory for docker builds to avoid conflicts with
Expand All @@ -74,7 +79,9 @@ case $KERNEL in
-v "$CARGO_HOME/registry:/usr/local/cargo/registry" \
-v "$CARGO_HOME/git:/usr/local/cargo/git" \
-it ghcr.io/espressosystems/devops-rust:stable \
bash -c "cd /work && cargo build --release"
bash -c "cd /work && cargo build --release \
&& cargo build --bin espresso-dev-node --release --all-features \
&& cargo build --release --manifest-path ./sequencer-sqlite/Cargo.toml"
;;
esac

Expand All @@ -92,7 +99,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" "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" "utils" "sequencer-sqlite"; do
for binary in "cdn-broker" "cdn-marshal" "cdn-whitelist" "deploy" "dev-rollup" "espresso-bridge" "espresso-dev-node" "keygen" "marketplace-builder" "marketplace-solver" "nasty-client" "node-metrics" "orchestrator" "permissionless-builder" "pub-key" "reset-storage" "sequencer" "sequencer-sqlite" "state-prover" "state-relay-server" "submit-transactions" "utils"; 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
11 changes: 8 additions & 3 deletions scripts/build-docker-images-static
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,13 @@ fi

set -euxo pipefail

nix develop .#crossShell --ignore-environment --command cargo build --release
nix develop .#armCrossShell --ignore-environment --command cargo build --release
nix develop .#crossShell --ignore-environment --command bash -c "cargo build --release \
&& cargo build --release --manifest-path ./sequencer-sqlite/Cargo.toml \
&& cargo build --bin espresso-dev-node --release --all-features"

nix develop .#armCrossShell --ignore-environment --command bash -c "cargo build --release \
&& cargo build --release --manifest-path ./sequencer-sqlite/Cargo.toml \
&& cargo build --bin espresso-dev-node --release --all-features"

# The rest of the script doesn't run in a nix shell but we need to know where
# the binaries are.
Expand Down Expand Up @@ -41,7 +46,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" "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" "utils" "sequencer-sqlite"; do
for binary in "cdn-broker" "cdn-marshal" "cdn-whitelist" "deploy" "dev-rollup" "espresso-bridge" "espresso-dev-node" "keygen" "marketplace-builder" "marketplace-solver" "nasty-client" "node-metrics" "orchestrator" "permissionless-builder" "pub-key" "reset-storage" "sequencer" "sequencer-sqlite" "state-prover" "state-relay-server" "submit-transactions" "utils"; do
cp -v "${CARGO_TARGET_DIR}/${TARGET}/release/$binary" ${WORKDIR}/target/$ARCH/release
done
done
Expand Down
Loading