GoogleCloudPlatform / cloud-code-intellij

Plugin to support the Google Cloud Platform in IntelliJ IDEA - Docs and Issues Repository
Apache License 2.0
318 stars 59 forks source link

Don't hide docker build output #3080

Open yfried opened 2 years ago

yfried commented 2 years ago

Expected Behavior

Print docker build output to stdout (at least if fails)

Actual Behavior

Docker build output is hidden. even on build failures

Additional Information

skaffold doesn't hide docker build output, but cloud code does

etanshaul commented 2 years ago

hi @yfried - if you enable verbose logging in Cloud Code, does it present the build output? (In the Run Configuration under 'Advanced Settings' you can set the log level to DEBUG).

etanshaul commented 2 years ago

https://github.com/GoogleCloudPlatform/cloud-code-intellij/issues/3068 looks related.

yfried commented 2 years ago

@etanshaul Even setting log to TRACE doesn't provide the docker build output

anthonyalayo commented 1 year ago

Can we get an update from the team here? I'm constantly hitting this as a pain point when developing. I need to switch to a terminal to walk through / debug build changes, then back to cloud code to run.

etanshaul commented 1 year ago

hi @anthonyalayo could you please show an example of logs you are missing? When I just tried building an image for deployment to k8s using Cloud Code, I see logs like the following in the IDE:

Generating tags...
 - java-hello-world -> gcr.io/etan-gcp/java-hello-world:latest
Checking cache...
 - java-hello-world: Not found. Building
Starting build...
Building [java-hello-world]...
Sending build context to Docker daemon  1.001MB
Step 1/9 : FROM maven:3-jdk-11-slim AS build-env
3-jdk-11-slim: Pulling from library/maven
a9fe95647e78: Pulling fs layer
4015b6e8cc8d: Pulling fs layer
fd343789f78f: Pulling fs layer
f361af981f24: Pulling fs layer
19ba18028d20: Pulling fs layer
...
anthonyalayo commented 1 year ago

@etanshaul this is what I get on my side when running with Cloud Code:

Generating tags...
 - backend-app -> backend-app:e02ba3255a3773d75fccf559f8834b34d0f602732326e9df78c49faf89986d72
Checking cache...
 - backend-app: Not found. Building
Starting build...
Found [docker-desktop] context, using local docker daemon.
Building [backend-app]...
Target platforms: [linux/arm64]
Build [backend-app] succeeded

Here's what I get in the terminal:

~/git/backend-app master* ❯ skaffold dev                                                                                          11:15:14 AM
Generating tags...
 - backend-app -> backend-app:a0f5dd0ef1599d80bab74a53b4b47449b771b5bdc6f0d997ff33239c07d57ee7
Checking cache...
 - backend-app: Not found. Building
Starting build...
Found [docker-desktop] context, using local docker daemon.
Building [backend-app]...
Target platforms: [linux/arm64]
#1 [internal] load .dockerignore
#1 transferring context: 121B done
#1 DONE 0.0s

#2 [internal] load build definition from Dockerfile
#2 transferring dockerfile: 4.25kB done
#2 DONE 0.0s

#3 [internal] load metadata for docker.io/library/ubuntu:18.04
#3 DONE 0.0s

...
...

#8 [src-base 5/8] RUN --mount=type=cache,target=/root/.m2,id=m2 ./mvnw dependency:resolve-plugins
#8 CACHED

#9 [src-base 3/8] COPY mvnw .
#9 CACHED

#10 [src-base 6/8] RUN --mount=type=cache,target=/root/.m2,id=m2 ./mvnw dependency:resolve
#10 CACHED

...
...

#16 [src-base 7/8] RUN --mount=type=cache,target=/root/.m2,id=m2 ./mvnw dependency:go-offline
#16 CACHED

...
...

#41 exporting to image
#41 exporting layers 0.0s done
#41 writing image sha256:b501781dbe1904b6d45f16646142de10336b5edcf58dcdeccdec37cad282f081 done
#41 naming to docker.io/library/backend-app:a0f5dd0ef1599d80bab74a53b4b47449b771b5bdc6f0d997ff33239c07d57ee7 done
#41 DONE 0.0s
Build [backend-app] succeeded
anthonyalayo commented 1 year ago

Here's an example failure:

Found [docker-desktop] context, using local docker daemon.
Building [backend-app]...
Target platforms: [linux/arm64]
exit status 1. Docker build ran into internal error. Please retry.
If this keeps happening, please open an issue..
Cleaning up...