[英]Parallelizing google cloudbuild steps without mangling the build logs
Following guidance here: https://cloud.google.com/cloud-build/docs/configuring-builds/configure-build-step-order遵循此处的指导: https : //cloud.google.com/cloud-build/docs/configuring-builds/configure-build-step-order
We have split up our build into a multilayer docker image where layers are我们已经将我们的构建拆分成一个多层 docker 镜像,其中层是
We have tagged the steps in cloudbuild.yaml with docker id's and are using waitfor
to try to make it so that the debug
and release
versions can run in parallel .我们已经用 docker id 标记了 cloudbuild.yaml 中的步骤,并且正在使用
waitfor
尝试使其能够并行运行debug
和release
版本。
However, when we do this, the build log is mixed up -- the build logs for release and debug are are jumbled together making it much harder to read.然而,当我们这样做时,构建日志是混乱的——发布和调试的构建日志混杂在一起,使其更难以阅读。 eg
例如
Step #2 - "build-debug": �[0m�[91m Downloaded colored v1.7.0
Step #5 - "build-release": �[0m�[91merror: couldn't read /tmp/mobilenode/src/attest/src/ias/../data/AttestationReportSigningCACert.pem: No such file or directory (os error 2)
Step #5 - "build-release": --> /tmp/mobilenode/src/attest/src/ias/verify.rs:35:7
Step #5 - "build-release": |
Step #5 - "build-release": 35 | &[include_str!("../data/AttestationReportSigningCACert.pem")];
Step #5 - "build-release": | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Step #5 - "build-release":
Step #2 - "build-debug": �[0m�[91m Downloaded toml v0.4.10
[0m�[91m Downloaded safemem v0.3.0
Step #2 - "build-debug": �[0m�[91m Downloaded crunchy v0.1.6
Step #2 - "build-debug": �[0m�[91m Downloaded grpcio-sys v0.4.4
Step #5 - "build-release": �[0m�[91merror: aborting due to previous error
Step #5 - "build-release":
Step #5 - "build-release": �[0m�[91merror: Could not compile `attest`.
Step #5 - "build-release": warning: build failed, waiting for other jobs to finish...
Step #5 - "build-release": �[0m�[91merror: build failed
Step #5 - "build-release": �[0m�[91mmake: *** [src/enclave/target/release/libenclave.so] Error 101
Step #5 - "build-release": �[0mMakefile:90: recipe for target 'src/enclave/target/release/libenclave.so' failed
Step #2 - "build-debug": �[0m�[91m Downloaded term v0.5.1
Step #2 - "build-debug": �[0m�[91m Downloaded tiny_http v0.6.2
Step #2 - "build-debug": �[0m�[91m Downloaded regex v0.1.80
Is there a way to configure cloudbuild so that there is a separate log file for each build step?有没有办法配置 cloudbuild 以便每个构建步骤都有一个单独的日志文件? Is the best answer to use a different cloudbuild.yaml for the parallel steps, and skip all this
wait_for
stuff?对并行步骤使用不同的 cloudbuild.yaml 并跳过所有这些
wait_for
内容是最佳答案吗?
I was having this same issue, but then I discovered that viewing a build via the History
under Cloud Build
in the Console will let you view each step individually, or view the entire job, like you're currently seeing (click Build Summary
, the top entry in the sidebar).我遇到了同样的问题,但后来我发现通过控制台中
Cloud Build
下的History
查看构建将使您可以单独查看每个步骤,或查看整个作业,就像您当前看到的一样(单击Build Summary
,侧边栏中的顶部条目)。 Click on the name of the step in sidebar, each step should be comprised of a number followed by a colon and then the name of the step.单击边栏中的步骤名称,每个步骤应由数字后跟冒号和步骤名称组成。 The number appears to be based upon the order in which the job appears in your
cloudbuild.yaml
该数字似乎基于作业出现在您的
cloudbuild.yaml
中的cloudbuild.yaml
What you're seeing is a result of the parallelization of your build, as each step that is marked as being able to run concurrently is at a different step in its execution.您所看到的是构建并行化的结果,因为标记为能够并发运行的每个步骤都处于执行中的不同步骤。
You can read more about viewing the Build History using the console here .
您可以在 此处阅读有关使用控制台查看构建历史的更多信息。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.