Git Product home page Git Product logo

old_mixer_repo's Introduction

Mixer

Mixer

GoDoc Go Report Card codecov.io

Mixer enables extensible policy enforcement and control within the Istio service mesh. It is responsible for insulating the proxy (Envoy) from details of the current execution environment and the intricacies of infrastructure backends.

Mixer provides three distinct features:

  • Precondition Checking. Enables callers to verify a number of preconditions before responding to an incoming request from a service consumer. Preconditions can include whether the service consumer is properly authenticated, is on the service's whitelist, passes ACL checks, and more.

  • Quota Management. Enables services to allocate and free quota on a number of dimensions, Quotas are used as a relatively simple resource management tool to provide some fairness between service consumers when contending for limited resources.

  • Telemetry Reporting. Enables services to produce logging, monitoring, tracing and billing streams intended for the service producer itself as well as for its consumers.

Learn more about Mixer here.

Please see istio.io to learn about the overall Istio project and how to get in touch with us. To learn how you can contribute to any of the Istio components, including Mixer, please see the Istio contribution guidelines.

Mixer's developer's guide presents everything you need to know to create, build, and test code for Mixer.

Mixer's Adapter Developer's Guide presents everything you need to know about extending Mixer to provide support for new backends through the development of new adapters.

old_mixer_repo's People

Contributors

andraxylia avatar apicl avatar ayj avatar chowchow316 avatar chxchx avatar costinm avatar douglas-reid avatar esnible avatar geeknoid avatar guptasu avatar gyliu513 avatar istio-testing avatar jmuk avatar kyessenov avatar ldemailly avatar lizan avatar mandarjog avatar manlinl avatar ozevren avatar qiwzhang avatar redhotpenguin avatar rkpagadala avatar roeymaor avatar ryancox avatar sebastienvas avatar smawson avatar wora avatar xiaolanz avatar yutongz avatar zackbutcher avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

old_mixer_repo's Issues

Detect build & test breakages from PRs

Recent PRs resulted in build and test failures that had to be corrected by subsequent PRs. It would be great if these could be caught before merging (as part of the presubmit checks, perhaps even before review).

Add uniform adapter invariant checks

Add centralized test where every new adapter is added.
This includes running thru

pkg/adaptertesting.TestBuilderInvariants()

Also ensure that the Impl protobuf supports standard attributes, like.
debug and trace
etc.

Update denyChecker config to use a google.rpc.Status

I'd like the adapter configuration at adapter/denyChecker/cfg.proto to use a google.rpc.Status instead of an int32. But I can't figure out how to get the dependencies setup properly to get that to compile.

Would you mind taking a look to see if you can figure it out?

Shuffle directory structure

Current proposal:

istio.io/mixer/cmd/mixer/main.go
istio.io/mixer/pkg/adapter/...
istio.io/mixer/pkg/api/... (most of what's currently in mixer/server/*.go)
istio.io/mixer/ā€‹pkg/config/...
istio.io/mixer/pkg/attribute/...
istio.io/mixer/doc/...
istio.io/mixer/example/...

Fix bazel.build rules for building protos

This impacts the ability to build protos that depend on:

google/rpc/status.proto

which uses:

option go_package = "google.golang.org/genproto/googleapis/rpc/status;status";

Current building requires setting up imports for protoc that break sandbox.

Add stdio logging adapter

Tracking issue

Need to add a basic log to stdio logger to mixer to provide barebones logging support.

Work is being done in #157.

Fix relative imports in //BUILD.api

go_proto_library(
    name = "istio/config/v1",
    imports = [
        "../../external/com_github_google_protobuf/src"

prior comments:

geeknoid: Definitely not the right way to do this. I think the importmap feature is what you need here.
douglas-reid: importmap isn't needed for "well-known" protos. but you do need to specify where to find the sources for imports.
geeknoid: This can't be the right way to find these files. This is assuming the structure of the blaze output directories.

Add AccessLogger Aspect to Mixer

Tracking issue

Mixer will soon have a (application) logger aspect. We should consider adding an access log aspect that provides a LogAccess([]accesslogger.Entry) method for adapters.

Define plan for monitoring mixer itself

We should figure out how we want to monitor the mixer process itself. There is probably a way to do it in a slick way using the configured adapters, etc., but we should design/plan for it and start working on it. In particular, we should start defining what (beyond basic request count, latencies, go routines, mem usage, etc.) would be interesting to monitor (most likely, adapter metadata).

Proposal: attributes as first-class concept of Istio

I would like to propose to define attributes as a first-class concept of Istio at the same level of proxy, mixer, adapter and others, and use it to connect many sub-systems together, such as billing, logging, monitoring, analytics.

The main reason to define attributes as a first-class concept instead of part of proxy or mixer is to establish a stable foundation that we can quickly build many components on top it, including proxy, chemist, logging, monitoring, billing, rate limiting and more. So we don't let one component overrule others. Istio ecosystem must interact with many other systems, including standards like HTTP, gRPC, REST, Swagger/OpenAPI. With first-class attributes, we can develop the system as N modules instead of (N * N) mesh. Per our experience with Google API Platform, I am confident this proposal is significantly better and simpler than previous metadata designs and should meet Istio's needs comfortably.

An Istio attribute is a piece of metadata describing activities with an Istio service, such as the origin.ip (the attribute) of an API request (the activity) received by an Istio API service. Being a first-class concept, the same attribute will have the same value and semantics across all sub-systems, e.g. origin.ip in the logs will mean the same thing in the rate limiting system. If you want to allow one request per IP address per second, you can define the rate limit as "1/{origin.ip}/s".

The schema of the attribute will be simple:

  • name: Each attribute has a qualified name. The namespace will be organized as "organization.product.property".
    • For example, origin.ip.
  • type: Each attribute has a type, which specifies the value type. The type will be defined by an enum type.
    • For example, STRING.
  • value: Each attribute has a string value, which must be interpreted according to the type.
    • For example, 127.0.0.1.

To define the above scheme using proto3, it would look like this:

package istio.type;

message Attribute {
enum Type {
// The value is a valid UTF-8 string.
STRING = 0;
// The value is a 64-bit integer printed as a decimal number text. It must not have leading "+".
INT = 1;
// The value is a 64-bit floating point printed as text.
FLOAT = 2;
// The value is a timestamp with RTC 3339 format.
TIMETAMP = 3;
}
string name = 1;
// Most attributes have well known type, so this field is often omitted.
Type type = 2;
string value = 3;
};

The attribute can be used in various systems. For example:

  • To log attributes about an API request, we can simply specify a list of attribute names in the logging config.
  • To monitor a system against certain attributes, we can use attributes as dimensions of metrics.
  • To specify rate limits, we can use attributes in the limits.
    • Example: "1/{origin.ip}/s" and "3/{origin.user}/min".
  • To control access, we can use attributes in access policy.
    • Example: origin.user != null.
  • To express simple resource ownership.
    • Example: origin.user == resource.owner.
  • To send attributes from proxy to REST servers, we can map attribute to HTTP header.
    • Example: origin.ip => X-Origin-IP

Thoughts?

Mixer schema discovery

Add an endpoint to mixer to do adapter schema discovery.

  • either mixer used builder.getconfig()
  • the complete schema is emitted at build time

Build docker images in CI

Please build server docker images in your CI/CD workflow to be utilized by Istio manager.
Common pattern is to tag your images as:
gcr.io/istio-testing/mixer-alpha:GIT_SHA

Add Prometheus integration

This should exercise the config -> aspect -> adapter story from start to finish. When complete, we should ask the prometheus team to take a look and provide feedback on the approach and implementation.

Support for plugins

The mixer should support dynamic discovery/loading of adapters via a plugin model. There are a number of possible approaches, including usage of the coming go 1.8 plugin package.

Create mixer CLI

For testing, debugging, API validation, etc., it would be nice to generate a simple CLI that can be used to send requests to a mixer instance.

Design and add mixer error interfaces

we currently have an uncomfortable tension between programmer vs. operator errors.

Options.

  1. We use a custom error type that carries an explicitly operator-friendly error string in addition to the developer string
  2. Extend error interface with InteralError () If an error implements this interface, it is free to output any message.
    All other error must produce operator friendly error messages.

example: https://golang.org/pkg/net/#Error

Add basic logging adapter

Need to add basic logging adapter, capable of dumping to stdout/stderr, ideally in JSON.

This will provide a template for expansion for other, more complex loggers that can push to diverse backends, while providing simple functionality for early end-to-end testing.

Review metric schema in context of other OSS projects

Add ConfigManager

We need to add ConfigManager, for managing configuration within Mixer.

Add Stackdriver integration

Tracking issue.

Provide adapters for Stackdriver logging/monitoring. This will require setup of creds passing in config, etc.

Define and Implement Adapter Cache

We now have a 2 level adapter cache.

  1. Adapter Wrapper Cache
  2. AdapterImpl cache
type (
	CacheableMessage struct {
		inner proto.Message
		sha string
	}
)
func NewCacheableMessage (cfg proto.Message) *CacheableMessage{
	cm = &CacheableMessage{
		inner: cfg,
		sha: cfg.String(),
	}
}

When a new config is ingested proto messages should be kept with its sha.

For impl configs, sha should be computed after calling DefaultConfig followed by parsing in the ptype.Struct

Replace types.go pattern

I'd like to see the following changes in our current code base:

  • Get rid of the types.go pattern. Cramming a bunch of stuff in this kind of 'trash bin' is an anti-pattern as it obfuscate the source base.

  • Move adapter-related functionality to pkg/adapter. For example, the adapter registry and the primary Adapter type should be there instead of in aspectsupport.

glog: fix or find a replacement

glog.init() method registers standard golang flags.

k8sclient go client vendors a version of glog. This makes it hard to use glog inside istio with k8sclient.

kubernetes/kubernetes#35096

options

  1. fork and fix glog, so it does not auto register
  2. Find a way to build it in bazel by removing dependency.

Add basic statsd adapter

Need to add an adapter for basic export to statsd.

This will provide a basic template for creating additional metrics backend adapters and serve as a measuring stick for handling the various bits of config around metrics, monitored resources, labels, etc.

Consider further optimizations to the attribute protocol

There's potential to improve the end-to-end perf for the proxy->mixer attribute-related protocol. Please see the conversation thread for PR #107 for details.

Before attempting these improvements, we need to see what the client-side code in the mixer will look like and have some end-to-end benchmarks with representative traffic.

Decide singular or plural for directory+package names

This is one of classic naming issues. Many traditional names, such as "/usr/bin", "/usr/lib", "java.util", use singular names. While plural name is perfect valid choice when you look at it specifically, but it is often out of place in symbols, such as "com.google.api.services.gmail.Gmail". It looks awkward to have a plural word in the middle of many singular words.

It would be better to always use singular word for all directory names, then we don't need to debate the choice case by case.

Create microbenchmark for API

Create a set of simple standard scenario with a combination of well known attributes and metrics and benchmark size, serialization time & deserialization time.

Will need to quickly qualify API variations and evolution

Support mandatory and logs-only modes for Check() adapters

From a conversation with @wora this morning:

It should be possible to define Check adapters (and possibly Quota) that operate in a log-only like mode. In other words, an operator should be able to add adapters that execute on Check() calls but that don't impact the outcome of the call.

This would be to support the rollout / validation of new IAM checks, etc., without potentially causing outages. @wora mentioned support for "dark launches" when describing this use case.

Make mixer robust to adapter failures

The mixer needs to handle:

  • Panics in adapter methods
  • Timeouts in adapter methods
  • Needs to perform type validation of configs before they reach the adapters.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    šŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. šŸ“ŠšŸ“ˆšŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ā¤ļø Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.