likecoin / likecoin-chain

LikeCoin chain node binary - liked
https://docs.like.co/validator/likecoin-chain-node/setup-a-node
GNU General Public License v3.0
104 stars 23 forks source link

Production build fail on Ubuntu Mate (running on RPi 3+) #27

Closed dAAAb closed 2 years ago

dAAAb commented 5 years ago
Sending build context to Docker daemon  625.2kB
Step 1/9 : FROM likechain/golang as builder
 ---> 7d1bc4ac7ee9
Step 2/9 : COPY . ./abci
 ---> Using cache
 ---> a0e665a79624
Step 3/9 : RUN go build -a -o /bin/likechain/abci abci/cmd/abci/main.go
 ---> Running in a62a67fdf36c
Removing intermediate container a62a67fdf36c
 ---> b5871b357c52
Step 4/9 : RUN go build -a -o /bin/likechain/api abci/cmd/api/main.go
 ---> Running in 91416ca127cf
# command-line-arguments
/usr/local/go/pkg/tool/linux_arm/link: running gcc failed: fork/exec /usr/bin/gcc: cannot allocate memory

The command '/bin/sh -c go build -a -o /bin/likechain/api abci/cmd/api/main.go' returned a non-zero code: 2
Sending build context to Docker daemon  1.591MB
Step 1/9 : FROM likechain/golang as builder
 ---> 7d1bc4ac7ee9
Step 2/9 : COPY ./services ./services
 ---> Using cache
 ---> 7d35e163113e
Step 3/9 : COPY ./abci ./abci
 ---> Using cache
 ---> 7313a2317026
Step 4/9 : RUN go build -a -o /bin/likechain/like_service services/main.go
 ---> Running in 444441b903cd
# command-line-arguments
/usr/local/go/pkg/tool/linux_arm/link: running gcc failed: fork/exec /usr/bin/gcc: cannot allocate memory

The command '/bin/sh -c go build -a -o /bin/likechain/like_service services/main.go' returned a non-zero code: 2
daaab@dab-ubuntu-gold:~/likechain$ 

Full log: https://pastebin.com/a7wcYFDp

nnkken commented 5 years ago

It seems that memory on Raspberry Pi is not enough for building LikeChain. Since some libraries we used are using C libraries, cross compilation is not supported, so we need an ARM machine running Linux to build LikeChain for Raspberry Pi.

One possible solution is to shutdown X Window, login Ubuntu and build LikeChain in pure command line, to see if we can spare enough memory by cutting the GUI part.

That said, in our internal testing, the LikeChain node may crash in machines with only 1 GB memory during heavy loading, so Raspberry Pi is probably not a suitable choice for running LikeChain node.

dAAAb commented 5 years ago

It seems to be the issue about docker-compose version in ./docker-compose.yml? Because I create a new droplet on DigitalOcean with 2 GB Memory / 50 GB Disk / SGP1 - Ubuntu 18.04.2 x64 , the problem still there.

root@LikeChain:~/likechain# docker-compose up
ERROR: Version in "./docker-compose.yml" is unsupported. You might be seeing this error because you're using the wrong Compose file version. Either specify a supported version (e.g "2.2" or "3.3") and place your service definitions under the `services` key, or omit the `version` key and place your service definitions at the root of the file to use version 1.
For more on the Compose file format versions, see https://docs.docker.com/compose/compose-file/

螢幕快照 2019-03-11 下午2 48 46

nnkken commented 5 years ago

The new problem is different from the previous one. The original problem happened in the build process, while the new one is about running the already built services.

The new problem should be fixed by upgrading Docker and Docker Compose. We are using Docker Compose file version 3.6, which should be compatible with Docker Compose 1.20+ and Docker 18.02.0+.

Please try to update Docker and Docker Compose and try again.

rickmak commented 2 years ago

Please try again with the new Dockerfile. If problem persist, please reopen the issue.