Skip to content

Add definitions proto for vocabulary and other definitions #45

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@

syntax = "proto3";

package istio.mixer.v1.config.descriptor;
package istio.mixer.descriptor;

import "mixer/v1/config/descriptor/value_type.proto";
import "mixer/descriptor/value_type.proto";

// An `AttributeDescriptor` describes the schema of an Istio attribute type.
//
Expand Down
55 changes: 55 additions & 0 deletions mixer/descriptor/definitions.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
// Copyright 2017 Google Inc.
//
// 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";

import "mixer/descriptor/attribute_descriptor.proto";
import "mixer/descriptor/label_descriptor.proto";
import "mixer/descriptor/metric_descriptor.proto";
import "mixer/descriptor/quota_descriptor.proto";
import "mixer/descriptor/log_entry_descriptor.proto";
import "mixer/descriptor/monitored_resource_descriptor.proto";
import "mixer/descriptor/principal_descriptor.proto";

package istio.mixer.descriptor;

// Istio Definitions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please rephrase this comment to be in flowing prose with the intended audience to be the consumer of the message. That is, this shouldn't have things like "Every descriptor proto defined in this package should be represented here" as that is a comment for implementers of the package, not for its consumers.

// An istio definition proto message may contain some or all definition types.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"a definition may contain some or all definitions" isn't clear. Presumably, you mean to say something like

The effective set of descriptors understood by Istio is produced through the union of all Definition messages within the configuration state.

// Messages are combined by runtime to form the effective definition.
// In many cases attribute definitions (vocabulary) are available as separate messages.
// Every descriptor proto defined in this package should be represented here.
// Every proto message in definition has a unique name within the message class.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's 'message class'?

// Mixer uses a lookup api to access these definitions.
// Find(definition_name, definition_type)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Presumably, this is actually descriptor_name and descriptor_type, right?

message Definitions {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Considering this holds descriptors, why not call this Descriptors?

// subject
string subject = 1;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's this for? The comment is not helpful.

string revision = 2;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's this for, how is it used, what does it contain?

// attributes form the attribute vocabulary
// The effective vocabulary is a union of vocabulary presented by the proxy
// and additional attributes generated by the mixer.
repeated istio.mixer.v1.config.descriptor.AttributeDescriptor attributes = 3;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to update the packages here.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should move attribute and vocabulary to istio.attribute. Leave the rest under mixer/somewhere.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Definitions message is intended to hold the definitions of the various 'object types' used by the operator.

The set of attributes supported by a deployment is not a property of the configuration state, it is a manifest associated with pieces of code (the proxy in particular). As such, I don't think this field should exist here.

// labels are analogous to attributes. They are externalized representation of attributes used by aspects.
repeated istio.mixer.v1.config.descriptor.LabelDescriptor labels = 4;
// metrics defines available metrics types.
repeated istio.mixer.v1.config.descriptor.MetricDescriptor metrics = 5;
// quota defines available quota types.
repeated istio.mixer.v1.config.descriptor.QuotaDescriptor quotas = 6;
// logEntries define available log types.
repeated istio.mixer.v1.config.descriptor.LogEntryDescriptor logEntries = 7;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For proto fields, please use _ to separate words instead of camelCase.

// monitoredResources define monitored resource types.
repeated istio.mixer.v1.config.descriptor.MonitoredResourceDescriptor monitoredResources = 8;
// principals define principal types.
repeated istio.mixer.v1.config.descriptor.PrincipalDescriptor principals = 9;
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@

syntax = "proto3";

package istio.mixer.v1.config.descriptor;
package istio.mixer.descriptor;

import "mixer/v1/config/descriptor/value_type.proto";
import "mixer/descriptor/value_type.proto";

// A `LabelDescriptor` describes the schema of a label (or dimension) used in other descriptors.
message LabelDescriptor {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

syntax = "proto3";

package istio.mixer.v1.config.descriptor;
package istio.mixer.descriptor;

// Defines the format of a single log entry.
message LogEntryDescriptor {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@

syntax = "proto3";

package istio.mixer.v1.config.descriptor;
package istio.mixer.descriptor;

import "mixer/v1/config/descriptor/label_descriptor.proto";
import "mixer/v1/config/descriptor/value_type.proto";
import "mixer/descriptor/label_descriptor.proto";
import "mixer/descriptor/value_type.proto";

// Defines a metric type and its schema.
//
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

syntax = "proto3";

package istio.mixer.v1.config.descriptor;
package istio.mixer.descriptor;

// An object that describes the schema of a `MonitoredResource`. A
// `MonitoredResource` is used to define a type of resources for
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

syntax = "proto3";

package istio.mixer.v1.config.descriptor;
package istio.mixer.descriptor;

// Defines a a security principal.
//
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@

syntax = "proto3";

package istio.mixer.v1.config.descriptor;
package istio.mixer.descriptor;

import "google/protobuf/duration.proto";
import "mixer/v1/config/descriptor/label_descriptor.proto";
import "mixer/descriptor/label_descriptor.proto";

// Configuration state for a particular quota.
//
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

syntax = "proto3";

package istio.mixer.v1.config.descriptor;
package istio.mixer.descriptor;

// ValueType describes the types that values in the Istio system can take. These are used to describe the type of
// Attributes at run time, describe the type of the result of evaluating an expression, and to describe the runtime
Expand Down