Skip to content
This repository has been archived by the owner on Jan 8, 2025. It is now read-only.

Commit

Permalink
fix: docker file (#689)
Browse files Browse the repository at this point in the history
* add build of artifacts

* try build artifact

* revert try

* fix cross compilation

* fix issue

* remove build binaries from PR

* give write access to ghcr

* increase timeout

* remove build from PR
  • Loading branch information
greged93 authored Jan 5, 2024
1 parent c287b62 commit b7491c6
Show file tree
Hide file tree
Showing 6 changed files with 60 additions and 21 deletions.
5 changes: 5 additions & 0 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[target.x86_64-unknown-linux-gnu]
linker = "x86_64-linux-gnu-gcc"

[target.aarch64-unknown-linux-gnu]
linker = "aarch64-linux-gnu-gcc"
3 changes: 1 addition & 2 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
docker-data/*
docs/*
rpc-call-examples/*
.git/*
.github/*
.vscode/*
.env.example
target/*
Dockerfile
Dockerfile
8 changes: 5 additions & 3 deletions .github/workflows/kakarot_rpc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,13 @@ on:
env:
REGISTRY_IMAGE: ghcr.io/${{ github.repository }}/node

permissions:
packages: write

jobs:
build:
runs-on: ubuntu-latest-16-cores
timeout-minutes: 30
timeout-minutes: 45
strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -53,8 +56,7 @@ jobs:
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
outputs: type=image,name=${{ env.REGISTRY_IMAGE
}},name-canonical=true,push=true
outputs: type=image,name=${{ env.REGISTRY_IMAGE }},name-canonical=true,push=true

- name: Export digest
run: |
Expand Down
11 changes: 11 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

28 changes: 14 additions & 14 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -43,32 +43,32 @@ serde_with = "2.3.1"
# Others
anyhow = "1.0.68"
async-trait = "0.1.58"
bytes = "1"
ctor = "0.2.4"
dotenv = "0.15.0"
env_logger = "0.10.0"
eyre = "0.6.8"

foundry-config = { git = "https://github.com/foundry-rs/foundry", branch = "master" }
futures = "0.3.26"
git2 = "0.18.0"
hex = "0.4"
lazy_static = "1.4.0"
log = "0.4.17"
num-bigint = "0.4.3"
openssl = { version = "0", features = ["vendored"] }
pin-project = "1.1.2"
reqwest = "0.11.13"
ruint = "1.9.0"
rstest = "0.18.1"
tokio = { version = "1.21.2", features = ["macros"] }
tracing = "0.1.37"
tracing-subscriber = { version = "0.3.3", features = ["env-filter"] }
url = "2.3.1"

env_logger = "0.10.0"
hex = "0.4"
log = "0.4.17"
reqwest = "0.11.13"
thiserror = "1.0.38"

tokio = { version = "1.21.2", features = ["macros"] }
tower = "0.4.12"
tower-http = "0.4.4"
futures = "0.3.26"
num-bigint = "0.4.3"

bytes = "1"
foundry-config = { git = "https://github.com/foundry-rs/foundry", branch = "master" }
tracing = "0.1.37"
tracing-subscriber = { version = "0.3.3", features = ["env-filter"] }
url = "2.3.1"
walkdir = "2.3.3"


Expand Down
26 changes: 24 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,24 @@
FROM python:3.9.13 as compiler
# install poetry
RUN curl -sSL https://install.python-poetry.org | python3 -
ENV PATH="$PATH:/root/.local/bin:/root/.foundry/bin"
RUN poetry config virtualenvs.create false

WORKDIR /usr/src/compiler

# Install dependencies
RUN curl -L https://foundry.paradigm.xyz -o foundry.sh \
&& chmod +x foundry.sh \
&& ./foundry.sh \
&& foundryup \
&& apt-get update && apt-get install -y jq

COPY .git ./.git
COPY .gitmodules .gitmodules
COPY Makefile Makefile
COPY scripts scripts
RUN make setup

# Define ARG for build platform
FROM --platform=$BUILDPLATFORM rust:1.64 as builder

Expand All @@ -8,6 +29,8 @@ ARG TARGETPLATFORM
# Set working directory
WORKDIR /usr/src/rpc

COPY --from=compiler /usr/src/compiler/artifacts /usr/src/rpc/artifacts

# Copy source code
COPY . .

Expand All @@ -30,8 +53,7 @@ RUN build_platform() { \
echo "Using BINDGEN_EXTRA_CLANG_ARGS: $BINDGEN_EXTRA_CLANG_ARGS"; \
# Build the Rust application for the specified target
BINDGEN_EXTRA_CLANG_ARGS=$BINDGEN_EXTRA_CLANG_ARGS cargo build --all --release \
--target=$ARCH \
--config target.$ARCH.linker=\"$LINKER\"; \
--target=$ARCH; \
# Copy the built binary to a common release directory
cp /usr/src/rpc/target/$ARCH/release/kakarot-rpc /usr/src/rpc/target/release/; \
} \
Expand Down

0 comments on commit b7491c6

Please sign in to comment.