status-im / nimbus-eth1

Nimbus: an Ethereum Execution Client for Resource-Restricted Devices
https://status-im.github.io/nimbus-eth1/
Apache License 2.0
569 stars 115 forks source link

Fluffy's Dockerfile.portalhive for portal hive debugging is broken #1930

Closed kdeme closed 1 month ago

kdeme commented 10 months ago

Fails when trying to build:

 => [build 5/6] RUN --mount=type=cache,target=/fluffy/vendor     make deps -j2                                                                                                                                                           0.2s 
 => ERROR [build 6/6] RUN --mount=type=cache,target=/fluffy/vendor <<EOF (set -e...)                                                                                                                                                     0.3s 
------                                                                                                                                                                                                                                        
 > [build 6/6] RUN --mount=type=cache,target=/fluffy/vendor <<EOF (set -e...):                                                                                                                                                                
#0 0.278 Git submodules not found. Running 'git -c submodule.vendor/nimbus-eth2.update=none submodule update --init --recursive; git submodule update vendor/nimbus-eth2; cd vendor/nimbus-eth2; git submodule update --init vendor/eth2-networks; git submodule update --init vendor/holesky; git submodule update --init vendor/sepolia; git submodule update --init vendor/gnosis-chain-configs; git submodule update --init --recursive vendor/nim-kzg4844; cd ../..'.                  
#0 0.278                                                                                                                                                                                                                                      
#0 0.286 fatal: not a git repository (or any of the parent directories): .git
#0 0.294 fatal: not a git repository (or any of the parent directories): .git
#0 0.294 bash: line 2: cd: vendor/nimbus-eth2: No such file or directory
#0 0.302 fatal: not a git repository (or any of the parent directories): .git
#0 0.310 fatal: not a git repository (or any of the parent directories): .git
#0 0.317 fatal: not a git repository (or any of the parent directories): .git
#0 0.325 fatal: not a git repository (or any of the parent directories): .git
#0 0.332 fatal: not a git repository (or any of the parent directories): .git
#0 0.333 
#0 0.333 make: Nothing to be done for 'fluffy'.
#0 0.334 cp: cannot stat '/fluffy/build/fluffy': No such file or directory
------
Dockerfile.portalhive:18
--------------------
  17 |     
  18 | >>> RUN --mount=type=cache,target=/fluffy/vendor <<EOF
  19 | >>>   set -e
  20 | >>>   make fluffy -j${NPROC}
  21 | >>>   cp /fluffy/build/fluffy /usr/local/bin/fluffy
  22 | >>> EOF
  23 |     
--------------------
ERROR: failed to solve: process "/bin/sh -c   set -e\n  make fluffy -j${NPROC}\n  cp /fluffy/build/fluffy /usr/local/bin/fluffy\n" did not complete successfully: exit code: 1

Tried also removing vendor from the dockerignore, did not work.

kdeme commented 10 months ago

I can get away with this simple Dockerfile for debugging:

FROM debian:stable-slim

COPY ./build/fluffy /usr/local/bin/fluffy
bhartnett commented 3 months ago

@kdeme Is this issue still valid? I had no issues using the portalhive docker file locally when I was fixing the state hive tests.

kdeme commented 3 months ago

@kdeme Is this issue still valid? I had no issues using the portalhive docker file locally when I was fixing the state hive tests.

I will retest

kdeme commented 2 months ago

Testing the Dockerfile on macOS I did hit this issue:

--------------------
  17 |     
  18 | >>> RUN  --mount=type=cache,target=/nimbus-eth1/build --mount=type=cache,target=/nimbus-eth1/vendor \
  19 | >>>   mv vendor.orig vendor && \
  20 | >>>   make -j${NPROC} NIMFLAGS="${NIMFLAGS_COMMON} --parallelBuild:${NPROC}" V=1 update
  21 |     
--------------------
ERROR: failed to solve: process "/bin/sh -c mv vendor.orig vendor &&   make -j${NPROC} NIMFLAGS=\"${NIMFLAGS_COMMON} --parallelBuild:${NPROC}\" V=1 update" did not complete successfully: exit code: 1

edit: the above issue seem to have occured after I had changed (correctly) the Dockerfile between builds. After docker build cache prune and rebuild few times with the newer Dockerfile, it no longer occurs.

kdeme commented 1 month ago

Currently on Linux I do not have this issue anymore. Might have had to do with some state of the vendor modules. Will close for now and re-open should it occur again.