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

setting benchmark path #1951

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

Fuma419
Copy link

@Fuma419 Fuma419 commented Sep 23, 2024

without benchmark path being stated the mythical docker image fails to build

Content

Here is the log output prior to this fix:

 => ERROR [rustbuilder  8/12] RUN cargo build --release -p mithril-signer --manifest-path /app/mithril-signer/Cargo.toml                                                                                                                                                   0.2s
------
 > [rustbuilder  8/12] RUN cargo build --release -p mithril-signer --manifest-path /app/mithril-signer/Cargo.toml:
0.178 error: failed to parse manifest at `/app/mithril-signer/Cargo.toml`
0.178 
0.178 Caused by:
0.178   can't find `mktree_store_sqlite` bench at `benches/mktree_store_sqlite.rs` or `benches/mktree_store_sqlite/main.rs`. Please specify bench.path if you want to use a non-default path.
------
Dockerfile:19
--------------------
  17 |     COPY mithril-signer/Cargo.toml /app/mithril-signer/
  18 |     RUN echo "fn  main () {}" > /app/mithril-signer/src/main.rs
  19 | >>> RUN cargo build --release -p mithril-signer --manifest-path /app/mithril-signer/Cargo.toml
  20 |     
  21 |     # Rollback the rest of the files into the container
--------------------
ERROR: failed to solve: process "/bin/sh -c cargo build --release -p mithril-signer --manifest-path /app/mithril-signer/Cargo.toml" did not complete successfully: exit code: 101

after bugfix:

cd ../ && docker build -t mithril/mithril-signer -f mithril-signer/Dockerfile .
[+] Building 121.3s (26/26) FINISHED                                                                                                                                                                                                                                     docker:default
 => [internal] load build definition from Dockerfile                                                                                                                                                                                                                               0.0s
 => => transferring dockerfile: 2.32kB                                                                                                                                                                                                                                             0.0s
 => [internal] load metadata for docker.io/library/debian:11-slim                                                                                                                                                                                                                  0.3s
 => [internal] load metadata for docker.io/library/rust:bullseye                                                                                                                                                                                                                   0.2s
 => [internal] load .dockerignore                                                                                                                                                                                                                                                  0.0s
 => => transferring context: 106B                                                                                                                                                                                                                                                  0.0s
 => [internal] load build context                                                                                                                                                                                                                                                  0.1s
 => => transferring context: 393.05kB                                                                                                                                                                                                                                              0.1s
 => [rustbuilder  1/12] FROM docker.io/library/rust:bullseye@sha256:8fae3b1a63a4dcfb6cf277a49fb5967ccbf479b9e9cee4588a077a9cb216e6d4                                                                                                                                               0.0s
 => [stage-1 1/8] FROM docker.io/library/debian:11-slim@sha256:00558f781b91e90469812bad32002f311ab26ef241b4a1996f6600680ec82f5c                                                                                                                                                    0.0s
 => CACHED [stage-1 2/8] RUN apt-get update -y && apt-get install -y libssl-dev ca-certificates wget sqlite3 && rm -rf /var/lib/apt/lists/*                                                                                                                                        0.0s
 => CACHED [rustbuilder  2/12] RUN adduser --no-create-home --disabled-password appuser                                                                                                                                                                                            0.0s
 => CACHED [rustbuilder  3/12] WORKDIR /app                                                                                                                                                                                                                                        0.0s
 => [rustbuilder  4/12] COPY . .                                                                                                                                                                                                                                                   0.2s
 => [rustbuilder  5/12] RUN mv /app/mithril-signer /app/mithril-signer.1 && mkdir -p /app/mithril-signer/src                                                                                                                                                                       0.2s
 => [rustbuilder  6/12] COPY mithril-signer/Cargo.toml /app/mithril-signer/                                                                                                                                                                                                        0.0s
 => [rustbuilder  7/12] RUN echo "fn  main () {}" > /app/mithril-signer/src/main.rs                                                                                                                                                                                                0.2s
 => [rustbuilder  8/12] RUN cargo build --release -p mithril-signer --manifest-path /app/mithril-signer/Cargo.toml                                                                                                                                                               110.9s
 => [rustbuilder  9/12] RUN rm -rf /app/mithril-signer && mv /app/mithril-signer.1 /app/mithril-signer                                                                                                                                                                             0.2s 
 => [rustbuilder 10/12] COPY ./mithril-signer/src/main.rs /app/mithril-signer/src/                                                                                                                                                                                                 0.0s 
 => [rustbuilder 11/12] RUN cargo build --release -p mithril-signer                                                                                                                                                                                                                8.3s 
 => [rustbuilder 12/12] RUN /app/target/release/mithril-signer --version                                                                                                                                                                                                           0.2s 
 => [stage-1 3/8] COPY --from=rustbuilder /etc/passwd /etc/passwd                                                                                                                                                                                                                  0.0s 
 => [stage-1 4/8] COPY --from=rustbuilder /app/target/release/mithril-signer /app/bin/mithril-signer                                                                                                                                                                               0.0s 
 => [stage-1 5/8] COPY --from=rustbuilder /app/mithril-signer/config /app/config                                                                                                                                                                                                   0.0s
 => [stage-1 6/8] RUN if [ "$EMBED-CARDANO-CLI" = 1 ] ; then     wget -nv -O cardano-bin.tar.gz https://github.com/input-output-hk/cardano-node/releases/download/9.1.0/cardano-node-9.1.0-linux.tar.gz     && mkdir -p /app/bin     && (tar xzf cardano-bin.tar.gz ./bin/cardano  0.1s
 => [stage-1 7/8] WORKDIR /app/                                                                                                                                                                                                                                                    0.0s
 => [stage-1 8/8] RUN chown -R appuser /app/                                                                                                                                                                                                                                       0.2s
 => exporting to image                                                                                                                                                                                                                                                             0.1s
 => => exporting layers                                                                                                                                                                                                                                                            0.1s
 => => writing image sha256:630f6ff8dafb9d69d3e4a22f8b23b2196d75638d6f5cd4b1eb03bbfded5844d7                                                                                                                                                                                       0.0s
 => => naming to docker.io/mithril/mithril-signer    

This PR includes...

Pre-submit checklist

  • Branch
    • Tests are provided (if possible)
    • Crates versions are updated (if relevant)
    • CHANGELOG file is updated (if relevant)
    • Commit sequence broadly makes sense
    • Key commits have useful messages
  • PR
    • No clippy warnings in the CI
    • Self-reviewed the diff
    • Useful pull request description
    • Reviewer requested
  • Documentation
    • Update README file (if relevant)
    • Update documentation website (if relevant)
    • Add dev blog post (if relevant)

Comments

Issue(s)

Relates to #YYY or Closes #YYY

without benchmark path being stated the mythical docker image fails to build
@jpraynaud
Copy link
Member

Hi @Fuma419, thank you for reporting the problem 👍

After investigation, it appears that the problem is due to the bench files not being properly copied in the Docker image.

This is something which is already implemented in another Docker image:
https://github.com/input-output-hk/mithril/blob/main/mithril-aggregator/Dockerfile#L16C1-L20C67

RUN mv /app/mithril-aggregator /app/mithril-aggregator.1 \
    && mkdir -p /app/mithril-aggregator/src \
    && mkdir -p /app/mithril-aggregator/benches
COPY mithril-aggregator/Cargo.toml /app/mithril-aggregator/
COPY mithril-aggregator/benches/* /app/mithril-aggregator/benches/

Can you update your PR with the same fix in this Docker image?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants