From a6182a38808033c0170c3f6d9f4404ed15cc97fd Mon Sep 17 00:00:00 2001 From: "Aalyria Technologies, Inc" Date: Tue, 11 Jun 2024 19:22:55 +0000 Subject: [PATCH] Project import generated by Copybara. GitOrigin-RevId: f0619c08c7373225c74fb184b0ae2efea35bb327 --- MODULE.bazel | 2 +- WORKSPACE | 6 +- api/cdpi/v1alpha/BUILD | 5 +- api/common/network.proto | 71 ++++- api/common/telemetry.proto | 16 + api/federation/BUILD | 5 +- api/nbi/v1alpha/BUILD | 5 +- api/nbi/v1alpha/resources/BUILD | 4 + api/nbi/v1alpha/resources/intent.proto | 12 +- .../v1alpha/resources/network_element.proto | 26 +- api/nbi/v1alpha/resources/network_link.proto | 56 +++- api/scheduling/v1alpha/BUILD | 67 ++++ api/scheduling/v1alpha/scheduling.proto | 201 ++++++++++++ api/telemetry/BUILD | 60 ++++ api/telemetry/telemetry.proto | 298 ++++++++++++++++++ api/types/ietf.proto | 129 ++++---- bazel/bazel_downloader.cfg | 17 + cdpi_agent/agent.go | 2 +- cdpi_agent/internal/agentcli/BUILD | 2 +- cdpi_agent/internal/agentcli/agentcli.go | 4 +- cdpi_agent/internal/task/BUILD | 2 +- cdpi_agent/internal/task/task_test.go | 4 +- common.bazelrc | 7 +- tools/nbictl/connection.go | 2 +- 24 files changed, 904 insertions(+), 99 deletions(-) create mode 100644 api/scheduling/v1alpha/BUILD create mode 100644 api/scheduling/v1alpha/scheduling.proto create mode 100644 api/telemetry/BUILD create mode 100644 api/telemetry/telemetry.proto create mode 100644 bazel/bazel_downloader.cfg diff --git a/MODULE.bazel b/MODULE.bazel index 712f9d4..7654cf4 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -38,7 +38,7 @@ bazel_dep(name = "gazelle", version = "0.35.0") bazel_dep(name = "container_structure_test", version = "1.16.0", dev_dependency = True) go_sdk = use_extension("@rules_go//go:extensions.bzl", "go_sdk") -go_sdk.download(version = "1.22.1") +go_sdk.download(version = "1.22.3") oci = use_extension("@rules_oci//oci:extensions.bzl", "oci") oci.pull( diff --git a/WORKSPACE b/WORKSPACE index 5d771e9..6459606 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -135,7 +135,7 @@ go_rules_dependencies() # Install the Go toolchains. (https://github.com/bazelbuild/rules_go/blob/master/go/toolchains.rst#go-toolchain) go_register_toolchains( - version = "1.22.2", + version = "1.22.3", ) gazelle_dependencies() @@ -472,8 +472,8 @@ go_repository( # https://github.com/bazelbuild/rules_go/blob/master/go/dependencies.rst#grpc-dependencies. build_file_proto_mode = "disable", importpath = "google.golang.org/grpc", - sum = "h1:B4n+nfKzOICUXMgyrNd19h/I9oH0L1pizfk1d4zSgTk=", - version = "v1.62.1", + sum = "h1:MUeiw1B2maTVZthpU5xvASfTh3LDbxHd6IJ6QQVU+xM=", + version = "v1.63.2", ) go_repository( diff --git a/api/cdpi/v1alpha/BUILD b/api/cdpi/v1alpha/BUILD index c2f765d..54a92b5 100644 --- a/api/cdpi/v1alpha/BUILD +++ b/api/cdpi/v1alpha/BUILD @@ -49,7 +49,10 @@ cpp_grpc_library( go_proto_library( name = "cdpi_go_grpc", - compilers = ["@io_bazel_rules_go//proto:go_grpc"], + compilers = [ + "@io_bazel_rules_go//proto:go_proto", + "@io_bazel_rules_go//proto:go_grpc_v2", + ], importpath = "aalyria.com/spacetime/api/cdpi/v1alpha", proto = ":cdpi_proto", deps = [ diff --git a/api/common/network.proto b/api/common/network.proto index 0fd2c56..ba94025 100644 --- a/api/common/network.proto +++ b/api/common/network.proto @@ -80,10 +80,20 @@ message PacketClassifier { } optional EthernetHeader ethernet_header = 3; + // [RFC 3032](https://rfc-editor.org/rfc/rfc3032) message MplsLabelStackEntry { - optional uint32 label = 1; - // When matching on additional fields in the MPLS label stack entry is - // needed we can add them here. + optional uint32 label = 1; // restricted to unsigned 20-bit values + + // TODO: Consider https://rfc-editor.org/rfc/rfc5462 field. + // optional uint32 traffic_class = 2; unsigned 3-bit values only + + // If this MplsLabelStackEntry is last in an ordered list of entries, + // then it may be inferred that it is the bottom of the stack. Whether + // the Bottom-of-Stack bit is to be set or not may require additional + // context. + // + // TODO: Consider explicit Bottom of Stack indicator. + // optional bool s = 3; } optional MplsLabelStackEntry mpls_label_stack_entry = 4; @@ -116,6 +126,56 @@ message IpFlowClassifier { reserved 4 to max; // Next IDs. } +// MEF EVC E-Line Flow Classifier +// +// Suitable for describing a MEF 10.4 section 8.3.1 Point-to-Point EVC, +// specifically: +// +// * "Ethernet Private Line Service (EPL) +// Point-to-Point EVC, all to one bundling" +// +// See also: MEF 6.3 Section 9.1, MEF 7.4 Section 11.1 +// +// * "Ethernet Virtual Private Line (EVPL) +// Point-to-Point EVC, bundling and/or multiplexing" +// +// See also: MEF 6.3 Section 9.2, MEF 7.4 Section 11.2 +message EvcElineFlowClassifier { + // A locally meaningful name for traffic described by this classifier. + // + // Possible examples include: + // * the MEF 10.4 section 10.1 EVC EP ID service attribute that + // corresponds to the UNI and Map service attributes below, or + // * an identifier for the pseudowire that will carry this traffic. + // + // This does not appear anywhere in the data plane and the value is + // opaque to rest of the system. + optional string id = 1; + + // E.g., MEF 10.4 section 10.2 EVC EP UNI service attribute. + optional NetworkInterfaceId uni = 2; + + // MEF 10.4 section 10.4 EVC EP Map service attribute. + // + // For section 10.4.1 "EVC EP Map Service Attribute = List", add + // all applicable non-zero, non-4095 Customer Edge VLAN IDs. + // + // For section 10.4.2 "EVC EP Map service attribute = All", leave + // this list empty. + // + // For section 10.4.3 "EVC EP Map service attribute = UT/PT", use + // only a single VLAN ID, either 0 (zero) or the value of the UNI's + // Default CE-VLAN ID attribute (MEF 10.3 and earlier), whichever + // has local meaning. + repeated uint32 vlan_ids = 3; + + // For use if Ethernet service frames are classified by another + // network element and encapsulated inside an MPLS label stack + // that uniquely identifies the flow. + // + repeated PacketClassifier.MplsLabelStackEntry mpls_stack = 4; +} + // Rules for matching a network flow. message FlowClassifier { optional IpFlowClassifier ip_classifier = 1; @@ -123,5 +183,8 @@ message FlowClassifier { optional PacketClassifier.GenericLayer4Header l4_classifier = 2; optional PacketClassifier.EthernetHeader ethernet_classifier = 3; - reserved 4 to max; // Next IDs. + + optional EvcElineFlowClassifier evc_eline_classifier = 4; + + reserved 5 to max; // Next IDs. } diff --git a/api/common/telemetry.proto b/api/common/telemetry.proto index b346c99..2ad3c4e 100644 --- a/api/common/telemetry.proto +++ b/api/common/telemetry.proto @@ -159,6 +159,22 @@ message RadioStats { reserved 1, 2; } +// Summary interface statistics, with the time observed. +// +// Modeled after RFC 8343 `ietf-interfaces` module `statistics` +// entry, slightly simplified: +// +// +--ro statistics +// +--ro in-octets? yang:counter64 +// +--ro in-unicast-pkts? yang:counter64 +// +--ro in-discards? yang:counter32 +// +--ro in-errors? yang:counter32 +// +--ro out-octets? yang:counter64 +// +--ro out-unicast-pkts? yang:counter64 +// +--ro out-discards? yang:counter32 +// +--ro out-errors? yang:counter32 +// +// Field names inspired by Linux RT_NETLINK structures. message InterfaceStats { optional DateTime timestamp = 9; diff --git a/api/federation/BUILD b/api/federation/BUILD index 0ccb323..14f0753 100644 --- a/api/federation/BUILD +++ b/api/federation/BUILD @@ -42,7 +42,10 @@ go_proto_library( go_proto_library( name = "v1alpha_go_proto", - compilers = ["@io_bazel_rules_go//proto:go_grpc"], + compilers = [ + "@io_bazel_rules_go//proto:go_proto", + "@io_bazel_rules_go//proto:go_grpc_v2", + ], importpath = "aalyria.com/spacetime/api/fed/v1alpha", proto = ":federation_proto", visibility = ["//visibility:public"], diff --git a/api/nbi/v1alpha/BUILD b/api/nbi/v1alpha/BUILD index f8cdc78..9669d9f 100644 --- a/api/nbi/v1alpha/BUILD +++ b/api/nbi/v1alpha/BUILD @@ -71,7 +71,10 @@ python_grpc_library( go_proto_library( name = "v1alpha_go_proto", - compilers = ["@io_bazel_rules_go//proto:go_grpc"], + compilers = [ + "@io_bazel_rules_go//proto:go_proto", + "@io_bazel_rules_go//proto:go_grpc_v2", + ], importpath = "aalyria.com/spacetime/api/nbi/v1alpha", proto = ":nbi_proto", deps = [ diff --git a/api/nbi/v1alpha/resources/BUILD b/api/nbi/v1alpha/resources/BUILD index 14de796..d2fccb7 100644 --- a/api/nbi/v1alpha/resources/BUILD +++ b/api/nbi/v1alpha/resources/BUILD @@ -36,6 +36,7 @@ proto_library( ], deps = [ "//api/common:common_proto", + "//api/types:types_proto", "@com_google_googleapis//google/rpc:code_proto", "@com_google_googleapis//google/type:interval_proto", "@com_google_googleapis//google/type:money_proto", @@ -51,6 +52,7 @@ cpp_grpc_library( protos = [":resources_proto"], deps = [ "//api/common:common_cpp_proto", + "//api/types:types_cpp_proto", "@com_google_googleapis//google/api:annotations_cc_proto", "@com_google_googleapis//google/rpc:code_cc_proto", "@com_google_googleapis//google/type:interval_cc_proto", @@ -64,6 +66,7 @@ go_proto_library( proto = ":resources_proto", deps = [ "//api/common:common_go_proto", + "//api/types:types_go_proto", "@org_golang_google_genproto//googleapis/type/interval", "@org_golang_google_genproto//googleapis/type/money", "@org_golang_google_genproto_googleapis_rpc//code", @@ -75,6 +78,7 @@ java_grpc_library( protos = [":resources_proto"], deps = [ "//api/common:common_java_proto", + "//api/types:types_java_proto", "@com_google_googleapis//google/api:api_java_proto", "@com_google_googleapis//google/rpc:rpc_java_proto", "@com_google_googleapis//google/type:type_java_proto", diff --git a/api/nbi/v1alpha/resources/intent.proto b/api/nbi/v1alpha/resources/intent.proto index 6197996..a3fe8b6 100644 --- a/api/nbi/v1alpha/resources/intent.proto +++ b/api/nbi/v1alpha/resources/intent.proto @@ -36,10 +36,8 @@ option go_package = "aalyria.com/spacetime/api/nbi/v1alpha/resources"; enum IntentState { UNKNOWN = 0; INSTALL_REQ = 1; - PUSHING = 9; SCHEDULED = 10; SCHEDULING = 12; - MAYBE_INSTALLED = 11; INSTALLING = 3; // In process of being deprecated. INSTALLED = 4; WITHDRAW_REQ = 5; @@ -49,7 +47,7 @@ enum IntentState { WITHDRAWING = 6; FAILED = 8; - reserved 2, 7; + reserved 2, 7, 9, 11; } // Specifies a policy that reserves the use of a network resource. @@ -114,13 +112,7 @@ message Intent { repeated aalyria.spacetime.api.common.ScheduledControlUpdate compiled_withdrawal_updates = 17; - // Automatically retry installation if the intent fails to install. - // The first try will occur at time_to_enact (or immediately, if unset). If - // the intent fails to install, it will retry immediately, until the intent is - // removed. - optional bool auto_retry = 12; - - reserved 2, 18 to max; // Next IDs. + reserved 2, 12, 18 to max; // Next IDs. } // Models an intent to configure steerable beams and/or radio resources. diff --git a/api/nbi/v1alpha/resources/network_element.proto b/api/nbi/v1alpha/resources/network_element.proto index 8cb8426..d6d1975 100644 --- a/api/nbi/v1alpha/resources/network_element.proto +++ b/api/nbi/v1alpha/resources/network_element.proto @@ -18,6 +18,7 @@ package aalyria.spacetime.api.nbi.v1alpha.resources; import "api/common/time.proto"; import "api/common/wireless_transceiver.proto"; +import "api/types/ietf.proto"; import "google/protobuf/any.proto"; import "google/protobuf/duration.proto"; @@ -26,7 +27,7 @@ option go_package = "aalyria.com/spacetime/api/nbi/v1alpha/resources"; // Models an abstract network node (a device, or an entire network). message NetworkNode { - reserved 3, 6, 11 to max; + reserved 6, 11 to max; // A globally unique identifier for the network node. optional string node_id = 1; @@ -35,6 +36,16 @@ message NetworkNode { optional string name = 2; optional string type = 7; + message RoutingConfiguration { + // The router ID of this NetworkNode. + optional types.RouterId router_id = 1; + + // The Segment Routing (RFC 8402) Node SID for this NetworkNode. + optional types.SegmentId node_sid = 2; + } + // Note: Only a single IP VRF at this time. + optional RoutingConfiguration routing_config = 3; + // A node may optionally act a gateway for a set of specified IP subnets. repeated string subnet = 8; @@ -118,7 +129,7 @@ message SdnAgent { // Models a network interface (aka network device, port, cable, or adapter). // Next ID: 18 message NetworkInterface { - reserved 2, 5, 7, 9 to 13, 18 to max; + reserved 2, 5, 9 to 13, 18 to max; // A node-unique identifier for the network interface. optional string interface_id = 1; @@ -160,6 +171,17 @@ message NetworkInterface { WirelessDevice wireless = 6; } + message RoutingConfiguration { + message AdjacencySidEntry { + // Required. + optional types.SegmentId sid = 1; + // Only required if the link is not P2P (e.g., a LAN). + optional string next_hop = 2; // An IPv4 or IPv6 address. + } + repeated AdjacencySidEntry adjacency_sids = 1; + } + optional RoutingConfiguration routing_config = 7; + message Impairment { enum Type { // The interface is known to be unusable. diff --git a/api/nbi/v1alpha/resources/network_link.proto b/api/nbi/v1alpha/resources/network_link.proto index ff3cb76..c69ffc8 100644 --- a/api/nbi/v1alpha/resources/network_link.proto +++ b/api/nbi/v1alpha/resources/network_link.proto @@ -19,6 +19,7 @@ package aalyria.spacetime.api.nbi.v1alpha.resources; import "api/common/control_radio.proto"; import "api/common/coordinates.proto"; import "api/common/network.proto"; +import "api/common/platform_antenna.proto"; import "api/common/time.proto"; import "api/common/wireless_transceiver.proto"; @@ -57,6 +58,46 @@ message Radio { // For optical transceivers, this may be converted to wavelength. optional uint64 center_frequency_hz = 1; optional string band_profile_id = 2; + optional aalyria.spacetime.api.common.Polarization polarization = 3; + + message TxRadioConfiguration { + + message BeamPower { + enum PowerType { + POWER_TYPE_UNSPECIFIED = 0; + POWER_TYPE_NADIR_EQUIVALENT_BEAM_PEAK_EIRP_PSD_DBW_PER_MHZ = 1; + POWER_TYPE_BEAM_PEAK_EIRP_PSD_DBW_PER_MHZ = 2; + } + optional PowerType power_type = 1; + optional double power_value = 2; + } + optional BeamPower transmit_power = 1; + + optional string modulator_id = 2; + + enum ModulatorMode { + MODULATOR_MODE_UNSPECIFIED = 0; + MODULATOR_MODE_DVB_S2X = 1; + MODULATOR_MODE_DIGITAL_TRANSPARENT = 2; + } + optional ModulatorMode modulator_mode = 3; + } + + optional TxRadioConfiguration tx_radio = 4; + + optional RxRadioConfiguration rx_radio = 5; +} + +message RxRadioConfiguration { + optional string demodulator_id = 1; + + enum DemodulatorMode { + DEMODULATOR_MODE_UNSPECIFIED = 0; + DEMODULATOR_MODE_DVB_S2X = 1; + DEMODULATOR_MODE_DVB_RCS2_TDMA = 2; + DEMODULATOR_MODE_DIGITAL_TRANSPARENT = 3; + } + optional DemodulatorMode demodulator_mode = 2; } message LinkEnd { @@ -84,7 +125,9 @@ message BidirectionalLink { optional Radio b_to_a_radio = 4; } -// Configures a directional link. +// Configures a directional link. The link may be a point-to-multipoint link +// between a transmitter and a list of receiving platforms, or a +// point-to-point link between two transceivers. message DirectionalLink { // Identifies the wireless network interface. optional aalyria.spacetime.api.common.NetworkInterfaceId id = 1; @@ -96,6 +139,17 @@ message DirectionalLink { // This field is optional and may be omitted for wireless interfaces whose // beams are fixed to the platform. It is required for steerable beams. optional BeamTarget target = 3; + + // Identifies the platforms that are on the receiving end of the + // point-to-multipoint link. + repeated RxPlatform rx_platforms = 4; +} + +message RxPlatform { + optional aalyria.spacetime.api.common.NetworkInterfaceId id = 1; + + // Defines the radio configuration to apply to the receiving platform. + optional RxRadioConfiguration rx_radio = 2; } // Defines whether or not a link is usable or possible. diff --git a/api/scheduling/v1alpha/BUILD b/api/scheduling/v1alpha/BUILD new file mode 100644 index 0000000..4c445a9 --- /dev/null +++ b/api/scheduling/v1alpha/BUILD @@ -0,0 +1,67 @@ +# Copyright 2024 Aalyria Technologies, Inc., and its affiliates. +# +# 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. + +load("@io_bazel_rules_go//proto:def.bzl", "go_proto_library") +load("@rules_proto//proto:defs.bzl", "proto_library") +load("@rules_proto_grpc//cpp:defs.bzl", "cpp_grpc_library") +load("@rules_proto_grpc//java:defs.bzl", "java_grpc_library") +load("@rules_proto_grpc//python:defs.bzl", "python_grpc_library") + +package(default_visibility = ["//visibility:public"]) + +proto_library( + name = "scheduling_proto", + srcs = [ + "scheduling.proto", + ], + deps = [ + "@com_google_googleapis//google/rpc:status_proto", + "@com_google_protobuf//:empty_proto", + "@com_google_protobuf//:timestamp_proto", + ], +) + +cpp_grpc_library( + name = "scheduling_cpp_grpc", + protos = [":scheduling_proto"], + deps = [ + "@com_google_googleapis//google/rpc:status_cc_proto", + ], +) + +go_proto_library( + name = "scheduling_go_grpc", + compilers = [ + "@io_bazel_rules_go//proto:go_proto", + "@io_bazel_rules_go//proto:go_grpc_v2", + ], + importpath = "aalyria.com/spacetime/scheduling/v1alpha", + proto = ":scheduling_proto", + deps = [ + "@org_golang_google_genproto_googleapis_rpc//status", + ], +) + +java_grpc_library( + name = "scehduling_java_grpc", + protos = [":scheduling_proto"], + deps = [ + "@com_google_googleapis//google/rpc:rpc_java_proto", + ], +) + +python_grpc_library( + name = "scheduling_python_grpc", + protos = [":scheduling_proto"], +) diff --git a/api/scheduling/v1alpha/scheduling.proto b/api/scheduling/v1alpha/scheduling.proto new file mode 100644 index 0000000..1a86283 --- /dev/null +++ b/api/scheduling/v1alpha/scheduling.proto @@ -0,0 +1,201 @@ +// Copyright 2024 Aalyria Technologies, Inc., and its affiliates. +// +// 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. + +syntax = "proto3"; + +package aalyria.spacetime.scheduling.v1alpha; + +import "google/protobuf/empty.proto"; +import "google/protobuf/timestamp.proto"; +import "google/rpc/status.proto"; + +option go_package = "aalyria.com/spacetime/scheduling/v1alpha"; +option java_package = "com.aalyria.spacetime.scheduling.v1alpha"; + +service Scheduling { + // Establishes a bidirectional stream through which the SDN controller may + // send scheduling requests to the SDN agent, and the agent may respond. + // + // The use of the stream allows the SDN controller to send requests to the + // agent even though the SDN controller may not be able to initiate a + // connection to the agent (if the agent is behind a firewall, for example, + // or a NAT gateway). + // + // The SDN controller will leave the stream open indefinitely. In the event + // that the stream closes, the agent should re-establish the stream to + // continue receiving requests. + rpc ReceiveRequests(stream ReceiveRequestsMessageToController) + returns (stream ReceiveRequestsMessageFromController) {} + + + // Notifies the SDN controller that an agent's schedule has been reset. The + // agent must call this upon startup and after any event that has reset the + // schedule. + rpc Reset(ResetRequest) returns (google.protobuf.Empty) {} +} + +// The message type for Scheduling.ReceiveRequests in the direction toward the +// controller. +message ReceiveRequestsMessageToController { + message Hello { + // Required. Identifies the SDN agent whose schedule is to be managed by + // this scheduling session. + string agent_id = 1; + + // Required. When multiple sessions are opened for managing the same SDN + // agent's schedule, the channel priority determines the order in which the + // SDN controller attempts to send a message over those sessions. Sessions + // with the lowest priority are tried first; it is recommended to use: + // * priority = 0 for the default control-plane network + // * priority = 1 for backup/secondary control paths + uint32 channel_priority = 2; + } + + message Response { + // Required. The ID of the request to which this response corresponds. See + // ReceiveRequestsMessageFromController.request_id. + int64 request_id = 1; + + // The response status. + google.rpc.Status status = 2; + } + + // Required in the initial request of the session. Identifies the SDN agent + // and the properties of the underlying channel. + Hello hello = 1; + + // A response to a request received from the SDN controller. + // + // The response may originate from a proxy rather than the SDN agent itself. + // For example, if the proxy is unable to deliver the request to the SDN + // agent, the proxy may populate the response with an appropriate error. + Response response = 2; +} + +// The message type for Scheduling.ReceiveRequests in the direction from the +// controller. +// +// This is a response message in that it flows from server to client, however +// it holds requests being sent to the SDN agent (the client) by the SDN +// controller (the server). +message ReceiveRequestsMessageFromController { + // An SDN-controller-generated value uniquely identifying the request within + // the scope of the scheduling session. That is, two requests received from + // the same session will always have different request IDs. The SDN agent + // must provide the ID in the response to this request (see + // ReceiveRequestsMessageToController.Response.request_id). + int64 request_id = 1; + + // The contents of the request. + oneof request { + // Creates an entry in the agent's schedule. Note that entries are + // immutable: once created, an entry may not changed, though it may be + // deleted. + CreateEntryRequest create_entry = 2; + + // Deletes an entry from the agent's schedule. + DeleteEntryRequest delete_entry = 3; + + // Finalizes all schedule entries earlier than a specified time. + // + // Notifies the agent that all aspects of its schedule pertaining to the + // interval prior to a given instant will no longer be modified . This frees + // the agent to garbage-collect all entries scheduled for before that + // instant. + FinalizeRequest finalize = 4; + } +} + +message CreateEntryRequest { + // Required. A token that must match the agent's token for the request to be + // accepted (see ResetRequest.schedule_manipulation_token). This ensures that + // the agent does not execute an operation intended for an old edition of the + // schedule on a newer version. + string schedule_manipulation_token = 1; + + // Required. The request's sequence number among all requests in the + // Scheduling service with the same schedule manipulation token. The sequence + // number resets with each new schedule manipulation token. + uint32 sequence_number = 2; + + // Required. A unique identifier of the schedule entry being created. + string id = 3; + + // Required. The time at which the entry is scheduled to be executed. + google.protobuf.Timestamp time = 4; + + oneof configuration_change { + SetBeamConfiguration set_beam_configuration = 5; + ClearBeamConfiguration clear_beam_configuration = 6; + SetForwardingConfiguration set_forwarding_configuration = 7; + ClearForwardingConfiguration clear_forwarding_configuration = 8; + } +} + +message SetBeamConfiguration { + // TODO: populate with beam configuration parameters. +} + +message ClearBeamConfiguration { + // TODO: populate with beam configuration parameters. +} + +message SetForwardingConfiguration { + // TODO: populate with forwarding configuration parameters. +} + +message ClearForwardingConfiguration { + // TODO: populate with forwarding configuration parameters. +} + +message DeleteEntryRequest { + // Required. A token that must match the agent's token for the request to be + // accepted (see ResetRequest.schedule_manipulation_token). This ensures that + // the agent does not execute an operation intended for an old edition of the + // schedule on a newer version. + string schedule_manipulation_token = 1; + + // Required. The request's sequence number among all requests in the + // Scheduling service with the same schedule manipulation token. The sequence + // number resets with each new schedule manipulation token. + uint32 sequence_number = 2; + + // Required. The schedule entry to delete. + string id = 3; +} + +message FinalizeRequest { + // Required. A token that must match the agent's token for the request to be + // accepted (see ResetRequest.schedule_manipulation_token). This ensures that + // the agent does not execute an operation intended for an old edition of the + // schedule on a newer version. + string schedule_manipulation_token = 1; + + // Required. The request's sequence number among all requests in the + // Scheduling service with the same schedule manipulation token. The sequence + // number resets with each new schedule manipulation token. + uint32 sequence_number = 2; + + // Required. The time before which the schedule will no longer be modified. + google.protobuf.Timestamp time = 3; +} + +message ResetRequest { + // Required. Identifies the agent whose schedule has been reset. + string agent_id = 1; + + // Required. The new schedule's manipulation token. Only requests annotated + // with a matching token should be accepted. + string schedule_manipulation_token = 2; +} diff --git a/api/telemetry/BUILD b/api/telemetry/BUILD new file mode 100644 index 0000000..097453b --- /dev/null +++ b/api/telemetry/BUILD @@ -0,0 +1,60 @@ +# Copyright 2024 Aalyria Technologies, Inc., and its affiliates. +# +# 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. + +load("@io_bazel_rules_go//proto:def.bzl", "go_proto_library") +load("@rules_proto//proto:defs.bzl", "proto_library") +load("@rules_proto_grpc//cpp:defs.bzl", "cpp_grpc_library") +load("@rules_proto_grpc//java:defs.bzl", "java_grpc_library") +load("@rules_proto_grpc//python:defs.bzl", "python_grpc_library") + +package(default_visibility = ["//visibility:public"]) + +proto_library( + name = "telemetry_proto", + srcs = [ + "telemetry.proto", + ], + deps = [ + "@com_google_protobuf//:empty_proto", + "@com_google_protobuf//:timestamp_proto", + ], +) + +cpp_grpc_library( + name = "telemetry_cpp_grpc", + protos = [":telemetry_proto"], +) + +go_proto_library( + name = "telemetry_go_grpc", + compilers = [ + "@io_bazel_rules_go//proto:go_proto", + "@io_bazel_rules_go//proto:go_grpc_v2", + ], + importpath = "aalyria.com/spacetime/telemetry/v1alpha", + proto = ":telemetry_proto", +) + +java_grpc_library( + name = "telemetry_java_grpc", + protos = [":telemetry_proto"], + deps = [ + "@com_google_googleapis//google/rpc:rpc_java_proto", + ], +) + +python_grpc_library( + name = "telemetry_python_grpc", + protos = [":telemetry_proto"], +) diff --git a/api/telemetry/telemetry.proto b/api/telemetry/telemetry.proto new file mode 100644 index 0000000..8f972f3 --- /dev/null +++ b/api/telemetry/telemetry.proto @@ -0,0 +1,298 @@ +// Copyright 2024 Aalyria Technologies, Inc., and its affiliates. +// +// 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. + +syntax = "proto3"; + +package aalyria.spacetime.telemetry.v1alpha; + +import "google/protobuf/empty.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "aalyria.com/spacetime/telemetry/v1alpha"; +option java_package = "com.aalyria.spacetime.telemetry.v1alpha"; + +service Telemetry { + // Pushes metrics to the SDN controller. + rpc ExportMetrics(ExportMetricsRequest) returns (google.protobuf.Empty) {} +} + +// The request for aalyria.spacetime.telemetry.v1alpha.Telemetry.ExportMetrics. +message ExportMetricsRequest { + repeated InterfaceMetrics interface_metrics = 1; + repeated ModemMetrics modem_metrics = 2; +} + +// A collection of metrics from a network interface. +message InterfaceMetrics { + // Required. The interface producing telemetry. + string interface_id = 1; + + // Data points describing the time-varying value of the interface's + // operational state. + repeated IfOperStatusDataPoint operational_state_data_points = 2; + + // Data points describing the time-varying values of the interface's standard + // statistics. + repeated StandardInterfaceStatisticsDataPoint + standard_interface_statistics_data_points = 3; +} + +// A data point in a timeseries that describes a network interface's time- +// varying operational state. +message IfOperStatusDataPoint { + // Required. When the value was captured. + google.protobuf.Timestamp time = 1; + + IfOperStatus value = 2; +} + +// Network interface operational state. +// +// See [RFC 2863](https://www.rfc-editor.org/rfc/rfc2863.html). +enum IfOperStatus { + IF_OPER_STATUS_UNSPECIFIED = 0; + + // Ready to pass packets. + IF_OPER_STATUS_UP = 1; + + IF_OPER_STATUS_DOWN = 2; + + // In some test mode. + IF_OPER_STATUS_TESTING = 3; + + // Status can not be determined for some reason. + IF_OPER_STATUS_UNKNOWN = 4; + + IF_OPER_STATUS_DORMANT = 5; + + // Some component is missing. + IF_OPER_STATUS_NOT_PRESENT = 6; + + // Down due to state of lower-layer interface(s). + IF_OPER_STATUS_LOWER_LAYER_DOWN = 7; +} + +// A data point in a timeseries that describes the time-varying values of +// a standard collection of network interface statistics. +// +// Specifically, the statistics are defined to mirror Linux's standard interface +// the fields and their documentation are derived. +message StandardInterfaceStatisticsDataPoint { + // The start time of the sums. + google.protobuf.Timestamp start_time = 1; + + // Required. When the statistics were captured. + google.protobuf.Timestamp time = 2; + + // Number of good packets received by the interface. For hardware interfaces + // counts all good packets received from the device by the host, including + // packets which host had to drop at various stages of processing (even in + // the driver). + int64 rx_packets = 3; + + // Number of packets successfully transmitted. For hardware interfaces counts + // packets which host was able to successfully hand over to the device, which + // does not necessarily mean that packets had been successfully transmitted + // out of the device, only that device acknowledged it copied them out of + // host memory. + int64 tx_packets = 4; + + // Number of good received bytes, corresponding to rx_packets. + // + // For IEEE 802.3 devices should count the length of Ethernet Frames + // excluding the FCS. + int64 rx_bytes = 5; + + // Number of good transmitted bytes, corresponding to tx_packets. + // + // For IEEE 802.3 devices should count the length of Ethernet Frames + // excluding the FCS. + int64 tx_bytes = 6; + + // Total number of bad packets received on this network device. This counter + // must include events counted by rx_length_errors, rx_crc_errors, + // rx_frame_errors and other errors not otherwise counted. + int64 rx_errors = 7; + + // Total number of transmit problems. This counter must include events + // counter by tx_aborted_errors, tx_carrier_errors, tx_fifo_errors, + // tx_heartbeat_errors, tx_window_errors and other errors not otherwise + // counted. + int64 tx_errors = 8; + + // Number of packets received but not processed, e.g. due to lack of + // resources or unsupported protocol. For hardware interfaces this counter + // may include packets discarded due to L2 address filtering but should not + // include packets dropped by the device due to buffer exhaustion which are + // counted separately in rx_missed_errors (since procfs folds those two + // counters together). + int64 rx_dropped = 9; + + // Number of packets dropped on their way to transmission, e.g. due to lack + // of resources. + int64 tx_dropped = 10; + + // Multicast packets received. For hardware interfaces this statistic is + // commonly calculated at the device level (unlike rx_packets) and therefore + // may include packets which did not reach the host. + // + // For IEEE 802.3 devices this counter may be equivalent to: + // * 30.3.1.1.21 aMulticastFramesReceivedOK + int64 multicast = 11; + + // Number of collisions during packet transmissions. + int64 collisions = 12; + + // Number of packets dropped due to invalid length. + // + // For IEEE 802.3 devices this counter should be equivalent to a sum of the + // following attributes: + // * 30.3.1.1.23 aInRangeLengthErrors + // * 30.3.1.1.24 aOutOfRangeLengthField + // * 30.3.1.1.25 aFrameTooLongErrors + int64 rx_length_errors = 13; + + // Receiver FIFO overflow event counter. + // + // Historically the count of overflow events. Such events may be reported in + // the receive descriptors or via interrupts, and may not correspond one-to- + // one with dropped packets. + // + // The recommended interpretation for high speed interfaces is - number of + // packets dropped because they did not fit into buffers provided by the host, + // e.g. packets larger than MTU or next buffer in the ring was not available + // for a scatter transfer. + // + // This statistics was historically used interchangeably with rx_fifo_errors. + // + // This statistic corresponds to hardware events and is not commonly used on + // software devices. + int64 rx_over_errors = 14; + + // Number of packets received with a CRC error. + // + // For IEEE 802.3 devices this counter must be equivalent to: + // * 30.3.1.1.6 aFrameCheckSequenceErrors + int64 rx_crc_errors = 15; + + // Receiver frame alignment errors. + // + // For IEEE 802.3 devices this counter should be equivalent to: + // * 30.3.1.1.7 aAlignmentErrors + int64 rx_frame_errors = 16; + + // Receiver FIFO error counter. + // + // Historically the count of overflow events. Those events may be reported in + // the receive descriptors or via interrupts, and may not correspond one-to- + // one with dropped packets. + // + // This statistics was used interchangeably with rx_over_errors. Not + // recommended for use in drivers for high speed interfaces. + // + // This statistic is used on software devices, e.g. to count software packet + // queue overflow (can) or sequencing errors (GRE). + int64 rx_fifo_errors = 17; + + // Count of packets missed by the host. + // + // Counts number of packets dropped by the device due to lack of buffer space. + // This usually indicates that the host interface is slower than the network + // interface, or host is not keeping up with the receive packet rate. + // + // This statistic corresponds to hardware events and is not used on software + // devices. + int64 rx_missed_errors = 18; + + + // For IEEE 802.3 devices capable of half-duplex operation this counter must + // be equivalent to: + // * 30.3.1.1.11 aFramesAbortedDueToXSColls + // + // High speed interfaces may use this counter as a general device discard + // counter. + int64 tx_aborted_errors = 19; + + // Number of frame transmission errors due to loss of carrier during + // transmission. + // + // For IEEE 802.3 devices this counter must be equivalent to: + // * 30.3.1.1.13 aCarrierSenseErrors + int64 tx_carrier_errors = 20; + + // Number of frame transmission errors due to device FIFO underrun / + // underflow. This condition occurs when the device begins transmission of a + // frame but is unable to deliver the entire frame to the transmitter in time + // for transmission. + int64 tx_fifo_errors = 21; + + // Number of Heartbeat / SQE Test errors for old half-duplex Ethernet. + // + // For IEEE 802.3 devices possibly equivalent to: + // * 30.3.2.1.4 aSQETestErrors + int64 tx_heartbeat_errors = 22; + + // Number of frame transmission errors due to late collisions (for Ethernet - + // after the first 64B of transmission). + // + // For IEEE 802.3 devices this counter must be equivalent to: + // * 30.3.1.1.10 aLateCollisions + int64 tx_window_errors = 23; + + // Number of correctly received compressed packets. This counters is only + // meaningful for interfaces which support packet compression (e.g. CSLIP, + // PPP). + int64 rx_compressed = 24; + + // Number of transmitted compressed packets. This counters is only meaningful + // for interfaces which support packet compression (e.g. CSLIP, PPP). + int64 tx_compressed = 25; + + // Number of packets received on the interface but dropped by the networking + // stack because the device is not designated to receive packets (e.g. backup + // link in a bond). + int64 rx_nohandler = 26; + + // Number of packets dropped due to mismatch in destination MAC address. + int64 rx_otherhost_dropped = 27; +} + +// A collection of metrics from a modem. +message ModemMetrics { + // Required. The modem producing telemetry. + string modem_id = 1; + + // Data points describing the time-varying properties of the modem's links. + repeated LinkMetricsDataPoint link_metrics_data_points = 2; +} + +// A data point in a timeseries that describes the time-varying values of +// a link's metrics. +message LinkMetricsDataPoint { + // Required. When the values were captured. + google.protobuf.Timestamp time = 1; + + // The transmitting modem. + string tx_modem_id = 2; + + // The data rate in bits per second. + double data_rate_bps = 3; + + // The energy per symbol to noise power spectral density, expressed in + // decibels. + double esn0_db = 4; + + // The signal-to-interference-plus-noise ratio, expressed in decibels. + double sinr_db = 5; +} diff --git a/api/types/ietf.proto b/api/types/ietf.proto index 6cf5a93..7d789c4 100644 --- a/api/types/ietf.proto +++ b/api/types/ietf.proto @@ -19,80 +19,81 @@ package aalyria.spacetime.api.types; option java_package = "com.aalyria.spacetime.api.types"; option go_package = "aalyria.com/spacetime/api/types"; - -// Some types derived from "ietf-inet-types" YANG module; -// see [RFC 6991](https://www.rfc-editor.org/rfc/rfc6991.html). - -// An IPv4 address string representation, without a CIDR suffix -// and without any zone/scope ID qualifier. -// -// This is the logical equivalent of "inet:ipv4-address-no-zone". -message IPv4Address { - string value = 1; -} - -// An IPv6 address string representation, without a CIDR suffix -// and without any zone/scope ID qualifier. -// -// This is the logical equivalent of "inet:ipv6-address-no-zone". +// A type representing an IP prefix that may optionally need an +// additional qualifier to be properly unique. This is required, for +// example, when multiple non-public IP prefixes may be referenced +// within an NMTS model (e.g., overlapping RFC 1918 networks, or +// incorrectly-allocated ULAs). // -// See [RFC 5952](https://www.rfc-editor.org/rfc/rfc5952.html), +// The `ip_prefix` field is the approximate equivalent of +// "inet:ip-prefix" from the "ietf-inet-types" YANG module; see also +// [RFC 6991](https://rfc-editor.org/rfc/rfc6991). It contains the +// the string representation of an IPv4 or IPv6 prefix, with a CIDR +// suffix and without any zone/scope ID qualifier. Text formatting +// should follow [RFC 5952](https://rfc-editor.org/rfc/rfc5952), // especially section 4.3. -message IPv6Address { - string value = 1; -} - -// An IPv4 or IPv6 address string representation, without a CIDR -// suffix and without any zone/scope ID qualifier. // -// This is the logical equivalent of "inet:ip-address-no-zone". -message IPAddress { - oneof version { - IPv4Address ipv4 = 1; - IPv6Address ipv6 = 2; - } +// The `realm` field is an optional qualifier containing a string name +// for a "realm" that is significant within the model and sufficient +// to differentiate one instance of a non-public prefix from another. +// The name "realm" is modeled after RFC 3102/3103 Realm-specific IP, +// though this in no way implies support for this protocol. +message IPNetwork { + string ip_prefix = 1; + string realm = 2; } -// An IPv4 prefix string representation, with a CIDR suffix -// and without any zone/scope ID qualifier. +// The format of the `dotted_quad` string field is given by RFC 6991 +// [Section 3](https://rfc-editor.org/rfc/rfc6991#section-3): // -// This is the approximate equivalent of "inet:ipv4-prefix". -message IPv4Prefix { - string value = 1; -} - -// An IPv6 prefix string representation, with a CIDR suffix -// and without any zone/scope ID qualifier. +// "An unsigned 32-bit number expressed in the dotted-quad +// notation, i.e., four octets written as decimal numbers +// and separated with the '.' (full stop) character." // -// This is the approximate equivalent of "inet:ipv6-prefix". -message IPv6Prefix { - string value = 1; -} - -// An IPv4 or IPv6 prefix string representation, with a CIDR -// suffix and without any zone/scope ID qualifier. +// See also: +// * [OSPFv2](https://rfc-editor.org/rfc/rfc2328#section-1.2) +// * [OSPFv3](https://rfc-editor.org/rfc/rfc5340#section-2.11) // -// This is the approximate equivalent of "inet:ip-prefix". -message IPPrefix { - oneof version { - IPv4Prefix ipv4 = 1; - IPv6Prefix ipv6 = 2; +// IS-IS identifiers may be much larger, but 4-octet conventions and +// uses are common practice, e.g.: +// * [IS-IS for IP](https://rfc-editor.org/rfc/rfc1195#section-3.3) +// * [IS-IS TE](https://rfc-editor.org/rfc/rfc5305#section-4.3) +// +// Note: "0.0.0.0" is commonly considered RESERVED in several router +// identification and configuration contexts and SHOULD NOT be used. +message RouterId { + oneof type { + string dotted_quad = 1; + uint32 u32 = 2; } } -// An type representing an IPPrefix that may optionally need an -// additional qualifier to be properly unique. This is required, for -// example, when multiple non-public IP prefixes may be referenced -// within an NMTS model (e.g., overlapping RFC 1918 networks, or -// incorrectly-allocated ULAs). +// A Segment Routing Architecture Segment Identifier (SID). // -// The qualifier is a string name for a "realm" that is significant -// within the model and sufficient to differentiate one instance of -// a non-public prefix from another. +// One representation of a SID is as an index relative to a block of +// other identifiers. That representation is presently NOT RECOMMENDED +// here; all SIDs should be resolved to concrete data plane values +// prior to input to the model. // -// The name "realm" is modeled after RFC 3102/3103 Realm-specific IP, -// though this in no way implies support for this protocol. -message IPNetwork { - IPPrefix prefix = 1; - string realm = 2; -} +// It is not expected that networks would operate both SR-MPLS and +// SRv6 at the same time. Nevertheless, a router could conceivably +// "bridge" an SR-MPLS domain and an SRv6 domain (especially since +// an SRv6 domain can more easily span multiple administrative +// domains, whether advisable or not). +// +// Values for `mpls` fields are 20-bit unsigned integers. Zero (0), +// being reserved for the "IPv4 Explicit NULL Label", is not a valid +// SR-MPLS label value. See also: +// https://rfc-editor.org/rfc/rfc3032#section-2.1 +// https://iana.org/assignments/mpls-label-values +// +// Values for `ipv6` fields may be any forwardable unicast IPv6 +// address. Use of addresses from the IANA-reserved 5f00::/16 prefix +// is RECOMMENDED. Empty `IPv6Address` strings and the zero-value "::" +// are both invalid SRv6 SIDs. See also: +// https://datatracker.ietf.org/doc/draft-ietf-6man-sids/ +// https://iana.org/assignments/iana-ipv6-special-registry +message SegmentId { + optional uint32 mpls = 1; // restricted to unsigned 20-bit values + optional string ipv6 = 2; // An IPv6 (SRv6) address. +} \ No newline at end of file diff --git a/bazel/bazel_downloader.cfg b/bazel/bazel_downloader.cfg new file mode 100644 index 0000000..0becf6f --- /dev/null +++ b/bazel/bazel_downloader.cfg @@ -0,0 +1,17 @@ +# Copyright 2023 Aalyria Technologies, Inc., and its affiliates. +# +# 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. + +# block hostName - Will block access to the given host and subdomains +# block cn domains +block cn diff --git a/cdpi_agent/agent.go b/cdpi_agent/agent.go index 6c424fb..5dfa7fa 100644 --- a/cdpi_agent/agent.go +++ b/cdpi_agent/agent.go @@ -228,7 +228,7 @@ func (a *Agent) start(ctx context.Context, agentMap *expvar.Map, errCh chan erro log := zerolog.Ctx(ctx) log.Trace().Str("endpoint", a.endpoint).Msg("contacting the CDPI endpoint") - conn, err := grpc.DialContext(ctx, a.endpoint, a.dialOpts...) + conn, err := grpc.NewClient(a.endpoint, a.dialOpts...) if err != nil { return fmt.Errorf("agent: failed connecting to CDPI backend: %w", err) } diff --git a/cdpi_agent/internal/agentcli/BUILD b/cdpi_agent/internal/agentcli/BUILD index b4df895..67bd205 100644 --- a/cdpi_agent/internal/agentcli/BUILD +++ b/cdpi_agent/internal/agentcli/BUILD @@ -43,7 +43,7 @@ go_library( "@io_opentelemetry_go_otel_exporters_otlp_otlptrace_otlptracegrpc//:otlptracegrpc", "@io_opentelemetry_go_otel_sdk//resource", "@io_opentelemetry_go_otel_sdk//trace", - "@io_opentelemetry_go_otel_trace//:trace", + "@io_opentelemetry_go_otel_trace//noop", "@org_golang_google_grpc//:go_default_library", "@org_golang_google_grpc//backoff", "@org_golang_google_grpc//channelz/service", diff --git a/cdpi_agent/internal/agentcli/agentcli.go b/cdpi_agent/internal/agentcli/agentcli.go index 54f3335..3482895 100644 --- a/cdpi_agent/internal/agentcli/agentcli.go +++ b/cdpi_agent/internal/agentcli/agentcli.go @@ -41,7 +41,7 @@ import ( "go.opentelemetry.io/otel/sdk/resource" otelsdktrace "go.opentelemetry.io/otel/sdk/trace" semconv "go.opentelemetry.io/otel/semconv/v1.24.0" - oteltrace "go.opentelemetry.io/otel/trace" + oteltracenoop "go.opentelemetry.io/otel/trace/noop" "golang.org/x/sync/errgroup" "google.golang.org/grpc" "google.golang.org/grpc/backoff" @@ -229,7 +229,7 @@ func readParams(confPath, protoFormat string) (*configpb.AgentParams, error) { func injectTracer(ctx context.Context, params *configpb.AgentParams) (newCtx context.Context, shutdown func(), err error) { endpoint := params.GetObservabilityParams().GetOtelCollectorEndpoint() if endpoint == "" { - return task.InjectTracerProvider(ctx, oteltrace.NewNoopTracerProvider()), func() {}, nil + return task.InjectTracerProvider(ctx, oteltracenoop.NewTracerProvider()), func() {}, nil } res, err := resource.Merge( diff --git a/cdpi_agent/internal/task/BUILD b/cdpi_agent/internal/task/BUILD index 261ff72..bc1a42a 100644 --- a/cdpi_agent/internal/task/BUILD +++ b/cdpi_agent/internal/task/BUILD @@ -37,6 +37,6 @@ go_test( embed = [":task"], deps = [ "@io_opentelemetry_go_otel_sdk//trace", - "@io_opentelemetry_go_otel_trace//:trace", + "@io_opentelemetry_go_otel_trace//noop", ], ) diff --git a/cdpi_agent/internal/task/task_test.go b/cdpi_agent/internal/task/task_test.go index 959c350..362fd13 100644 --- a/cdpi_agent/internal/task/task_test.go +++ b/cdpi_agent/internal/task/task_test.go @@ -21,11 +21,11 @@ import ( "testing" otelsdktrace "go.opentelemetry.io/otel/sdk/trace" - oteltrace "go.opentelemetry.io/otel/trace" + oteltracenoop "go.opentelemetry.io/otel/trace/noop" ) func TestContextGetters_Tracer(t *testing.T) { - want := oteltrace.NewNoopTracerProvider().Tracer("task") + want := oteltracenoop.NewTracerProvider().Tracer("task") ctx := InjectTracer(context.Background(), want) got, ok := ExtractTracer(ctx) diff --git a/common.bazelrc b/common.bazelrc index 9bf7e75..b4070c2 100644 --- a/common.bazelrc +++ b/common.bazelrc @@ -58,12 +58,12 @@ build --features=external_include_paths # Enable hermetic testing and compilation of Java using a JVM downloaded from a # remote repository. ## -build --tool_java_runtime_version=remotejdk_17 --java_runtime_version=remotejdk_17 +build --tool_java_runtime_version=remotejdk_21 --java_runtime_version=remotejdk_21 ## -# Allow Java constructs compatible with the Java 17 specification. +# Allow Java constructs compatible with the Java 21 specification. ## -build --tool_java_language_version=17 --java_language_version=17 +build --tool_java_language_version=21 --java_language_version=21 ## # Don't automatically create __init__.py files in the runfiles of @@ -75,3 +75,4 @@ build --tool_java_language_version=17 --java_language_version=17 ## build --incompatible_default_to_explicit_init_py +common --experimental_downloader_config=./bazel/bazel_downloader.cfg diff --git a/tools/nbictl/connection.go b/tools/nbictl/connection.go index 519cdaa..3eae35d 100644 --- a/tools/nbictl/connection.go +++ b/tools/nbictl/connection.go @@ -51,7 +51,7 @@ func dial(ctx context.Context, setting *nbictlpb.Config) (*grpc.ClientConn, erro if err != nil { return nil, fmt.Errorf("unable to construct dial options: %w", err) } - conn, err := grpc.DialContext(ctx, setting.GetUrl(), dialOpts...) + conn, err := grpc.NewClient(setting.GetUrl(), dialOpts...) if err != nil { return nil, fmt.Errorf("unable to connect to the server: %w", err) }