mirror of
https://github.com/opennetworkinglab/onos.git
synced 2026-05-05 04:06:49 +02:00
First attempt at supporting builds with Java 11
Includes: - Bump protobuf to 3.8.0 and grpc-java to 1.21.0 (along with transitive dependencies such as Netty) - Add jaxb_api at compile time when needed (removed in JDK 11) - Bump Bnd to 4.1 (adds support for Java 11) To build with JDK 11, uncomment lines in .bazelrc. Tested with Bazel 0.26.0. Change-Id: Ib8e0c7310eacf97328762606e57c01e4834e5565
This commit is contained in:
parent
f3f6a8de79
commit
b9536696f6
7
.bazelrc
7
.bazelrc
@ -1,3 +1,10 @@
|
||||
# Build options to use JDK 11
|
||||
# build --incompatible_use_jdk11_as_host_javabase
|
||||
# build --javabase=@bazel_tools//tools/jdk:remote_jdk11
|
||||
# build --host_javabase=@bazel_tools//tools/jdk:remote_jdk11
|
||||
# build --host_java_toolchain=@bazel_tools//tools/jdk:toolchain_vanilla
|
||||
# build --java_toolchain=@bazel_tools//tools/jdk:toolchain_vanilla
|
||||
|
||||
build --nouse_ijars
|
||||
build --experimental_strict_action_env
|
||||
test --test_summary=terse
|
||||
|
||||
14
WORKSPACE
14
WORKSPACE
@ -32,13 +32,21 @@ load("//tools/build/bazel:protobuf_workspace.bzl", "generate_protobuf")
|
||||
|
||||
generate_protobuf()
|
||||
|
||||
load("@com_google_protobuf//:protobuf_deps.bzl", "protobuf_deps")
|
||||
|
||||
protobuf_deps()
|
||||
|
||||
load("//tools/build/bazel:grpc_workspace.bzl", "generate_grpc")
|
||||
|
||||
generate_grpc()
|
||||
|
||||
load("@io_grpc_grpc_java//:repositories.bzl", "grpc_java_repositories")
|
||||
|
||||
# We omit as many dependencies as we can and instead import the same via
|
||||
# deps.json, so they get wrapped properly for Karaf runtime.
|
||||
grpc_java_repositories(
|
||||
omit_bazel_skylib = False,
|
||||
omit_com_google_android_annotations = False,
|
||||
omit_com_google_api_grpc_google_common_protos = True,
|
||||
omit_com_google_auth_google_auth_library_credentials = True,
|
||||
omit_com_google_auth_google_auth_library_oauth2_http = True,
|
||||
@ -46,14 +54,15 @@ grpc_java_repositories(
|
||||
omit_com_google_code_gson = True,
|
||||
omit_com_google_errorprone_error_prone_annotations = True,
|
||||
omit_com_google_guava = True,
|
||||
omit_com_google_guava_failureaccess = False,
|
||||
omit_com_google_j2objc_j2objc_annotations = True,
|
||||
omit_com_google_protobuf = True,
|
||||
omit_com_google_protobuf_javalite = True,
|
||||
omit_com_google_protobuf_nano_protobuf_javanano = True,
|
||||
omit_com_google_re2j = True,
|
||||
omit_com_google_truth_truth = True,
|
||||
omit_com_squareup_okhttp = True,
|
||||
omit_com_squareup_okio = True,
|
||||
omit_io_grpc_grpc_proto = True,
|
||||
omit_io_netty_buffer = True,
|
||||
omit_io_netty_codec = True,
|
||||
omit_io_netty_codec_http = True,
|
||||
@ -67,8 +76,9 @@ grpc_java_repositories(
|
||||
omit_io_netty_transport = True,
|
||||
omit_io_opencensus_api = True,
|
||||
omit_io_opencensus_grpc_metrics = True,
|
||||
omit_javax_annotation = False,
|
||||
omit_javax_annotation = True,
|
||||
omit_junit_junit = True,
|
||||
omit_net_zlib = True,
|
||||
omit_org_apache_commons_lang3 = True,
|
||||
omit_org_codehaus_mojo_animal_sniffer_annotations = True,
|
||||
)
|
||||
|
||||
@ -2,6 +2,7 @@ COMPILE_DEPS = CORE_DEPS + JACKSON + KRYO + REST + [
|
||||
"//core/store/serializers:onos-core-serializers",
|
||||
"//apps/routing-api:onos-apps-routing-api",
|
||||
"//apps/intentsync:onos-apps-intentsync",
|
||||
"@jaxb_api//jar",
|
||||
]
|
||||
|
||||
BUNDLES = [
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
COMPILE_DEPS = CORE_DEPS + JACKSON + [
|
||||
"//lib:com_google_protobuf_protobuf_java",
|
||||
"//lib:io_grpc_grpc_core_context",
|
||||
"//lib:io_grpc_grpc_api_context",
|
||||
"//lib:io_grpc_grpc_netty",
|
||||
"//lib:io_grpc_grpc_stub",
|
||||
"//core/store/serializers:onos-core-serializers",
|
||||
|
||||
@ -16,7 +16,7 @@ BUNDLES = [
|
||||
"@simpleclient_hotspot//jar",
|
||||
"@simpleclient_servlet//jar",
|
||||
# gRPC dependencies (with patched core)
|
||||
"//lib:io_grpc_grpc_core_context",
|
||||
"//lib:io_grpc_grpc_api_context",
|
||||
"//lib:io_grpc_grpc_stub",
|
||||
"//lib:io_grpc_grpc_netty",
|
||||
"//lib:io_grpc_grpc_auth",
|
||||
|
||||
@ -12,7 +12,7 @@ COMPILE_DEPS = CORE_DEPS + JACKSON + KRYO + CLI + REST + [
|
||||
"@jetty_util//jar",
|
||||
"@jetty_websocket//jar",
|
||||
"@servlet_api//jar",
|
||||
"//lib:io_grpc_grpc_core_context",
|
||||
"//lib:io_grpc_grpc_api_context",
|
||||
"//lib:io_grpc_grpc_protobuf_lite",
|
||||
"//core/store/serializers:onos-core-serializers",
|
||||
"//apps/openstacknode/api:onos-apps-openstacknode-api",
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
COMPILE_DEPS = CORE_DEPS + JACKSON + [
|
||||
"//protocols/ovsdb/api:onos-protocols-ovsdb-api",
|
||||
"//protocols/ovsdb/rfc:onos-protocols-ovsdb-rfc",
|
||||
"@jaxb_api//jar",
|
||||
]
|
||||
|
||||
osgi_jar_with_tests(
|
||||
|
||||
@ -4,7 +4,7 @@ COMPILE_DEPS = CORE_DEPS + KRYO + JACKSON + [
|
||||
"//pipelines/basic:onos-pipelines-basic",
|
||||
"//protocols/p4runtime/api:onos-protocols-p4runtime-api",
|
||||
"//protocols/p4runtime/model:onos-protocols-p4runtime-model",
|
||||
"//lib:io_grpc_grpc_core_context",
|
||||
"//lib:io_grpc_grpc_api_context",
|
||||
"//lib:io_grpc_grpc_netty",
|
||||
"@minimal_json//jar",
|
||||
# "//protocols/bmv2/thrift-api:onos-protocols-bmv2-thrift-api",
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
COMPILE_DEPS = CORE_DEPS + KRYO + [
|
||||
"//lib:com_google_protobuf_protobuf_java",
|
||||
"//lib:io_grpc_grpc_core_context",
|
||||
"//lib:io_grpc_grpc_api_context",
|
||||
"//lib:io_grpc_grpc_netty",
|
||||
"//lib:io_grpc_grpc_stub",
|
||||
"//core/store/serializers:onos-core-serializers",
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
COMPILE_DEPS = CORE_DEPS + KRYO + [
|
||||
"//lib:com_google_protobuf_protobuf_java",
|
||||
"//lib:io_grpc_grpc_core_context",
|
||||
"//lib:io_grpc_grpc_api_context",
|
||||
"//lib:io_grpc_grpc_netty",
|
||||
"//lib:io_grpc_grpc_stub",
|
||||
"//protocols/gnoi/stub:onos-protocols-gnoi-stub",
|
||||
|
||||
@ -3,7 +3,7 @@ COMPILE_DEPS = CORE_DEPS + KRYO + [
|
||||
"//protocols/grpc/api:onos-protocols-grpc-api",
|
||||
"//protocols/grpc/utils:onos-protocols-grpc-utils",
|
||||
"//protocols/p4runtime/api:onos-protocols-p4runtime-api",
|
||||
"//lib:io_grpc_grpc_core_context",
|
||||
"//lib:io_grpc_grpc_api_context",
|
||||
]
|
||||
|
||||
BUNDLES = [
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
COMPILE_DEPS = CORE_DEPS + KRYO + JACKSON + [
|
||||
"//lib:io_grpc_grpc_core_context",
|
||||
"//lib:io_grpc_grpc_api_context",
|
||||
"//drivers/p4runtime:onos-drivers-p4runtime",
|
||||
"//drivers/gnmi:onos-drivers-gnmi",
|
||||
"//drivers/gnoi:onos-drivers-gnoi",
|
||||
|
||||
43
lib/BUILD
43
lib/BUILD
@ -4,15 +4,50 @@ load("//tools/build/bazel:osgi_java_library.bzl", "wrapped_osgi_jar")
|
||||
# original ones are built with Bazel and NOT imported via mvn.
|
||||
|
||||
wrapped_osgi_jar(
|
||||
# Differently from the official "grpc-core" package, here we also include
|
||||
# Differently from the official "grpc-api" package, here we also include
|
||||
# "grpc-context" to solve the OSGI split-brain problem:
|
||||
# https://github.com/grpc/grpc-java/issues/2727
|
||||
# We use patched Bazel BUILD files to package together core and context (see
|
||||
# We use patched Bazel BUILD files to package together api and context (see
|
||||
# tools/build/bazel/grpc_workspace.bzl). If you need grpc-context as a
|
||||
# compile-time dependency, please use this one.
|
||||
name = "io_grpc_grpc_core_context",
|
||||
name = "io_grpc_grpc_api_context",
|
||||
generate_pom = True,
|
||||
jar = "@io_grpc_grpc_java//core",
|
||||
# Name resolver and load balancer providers which are part of the internal
|
||||
# package are loaded dynamically, hence this import statement.
|
||||
import_packages = "io.grpc.internal,*",
|
||||
jar = "@io_grpc_grpc_java//api",
|
||||
visibility = ["//visibility:public"],
|
||||
deps = [],
|
||||
)
|
||||
|
||||
wrapped_osgi_jar(
|
||||
name = "io_grpc_grpc_core_inprocess",
|
||||
generate_pom = True,
|
||||
jar = "@io_grpc_grpc_java//core:inprocess",
|
||||
visibility = ["//visibility:public"],
|
||||
deps = [],
|
||||
)
|
||||
|
||||
wrapped_osgi_jar(
|
||||
name = "io_grpc_grpc_core_internal",
|
||||
generate_pom = True,
|
||||
jar = "@io_grpc_grpc_java//core:internal",
|
||||
visibility = ["//visibility:public"],
|
||||
deps = [],
|
||||
)
|
||||
|
||||
wrapped_osgi_jar(
|
||||
name = "io_grpc_grpc_core_util",
|
||||
generate_pom = True,
|
||||
jar = "@io_grpc_grpc_java//core:util",
|
||||
visibility = ["//visibility:public"],
|
||||
deps = [],
|
||||
)
|
||||
|
||||
wrapped_osgi_jar(
|
||||
name = "io_grpc_grpc_core_perfmark",
|
||||
generate_pom = True,
|
||||
jar = "@io_grpc_grpc_java//core:perfmark",
|
||||
visibility = ["//visibility:public"],
|
||||
deps = [],
|
||||
)
|
||||
|
||||
@ -67,7 +67,7 @@
|
||||
"hk2-utils",
|
||||
"javax.inject",
|
||||
"hk2-osgi-resource-locator",
|
||||
"javax.annotation-api-mvn",
|
||||
"javax_annotation_javax_annotation_api",
|
||||
"validation-api",
|
||||
"//core/common:onos-core-common",
|
||||
"//core/api:onos-api-tests",
|
||||
@ -184,7 +184,7 @@
|
||||
|
||||
// Note: grpc imports "javax_annotation_api" has an http file, so we need to give a different name here
|
||||
// See WORKSPACE
|
||||
"javax.annotation-api-mvn": "mvn:javax.annotation:javax.annotation-api:1.3",
|
||||
"javax_annotation_javax_annotation_api": "mvn:javax.annotation:javax.annotation-api:1.3",
|
||||
|
||||
"javax.inject": "mvn:org.glassfish.hk2.external:javax.inject:2.5.0-b42",
|
||||
"javax.ws.rs-api": "mvn:javax.ws.rs:javax.ws.rs-api:2.1",
|
||||
@ -229,19 +229,19 @@
|
||||
"minimal-json": "mvn:com.eclipsesource.minimal-json:minimal-json:0.9.4",
|
||||
"minlog": "mvn:com.esotericsoftware:minlog:1.3.0",
|
||||
"io_netty_netty": "mvn:io.netty:netty:3.10.5.Final",
|
||||
"io_netty_netty_buffer": "mvn:io.netty:netty-buffer:4.1.32.Final",
|
||||
"io_netty_netty_codec": "mvn:io.netty:netty-codec:4.1.32.Final",
|
||||
"io_netty_netty_common": "mvn:io.netty:netty-common:4.1.32.Final",
|
||||
"io_netty_netty_handler": "mvn:io.netty:netty-handler:4.1.32.Final",
|
||||
"io_netty_netty_handler_proxy": "mvn:io.netty:netty-handler-proxy:4.1.32.Final",
|
||||
"io_netty_netty_transport": "mvn:io.netty:netty-transport:4.1.32.Final",
|
||||
"io_netty_netty_transport_native_unix_common": "mvn:io.netty:netty-transport-native-unix-common:4.1.32.Final",
|
||||
"io_netty_netty_transport-native-epoll": "mvn:io.netty:netty-transport-native-epoll:4.1.32.Final",
|
||||
"io_netty_netty_resolver": "mvn:io.netty:netty-resolver:4.1.32.Final",
|
||||
"io_netty_netty_codec-http2": "mvn:io.netty:netty-codec-http2:4.1.32.Final",
|
||||
"io_netty_netty_codec-http": "mvn:io.netty:netty-codec-http:4.1.32.Final",
|
||||
"io_netty_netty_codec-socks": "mvn:io.netty:netty-codec-socks:4.1.32.Final",
|
||||
"io_netty_netty_tcnative_boringssl": "mvn:io.netty:netty-tcnative-boringssl-static:2.0.20.Final",
|
||||
"io_netty_netty_buffer": "mvn:io.netty:netty-buffer:4.1.34.Final",
|
||||
"io_netty_netty_codec": "mvn:io.netty:netty-codec:4.1.34.Final",
|
||||
"io_netty_netty_common": "mvn:io.netty:netty-common:4.1.34.Final",
|
||||
"io_netty_netty_handler": "mvn:io.netty:netty-handler:4.1.34.Final",
|
||||
"io_netty_netty_handler_proxy": "mvn:io.netty:netty-handler-proxy:4.1.34.Final",
|
||||
"io_netty_netty_transport": "mvn:io.netty:netty-transport:4.1.34.Final",
|
||||
"io_netty_netty_transport_native_unix_common": "mvn:io.netty:netty-transport-native-unix-common:4.1.34.Final",
|
||||
"io_netty_netty_transport-native-epoll": "mvn:io.netty:netty-transport-native-epoll:4.1.34.Final",
|
||||
"io_netty_netty_resolver": "mvn:io.netty:netty-resolver:4.1.34.Final",
|
||||
"io_netty_netty_codec-http2": "mvn:io.netty:netty-codec-http2:4.1.34.Final",
|
||||
"io_netty_netty_codec-http": "mvn:io.netty:netty-codec-http:4.1.34.Final",
|
||||
"io_netty_netty_codec-socks": "mvn:io.netty:netty-codec-socks:4.1.34.Final",
|
||||
"io_netty_netty_tcnative_boringssl": "mvn:io.netty:netty-tcnative-boringssl-static:2.0.22.Final",
|
||||
"objenesis": "mvn:org.objenesis:objenesis:2.6",
|
||||
"openflowj": "mvn:org.onosproject:openflowj:3.2.1.onos",
|
||||
"org.osgi.util.function": "mvn:org.osgi:org.osgi.util.function:1.1.0",
|
||||
@ -275,8 +275,8 @@
|
||||
"validation-api": "mvn:javax.validation:validation-api:1.1.0.Final",
|
||||
"checkstyle": "mvn:com.puppycrawl.tools:checkstyle:8.10",
|
||||
"apache-karaf": "http://repo1.maven.org/maven2/org/onosproject/apache-karaf-offline/4.2.5-offline-201904251/apache-karaf-4.2.5-offline-201904251.tar.gz",
|
||||
"bndlib": "mvn:biz.aQute.bnd:biz.aQute.bndlib:jar:4.0.0",
|
||||
"bndexe": "mvn:biz.aQute.bnd:biz.aQute.bnd:4.0.0",
|
||||
"bndlib": "mvn:biz.aQute.bnd:biz.aQute.bndlib:jar:4.1.0",
|
||||
"bndexe": "mvn:biz.aQute.bnd:biz.aQute.bnd:4.1.0",
|
||||
"libthrift": "mvn:org.apache.thrift:libthrift:0.11.0",
|
||||
"qdox": "mvn:com.thoughtworks.qdox:qdox:2.0-M3",
|
||||
"snmp-core": "mvn:org.onosproject:snmp-core:1.3-20161021.1",
|
||||
@ -290,12 +290,12 @@
|
||||
|
||||
// grpc related jars
|
||||
"com_google_api_grpc_proto_google_common_protos": "mvn:com.google.api.grpc:proto-google-common-protos:1.12.0",
|
||||
"com_google_errorprone_error_prone_annotations": "mvn:com.google.errorprone:error_prone_annotations:2.3.2",
|
||||
"com_google_auth_google_auth_library_credentials": "mvn:com.google.auth:google-auth-library-credentials:0.9.0",
|
||||
"com_google_auth_google_auth_library_oauth2_http": "mvn:com.google.auth:google-auth-library-oauth2-http:0.9.0",
|
||||
"com_google_errorprone_error_prone_annotations": "mvn:com.google.errorprone:error_prone_annotations:2.3.3",
|
||||
"com_google_auth_google_auth_library_credentials": "mvn:com.google.auth:google-auth-library-credentials:0.13.0",
|
||||
"com_google_auth_google_auth_library_oauth2_http": "mvn:com.google.auth:google-auth-library-oauth2-http:0.13.0",
|
||||
"com_google_j2objc_j2objc_annotations": "mvn:com.google.j2objc:j2objc-annotations:1.1",
|
||||
"io_opencensus_opencensus_api": "mvn:io.opencensus:opencensus-api:0.18.0",
|
||||
"io_opencensus_opencensus_contrib_grpc_metrics": "mvn:io.opencensus:opencensus-contrib-grpc-metrics:0.18.0",
|
||||
"io_opencensus_opencensus_api": "mvn:io.opencensus:opencensus-api:0.21.0",
|
||||
"io_opencensus_opencensus_contrib_grpc_metrics": "mvn:io.opencensus:opencensus-contrib-grpc-metrics:0.21.0",
|
||||
|
||||
// Openstack4j related jars
|
||||
"openstack4j-core": "mvn:org.pacesys:openstack4j-core:3.2.0",
|
||||
|
||||
@ -3,7 +3,7 @@ COMPILE_DEPS = CORE_DEPS + KRYO + [
|
||||
"//protocols/gnmi/stub:onos-protocols-gnmi-stub",
|
||||
"//protocols/grpc/api:onos-protocols-grpc-api",
|
||||
"//protocols/grpc/ctl:onos-protocols-grpc-ctl",
|
||||
"//lib:io_grpc_grpc_core_context",
|
||||
"//lib:io_grpc_grpc_api_context",
|
||||
"//lib:com_google_protobuf_protobuf_java",
|
||||
"//lib:io_grpc_grpc_netty",
|
||||
"//lib:io_grpc_grpc_protobuf_lite",
|
||||
@ -13,7 +13,7 @@ COMPILE_DEPS = CORE_DEPS + KRYO + [
|
||||
|
||||
TEST_DEPS = TEST + [
|
||||
"@minimal_json//jar",
|
||||
"//lib:io_grpc_grpc_core_context",
|
||||
"//lib:io_grpc_grpc_api_context",
|
||||
"//lib:io_grpc_grpc_protobuf_lite",
|
||||
]
|
||||
|
||||
|
||||
@ -3,7 +3,7 @@ COMPILE_DEPS = CORE_DEPS + KRYO + [
|
||||
"//protocols/gnoi/stub:onos-protocols-gnoi-stub",
|
||||
"//protocols/grpc/api:onos-protocols-grpc-api",
|
||||
"//protocols/grpc/ctl:onos-protocols-grpc-ctl",
|
||||
"//lib:io_grpc_grpc_core_context",
|
||||
"//lib:io_grpc_grpc_api_context",
|
||||
"//lib:com_google_protobuf_protobuf_java",
|
||||
"//lib:io_grpc_grpc_netty",
|
||||
"//lib:io_grpc_grpc_protobuf_lite",
|
||||
@ -13,7 +13,7 @@ COMPILE_DEPS = CORE_DEPS + KRYO + [
|
||||
|
||||
TEST_DEPS = TEST + [
|
||||
"@minimal_json//jar",
|
||||
"//lib:io_grpc_grpc_core_context",
|
||||
"//lib:io_grpc_grpc_api_context",
|
||||
"//lib:io_grpc_grpc_protobuf_lite",
|
||||
]
|
||||
|
||||
|
||||
@ -3,7 +3,11 @@ BUNDLES = [
|
||||
"//protocols/grpc/ctl:onos-protocols-grpc-ctl",
|
||||
"//protocols/grpc/utils:onos-protocols-grpc-utils",
|
||||
# gRPC dependencies (with patched core)
|
||||
"//lib:io_grpc_grpc_core_context",
|
||||
"//lib:io_grpc_grpc_api_context",
|
||||
"//lib:io_grpc_grpc_core_internal",
|
||||
"//lib:io_grpc_grpc_core_inprocess",
|
||||
"//lib:io_grpc_grpc_core_util",
|
||||
"//lib:io_grpc_grpc_core_perfmark",
|
||||
"//lib:io_grpc_grpc_stub",
|
||||
"//lib:io_grpc_grpc_netty",
|
||||
"//lib:io_grpc_grpc_auth",
|
||||
|
||||
@ -1,3 +1,3 @@
|
||||
osgi_jar(
|
||||
deps = CORE_DEPS + ["//lib:io_grpc_grpc_core_context"],
|
||||
deps = CORE_DEPS + ["//lib:io_grpc_grpc_api_context"],
|
||||
)
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
COMPILE_DEPS = CORE_DEPS + [
|
||||
"//protocols/grpc/api:onos-protocols-grpc-api",
|
||||
"//lib:io_grpc_grpc_core_context",
|
||||
"//lib:io_grpc_grpc_api_context",
|
||||
"//lib:io_grpc_grpc_core_internal",
|
||||
"//lib:io_grpc_grpc_netty",
|
||||
"//lib:io_grpc_grpc_protobuf_lite",
|
||||
"//lib:com_google_protobuf_protobuf_java",
|
||||
|
||||
@ -17,8 +17,12 @@
|
||||
package org.onosproject.grpc.ctl;
|
||||
|
||||
import com.google.common.util.concurrent.Striped;
|
||||
import io.grpc.LoadBalancerRegistry;
|
||||
import io.grpc.ManagedChannel;
|
||||
import io.grpc.ManagedChannelBuilder;
|
||||
import io.grpc.NameResolverRegistry;
|
||||
import io.grpc.internal.DnsNameResolverProvider;
|
||||
import io.grpc.internal.PickFirstLoadBalancerProvider;
|
||||
import io.grpc.netty.GrpcSslContexts;
|
||||
import io.grpc.netty.NettyChannelBuilder;
|
||||
import io.netty.handler.ssl.SslContext;
|
||||
@ -68,6 +72,11 @@ public class GrpcChannelControllerImpl implements GrpcChannelController {
|
||||
private static final int DEFAULT_MAX_INBOUND_MSG_SIZE = 256; // Megabytes.
|
||||
private static final int MEGABYTES = 1024 * 1024;
|
||||
|
||||
private static final PickFirstLoadBalancerProvider PICK_FIRST_LOAD_BALANCER_PROVIDER =
|
||||
new PickFirstLoadBalancerProvider();
|
||||
private static final DnsNameResolverProvider DNS_NAME_RESOLVER_PROVIDER =
|
||||
new DnsNameResolverProvider();
|
||||
|
||||
@Reference(cardinality = ReferenceCardinality.MANDATORY)
|
||||
protected ComponentConfigService componentConfigService;
|
||||
|
||||
@ -89,6 +98,10 @@ public class GrpcChannelControllerImpl implements GrpcChannelController {
|
||||
componentConfigService.registerProperties(getClass());
|
||||
channels = new ConcurrentHashMap<>();
|
||||
interceptors = new ConcurrentHashMap<>();
|
||||
LoadBalancerRegistry.getDefaultRegistry()
|
||||
.register(PICK_FIRST_LOAD_BALANCER_PROVIDER);
|
||||
NameResolverRegistry.getDefaultRegistry()
|
||||
.register(DNS_NAME_RESOLVER_PROVIDER);
|
||||
log.info("Started");
|
||||
}
|
||||
|
||||
@ -105,6 +118,10 @@ public class GrpcChannelControllerImpl implements GrpcChannelController {
|
||||
|
||||
@Deactivate
|
||||
public void deactivate() {
|
||||
LoadBalancerRegistry.getDefaultRegistry()
|
||||
.deregister(PICK_FIRST_LOAD_BALANCER_PROVIDER);
|
||||
NameResolverRegistry.getDefaultRegistry()
|
||||
.register(DNS_NAME_RESOLVER_PROVIDER);
|
||||
componentConfigService.unregisterProperties(getClass(), false);
|
||||
channels.values().forEach(ManagedChannel::shutdownNow);
|
||||
channels.clear();
|
||||
@ -162,9 +179,12 @@ public class GrpcChannelControllerImpl implements GrpcChannelController {
|
||||
final boolean useTls = channelUri.getScheme().equals(GRPCS);
|
||||
|
||||
final NettyChannelBuilder channelBuilder = NettyChannelBuilder
|
||||
.forAddress(channelUri.getHost(),
|
||||
channelUri.getPort())
|
||||
.maxInboundMessageSize(DEFAULT_MAX_INBOUND_MSG_SIZE * MEGABYTES);
|
||||
.forAddress(channelUri.getHost(), channelUri.getPort())
|
||||
.nameResolverFactory(DNS_NAME_RESOLVER_PROVIDER)
|
||||
.defaultLoadBalancingPolicy(
|
||||
PICK_FIRST_LOAD_BALANCER_PROVIDER.getPolicyName())
|
||||
.maxInboundMessageSize(
|
||||
DEFAULT_MAX_INBOUND_MSG_SIZE * MEGABYTES);
|
||||
|
||||
if (useTls) {
|
||||
try {
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
COMPILE_DEPS = CORE_DEPS + [
|
||||
"//protocols/grpc/api:onos-protocols-grpc-api",
|
||||
"//lib:io_grpc_grpc_core_context",
|
||||
"//lib:io_grpc_grpc_api_context",
|
||||
]
|
||||
|
||||
osgi_jar(
|
||||
|
||||
@ -90,12 +90,7 @@ public abstract class AbstractGrpcHandshaker
|
||||
.orElseThrow(() -> new IllegalStateException(
|
||||
"Missing gRPC channel in controller"));
|
||||
} else {
|
||||
try {
|
||||
channel = channelController.create(netcfgUri);
|
||||
} catch (IllegalArgumentException ex) {
|
||||
throw new IllegalStateException(
|
||||
"A gRPC channel with same URI already exists", ex);
|
||||
}
|
||||
channel = channelController.create(netcfgUri);
|
||||
// Store channel URI for future use.
|
||||
CHANNEL_URIS.put(deviceId, netcfgUri);
|
||||
// Trigger connection.
|
||||
@ -178,7 +173,7 @@ public abstract class AbstractGrpcHandshaker
|
||||
.removeDeviceAgentListener(data().deviceId(), providerId);
|
||||
}
|
||||
|
||||
private void resetChannelConnectBackoffIfNeeded() {
|
||||
private void resetChannelConnectBackoffIfNeeded() {
|
||||
// Stimulate channel reconnect if in failure state.
|
||||
final ManagedChannel channel = getExistingChannel();
|
||||
if (channel == null) {
|
||||
@ -186,7 +181,7 @@ public abstract class AbstractGrpcHandshaker
|
||||
return;
|
||||
}
|
||||
if (channel.getState(false)
|
||||
.equals(ConnectivityState.TRANSIENT_FAILURE)) {
|
||||
.equals(ConnectivityState.TRANSIENT_FAILURE)) {
|
||||
channel.resetConnectBackoff();
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
COMPILE_DEPS = CORE_DEPS + [
|
||||
"//protocols/grpc/api:onos-protocols-grpc-api",
|
||||
"//lib:io_grpc_grpc_core_context",
|
||||
"//lib:io_grpc_grpc_api_context",
|
||||
]
|
||||
|
||||
TEST_DEPS = TEST + [
|
||||
|
||||
@ -5,7 +5,7 @@ COMPILE_DEPS = CORE_DEPS + KRYO + [
|
||||
"//protocols/p4runtime/api:onos-protocols-p4runtime-api",
|
||||
"//protocols/p4runtime/proto:onos-protocols-p4runtime-proto",
|
||||
"//lib:com_google_protobuf_protobuf_java",
|
||||
"//lib:io_grpc_grpc_core_context",
|
||||
"//lib:io_grpc_grpc_api_context",
|
||||
"//lib:io_grpc_grpc_netty",
|
||||
"//lib:io_grpc_grpc_protobuf_lite",
|
||||
"//lib:io_grpc_grpc_stub",
|
||||
@ -14,7 +14,9 @@ COMPILE_DEPS = CORE_DEPS + KRYO + [
|
||||
|
||||
TEST_DEPS = TEST + [
|
||||
"@minimal_json//jar",
|
||||
"//lib:io_grpc_grpc_core_context",
|
||||
"//lib:io_grpc_grpc_api_context",
|
||||
"//lib:io_grpc_grpc_core_internal",
|
||||
"//lib:io_grpc_grpc_core_inprocess",
|
||||
"//lib:io_grpc_grpc_protobuf_lite",
|
||||
]
|
||||
|
||||
|
||||
@ -16,12 +16,12 @@
|
||||
|
||||
def check_bazel_version():
|
||||
if "bazel_version" not in dir(native):
|
||||
fail("\nBazel version is too old; please use 0.19.* official release!\n\n")
|
||||
fail("\nBazel version is too old; please use 0.23.* official release!\n\n")
|
||||
elif not native.bazel_version:
|
||||
print("\nBazel is not a release version; please use 0.19.* official release!\n\n")
|
||||
print("\nBazel is not a release version; please use 0.23.* official release!\n\n")
|
||||
return
|
||||
|
||||
versions = native.bazel_version.split(".")
|
||||
if not int(versions[1]) >= 19:
|
||||
fail("\nBazel version %s is not supported; please use 0.19.* official release!\n\n" %
|
||||
if not int(versions[1]) >= 23:
|
||||
fail("\nBazel version %s is not supported; please use 0.23.* official release!\n\n" %
|
||||
native.bazel_version)
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
# ***** This file was auto-generated at Thu, 25 Apr 2019 21:24:45 GMT. Do not edit this file manually. *****
|
||||
# ***** This file was auto-generated at Wed, 29 May 2019 22:17:30 GMT. Do not edit this file manually. *****
|
||||
# ***** Use onos-lib-gen *****
|
||||
|
||||
load("//tools/build/bazel:variables.bzl", "ONOS_GROUP_ID", "ONOS_VERSION")
|
||||
@ -69,7 +69,7 @@ TEST_REST = [] + TEST_ADAPTERS + [
|
||||
"@hk2_utils//jar",
|
||||
"@javax_inject//jar",
|
||||
"@hk2_osgi_resource_locator//jar",
|
||||
"@javax_annotation_api_mvn//jar",
|
||||
"@javax_annotation_javax_annotation_api//jar",
|
||||
"@validation_api//jar",
|
||||
"//core/common:onos-core-common",
|
||||
"//core/api:onos-api-tests",
|
||||
@ -472,9 +472,9 @@ def generated_maven_jars():
|
||||
jar_sha256 = "adc1c495e9c7286bfa1d861ca07e06c8d0980057ad981b48b04f68eb8dcade2c",
|
||||
licenses = ["notice"],
|
||||
jar_urls = ["http://repo1.maven.org/maven2/com/fasterxml/jackson/dataformat/jackson-dataformat-yaml/2.9.5/jackson-dataformat-yaml-2.9.5.jar"], )
|
||||
if "javax_annotation_api_mvn" not in native.existing_rules():
|
||||
if "javax_annotation_javax_annotation_api" not in native.existing_rules():
|
||||
java_import_external(
|
||||
name = "javax_annotation_api_mvn",
|
||||
name = "javax_annotation_javax_annotation_api",
|
||||
jar_sha256 = "f43f8ca10941606fb675785286981c166be1393f584020ffd965c6863f62232c",
|
||||
licenses = ["notice"],
|
||||
jar_urls = ["http://repo1.maven.org/maven2/javax/annotation/javax.annotation-api/1.3/javax.annotation-api-1.3.jar"], )
|
||||
@ -739,81 +739,81 @@ def generated_maven_jars():
|
||||
if "io_netty_netty_buffer" not in native.existing_rules():
|
||||
java_import_external(
|
||||
name = "io_netty_netty_buffer",
|
||||
jar_sha256 = "8ac0e30048636bd79ae205c4f9f5d7544290abd3a7ed39d8b6d97dfe3795afc1",
|
||||
jar_sha256 = "39dfe88df8505fd01fbf9c1dbb6b6fa9b0297e453c3dc4ce039ea578aea2eaa3",
|
||||
licenses = ["notice"],
|
||||
jar_urls = ["http://repo1.maven.org/maven2/io/netty/netty-buffer/4.1.32.Final/netty-buffer-4.1.32.Final.jar"], )
|
||||
jar_urls = ["http://repo1.maven.org/maven2/io/netty/netty-buffer/4.1.34.Final/netty-buffer-4.1.34.Final.jar"], )
|
||||
if "io_netty_netty_codec" not in native.existing_rules():
|
||||
java_import_external(
|
||||
name = "io_netty_netty_codec",
|
||||
jar_sha256 = "dbd6cea7d7bf5a2604e87337cb67c9468730d599be56511ed0979aacb309f879",
|
||||
jar_sha256 = "52e9eeb3638a8ed0911c72a508c05fa4f9d3391125eae46f287d3a8a0776211d",
|
||||
licenses = ["notice"],
|
||||
jar_urls = ["http://repo1.maven.org/maven2/io/netty/netty-codec/4.1.32.Final/netty-codec-4.1.32.Final.jar"], )
|
||||
jar_urls = ["http://repo1.maven.org/maven2/io/netty/netty-codec/4.1.34.Final/netty-codec-4.1.34.Final.jar"], )
|
||||
if "io_netty_netty_common" not in native.existing_rules():
|
||||
java_import_external(
|
||||
name = "io_netty_netty_common",
|
||||
jar_sha256 = "cc993e660f8f8e3b033f1d25a9e2f70151666bdf878d460a6508cb23daa696dc",
|
||||
jar_sha256 = "122931117eacf370b054d0e8a2411efa81de4956a6c3f938b0f0eb915969a425",
|
||||
licenses = ["notice"],
|
||||
jar_urls = ["http://repo1.maven.org/maven2/io/netty/netty-common/4.1.32.Final/netty-common-4.1.32.Final.jar"], )
|
||||
jar_urls = ["http://repo1.maven.org/maven2/io/netty/netty-common/4.1.34.Final/netty-common-4.1.34.Final.jar"], )
|
||||
if "io_netty_netty_handler" not in native.existing_rules():
|
||||
java_import_external(
|
||||
name = "io_netty_netty_handler",
|
||||
jar_sha256 = "07d9756e48b5f6edc756e33e8b848fb27ff0b1ae087dab5addca6c6bf17cac2d",
|
||||
jar_sha256 = "035616801fe9894ca2490832cf9976536dac740f41e90de1cdd4ba46f04263d1",
|
||||
licenses = ["notice"],
|
||||
jar_urls = ["http://repo1.maven.org/maven2/io/netty/netty-handler/4.1.32.Final/netty-handler-4.1.32.Final.jar"], )
|
||||
jar_urls = ["http://repo1.maven.org/maven2/io/netty/netty-handler/4.1.34.Final/netty-handler-4.1.34.Final.jar"], )
|
||||
if "io_netty_netty_handler_proxy" not in native.existing_rules():
|
||||
java_import_external(
|
||||
name = "io_netty_netty_handler_proxy",
|
||||
jar_sha256 = "10d1081ed114bb0e76ebbb5331b66a6c3189cbdefdba232733fc9ca308a6ea34",
|
||||
jar_sha256 = "f506c6acb97b3e0b0795cf9f0971d80bbab7c17086312fa225b98ccc94be6dff",
|
||||
licenses = ["notice"],
|
||||
jar_urls = ["http://repo1.maven.org/maven2/io/netty/netty-handler-proxy/4.1.32.Final/netty-handler-proxy-4.1.32.Final.jar"], )
|
||||
jar_urls = ["http://repo1.maven.org/maven2/io/netty/netty-handler-proxy/4.1.34.Final/netty-handler-proxy-4.1.34.Final.jar"], )
|
||||
if "io_netty_netty_transport" not in native.existing_rules():
|
||||
java_import_external(
|
||||
name = "io_netty_netty_transport",
|
||||
jar_sha256 = "175bae0d227d7932c0c965c983efbb3cf01f39abe934f5c4071d0319784715fb",
|
||||
jar_sha256 = "2b3f7d3a595101def7d411793a675bf2a325964475fd7bdbbe448e908de09445",
|
||||
licenses = ["notice"],
|
||||
jar_urls = ["http://repo1.maven.org/maven2/io/netty/netty-transport/4.1.32.Final/netty-transport-4.1.32.Final.jar"], )
|
||||
jar_urls = ["http://repo1.maven.org/maven2/io/netty/netty-transport/4.1.34.Final/netty-transport-4.1.34.Final.jar"], )
|
||||
if "io_netty_netty_transport_native_unix_common" not in native.existing_rules():
|
||||
java_import_external(
|
||||
name = "io_netty_netty_transport_native_unix_common",
|
||||
jar_sha256 = "5c9d5b3b7ca6bcd8f7a40b1f93c96cf8a7fd2238d9d633e5f2b3f0577518074e",
|
||||
jar_sha256 = "f13a550511c8ee30fc0b7b2e687efc01478598c5f4fe525bd49e1a814fbe1bb9",
|
||||
licenses = ["notice"],
|
||||
jar_urls = ["http://repo1.maven.org/maven2/io/netty/netty-transport-native-unix-common/4.1.32.Final/netty-transport-native-unix-common-4.1.32.Final.jar"], )
|
||||
jar_urls = ["http://repo1.maven.org/maven2/io/netty/netty-transport-native-unix-common/4.1.34.Final/netty-transport-native-unix-common-4.1.34.Final.jar"], )
|
||||
if "io_netty_netty_transport_native_epoll" not in native.existing_rules():
|
||||
java_import_external(
|
||||
name = "io_netty_netty_transport_native_epoll",
|
||||
jar_sha256 = "4702dfaaf295883eb342550d7b52e4e0491bbae6dc3c81129904c5342ad7d8b3",
|
||||
jar_sha256 = "e0291026cd09fd1b3496bc7f41144701e5c344533bef71b162fcae8cb7c6331c",
|
||||
licenses = ["notice"],
|
||||
jar_urls = ["http://repo1.maven.org/maven2/io/netty/netty-transport-native-epoll/4.1.32.Final/netty-transport-native-epoll-4.1.32.Final.jar"], )
|
||||
jar_urls = ["http://repo1.maven.org/maven2/io/netty/netty-transport-native-epoll/4.1.34.Final/netty-transport-native-epoll-4.1.34.Final.jar"], )
|
||||
if "io_netty_netty_resolver" not in native.existing_rules():
|
||||
java_import_external(
|
||||
name = "io_netty_netty_resolver",
|
||||
jar_sha256 = "9b4a19982047a95ea4791a7ad7ad385c7a08c2ac75f0a3509cc213cb32a726ae",
|
||||
jar_sha256 = "774221ed4c130b532865770b10630bc12d0d400127da617ee0ac8de2a7ac2097",
|
||||
licenses = ["notice"],
|
||||
jar_urls = ["http://repo1.maven.org/maven2/io/netty/netty-resolver/4.1.32.Final/netty-resolver-4.1.32.Final.jar"], )
|
||||
jar_urls = ["http://repo1.maven.org/maven2/io/netty/netty-resolver/4.1.34.Final/netty-resolver-4.1.34.Final.jar"], )
|
||||
if "io_netty_netty_codec_http2" not in native.existing_rules():
|
||||
java_import_external(
|
||||
name = "io_netty_netty_codec_http2",
|
||||
jar_sha256 = "4d4c6cfc1f19efb969b9b0ae6cc977462d202867f7dcfee6e9069977e623a2f5",
|
||||
jar_sha256 = "319f66f3ab0d3aac3477febf19c259990ee8c639fc7da8822dfa58e7dab1bdcf",
|
||||
licenses = ["notice"],
|
||||
jar_urls = ["http://repo1.maven.org/maven2/io/netty/netty-codec-http2/4.1.32.Final/netty-codec-http2-4.1.32.Final.jar"], )
|
||||
jar_urls = ["http://repo1.maven.org/maven2/io/netty/netty-codec-http2/4.1.34.Final/netty-codec-http2-4.1.34.Final.jar"], )
|
||||
if "io_netty_netty_codec_http" not in native.existing_rules():
|
||||
java_import_external(
|
||||
name = "io_netty_netty_codec_http",
|
||||
jar_sha256 = "db2c22744f6a4950d1817e4e1a26692e53052c5d54abe6cceecd7df33f4eaac3",
|
||||
jar_sha256 = "5df5556ef6b0e7ce7c72a359e4ca774fcdf8d8fe12f0b6332715eaa44cfe41f8",
|
||||
licenses = ["notice"],
|
||||
jar_urls = ["http://repo1.maven.org/maven2/io/netty/netty-codec-http/4.1.32.Final/netty-codec-http-4.1.32.Final.jar"], )
|
||||
jar_urls = ["http://repo1.maven.org/maven2/io/netty/netty-codec-http/4.1.34.Final/netty-codec-http-4.1.34.Final.jar"], )
|
||||
if "io_netty_netty_codec_socks" not in native.existing_rules():
|
||||
java_import_external(
|
||||
name = "io_netty_netty_codec_socks",
|
||||
jar_sha256 = "fe2f2e97d6c65dc280623dcfd24337d8a5c7377049c120842f2c59fb83d7408a",
|
||||
jar_sha256 = "9c4ff58b648193942654db20f172d017441625754b902394f620f04074830346",
|
||||
licenses = ["notice"],
|
||||
jar_urls = ["http://repo1.maven.org/maven2/io/netty/netty-codec-socks/4.1.32.Final/netty-codec-socks-4.1.32.Final.jar"], )
|
||||
jar_urls = ["http://repo1.maven.org/maven2/io/netty/netty-codec-socks/4.1.34.Final/netty-codec-socks-4.1.34.Final.jar"], )
|
||||
if "io_netty_netty_tcnative_boringssl" not in native.existing_rules():
|
||||
java_import_external(
|
||||
name = "io_netty_netty_tcnative_boringssl",
|
||||
jar_sha256 = "c0bbfcb116ae9928ebb17cbfbdd80ee51980ad228a4fffb0cb3137ac91b1bc09",
|
||||
jar_sha256 = "382fef183d2dbb991e2c4ac8c9749673aa90ca1ce3cebf3301533beb664bf92f",
|
||||
licenses = ["notice"],
|
||||
jar_urls = ["http://repo1.maven.org/maven2/io/netty/netty-tcnative-boringssl-static/2.0.20.Final/netty-tcnative-boringssl-static-2.0.20.Final.jar"], )
|
||||
jar_urls = ["http://repo1.maven.org/maven2/io/netty/netty-tcnative-boringssl-static/2.0.22.Final/netty-tcnative-boringssl-static-2.0.22.Final.jar"], )
|
||||
if "objenesis" not in native.existing_rules():
|
||||
java_import_external(
|
||||
name = "objenesis",
|
||||
@ -1015,15 +1015,15 @@ def generated_maven_jars():
|
||||
if "bndlib" not in native.existing_rules():
|
||||
java_import_external(
|
||||
name = "bndlib",
|
||||
jar_sha256 = "d1a328c8f63aea4f7ce6028a49255137664a7138fadc4af9d25461192b71e098",
|
||||
jar_sha256 = "dfa48c53c124a41e8a21198b49e4a4d68620f2df8a545f9bcdca8c9f5bb5b14c",
|
||||
licenses = ["notice"],
|
||||
jar_urls = ["http://repo1.maven.org/maven2/biz/aQute/bnd/biz.aQute.bndlib/4.0.0/biz.aQute.bndlib-4.0.0.jar"], )
|
||||
jar_urls = ["http://repo1.maven.org/maven2/biz/aQute/bnd/biz.aQute.bndlib/4.1.0/biz.aQute.bndlib-4.1.0.jar"], )
|
||||
if "bndexe" not in native.existing_rules():
|
||||
java_import_external(
|
||||
name = "bndexe",
|
||||
jar_sha256 = "b18d88ae15db4bf7af53c396feb45a64f27403d7e7d7cd50a68bf8915ca7b6c0",
|
||||
jar_sha256 = "5ad18a5a8702fcfe42d5180ee4ba33cf4728d5f68055b2d3755a86222afac462",
|
||||
licenses = ["notice"],
|
||||
jar_urls = ["http://repo1.maven.org/maven2/biz/aQute/bnd/biz.aQute.bnd/4.0.0/biz.aQute.bnd-4.0.0.jar"], )
|
||||
jar_urls = ["http://repo1.maven.org/maven2/biz/aQute/bnd/biz.aQute.bnd/4.1.0/biz.aQute.bnd-4.1.0.jar"], )
|
||||
if "libthrift" not in native.existing_rules():
|
||||
java_import_external(
|
||||
name = "libthrift",
|
||||
@ -1087,21 +1087,21 @@ def generated_maven_jars():
|
||||
if "com_google_errorprone_error_prone_annotations" not in native.existing_rules():
|
||||
java_import_external(
|
||||
name = "com_google_errorprone_error_prone_annotations",
|
||||
jar_sha256 = "357cd6cfb067c969226c442451502aee13800a24e950fdfde77bcdb4565a668d",
|
||||
jar_sha256 = "ec59f1b702d9afc09e8c3929f5c42777dec623a6ea2731ac694332c7d7680f5a",
|
||||
licenses = ["notice"],
|
||||
jar_urls = ["http://repo1.maven.org/maven2/com/google/errorprone/error_prone_annotations/2.3.2/error_prone_annotations-2.3.2.jar"], )
|
||||
jar_urls = ["http://repo1.maven.org/maven2/com/google/errorprone/error_prone_annotations/2.3.3/error_prone_annotations-2.3.3.jar"], )
|
||||
if "com_google_auth_google_auth_library_credentials" not in native.existing_rules():
|
||||
java_import_external(
|
||||
name = "com_google_auth_google_auth_library_credentials",
|
||||
jar_sha256 = "ac9efdd6a930e4df906fa278576fa825d979f74315f2faf5c91fe7e6aabb2788",
|
||||
jar_sha256 = "e117279c52c41b66937a5adae41dfeae0e40e48ae40230d2edeb4adc28ed996c",
|
||||
licenses = ["notice"],
|
||||
jar_urls = ["http://repo1.maven.org/maven2/com/google/auth/google-auth-library-credentials/0.9.0/google-auth-library-credentials-0.9.0.jar"], )
|
||||
jar_urls = ["http://repo1.maven.org/maven2/com/google/auth/google-auth-library-credentials/0.13.0/google-auth-library-credentials-0.13.0.jar"], )
|
||||
if "com_google_auth_google_auth_library_oauth2_http" not in native.existing_rules():
|
||||
java_import_external(
|
||||
name = "com_google_auth_google_auth_library_oauth2_http",
|
||||
jar_sha256 = "e55d9722102cc1245c8c43d69acd49d3c9bbfcc1bcf722e971425506b970097e",
|
||||
jar_sha256 = "62551f27379f873962e410328fc10a11a2b8f5df7c232e3cbe96a1b5edadf1ba",
|
||||
licenses = ["notice"],
|
||||
jar_urls = ["http://repo1.maven.org/maven2/com/google/auth/google-auth-library-oauth2-http/0.9.0/google-auth-library-oauth2-http-0.9.0.jar"], )
|
||||
jar_urls = ["http://repo1.maven.org/maven2/com/google/auth/google-auth-library-oauth2-http/0.13.0/google-auth-library-oauth2-http-0.13.0.jar"], )
|
||||
if "com_google_j2objc_j2objc_annotations" not in native.existing_rules():
|
||||
java_import_external(
|
||||
name = "com_google_j2objc_j2objc_annotations",
|
||||
@ -1111,15 +1111,15 @@ def generated_maven_jars():
|
||||
if "io_opencensus_opencensus_api" not in native.existing_rules():
|
||||
java_import_external(
|
||||
name = "io_opencensus_opencensus_api",
|
||||
jar_sha256 = "45421ffe95271aba94686ed8d4c5070fe77dc2ff0b922688097f0dd40f1931b1",
|
||||
jar_sha256 = "8e2cb0f6391d8eb0a1bcd01e7748883f0033b1941754f4ed3f19d2c3e4276fc8",
|
||||
licenses = ["notice"],
|
||||
jar_urls = ["http://repo1.maven.org/maven2/io/opencensus/opencensus-api/0.18.0/opencensus-api-0.18.0.jar"], )
|
||||
jar_urls = ["http://repo1.maven.org/maven2/io/opencensus/opencensus-api/0.21.0/opencensus-api-0.21.0.jar"], )
|
||||
if "io_opencensus_opencensus_contrib_grpc_metrics" not in native.existing_rules():
|
||||
java_import_external(
|
||||
name = "io_opencensus_opencensus_contrib_grpc_metrics",
|
||||
jar_sha256 = "1f90585e777b1e0493dbf22e678303369a8d5b7c750b4eda070a34ca99271607",
|
||||
jar_sha256 = "29fc79401082301542cab89d7054d2f0825f184492654c950020553ef4ff0ef8",
|
||||
licenses = ["notice"],
|
||||
jar_urls = ["http://repo1.maven.org/maven2/io/opencensus/opencensus-contrib-grpc-metrics/0.18.0/opencensus-contrib-grpc-metrics-0.18.0.jar"], )
|
||||
jar_urls = ["http://repo1.maven.org/maven2/io/opencensus/opencensus-contrib-grpc-metrics/0.21.0/opencensus-contrib-grpc-metrics-0.21.0.jar"], )
|
||||
if "openstack4j_core" not in native.existing_rules():
|
||||
java_import_external(
|
||||
name = "openstack4j_core",
|
||||
@ -1383,7 +1383,7 @@ artifact_map["@jackson_annotations//:jackson_annotations"] = "mvn:com.fasterxml.
|
||||
artifact_map["@jackson_core//:jackson_core"] = "mvn:com.fasterxml.jackson.core:jackson-core:jar:2.9.5"
|
||||
artifact_map["@jackson_databind//:jackson_databind"] = "mvn:com.fasterxml.jackson.core:jackson-databind:jar:2.9.5"
|
||||
artifact_map["@jackson_dataformat_yaml//:jackson_dataformat_yaml"] = "mvn:com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:jar:2.9.5"
|
||||
artifact_map["@javax_annotation_api_mvn//:javax_annotation_api_mvn"] = "mvn:javax.annotation:javax.annotation-api:jar:1.3"
|
||||
artifact_map["@javax_annotation_javax_annotation_api//:javax_annotation_javax_annotation_api"] = "mvn:javax.annotation:javax.annotation-api:jar:1.3"
|
||||
artifact_map["@javax_inject//:javax_inject"] = "mvn:org.glassfish.hk2.external:javax.inject:jar:2.5.0-b42"
|
||||
artifact_map["@javax_ws_rs_api//:javax_ws_rs_api"] = "mvn:javax.ws.rs:javax.ws.rs-api:jar:2.1"
|
||||
artifact_map["@javax_activation//:javax_activation"] = "mvn:javax.activation:activation:jar:NON-OSGI:1.1.1"
|
||||
@ -1427,19 +1427,19 @@ artifact_map["@metrics_json//:metrics_json"] = "mvn:io.dropwizard.metrics:metric
|
||||
artifact_map["@minimal_json//:minimal_json"] = "mvn:com.eclipsesource.minimal-json:minimal-json:jar:0.9.4"
|
||||
artifact_map["@minlog//:minlog"] = "mvn:com.esotericsoftware:minlog:jar:1.3.0"
|
||||
artifact_map["@io_netty_netty//:io_netty_netty"] = "mvn:io.netty:netty:jar:3.10.5.Final"
|
||||
artifact_map["@io_netty_netty_buffer//:io_netty_netty_buffer"] = "mvn:io.netty:netty-buffer:jar:4.1.32.Final"
|
||||
artifact_map["@io_netty_netty_codec//:io_netty_netty_codec"] = "mvn:io.netty:netty-codec:jar:4.1.32.Final"
|
||||
artifact_map["@io_netty_netty_common//:io_netty_netty_common"] = "mvn:io.netty:netty-common:jar:4.1.32.Final"
|
||||
artifact_map["@io_netty_netty_handler//:io_netty_netty_handler"] = "mvn:io.netty:netty-handler:jar:4.1.32.Final"
|
||||
artifact_map["@io_netty_netty_handler_proxy//:io_netty_netty_handler_proxy"] = "mvn:io.netty:netty-handler-proxy:jar:4.1.32.Final"
|
||||
artifact_map["@io_netty_netty_transport//:io_netty_netty_transport"] = "mvn:io.netty:netty-transport:jar:4.1.32.Final"
|
||||
artifact_map["@io_netty_netty_transport_native_unix_common//:io_netty_netty_transport_native_unix_common"] = "mvn:io.netty:netty-transport-native-unix-common:jar:4.1.32.Final"
|
||||
artifact_map["@io_netty_netty_transport_native_epoll//:io_netty_netty_transport_native_epoll"] = "mvn:io.netty:netty-transport-native-epoll:jar:4.1.32.Final"
|
||||
artifact_map["@io_netty_netty_resolver//:io_netty_netty_resolver"] = "mvn:io.netty:netty-resolver:jar:4.1.32.Final"
|
||||
artifact_map["@io_netty_netty_codec_http2//:io_netty_netty_codec_http2"] = "mvn:io.netty:netty-codec-http2:jar:4.1.32.Final"
|
||||
artifact_map["@io_netty_netty_codec_http//:io_netty_netty_codec_http"] = "mvn:io.netty:netty-codec-http:jar:4.1.32.Final"
|
||||
artifact_map["@io_netty_netty_codec_socks//:io_netty_netty_codec_socks"] = "mvn:io.netty:netty-codec-socks:jar:4.1.32.Final"
|
||||
artifact_map["@io_netty_netty_tcnative_boringssl//:io_netty_netty_tcnative_boringssl"] = "mvn:io.netty:netty-tcnative-boringssl-static:jar:2.0.20.Final"
|
||||
artifact_map["@io_netty_netty_buffer//:io_netty_netty_buffer"] = "mvn:io.netty:netty-buffer:jar:4.1.34.Final"
|
||||
artifact_map["@io_netty_netty_codec//:io_netty_netty_codec"] = "mvn:io.netty:netty-codec:jar:4.1.34.Final"
|
||||
artifact_map["@io_netty_netty_common//:io_netty_netty_common"] = "mvn:io.netty:netty-common:jar:4.1.34.Final"
|
||||
artifact_map["@io_netty_netty_handler//:io_netty_netty_handler"] = "mvn:io.netty:netty-handler:jar:4.1.34.Final"
|
||||
artifact_map["@io_netty_netty_handler_proxy//:io_netty_netty_handler_proxy"] = "mvn:io.netty:netty-handler-proxy:jar:4.1.34.Final"
|
||||
artifact_map["@io_netty_netty_transport//:io_netty_netty_transport"] = "mvn:io.netty:netty-transport:jar:4.1.34.Final"
|
||||
artifact_map["@io_netty_netty_transport_native_unix_common//:io_netty_netty_transport_native_unix_common"] = "mvn:io.netty:netty-transport-native-unix-common:jar:4.1.34.Final"
|
||||
artifact_map["@io_netty_netty_transport_native_epoll//:io_netty_netty_transport_native_epoll"] = "mvn:io.netty:netty-transport-native-epoll:jar:4.1.34.Final"
|
||||
artifact_map["@io_netty_netty_resolver//:io_netty_netty_resolver"] = "mvn:io.netty:netty-resolver:jar:4.1.34.Final"
|
||||
artifact_map["@io_netty_netty_codec_http2//:io_netty_netty_codec_http2"] = "mvn:io.netty:netty-codec-http2:jar:4.1.34.Final"
|
||||
artifact_map["@io_netty_netty_codec_http//:io_netty_netty_codec_http"] = "mvn:io.netty:netty-codec-http:jar:4.1.34.Final"
|
||||
artifact_map["@io_netty_netty_codec_socks//:io_netty_netty_codec_socks"] = "mvn:io.netty:netty-codec-socks:jar:4.1.34.Final"
|
||||
artifact_map["@io_netty_netty_tcnative_boringssl//:io_netty_netty_tcnative_boringssl"] = "mvn:io.netty:netty-tcnative-boringssl-static:jar:2.0.22.Final"
|
||||
artifact_map["@objenesis//:objenesis"] = "mvn:org.objenesis:objenesis:jar:2.6"
|
||||
artifact_map["@openflowj//:openflowj"] = "mvn:org.onosproject:openflowj:jar:3.2.1.onos"
|
||||
artifact_map["@org_osgi_util_function//:org_osgi_util_function"] = "mvn:org.osgi:org.osgi.util.function:jar:1.1.0"
|
||||
@ -1473,8 +1473,8 @@ artifact_map["@typesafe_config//:typesafe_config"] = "mvn:com.typesafe:config:ja
|
||||
artifact_map["@validation_api//:validation_api"] = "mvn:javax.validation:validation-api:jar:1.1.0.Final"
|
||||
artifact_map["@checkstyle//:checkstyle"] = "mvn:com.puppycrawl.tools:checkstyle:jar:NON-OSGI:8.10"
|
||||
artifact_map["@apache_karaf//:apache_karaf"] = "http://repo1.maven.org/maven2/org/onosproject/apache-karaf-offline/4.2.5-offline-201904251/apache-karaf-4.2.5-offline-201904251.tar.gz"
|
||||
artifact_map["@bndlib//:bndlib"] = "mvn:biz.aQute.bnd:biz.aQute.bndlib:jar:4.0.0"
|
||||
artifact_map["@bndexe//:bndexe"] = "mvn:biz.aQute.bnd:biz.aQute.bnd:jar:4.0.0"
|
||||
artifact_map["@bndlib//:bndlib"] = "mvn:biz.aQute.bnd:biz.aQute.bndlib:jar:4.1.0"
|
||||
artifact_map["@bndexe//:bndexe"] = "mvn:biz.aQute.bnd:biz.aQute.bnd:jar:4.1.0"
|
||||
artifact_map["@libthrift//:libthrift"] = "mvn:org.apache.thrift:libthrift:jar:0.11.0"
|
||||
artifact_map["@qdox//:qdox"] = "mvn:com.thoughtworks.qdox:qdox:jar:NON-OSGI:2.0-M3"
|
||||
artifact_map["@snmp_core//:snmp_core"] = "mvn:org.onosproject:snmp-core:jar:1.3-20161021.1"
|
||||
@ -1485,12 +1485,12 @@ artifact_map["@json//:json"] = "mvn:org.json:json:jar:NON-OSGI:20090211"
|
||||
artifact_map["@engine_io_client//:engine_io_client"] = "mvn:io.socket:engine.io-client:jar:NON-OSGI:0.8.3"
|
||||
artifact_map["@org_codehaus_mojo_animal_sniffer_annotations//:org_codehaus_mojo_animal_sniffer_annotations"] = "mvn:org.codehaus.mojo:animal-sniffer-annotations:jar:NON-OSGI:1.17"
|
||||
artifact_map["@com_google_api_grpc_proto_google_common_protos//:com_google_api_grpc_proto_google_common_protos"] = "mvn:com.google.api.grpc:proto-google-common-protos:jar:NON-OSGI:1.12.0"
|
||||
artifact_map["@com_google_errorprone_error_prone_annotations//:com_google_errorprone_error_prone_annotations"] = "mvn:com.google.errorprone:error_prone_annotations:jar:NON-OSGI:2.3.2"
|
||||
artifact_map["@com_google_auth_google_auth_library_credentials//:com_google_auth_google_auth_library_credentials"] = "mvn:com.google.auth:google-auth-library-credentials:jar:NON-OSGI:0.9.0"
|
||||
artifact_map["@com_google_auth_google_auth_library_oauth2_http//:com_google_auth_google_auth_library_oauth2_http"] = "mvn:com.google.auth:google-auth-library-oauth2-http:jar:NON-OSGI:0.9.0"
|
||||
artifact_map["@com_google_errorprone_error_prone_annotations//:com_google_errorprone_error_prone_annotations"] = "mvn:com.google.errorprone:error_prone_annotations:jar:NON-OSGI:2.3.3"
|
||||
artifact_map["@com_google_auth_google_auth_library_credentials//:com_google_auth_google_auth_library_credentials"] = "mvn:com.google.auth:google-auth-library-credentials:jar:NON-OSGI:0.13.0"
|
||||
artifact_map["@com_google_auth_google_auth_library_oauth2_http//:com_google_auth_google_auth_library_oauth2_http"] = "mvn:com.google.auth:google-auth-library-oauth2-http:jar:NON-OSGI:0.13.0"
|
||||
artifact_map["@com_google_j2objc_j2objc_annotations//:com_google_j2objc_j2objc_annotations"] = "mvn:com.google.j2objc:j2objc-annotations:jar:NON-OSGI:1.1"
|
||||
artifact_map["@io_opencensus_opencensus_api//:io_opencensus_opencensus_api"] = "mvn:io.opencensus:opencensus-api:jar:NON-OSGI:0.18.0"
|
||||
artifact_map["@io_opencensus_opencensus_contrib_grpc_metrics//:io_opencensus_opencensus_contrib_grpc_metrics"] = "mvn:io.opencensus:opencensus-contrib-grpc-metrics:jar:NON-OSGI:0.18.0"
|
||||
artifact_map["@io_opencensus_opencensus_api//:io_opencensus_opencensus_api"] = "mvn:io.opencensus:opencensus-api:jar:NON-OSGI:0.21.0"
|
||||
artifact_map["@io_opencensus_opencensus_contrib_grpc_metrics//:io_opencensus_opencensus_contrib_grpc_metrics"] = "mvn:io.opencensus:opencensus-contrib-grpc-metrics:jar:NON-OSGI:0.21.0"
|
||||
artifact_map["@openstack4j_core//:openstack4j_core"] = "mvn:org.pacesys:openstack4j-core:jar:3.2.0"
|
||||
artifact_map["@openstack4j_http_connector//:openstack4j_http_connector"] = "mvn:org.pacesys.openstack4j.connectors:openstack4j-http-connector:jar:3.2.0"
|
||||
artifact_map["@openstack4j_httpclient//:openstack4j_httpclient"] = "mvn:org.pacesys.openstack4j.connectors:openstack4j-httpclient:jar:3.2.0"
|
||||
|
||||
@ -1,13 +1,13 @@
|
||||
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
|
||||
|
||||
GRPC_JAVA_VERSION = "1.18.0"
|
||||
GRPC_SHA = "979cd1873c0f3aefa25f3d20336c023ce34471203bf2d954ad9e3158fc55c16b"
|
||||
GRPC_JAVA_VERSION = "1.21.0"
|
||||
GRPC_SHA = "eaad045e911587c03cae27364920bcb0c80fb0a37bac5f54eb94af9fa0391db3"
|
||||
|
||||
GAPIS_COMMIT = "37cc0e5acae50ee91f00827a7010c3b07dfa5311"
|
||||
GAPIS_SHA = "17d023f48ea290f25edaf25a967973b5a42ce6d71b1570862f302d95aa8b9f77"
|
||||
|
||||
def generate_grpc():
|
||||
# grpc-java fork that fixes the OSGi split problem.
|
||||
# grpc-java fork that fixes the OSGi split brain problem.
|
||||
http_archive(
|
||||
name = "io_grpc_grpc_java",
|
||||
urls = ["https://github.com/opennetworkinglab/grpc-java/archive/v%s-patched.zip" % GRPC_JAVA_VERSION],
|
||||
|
||||
@ -701,34 +701,41 @@ def osgi_proto_jar(
|
||||
karaf_command_packages = []):
|
||||
if name == None:
|
||||
name = _auto_name()
|
||||
proto_name = name + "-java-proto"
|
||||
native.java_proto_library(
|
||||
name = name + "-java-proto",
|
||||
name = proto_name,
|
||||
deps = proto_libs,
|
||||
)
|
||||
java_sources_alt(
|
||||
name = name + "-proto-srcjar",
|
||||
srcs = [":%s-java-proto" % name],
|
||||
name = proto_name + "-srcjar",
|
||||
srcs = [":" + proto_name],
|
||||
)
|
||||
osgi_srcs = [
|
||||
":%s-proto-srcjar" % name,
|
||||
proto_name + "-srcjar",
|
||||
]
|
||||
base_deps = [
|
||||
"//lib:com_google_protobuf_protobuf_java",
|
||||
]
|
||||
if grpc_proto_lib != None:
|
||||
grpc_name = name + "-java-grpc"
|
||||
java_grpc_library(
|
||||
name = name + "-java-grpc",
|
||||
name = grpc_name,
|
||||
srcs = [grpc_proto_lib],
|
||||
deps = [":%s-java-proto" % name],
|
||||
deps = [":" + proto_name],
|
||||
)
|
||||
java_sources_alt(
|
||||
name = grpc_name + "-srcjar",
|
||||
srcs = [":lib%s-src.jar" % grpc_name],
|
||||
)
|
||||
osgi_srcs.append(
|
||||
":%s-java-grpc__do_not_reference__srcjar" % name,
|
||||
":" + grpc_name + "-srcjar",
|
||||
)
|
||||
base_deps.extend([
|
||||
"@com_google_guava_guava//jar",
|
||||
"//lib:io_grpc_grpc_core_context",
|
||||
"//lib:io_grpc_grpc_api_context",
|
||||
"//lib:io_grpc_grpc_stub",
|
||||
"//lib:io_grpc_grpc_protobuf",
|
||||
"@javax_annotation_javax_annotation_api//jar",
|
||||
])
|
||||
osgi_jar(
|
||||
name = name,
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
|
||||
|
||||
PROTOBUF_VERSION = "3.6.1.3"
|
||||
SHA = "9510dd2afc29e7245e9e884336f848c8a6600a14ae726adb6befdb4f786f0be2"
|
||||
PROTOBUF_VERSION = "3.8.0"
|
||||
SHA = "1e622ce4b84b88b6d2cdf1db38d1a634fe2392d74f0b7b74ff98f3a51838ee53"
|
||||
|
||||
def generate_protobuf():
|
||||
http_archive(
|
||||
|
||||
@ -48,6 +48,6 @@
|
||||
//utils/rest:onlab-rest
|
||||
//web/api:onos-rest
|
||||
//lib:com_google_protobuf_protobuf_java
|
||||
//lib:io_grpc_grpc_core_context
|
||||
//lib:io_grpc_grpc_api_context
|
||||
//lib:io_grpc_grpc_stub
|
||||
//lib:io_grpc_grpc_protobuf
|
||||
|
||||
@ -68,7 +68,7 @@ osgi_feature(
|
||||
description = "ONOS 3rd party dependencies for web apps",
|
||||
included_bundles = [
|
||||
"@jersey_common//jar",
|
||||
"@javax_annotation_api_mvn//jar",
|
||||
"@javax_annotation_javax_annotation_api//jar",
|
||||
"@javax_ws_rs_api//jar",
|
||||
"@hk2_api//jar",
|
||||
"@hk2_locator//jar",
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user