Skip to content

Commit

Permalink
Add anvil and postgres to dev-node image (#1707)
Browse files Browse the repository at this point in the history
* Add anvil and postgres to dev-node image

* Fix the build-docker-images scripts
  • Loading branch information
ImJeremyHe authored Jul 15, 2024
1 parent b9f54ce commit 7184e3c
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 12 deletions.
8 changes: 7 additions & 1 deletion docker/espresso-dev-node.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@ RUN curl -LO https://github.com/EspressoSystems/ark-srs/releases/download/v0.2.0
COPY target/$TARGETARCH/release/espresso-dev-node /bin/espresso-dev-node
RUN chmod +x /bin/espresso-dev-node

# Download the anvil binary
RUN curl -L https://github.com/foundry-rs/foundry/releases/download/nightly/foundry_nightly_linux_${TARGETARCH}.tar.gz --output -| tar -xzvf - -C /bin/ anvil

COPY scripts/launch-dev-node-with-postgres /bin/launch-dev-node-with-postgres
RUN chmod +x /bin/launch-dev-node-with-postgres

# When running as a Docker service, we always want a healthcheck endpoint, so set a default for the
# port that the HTTP server will run on. This can be overridden in any given deployment environment.
ENV ESPRESSO_SEQUENCER_API_PORT=8770
Expand All @@ -23,4 +29,4 @@ EXPOSE 8770
EXPOSE 8771
EXPOSE 8772

CMD [ "/bin/espresso-dev-node"]
CMD [ "/bin/launch-dev-node-with-postgres"]
10 changes: 5 additions & 5 deletions scripts/build-docker-images
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,14 @@ for ARCH in "amd64" "arm64"; 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"; do
cp -v "${CARGO_TARGET_DIR}/${TARGET}/release/$binary" ${WORKDIR}/target/$ARCH/release
done

# Download the latest foundry binary and extract anvil for the dev-node docker image.
curl -L https://github.com/foundry-rs/foundry/releases/download/nightly/foundry_nightly_linux_${ARCH}.tar.gz -o ${WORKDIR}/foundry.tar.gz
tar -xzvf ${WORKDIR}/foundry.tar.gz -C ${WORKDIR}/target/$ARCH/release anvil
done

mkdir -p ${WORKDIR}/docker/scripts
cp -v docker/scripts/sequencer-awssecretsmanager.sh ${WORKDIR}/docker/scripts

# Copy the dev-node launch script
cp -v scripts/launch-dev-node-with-postgres ${WORKDIR}
mkdir -p ${WORKDIR}/scripts
cp -v scripts/launch-dev-node-with-postgres ${WORKDIR}/scripts

export DOCKER_BUILDKIT=1
docker build -t ghcr.io/espressosystems/espresso-sequencer/orchestrator:main -f docker/orchestrator.Dockerfile ${WORKDIR}
Expand Down
11 changes: 5 additions & 6 deletions scripts/build-docker-images-native
Original file line number Diff line number Diff line change
Expand Up @@ -95,13 +95,12 @@ for binary in "orchestrator" "cdn-broker" "cdn-marshal" "cdn-whitelist" "sequenc
fi
done

# Copy the dev-node launch script
cp -v scripts/launch-dev-node-with-postgres ${WORKDIR}

# Download the latest foundry binary and extract anvil for the dev-node docker image.
curl -L https://github.com/foundry-rs/foundry/releases/download/nightly/foundry_nightly_linux_${ARCH}.tar.gz -o ${WORKDIR}/foundry.tar.gz
tar -xzvf ${WORKDIR}/foundry.tar.gz -C ${WORKDIR}/target/$ARCH/release anvil
mkdir -p ${WORKDIR}/docker/scripts
cp -v docker/scripts/sequencer-awssecretsmanager.sh ${WORKDIR}/docker/scripts

# Copy the dev-node launch script
mkdir -p ${WORKDIR}/scripts
cp -v scripts/launch-dev-node-with-postgres ${WORKDIR}/scripts

export DOCKER_BUILDKIT=1
docker build --platform $PLATFORM -t ghcr.io/espressosystems/espresso-sequencer/orchestrator:main -f docker/orchestrator.Dockerfile ${WORKDIR}
Expand Down

0 comments on commit 7184e3c

Please sign in to comment.