1
私はgcr.io/cloud-builders/bazel
を使用してGoogleコンテナビルドで画像を構築しています。Google Cloud Platformでbazelビルドを高速化するには
ログからは、ほとんどの時間がバーゼルの作業領域を設定するのに費やされているようです。このワークスペースはビルドごとに変更されないので、事前に計算して新しいイメージに保存することができます。
Google Cloud Platformでこれらのbazelビルドをスピードアップするにはどうすればよいですか?
Already have image (with digest): gcr.io/cloud-builders/bazel
Extracting Bazel installation...
........................
Loading:
Loading: 0 packages loaded
Loading: 0 packages loaded
Loading: 0 packages loaded
Loading: 0 packages loaded
Loading: 0 packages loaded
WARNING: /builder/home/.cache/bazel/_bazel_root/eab0d61a99b6696edb3d2aff87b585e8/external/io_bazel_rules_go/go/def.bzl:137:3: DEPRECATED: com_github_golang_protobuf : new_go_repository is deprecated. Please migrate to go_repository soon.
WARNING: /builder/home/.cache/bazel/_bazel_root/eab0d61a99b6696edb3d2aff87b585e8/external/io_bazel_rules_go/go/def.bzl:137:3: DEPRECATED: com_github_golang_glog : new_go_repository is deprecated. Please migrate to go_repository soon.
WARNING: /builder/home/.cache/bazel/_bazel_root/eab0d61a99b6696edb3d2aff87b585e8/external/io_bazel_rules_go/go/def.bzl:137:3: DEPRECATED: org_golang_google_grpc : new_go_repository is deprecated. Please migrate to go_repository soon.
WARNING: /builder/home/.cache/bazel/_bazel_root/eab0d61a99b6696edb3d2aff87b585e8/external/io_bazel_rules_go/go/def.bzl:137:3: DEPRECATED: org_golang_x_net : new_go_repository is deprecated. Please migrate to go_repository soon.
WARNING: /builder/home/.cache/bazel/_bazel_root/eab0d61a99b6696edb3d2aff87b585e8/external/io_bazel_rules_go/go/def.bzl:137:3: DEPRECATED: com_github_gogo_protobuf : new_go_repository is deprecated. Please migrate to go_repository soon.
WARNING: /builder/home/.cache/bazel/_bazel_root/eab0d61a99b6696edb3d2aff87b585e8/external/io_bazel_rules_go/go/def.bzl:137:3: DEPRECATED: com_github_grpc_ecosystem_grpc_gateway : new_go_repository is deprecated. Please migrate to go_repository soon.
WARNING: /builder/home/.cache/bazel/_bazel_root/eab0d61a99b6696edb3d2aff87b585e8/external/io_bazel_rules_go/go/def.bzl:137:3: DEPRECATED: org_golang_google_genproto : new_go_repository is deprecated. Please migrate to go_repository soon.
Analyzing: target //:docker (4 packages loaded)
Analyzing: target //:docker (5 packages loaded)
Analyzing: target //:docker (6 packages loaded)
Analyzing: target //:docker (76 packages loaded)
Analyzing: target //:docker (78 packages loaded)
Analyzing: target //:docker (78 packages loaded)
Analyzing: target //:docker (79 packages loaded)
Analyzing: target //:docker (79 packages loaded)
Analyzing: target //:docker (80 packages loaded)
Analyzing: target //:docker (160 packages loaded)
Analyzing: target //:docker (160 packages loaded)
Analyzing: target //:docker (160 packages loaded)
Analyzing: target //:docker (160 packages loaded)
Analyzing: target //:docker (174 packages loaded)
Analyzing: target //:docker (174 packages loaded)
Analyzing: target //:docker (211 packages loaded)
INFO: Analysed target //:docker (286 packages loaded).
INFO: Found 1 target...
[0/1] BazelWorkspaceStatusAction stable-status.txt
[17/19] SHA256 external/golang/image/002.tar.gz.nogz.sha256
[42/281] no action running
[51/290] no action running
[63/302] no action running
[80/319] no action running
[101/340] no action running
[118/358] no action running
[138/378] no action running
[168/407] Compiling external/com_github_google_protobuf/src/google/protobuf/compiler/csharp/csharp_message_field.cc [for host]; 0s linux-sandbox
[200/439] Compiling external/com_github_google_protobuf/src/google/protobuf/extension_set.cc [for host]; 1s linux-sandbox
INFO: From ProtoCompile assets/assets/assets.pb.gw.go:
assets/assets/assets.proto: warning: Import recipes.proto but not used.
INFO: From ProtoCompile assets/assets/assets.swagger.json:
assets/assets/assets.proto: warning: Import recipes.proto but not used.
INFO: From ProtoCompile assets/assets/assets.pb.go:
assets/assets/assets.proto: warning: Import recipes.proto but not used.
[522/697] GoCompile vendor/github.com/gorilla/mux/~lib~/go_default_library.o; 0s linux-sandbox
Target //:docker up-to-date:
bazel-bin/docker-layer.tar
INFO: Elapsed time: 331.343s, Critical Path: 13.73s
INFO: Build completed successfully, 737 total actions
EDIT:
steps:
- name: gcr.io/cloud-builders/bazel
args: ['run', '//:docker']
- name: gcr.io/cloud-builders/docker
args: ['tag', 'bazel:docker', '${_IMAGE_TAG}']
images: ['${_IMAGE_TAG}']
どのように実行しますか?完全なコマンドを投稿しますか? –
私が使用しているクラウドビルドファイルが追加されました – fabrizioM
利用可能なすべてのドキュメントの初めから、この場合に役立つキャッシュやボリュームの機能はありません。 Googleサポートに相談するのが一番です –