Blueprint-uServices / blueprint

Blueprint Microservices Compiler: Flexible and Configurable Open-Source Microservice Benchmark Applications
https://blueprint-uservices.github.io
BSD 3-Clause "New" or "Revised" License
21 stars 5 forks source link

Failed to build dsb_hotel #175

Closed alansong21 closed 6 months ago

alansong21 commented 6 months ago

I followed the usual application build instructions in examples/hotel_dsb and ran docker compose build from build/docker. I got the following output:

WARN[0000] /users/als2005/blueprint/examples/dsb_hotel/build/docker/docker-compose.yml: `version` is obsolete 
[+] Building 1.8s (72/112)                                                                         docker:default
 => [geo_service_container internal] load build definition from Dockerfile                                   0.0s
 => => transferring dockerfile: 1.30kB                                                                       0.0s
 => [recomd_service_container] resolve image config for docker-image://docker.io/docker/dockerfile:1         0.2s
 => [frontend_service_container internal] load build definition from Dockerfile                              0.0s
 => => transferring dockerfile: 1.35kB                                                                       0.0s
 => [rate_service_container internal] load build definition from Dockerfile                                  0.0s
 => => transferring dockerfile: 1.31kB                                                                       0.0s
 => [reserv_service_container internal] load build definition from Dockerfile                                0.0s
 => => transferring dockerfile: 1.33kB                                                                       0.0s
 => [profile_service_container internal] load build definition from Dockerfile                               0.0s
 => => transferring dockerfile: 1.34kB                                                                       0.0s
 => [recomd_service_container internal] load build definition from Dockerfile                                0.0s
 => => transferring dockerfile: 1.33kB                                                                       0.0s
 => [search_service_container internal] load build definition from Dockerfile                                0.0s
 => => transferring dockerfile: 1.33kB                                                                       0.0s
 => [user_service_container internal] load build definition from Dockerfile                                  0.0s
 => => transferring dockerfile: 1.31kB                                                                       0.0s
 => CACHED [user_service_container] docker-image://docker.io/docker/dockerfile:1@sha256:a57df69d0ea827fb726  0.0s
 => [rate_service_container internal] load metadata for docker.io/library/busybox:1.35.0-uclibc              0.4s
 => [search_service_container internal] load metadata for docker.io/library/golang:1.22-bookworm             0.4s
 => [user_service_container internal] load metadata for gcr.io/distroless/base-debian12:latest               0.5s
 => [geo_service_container internal] load .dockerignore                                                      0.0s
 => => transferring context: 2B                                                                              0.0s
 => [search_service_container internal] load .dockerignore                                                   0.0s
 => => transferring context: 2B                                                                              0.0s
 => [reserv_service_container internal] load .dockerignore                                                   0.0s
 => => transferring context: 2B                                                                              0.0s
 => [profile_service_container internal] load .dockerignore                                                  0.0s
 => => transferring context: 2B                                                                              0.0s
 => [user_service_container internal] load .dockerignore                                                     0.0s
 => => transferring context: 2B                                                                              0.0s
 => [rate_service_container internal] load .dockerignore                                                     0.0s
 => => transferring context: 2B                                                                              0.0s
 => [frontend_service_container internal] load .dockerignore                                                 0.0s
 => => transferring context: 2B                                                                              0.0s
 => [recomd_service_container internal] load .dockerignore                                                   0.0s
 => => transferring context: 2B                                                                              0.0s
 => [profile_service_container internal] load build context                                                  0.0s
 => => transferring context: 9.61kB                                                                          0.0s
 => CACHED [search_service_container stage-1 1/8] FROM gcr.io/distroless/base-debian12:latest@sha256:d8d01e  0.0s
 => CACHED [search_service_container] FROM docker.io/library/busybox:1.35.0-uclibc@sha256:56e199e321da9662f  0.0s
 => [search_service_container profile_service_process 1/6] FROM docker.io/library/golang:1.22-bookworm@sha2  0.0s
 => [rate_service_container internal] load build context                                                     0.0s
 => => transferring context: 9.18kB                                                                          0.0s
 => [frontend_service_container internal] load build context                                                 0.0s
 => => transferring context: 13.09kB                                                                         0.0s
 => [user_service_container internal] load build context                                                     0.0s
 => => transferring context: 9.17kB                                                                          0.0s
 => [reserv_service_container internal] load build context                                                   0.0s
 => => transferring context: 9.49kB                                                                          0.0s
 => [geo_service_container internal] load build context                                                      0.0s
 => => transferring context: 9.03kB                                                                          0.0s
 => [recomd_service_container internal] load build context                                                   0.0s
 => => transferring context: 9.51kB                                                                          0.0s
 => [search_service_container internal] load build context                                                   0.0s
 => => transferring context: 10.81kB                                                                         0.0s
 => CACHED [rate_service_container rate_service_process 2/6] COPY ./rate_service_process /src                0.0s
 => CACHED [rate_service_container rate_service_process 3/6] WORKDIR /src                                    0.0s
 => CACHED [rate_service_container rate_service_process 4/6] RUN go mod download                             0.0s
 => CACHED [rate_service_container rate_service_process 5/6] RUN mkdir /rate_service_process                 0.0s
 => CACHED [user_service_container user_service_process 2/6] COPY ./user_service_process /src                0.0s
 => CACHED [user_service_container user_service_process 3/6] WORKDIR /src                                    0.0s
 => CACHED [user_service_container user_service_process 4/6] RUN go mod download                             0.0s
 => CACHED [user_service_container user_service_process 5/6] RUN mkdir /user_service_process                 0.0s
 => CACHED [frontend_service_container frontend_service_process 2/6] COPY ./frontend_service_process /src    0.0s
 => CACHED [frontend_service_container frontend_service_process 3/6] WORKDIR /src                            0.0s
 => CACHED [frontend_service_container frontend_service_process 4/6] RUN go mod download                     0.0s
 => CACHED [frontend_service_container frontend_service_process 5/6] RUN mkdir /frontend_service_process     0.0s
 => CACHED [reserv_service_container reserv_service_process 2/6] COPY ./reserv_service_process /src          0.0s
 => CACHED [reserv_service_container reserv_service_process 3/6] WORKDIR /src                                0.0s
 => CACHED [reserv_service_container reserv_service_process 4/6] RUN go mod download                         0.0s
 => CACHED [reserv_service_container reserv_service_process 5/6] RUN mkdir /reserv_service_process           0.0s
 => CACHED [recomd_service_container recomd_service_process 2/6] COPY ./recomd_service_process /src          0.0s
 => CACHED [recomd_service_container recomd_service_process 3/6] WORKDIR /src                                0.0s
 => CACHED [recomd_service_container recomd_service_process 4/6] RUN go mod download                         0.0s
 => CACHED [recomd_service_container recomd_service_process 5/6] RUN mkdir /recomd_service_process           0.0s
 => CACHED [profile_service_container profile_service_process 2/6] COPY ./profile_service_process /src       0.0s
 => CACHED [profile_service_container profile_service_process 3/6] WORKDIR /src                              0.0s
 => CACHED [profile_service_container profile_service_process 4/6] RUN go mod download                       0.0s
 => CACHED [profile_service_container profile_service_process 5/6] RUN mkdir /profile_service_process        0.0s
 => CACHED [search_service_container search_service_process 2/6] COPY ./search_service_process /src          0.0s
 => CACHED [search_service_container search_service_process 3/6] WORKDIR /src                                0.0s
 => CACHED [search_service_container search_service_process 4/6] RUN go mod download                         0.0s
 => CACHED [search_service_container search_service_process 5/6] RUN mkdir /search_service_process           0.0s
 => ERROR [rate_service_container rate_service_process 6/6] RUN go build -o /rate_service_process ./rate_se  0.8s
 => CACHED [geo_service_container geo_service_process 2/6] COPY ./geo_service_process /src                   0.0s
 => CACHED [geo_service_container geo_service_process 3/6] WORKDIR /src                                      0.0s
 => CACHED [geo_service_container geo_service_process 4/6] RUN go mod download                               0.0s
 => CACHED [geo_service_container geo_service_process 5/6] RUN mkdir /geo_service_process                    0.0s
 => CANCELED [recomd_service_container recomd_service_process 6/6] RUN go build -o /recomd_service_process   1.0s
 => CANCELED [search_service_container search_service_process 6/6] RUN go build -o /search_service_process   1.0s
 => CANCELED [geo_service_container geo_service_process 6/6] RUN go build -o /geo_service_process ./geo_ser  1.0s
 => CANCELED [reserv_service_container reserv_service_process 6/6] RUN go build -o /reserv_service_process   1.0s
 => CANCELED [frontend_service_container frontend_service_process 6/6] RUN go build -o /frontend_service_pr  0.9s
 => CANCELED [user_service_container user_service_process 6/6] RUN go build -o /user_service_process ./user  1.0s
 => CANCELED [profile_service_container profile_service_process 6/6] RUN go build -o /profile_service_proce  1.0s
------
 > [rate_service_container rate_service_process 6/6] RUN go build -o /rate_service_process ./rate_service_process:
0.709 rate_service_process/rate_service_process.go:21:2: package blueprint/goproc/rate_service_process/grpc imports google.golang.org/grpc/status from implicitly required module; to add missing requirements, run:
0.709   go get google.golang.org/grpc@v1.63.2
------
failed to solve: process "/bin/sh -c go build -o /rate_service_process ./rate_service_process" did not complete successfully: exit code: 1

Running the command go get google.golang.org/grpc@v1.63.2 leads to the following:

go: go.mod file not found in current directory or any parent directory.
        'go get' is no longer supported outside a module.
        To build and install a command, use 'go install' with a version,
        like 'go install example.com/cmd@latest'
        For more information, see https://golang.org/doc/go-get-install-deprecation
        or run 'go help get' or 'go help install'.

Building dsb_hotel was no problem previously. Any idea what may be causing this?

vaastav commented 6 months ago

Are you working with the latest version of Blueprint? We upgraded some dependencies in our latest commit that fixed otel versioning issues.

alansong21 commented 6 months ago

Yes, I am using the latest version. Perhaps it has to do with the Go version? Initially I tried using Go 1.21.9, but some toolchains failed to install. I then used gvm to switch to Go 1.22.0, but then when I checked Go version in blueprint directory, it automatically changed the Go version to 1.22.1. Then, trying to build again led to error message saying Go version needs to be 1.22.0 not 1.22.1.

alansong21 commented 6 months ago

The issue I mentioned in the initial post is from when I ran with Go 1.21.9 and ignored the toolchains failing to build

alansong21 commented 6 months ago

This is what I saw when running go run wiring/main.go -w original -o build:

[09:35:59.354] [slog/logger.go:303] ERROR: go: downloading go1.22 (linux/amd64)
go: download go1.22 for linux/amd64: toolchain not available

[09:35:59.354] [slog/logger.go:303] ERROR: unable to generate Hotel-original artifacts due to exit status 1
exit status 2

Checking the Go version:

als2005@node-1:~/blueprint/examples/dsb_hotel$ go version
go version go1.22.1 linux/amd64
vaastav commented 6 months ago

Hmm, I can't seem to reproduce it locally atm. Will need to try it on a fresh machine so I'll need a couple of days to understand what's going wrong.

vaastav commented 6 months ago

I think your docker compose is using a cached version of the containers which is perhaps preventing new fresh docker images with the right dependencies from being built. Can you remove all the containers from your docker registry and then try building again?

alansong21 commented 6 months ago

Yes, I removed all containers from the registry and ran docker compose build again -- got the same error.

alansong21 commented 6 months ago

@vaastav OK, turns out I was still using go1.21 -- this issue is resolved now. Do you know why running go version in the blueprint dir showed go1.22 then? Does it have to do with the line toolchain go1.22.1 in the updated go.mod files?

vaastav commented 6 months ago

@alansong21 Maybe, but I am not sure really. Usually, it's best to only have 1 version of go installed on your computer.

As everything is working, I am closing this issue now.