cybercongress / go-cyber

Your 🔵 Superintelligence
https://cyb.ai
Other
354 stars 87 forks source link

Add docker build with wasm link statically #753

Open cyborgshead opened 1 month ago

cyborgshead commented 1 month ago

https://github.com/cosmos/gaia/issues/3119 https://github.com/cosmos/gaia/blob/main/DOCKER_README.md https://github.com/cosmos/gaia/blob/main/Makefile#L77 https://github.com/cosmos/gaia/blob/main/Dockerfile#L22 https://github.com/CosmWasm/wasmd/blob/main/Makefile#L68

I failed to build go-cyber locally on darwin and local linux machines (both with docker and without), build of gaia with docker based on alpine work but need to check how to put together our cuda build and put things together

mrlp4 commented 1 month ago

Seems like we need nvcc on the binary build stage itself. And that seems impossible cause cuda kit is compiled with glibc while muslc compiler is only supported in alpine.


 => [internal] load build definition from Dockerfile                                                                                                                            0.1s
 => => transferring dockerfile: 3.23kB                                                                                                                                          0.0s
 => [internal] load .dockerignore                                                                                                                                               0.1s
 => => transferring context: 58B                                                                                                                                                0.0s
 => [internal] load metadata for docker.io/library/golang:1.22-alpine                                                                                                           1.0s
 => [internal] load metadata for docker.io/library/ubuntu:20.04                                                                                                                 0.0s
 => [auth] library/golang:pull token for registry-1.docker.io                                                                                                                   0.0s
 => [internal] load build context                                                                                                                                               0.1s
 => => transferring context: 1.17MB                                                                                                                                             0.1s
 => CACHED https://github.com/CosmWasm/wasmvm/releases/download/v1.5.2/libwasmvm_muslc.x86_64.a                                                                                 0.8s
 => CACHED [cyber-builder  1/12] FROM docker.io/library/golang:1.22-alpine@sha256:0d3653dd6f35159ec6e3d10263a42372f6f194c3dea0b35235d72aabde86486e                              0.0s
 => [cuda_builder 1/5] FROM docker.io/library/ubuntu:20.04                                                                                                                      0.0s
 => CACHED [cuda_builder 2/5] RUN apt-get update && apt-get install -y --no-install-recommends wget ca-certificates && wget -O go.tgz https://golang.org/dl/go1.22.2.linux-amd  0.0s
 => [cuda_builder 3/5] COPY . /sources                                                                                                                                          1.2s
 => [cuda_builder 4/5] WORKDIR /sources                                                                                                                                         0.1s
 => [cuda_builder 5/5] RUN apt-get update && apt-get -y install --no-install-recommends     make gcc g++     curl     gnupg     git     software-properties-common && wget h  351.4s
 => [cyber-builder  2/12] COPY --from=cuda_builder  /usr/lib/libcbdrank.so /usr/lib/                                                                                            0.2s 
 => [cyber-builder  3/12] COPY --from=cuda_builder  /usr/lib/cbdrank.h /usr/lib/                                                                                                0.2s 
 => [cyber-builder  4/12] WORKDIR /src/app/                                                                                                                                     0.1s 
 => [cyber-builder  5/12] RUN apk add --no-cache curl make git libc-dev bash file gcc linux-headers eudev-dev                                                                   6.0s 
 => [cyber-builder  6/12] ADD https://github.com/CosmWasm/wasmvm/releases/download/v1.5.2/libwasmvm_muslc.x86_64.a /lib/libwasmvm_muslc.x86_64.a                                1.0s 
 => [cyber-builder  7/12] RUN sha256sum /lib/libwasmvm_muslc.x86_64.a | grep e660a38efb2930b34ee6f6b0bb12730adccb040b6ab701b8f82f34453a426ae7                                   0.9s 
 => [cyber-builder  8/12] RUN cp "/lib/libwasmvm_muslc.$(uname -m).a" /lib/libwasmvm_muslc.a                                                                                    1.5s 
 => [cyber-builder  9/12] COPY go.mod go.sum* ./                                                                                                                                0.3s 
 => [cyber-builder 10/12] RUN go mod download                                                                                                                                  33.3s 
 => [cyber-builder 11/12] COPY . .                                                                                                                                              1.4s 
 => ERROR [cyber-builder 12/12] RUN LEDGER_ENABLED=false LINK_STATICALLY=true BUILD_TAGS=muslc  CUDA_ENABLED=true make build                                                    0.7s
------                                                                                                                                                                               
 > [cyber-builder 12/12] RUN LEDGER_ENABLED=false LINK_STATICALLY=true BUILD_TAGS=muslc  CUDA_ENABLED=true make build:
#0 0.492 Makefile:53: *** CUDA not installed for GPU support, please install or set CUDA_ENABLED=false.  Stop.
------
Dockerfile:73
--------------------
  71 |     
  72 |     COPY . .
  73 | >>> RUN LEDGER_ENABLED=false LINK_STATICALLY=true BUILD_TAGS=muslc  CUDA_ENABLED=true make build
  74 |     
  75 |     
--------------------
ERROR: failed to solve: process "/bin/sh -c LEDGER_ENABLED=false LINK_STATICALLY=true BUILD_TAGS=muslc  CUDA_ENABLED=true make build" did not complete successfully: exit code: 2```