Winery.js: a framework for service experimentation
Перейти к файлу
Yulong Wang f065b465cb
optimize before_install stage in CI config (#7)
2018-05-31 17:04:59 -07:00
config Rename Engine into Host 2017-12-14 11:15:53 -08:00
docs Add examples/playground 2018-01-09 13:36:47 -08:00
examples/playground Add examples/playground 2018-01-09 13:36:47 -08:00
lib enable error report for Proxy.register (#5) 2018-05-30 22:07:20 -07:00
schema Add PerfDataCollector 2018-01-08 00:28:38 -08:00
test enable error report for Proxy.register (#5) 2018-05-30 22:07:20 -07:00
.gitignore Official publish winery.js 0.1.0 2018-01-17 14:00:40 -08:00
.npmignore Official publish winery.js 0.1.0 2018-01-17 14:00:40 -08:00
.travis.yml optimize before_install stage in CI config (#7) 2018-05-31 17:04:59 -07:00
LICENSE.txt Winery: initial version from Bing repo. 2017-12-06 14:14:40 -08:00
README.md Fix links in README.md 2018-01-17 17:14:32 -08:00
package.json enable error report for Proxy.register (#5) 2018-05-30 22:07:20 -07:00

README.md

Build status

Winery.js

Winery.js is a framework that enables services to run experiments along with production traffic in the same process. Besides A/B testing, it supports experimentation at per-request level, which minimizes turnaround time when code evolves fast. Winery.js also provides a structure for creating applications declaratively, with the access to Napa.js capabilities, such as multi-threading, pluggable logging, metric, and etc. Before this work was branched out as an open source project, it has been used in Bing to empower feature experiments for machine learned models.

Installation

npm install winery

Quick Start

const hub = require('winery').hub();
hub.register('winery/examples/playground', ['playground']);

const request = {
    "application": "playground",
    "entryPoint": "sort",
    "input": [12, 16, 1, 10, 2, 5, 0],
    "overrideObjects": [
        {
        "name": "comparator",
        "value": {
            "_type": "Function",
            "function": "function (a, b) { return a.toString() >= b.toString(); } "
        }
        }
    ]
};
    
hub.serve(request)
.then((response) => {
    console.log(response);
});

console output:

{ responseCode:0, output: [0, 1, 10, 12, 16, 2, 5] }

Features

  • Support request level dependency injection for rapid development
  • Support request template level dependency injection for A/B testing
  • Rich dependency injection capabilities: data, functions and behaviors
  • Declarative application framework
  • Flexible flow control: Entrypoint with stacked interceptors
  • Integrated with Napa.js to support computation heavy scenarios
  • Multi-tenancy with resource sharing among multiple applications
  • Built-in instrumentation and monitoring support

Overview

Winery.js was built based on the idea of dependency injection at multiple levels, thus its core is to encapsulate object creation and object retrieval behaviors with an overriding mechanism. White paper Continuous modification: a process to build constantly evolving services discussed this idea in details.

In Winery.js' implementation, Object Context serves the purpose to capture these behaviors, whose instances are owned by multiple runtime entities with different lifetime and configurability. These object context objects work collaboratively to form an overriding chain among these entities.

These runtime entities are:

  • Host: a conceptually singleton object to host applications. Live long and is configurable at deployment time.
  • Application: multi-instance object that manages resources for request execution and serve user requests. Live long and is configurable at deployment time.
  • Request Template: multi-instance object that manages different parameters and resources for A/B testing. Live long and is configurable at runtime.
  • Request: multi-instance object that describes request from user. Live short and is configurable at runtime.

Winery.js Architecture

Specification

Contribute

You can contribute to Winery.js in following ways:

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.

License

Copyright (c) Microsoft Corporation. All rights reserved.

Licensed under the MIT License.