forked from pixie-io/pixie
-
Notifications
You must be signed in to change notification settings - Fork 0
/
BUILD.bazel
222 lines (201 loc) · 10.6 KB
/
BUILD.bazel
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
# Copyright 2018- The Pixie Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0
load("@bazel_gazelle//:def.bzl", "gazelle")
load("@com_github_bazelbuild_buildtools//buildifier:def.bzl", "buildifier")
load("@io_bazel_rules_docker//container:container.bzl", "container_image")
load("@package_bundle//file:packages.bzl", "packages")
load("//bazel:repositories.bzl", "list_pl_deps")
licenses(["restricted"])
exports_files(["LICENSE"])
gazelle(
name = "gazelle",
prefix = "px.dev/pixie",
)
# This line is necessary to keep Gazelle from using the vendored gRPC for Go library:
# gazelle:exclude vendor
# gazelle:exclude third_party
# gazelle:exclude src/ui/node_modules
# gazelle:go_naming_convention import
# gazelle:exclude **/*.pb.go
# gazelle:exclude **/mock.go
# Make gazelle not generate proto files. We need to use gogo proto and this does
# not seem to work automatically right now. Keep an eye out on issue:
# https://github.com/bazelbuild/bazel-gazelle/issues/181 for updates.
# gazelle:proto disable
# TODO(zasgar): We should keep an eye on fixes to gazelle that make this automatic
# Make gazelle resolve the proto paths correctly.
# gazelle:resolve go px.dev/pixie/src/api/proto/cloudpb //src/api/proto/cloudpb:cloudapi_pl_go_proto
# gazelle:resolve go px.dev/pixie/src/api/proto/uuidpb //src/api/proto/uuidpb:uuid_pl_go_proto
# gazelle:resolve go px.dev/pixie/src/api/proto/vispb //src/api/proto/vispb:vis_pl_go_proto
# gazelle:resolve go px.dev/pixie/src/api/proto/vizierpb //src/api/proto/vizierpb:vizier_pl_go_proto
# gazelle:resolve go px.dev/pixie/src/api/proto/vizierconfigpb //src/api/proto/vizierconfigpb:vizier_pl_go_proto
# gazelle:resolve go px.dev/pixie/src/carnot/carnotpb //src/carnot/carnotpb:carnot_pl_go_proto
# gazelle:resolve go px.dev/pixie/src/carnot/docspb //src/carnot/docspb:docs_pl_go_proto
# gazelle:resolve go px.dev/pixie/src/carnot/planner/compilerpb //src/carnot/planner/compilerpb:compiler_status_pl_go_proto
# gazelle:resolve go px.dev/pixie/src/carnot/planner/distributedpb //src/carnot/planner/distributedpb:distributed_plan_pl_go_proto
# gazelle:resolve go px.dev/pixie/src/carnot/planner/dynamic_tracing/ir/logicalpb //src/carnot/planner/dynamic_tracing/ir/logicalpb:logical_pl_go_proto
# gazelle:resolve go px.dev/pixie/src/carnot/planner/plannerpb //src/carnot/planner/plannerpb:func_args_pl_go_proto
# gazelle:resolve go px.dev/pixie/src/carnot/planpb //src/carnot/planpb:plan_pl_go_proto
# gazelle:resolve go px.dev/pixie/src/carnot/queryresultspb //src/carnot/queryresultspb:query_results_pl_go_proto
# gazelle:resolve go px.dev/pixie/src/carnot/udfspb //src/carnot/udfspb:udfs_pl_go_proto
# gazelle:resolve go px.dev/pixie/src/cloud/artifact_tracker/artifacttrackerpb //src/cloud/artifact_tracker/artifacttrackerpb:artifact_tracker_pl_go_proto
# gazelle:resolve go px.dev/pixie/src/cloud/auth/authpb //src/cloud/auth/authpb:auth_go_proto
# gazelle:resolve go px.dev/pixie/src/cloud/auth/authpb //src/cloud/auth/authpb:auth_pl_go_proto
# gazelle:resolve go px.dev/pixie/src/cloud/config_manager/configmanagerpb //src/cloud/config_manager/configmanagerpb:service_pl_go_proto
# gazelle:resolve go px.dev/pixie/src/cloud/dnsmgr/dnsmgrpb //src/cloud/dnsmgr/dnsmgrpb:service_pl_go_proto
# gazelle:resolve go px.dev/pixie/src/cloud/profile/profilepb //src/cloud/profile/profilepb:service_pl_go_proto
# gazelle:resolve go px.dev/pixie/src/cloud/project_manager/projectmanagerpb //src/cloud/project_manager/projectmanagerpb:service_pl_go_proto
# gazelle:resolve go px.dev/pixie/src/cloud/scriptmgr/scriptmgrpb //src/cloud/scriptmgr/scriptmgrpb:service_pl_go_proto
# gazelle:resolve go px.dev/pixie/src/cloud/shared/messagespb //src/cloud/shared/messagespb:messages_pl_go_proto
# gazelle:resolve go px.dev/pixie/src/cloud/vzconn/vzconnpb //src/cloud/vzconn/vzconnpb:service_pl_go_proto
# gazelle:resolve go px.dev/pixie/src/cloud/vzmgr/vzmgrpb //src/cloud/vzmgr/vzmgrpb:service_pl_go_proto
# gazelle:resolve go px.dev/pixie/src/common/base/statuspb //src/common/base/statuspb:status_pl_go_proto
# gazelle:resolve go px.dev/pixie/src/shared/artifacts/versionspb //src/shared/artifacts/versionspb:versions_pl_go_proto
# gazelle:resolve go px.dev/pixie/src/shared/bloomfilterpb //src/shared/bloomfilterpb:bloomfilter_pl_go_proto
# gazelle:resolve go px.dev/pixie/src/shared/cvmsgspb //src/shared/cvmsgspb:cvmsgs_pl_go_proto
# gazelle:resolve go px.dev/pixie/src/shared/k8s/metadatapb //src/shared/k8s/metadatapb:metadata_pl_go_proto
# gazelle:resolve go px.dev/pixie/src/shared/metadatapb //src/shared/metadatapb:metadata_pl_go_proto
# gazelle:resolve go px.dev/pixie/src/shared/scriptspb //src/shared/scriptspb:scripts_pl_go_proto
# gazelle:resolve go px.dev/pixie/src/shared/services/jwtpb //src/shared/services/jwtpb:jwt_pl_go_proto
# gazelle:resolve go px.dev/pixie/src/shared/services/testproto //src/shared/services/testproto:ping_pl_go_proto
# gazelle:resolve go px.dev/pixie/src/shared/types/typespb //src/shared/types/typespb:types_pl_go_proto
# gazelle:resolve go px.dev/pixie/src/stirling/source_connectors/dynamic_tracer/dynamic_tracing/ir/logicalpb //src/stirling/source_connectors/dynamic_tracer/dynamic_tracing/ir/logicalpb:logical_pl_go_proto
# gazelle:resolve go px.dev/pixie/src/stirling/source_connectors/socket_tracer/protocols/http2/testing/proto //src/stirling/source_connectors/socket_tracer/protocols/http2/testing/proto:greet_pl_go_proto
# gazelle:resolve go px.dev/pixie/src/stirling/testing/demo_apps/go_grpc_tls_pl/server/greetpb //src/stirling/testing/demo_apps/go_grpc_tls_pl/server/greetpb:service_pl_go_proto
# gazelle:resolve go px.dev/pixie/src/stirling/testing/demo_apps/hipster_shop/proto //src/stirling/testing/demo_apps/hipster_shop/proto:demo_pl_go_proto
# gazelle:resolve go px.dev/pixie/src/table_store/schemapb //src/table_store/schemapb:schema_pl_go_proto
# gazelle:resolve go px.dev/pixie/src/vizier/messages/messagespb //src/vizier/messages/messagespb:messages_pl_go_proto
# gazelle:resolve go px.dev/pixie/src/vizier/services/certmgr/certmgrpb //src/vizier/services/certmgr/certmgrpb:service_pl_go_proto
# gazelle:resolve go px.dev/pixie/src/vizier/services/metadata/metadatapb //src/vizier/services/metadata/metadatapb:service_pl_go_proto
# gazelle:resolve go px.dev/pixie/src/vizier/services/metadata/storepb //src/vizier/services/metadata/storepb:store_pl_go_proto
# gazelle:resolve go px.dev/pixie/src/vizier/services/shared/agentpb //src/vizier/services/shared/agentpb:agent_pl_go_proto
#
# gazelle:resolve go px.dev/pixie/experimental/stirling/proto_data_model/proto //experimental/stirling/proto_data_model/proto:http_record_pl_go_proto
#
# Make gazelle resolve CGO libraries correctly.
# gazelle:resolve go px.dev/pixie/src/carnot/goplanner //src/carnot/goplanner:go_default_library
buildifier(
name = "buildifier",
exclude_patterns = [
"./third_party/**/*",
],
lint_mode = "fix",
lint_warnings = ["all"],
)
pl_cc_base_packages = [
packages["libc6"],
packages["libelf1"],
packages["liblzma5"],
packages["libtinfo6"],
packages["zlib1g"],
]
# These filegroups aren't strictly necessary but nice to avoid the extra @*_model//file:, in any other rules that want
# to use these files.
filegroup(
name = "sentencepiece.proto",
srcs = ["@sentencepiece_model//file:sentencepiece.proto"],
visibility = ["//visibility:public"],
)
filegroup(
name = "embedding.proto",
srcs = ["@embedding_model//file:embedding.proto"],
visibility = ["//visibility:public"],
)
container_image(
name = "pl_cc_base_image",
base = "@base_image//image",
debs = pl_cc_base_packages,
files = [
"//:embedding.proto",
"//:sentencepiece.proto",
],
visibility = ["//visibility:public"],
)
container_image(
name = "pl_cc_base_debug_image",
base = "@base_image_debug//image",
debs = pl_cc_base_packages,
files = [
"//:embedding.proto",
"//:sentencepiece.proto",
],
visibility = ["//visibility:public"],
)
# Note that each ull linux header tarballs is ~15MB compressed and ~230MB uncompressed.
# Trimmed versions are ~8MB compressed and ~110MB uncompressed.
# These are all trimmed versions, so we have 8 * 12 = 96 MB of headers.
linux_headers_tarballs = [
"@linux_headers_4_14_176_tar_gz//file:file",
"@linux_headers_4_15_18_tar_gz//file:file",
"@linux_headers_4_16_18_tar_gz//file:file",
"@linux_headers_4_17_19_tar_gz//file:file",
"@linux_headers_4_18_20_tar_gz//file:file",
"@linux_headers_4_19_118_tar_gz//file:file",
"@linux_headers_4_20_17_tar_gz//file:file",
"@linux_headers_5_0_21_tar_gz//file:file",
"@linux_headers_5_1_21_tar_gz//file:file",
"@linux_headers_5_2_21_tar_gz//file:file",
"@linux_headers_5_3_18_tar_gz//file:file",
"@linux_headers_5_4_35_tar_gz//file:file",
"@linux_headers_5_5_19_tar_gz//file:file",
"@linux_headers_5_6_19_tar_gz//file:file",
"@linux_headers_5_7_19_tar_gz//file:file",
"@linux_headers_5_8_18_tar_gz//file:file",
"@linux_headers_5_9_16_tar_gz//file:file",
"@linux_headers_5_10_34_tar_gz//file:file",
"@linux_headers_5_11_18_tar_gz//file:file",
]
linux_timeconst_files = [
"@timeconst_100//file:file",
"@timeconst_250//file:file",
"@timeconst_300//file:file",
"@timeconst_1000//file:file",
]
stirling_ctrl_files = [
"//src/stirling/binaries:stirling_ctrl",
]
container_image(
name = "pl_cc_bpf_image",
base = ":pl_cc_base_image",
directory = "/pl",
files = linux_headers_tarballs + linux_timeconst_files + stirling_ctrl_files,
visibility = ["//visibility:public"],
)
container_image(
name = "pl_cc_bpf_debug_image",
base = ":pl_cc_base_debug_image",
directory = "/pl",
files = linux_headers_tarballs + linux_timeconst_files + stirling_ctrl_files,
visibility = ["//visibility:public"],
)
alias(
name = "llvm",
actual = select({
"//bazel:use_libcpp": "@com_llvm_lib_libcpp//:llvm",
"//conditions:default": "@com_llvm_lib//:llvm",
}),
visibility = ["//visibility:public"],
)
list_pl_deps(
name = "pl_3p_deps",
)
genrule(
name = "pl_3p_go_sum",
srcs = ["go.sum"],
outs = ["pl_3p_go_sum.out"],
cmd = "cat $< | cut -d' ' -f1 > $@",
visibility = ["//visibility:public"],
)