cloud-code-intellij icon indicating copy to clipboard operation
cloud-code-intellij copied to clipboard

Don't hide docker build output

Open yfried opened this issue 2 years ago • 7 comments

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

  • IDE type (e.g. IntelliJ, Pycharm): Pycharm
  • IDE version:
PyCharm 2022.1.1 (Professional Edition)
Build #PY-221.5591.52, built on May 10, 2022
  • Cloud Code version (Settings > Plugins > Cloud Code): 22.4.2-213
  • Cloud SDK (Settings > Cloud Code > Cloud SDK):
    • Are you allowing the plugin to manage the Cloud SDK: yes
    • Version of the Cloud SDK: 387.0.0
  • Skaffold version (If you are using Kubernetes features; Settings > Cloud Code > Kubernetes): 1.38.0
  • Operating System: OS X 12.4

yfried avatar May 26 '22 14:05 yfried

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 avatar May 26 '22 15:05 etanshaul

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

etanshaul avatar May 27 '22 14:05 etanshaul

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

yfried avatar May 29 '22 08:05 yfried

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.

anthonyalayo avatar Jun 27 '23 23:06 anthonyalayo

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
...

etanshaul avatar Jun 28 '23 20:06 etanshaul

@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 avatar Jul 03 '23 18:07 anthonyalayo

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...

anthonyalayo avatar Jul 07 '23 02:07 anthonyalayo