-
Notifications
You must be signed in to change notification settings - Fork 64
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Removed previous docker images - Created new docker image with all binaries - Moved build files to build directory
- Loading branch information
Showing
14 changed files
with
181 additions
and
375 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,13 +16,7 @@ jobs: | |
strategy: | ||
matrix: | ||
image: | ||
- rollups-advance-runner | ||
- rollups-dispatcher | ||
- rollups-graphql-server | ||
- rollups-host-runner | ||
- rollups-indexer | ||
- rollups-inspect-server | ||
- rollups-state-server | ||
- rollups-node | ||
steps: | ||
- uses: vlaurin/[email protected] | ||
with: | ||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,108 @@ | ||
# (c) Cartesi and individual authors (see AUTHORS) | ||
# SPDX-License-Identifier: Apache-2.0 (see LICENSE) | ||
|
||
# syntax=docker.io/docker/dockerfile:1.4 | ||
|
||
ARG RUST_VERSION=1.71.0 | ||
ARG SERVER_MANAGER_VERSION=0.8.2 | ||
ARG ROLLUPS_CONTRACTS_VERSION=1.0.2 | ||
|
||
ARG BASE_PATH=/opt/cartesi | ||
ARG RUST_BUILD_PATH=${BASE_PATH}/src/rollups-node/offchain | ||
ARG DEPLOYMENT_PATH=${BASE_PATH}/share/deployments | ||
ARG RUNTIME_DIR=/var/opt/cartesi | ||
|
||
# | ||
# On-chain deployment files | ||
# | ||
FROM debian:bookworm-slim as deployment | ||
|
||
ARG DEBIAN_FRONTEND=noninteractive | ||
RUN apt-get update && apt-get install -y curl | ||
|
||
ARG DEPLOYMENT_PATH | ||
WORKDIR ${DEPLOYMENT_PATH} | ||
|
||
# Download deployment files from npm | ||
ARG ROLLUPS_CONTRACTS_VERSION | ||
RUN curl "https://registry.npmjs.org/@cartesi/rollups/-/rollups-${ROLLUPS_CONTRACTS_VERSION}.tgz" \ | ||
-o /tmp/rollups.tgz | ||
RUN tar zxf /tmp/rollups.tgz -C /tmp | ||
RUN cp /tmp/package/export/abi/* . | ||
|
||
# | ||
# Cargo chef | ||
# | ||
FROM rust:${RUST_VERSION}-bookworm AS rust-chef | ||
|
||
RUN rustup component add rustfmt | ||
RUN cargo install cargo-chef | ||
|
||
# The workdir will be inherited by the following Rust images | ||
ARG RUST_BUILD_PATH | ||
WORKDIR ${RUST_BUILD_PATH} | ||
|
||
# | ||
# Cargo chef prepare stage | ||
# | ||
FROM rust-chef as rust-planner | ||
|
||
COPY ./offchain/ . | ||
RUN cargo chef prepare --recipe-path recipe.json | ||
|
||
# | ||
# Cargo chef cook stage | ||
# | ||
FROM rust-chef as rust-builder | ||
|
||
ARG DEBIAN_FRONTEND=noninteractive | ||
RUN apt-get update && apt-get install -y --no-install-recommends \ | ||
cmake libprotobuf-dev protobuf-compiler curl | ||
|
||
# Build dependencies with cargo chef | ||
COPY --from=rust-planner ${RUST_BUILD_PATH}/recipe.json . | ||
RUN cargo chef cook --release --recipe-path recipe.json | ||
|
||
# Build application | ||
COPY ./offchain/ . | ||
RUN cargo build --release | ||
|
||
# | ||
# Runtime | ||
# | ||
FROM cartesi/server-manager:${SERVER_MANAGER_VERSION} as rollups-node | ||
|
||
USER root | ||
|
||
ARG DEBIAN_FRONTEND=noninteractive | ||
RUN apt-get update && apt-get install -y --no-install-recommends \ | ||
libpq5 ca-certificates curl | ||
RUN rm -rf /var/lib/apt/lists/* | ||
|
||
# Copy deployment files | ||
ARG DEPLOYMENT_PATH | ||
WORKDIR ${DEPLOYMENT_PATH} | ||
COPY --from=deployment ${DEPLOYMENT_PATH}/*.json . | ||
|
||
# Copy Rust binaries | ||
ARG BASE_PATH | ||
WORKDIR ${BASE_PATH}/bin | ||
ARG RUST_BUILD_PATH | ||
ARG BINARY_PREFIX=${RUST_BUILD_PATH}/target/release/cartesi-rollups | ||
COPY --from=rust-builder ${BINARY_PREFIX}-advance-runner . | ||
COPY --from=rust-builder ${BINARY_PREFIX}-dispatcher . | ||
COPY --from=rust-builder ${BINARY_PREFIX}-graphql-server . | ||
COPY --from=rust-builder ${BINARY_PREFIX}-host-runner . | ||
COPY --from=rust-builder ${BINARY_PREFIX}-indexer . | ||
COPY --from=rust-builder ${BINARY_PREFIX}-inspect-server . | ||
COPY --from=rust-builder ${BINARY_PREFIX}-state-server . | ||
|
||
# Setup runtime dir | ||
ARG RUNTIME_DIR | ||
RUN mkdir -p ${RUNTIME_DIR} | ||
RUN chown cartesi:cartesi ${RUNTIME_DIR} | ||
WORKDIR ${RUNTIME_DIR} | ||
|
||
ENV PATH="${BASE_PATH}/bin:${PATH}" | ||
USER cartesi | ||
CMD ["/bin/bash"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# Docker Build Instructions | ||
|
||
To build the Rollups Node Docker image, run the following command in the build directory. | ||
|
||
``` | ||
docker buildx bake --load | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# (c) Cartesi and individual authors (see AUTHORS) | ||
# SPDX-License-Identifier: Apache-2.0 (see LICENSE) | ||
|
||
target "docker-metadata-action" {} | ||
target "docker-platforms" {} | ||
|
||
group "default" { | ||
targets = [ | ||
"rollups-node", | ||
] | ||
} | ||
|
||
target "rollups-node" { | ||
inherits = ["docker-metadata-action", "docker-platforms"] | ||
dockerfile = "./build/Dockerfile" | ||
target = "rollups-node" | ||
context = ".." | ||
} |
Oops, something went wrong.