brownsys / K9db

MySQL-compatible database for GDPR compliance by construction.
MIT License
28 stars 0 forks source link

Docker build fails: Unable to Install cargo-raze due to yanked cargo_toml version #178

Closed nicolas-kuechler closed 2 months ago

nicolas-kuechler commented 3 months ago

Hey

I wanted to try out K9DB, but I'm having trouble building the Docker container because the installation of cargo-raze fails:

RUN /root/.cargo/bin/cargo install cargo-raze

The issue seems to be that cargo-raze depends on cargo_toml = "^0.8.1", which has been yanked. Since cargo-raze is no longer maintained, they recommend using crate_universe.

Could you look into this? Thank you so much for your help!

Error Message

 > [ 9/37] RUN /root/.cargo/bin/cargo install cargo-raze:
0.500     Updating crates.io index
1.313  Downloading crates ...
2.126   Downloaded cargo-raze v0.16.1
2.223   Installing cargo-raze v0.16.1
2.264     Updating crates.io index
3.122 error: failed to compile `cargo-raze v0.16.1`, intermediate artifacts can be found at `/tmp/cargo-installSa4YOY`.
3.122 To reuse those artifacts with a future compilation, set the environment variable `CARGO_TARGET_DIR` to that path.
3.122 
3.122 Caused by:
3.122   failed to select a version for the requirement `cargo_toml = "^0.8.1"`
3.122   candidate versions found which didn't match: 0.20.3, 0.20.2, 0.20.1, ...
3.122   location searched: crates.io index
3.122   required by package `cargo-raze v0.16.1`
3.122   if you are looking for the prerelease package it needs to be specified explicitly
3.122       cargo_toml = { version = "0.19.0-beta.1" }
3.122   perhaps a crate was updated and forgotten to be re-vendored?
------
Dockerfile:43
--------------------
  41 |     # install rust
  42 |     RUN curl https://sh.rustup.rs | sh -s -- -y
  43 | >>> RUN /root/.cargo/bin/cargo install cargo-raze
  44 |     
  45 |     # install mariadb (for baselines only)
--------------------
ERROR: failed to solve: process "/bin/sh -c /root/.cargo/bin/cargo install cargo-raze" did not complete successfully: exit code: 101

Steps to Reproduce

On Ubuntu 22.04.4 LTS:

docker build -t k9db/latest .
ms705 commented 3 months ago

Hi Nicolas!

Thanks for the report — we'll look into this and get back to you shortly. Possible solutions include using a later version of cargo_toml or moving to crate_universe as you suggest. Give us a few days to come up with a solution.

nicolas-kuechler commented 3 months ago

Thank you! It's not urgent from my side.

lado-saha commented 2 months ago

Hi

Any update on this issue?

KinanBab commented 2 months ago

I'm working on a fix right now using crate universe. I'll push it in a day or two

KinanBab commented 2 months ago

crate_universe turned out to be a nightmare due to toolchain versioning issues.

Instead, I forked cargo-raze and bumped cargo_toml version. This seems to work for building on my machine and via the docker container (but you have to rebuild the docker container).

I pushed the fix to main.

nicolas-kuechler commented 2 months ago

Thank you for pushing the fix. The Docker container now builds correctly, but I'm still encountering issues when running the code.

I followed the steps described here: https://github.com/brownsys/K9db/wiki/Requirements%3A-Using-Docker.

However, I didn't reach the Configuration done! message due to an issue with installing the plotting dependencies. I resolved this by adding pip install wheel==0.43.0 to configure_docker.sh:

  # Install plotting dependencies.
  echo "Installing plotting dependencies ..."
  cd /home/k9db/experiments/scripts/plotting
  rm -rf __pycache__ venv
  python3 -m venv venv
  . venv/bin/activate
  pip install wheel==0.43.0
  pip install -r requirements.txt || /bin/true
  deactivate
  cd -

Next, I attempted to build K9db following these instructions: https://github.com/brownsys/K9db/wiki/Building,-Testing,-and-Running. Unfortunately, it stopped with an error. I've attached the output from the first build attempt (error1.txt). Upon retrying, I encountered the same error, and the file /root/.cache/bazel/_bazel_root/b042375cfb5938574e78c538b83e294d/server/jvm.out remains empty.

root@d2744edb8635:/home/k9db# bazel build :k9db
Starting local Bazel server and connecting to it...
DEBUG: /root/.cache/bazel/_bazel_root/b042375cfb5938574e78c538b83e294d/external/rules_python/python/repositories.bzl:8:10: py_repositories is a no-op and is deprecated. You can remove this from your WORKSPACE file
WARNING: /root/.cache/bazel/_bazel_root/b042375cfb5938574e78c538b83e294d/external/rocksdb/BUILD.bazel:52:11: in linkstatic attribute of cc_library rule @rocksdb//:rocksdb_so: setting 'linkstatic=1' is recommended if there are no object files. Since this rule was created by the macro 'cc_library', the error might have been caused by the macro implementation
WARNING: /home/k9db/k9db/planner/calcite/src/com/brownsys/k9db/BUILD.bazel:3:12: in srcs attribute of java_binary rule //k9db/planner/calcite/src/com/brownsys/k9db:QueryPlanner: please do not import '//k9db/planner/calcite/src/com/brownsys/k9db/nativelib:DataFlowGraphLibraryConfig.java' directly. You should either move the file to this package or depend on an appropriate rule there. Since this rule was created by the macro 'java_binary', the error might have been caused by the macro implementation
INFO: Analyzed target //:k9db (241 packages loaded, 16513 targets configured).
INFO: Found 1 target...
INFO: Deleting stale sandbox base /root/.cache/bazel/_bazel_root/b042375cfb5938574e78c538b83e294d/sandbox
[159 / 382] 4 actions, 3 running
    Foreign Cc - CMake: Building rocksdb; 10s processwrapper-sandbox
    Writing file k9db/sql/rocksdb/libindex.a-2.params; 0s local
    Writing file k9db/libk9db.a-2.params; 0s local
    [Prepa] Compiling Rust (without process_wrapper) bin process_wrapper (4 files)

Server terminated abruptly (error code: 14, error message: 'Socket closed', log file: '/root/.cache/bazel/_bazel_root/b042375cfb5938574e78c538b83e294d/server/jvm.out')

Could you look into this? Thank you so much for your help! If you prefer I can also open a new issue.

KinanBab commented 1 month ago

I've been trying to replicate this but with no luck.

Can you give me some info about your OS/machine?

nicolas-kuechler commented 1 month ago

I retried on a new Ubuntu 24.04 LTS instance, and it worked after adding pip install wheel==0.43.0 to configure_docker.sh. The other build issues I encountered appear specific to my machine.

Thanks again - consider the issue resolved.

KinanBab commented 1 month ago

OK fantastic. Thanks