cardano-foundation / cardano-rosetta

An implementation of Rosetta for Cardano
https://www.rosetta-api.org
Apache License 2.0
98 stars 50 forks source link

Docker Build Appears Broken in 2.1.0 #542

Closed csknk closed 8 months ago

csknk commented 9 months ago

Summary

If I follow the instructions for building a Docker image provided on the project README, the build fails.

Steps to reproduce the bug

  1. Clone repo
  2. Move into project directory
  3. Run DOCKER_BUILDKIT=1 docker build --build-arg BUILDKIT_INLINE_CACHE=1 --cache-from=inputoutput/cardano-rosetta:master -t inputoutput/cardano-rosetta:2.1.0 . as per instructions

Actual Result

598.5 src-unix/Ouroboros/Consensus/Storage/IO.hs:28:1: error:
598.5     Could not find module `System.Posix.IO.ByteString'
598.5     Perhaps you meant
598.5       System.Posix.IO.ByteString (from unix-2.7.2.2)
598.5       System.Posix.ByteString (from unix-2.7.2.2)
598.5       System.Posix.Env.ByteString (from unix-2.7.2.2)
598.5    |
598.5 28 | import           "unix-bytestring" System.Posix.IO.ByteString (fdPreadBuf)
598.5    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
598.5 cabal: Failed to build ouroboros-consensus-0.1.0.1 (which is required by
598.5 exe:cardano-node from cardano-node-1.35.5). See the build log above for
598.5 details.
598.5 
598.5 mv: cannot stat './dist-newstyle/build/-linux/ghc-8.10.7/cardano-node-1.35.5/x/cardano-node/build/cardano-node/cardano-node': No such file or directory
------
Dockerfile:84
--------------------
  83 |     RUN cabal update
  84 | >>> RUN \
  85 | >>>     cabal build exe:cardano-node \
  86 | >>>       -f -systemd &&\
  87 | >>>     if [ "$TARGETARCH" = "arm64" ]; then \
  88 | >>>       TARGETARCH1=aarch64; \
  89 | >>>     else \
  90 | >>>       TARGETARCH1=x86_64; \
  91 | >>>     fi; \
  92 | >>>     mv ./dist-newstyle/build/${TARGETARCH1}-linux/ghc-${GHC_VERSION}/cardano-node-${CARDANO_NODE_VERSION}/x/cardano-node/build/cardano-node/cardano-node /usr/local/bin/
  93 |     RUN \
--------------------
ERROR: failed to solve: process "/bin/sh -c cabal build exe:cardano-node       -f -systemd &&    if [ \"$TARGETARCH\" = \"arm64\" ]; then       TARGETARCH1=aarch64;     else       TARGETARCH1=x86_64;     fi;     mv ./dist-newstyle/build/${TARGETARCH1}-linux/ghc-${GHC_VERSION}/cardano-node-${CARDANO_NODE_VERSION}/x/cardano-node/build/cardano-node/cardano-node /usr/local/bin/" did not complete successfully: exit code: 1

Expected Result

Docker build is successful

Environment

cardano-rosetta 2.1.0

Platform

Platform version

Ubuntu 20.04 LTS

Docker version

24.0.7

AlanVerbner commented 9 months ago

I'm facing the same issue

AlanVerbner commented 8 months ago

@csknk I was able to make docker build to run and it's syncing atm...in case you want to try it out, you can find my changes here.

AlanVerbner commented 8 months ago

Update: seems to be synching although I cannot try the snapshot restore so it's going to take some time to be up to date image

Kammerlo commented 8 months ago

Merged the pullrequest to master from @AlanVerbner. This solved the building issues. I'm currently refactoring other tests, actions and bumping the versions.

Closing this issue. If anything else appears to be broken, just let me know.