mirror of
https://github.com/opennetworkinglab/onos.git
synced 2025-10-15 17:31:31 +02:00
Includes fixes for: - ONOS-7593: Support for indirect resource Index type - ONOS-7595: Removed ID from direct resources - P4Runtime requires unset bits to be 0 in ternary field matches - Incorrect parsing of flow rule byte counters - Full entity names in P4Info with top-level control block (fixed only for basic.p4, other programs need to be re-compiled and PI IDs in respective pipeconf changed) Change-Id: Ia19aa949c02e363a550e692915c6d6516a2d13d7
57 lines
1.6 KiB
Python
57 lines
1.6 KiB
Python
include_defs(
|
|
'//bucklets/grpc.bucklet'
|
|
)
|
|
|
|
PROTOBUF_VER = '3.2.0'
|
|
GRPC_VER = '1.3.1'
|
|
|
|
PI_COMMIT = '219b3d67299ec09b49f433d7341049256ab5f512'
|
|
PI_BASEURL = 'https://github.com/p4lang/PI.git'
|
|
|
|
# Wondering which .proto files to build? Check p4runtime's Makefile:
|
|
# https://github.com/p4lang/PI/blob/master/proto/Makefile.am
|
|
PROTO_SRCS = [
|
|
'/proto/p4/p4types.proto',
|
|
'/proto/p4/p4runtime.proto',
|
|
'/proto/p4/config/p4info.proto',
|
|
'/proto/google/rpc/status.proto',
|
|
'/proto/google/rpc/code.proto',
|
|
'/proto/p4/tmp/p4config.proto',
|
|
]
|
|
|
|
COMPILE_DEPS =[
|
|
'//lib:CORE_DEPS',
|
|
'//incubator/grpc-dependencies:grpc-core-repkg-' + GRPC_VER,
|
|
'//lib:grpc-stub-' + GRPC_VER,
|
|
'//lib:grpc-protobuf-' + GRPC_VER,
|
|
'//lib:protobuf-java-' + PROTOBUF_VER,
|
|
]
|
|
|
|
genrule(
|
|
name = 'p4lang-pi-repo-' + PI_COMMIT,
|
|
bash = 'git clone --quiet ' + PI_BASEURL + ' $OUT > /dev/null && '
|
|
+ 'cd $OUT && '
|
|
+ 'git checkout --quiet -b buck-build ' + PI_COMMIT + ' > /dev/null && '
|
|
+ 'git submodule update --quiet --init --recursive > /dev/null',
|
|
out = 'repo',
|
|
)
|
|
|
|
def get_proto_src_string():
|
|
proto_srcs = map(lambda x: "$(location :p4lang-pi-repo-%s)%s" % (PI_COMMIT, x), PROTO_SRCS)
|
|
return " ".join(proto_srcs)
|
|
|
|
grpc_jar(
|
|
src_string = get_proto_src_string(),
|
|
proto_paths = [
|
|
'$(location :p4lang-pi-repo-' + PI_COMMIT + ')/proto',
|
|
],
|
|
protoc_version = PROTOBUF_VER,
|
|
plugin_version = GRPC_VER,
|
|
deps = COMPILE_DEPS,
|
|
include_std_lib = True,
|
|
)
|
|
|
|
project_config(
|
|
src_target = ':onos-protocols-p4runtime-proto'
|
|
)
|