Git Product home page Git Product logo

wineryjs's Introduction

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 [email protected] with any additional questions or comments.

License

Copyright (c) Microsoft Corporation. All rights reserved.

Licensed under the MIT License.

wineryjs's People

Contributors

daiyip avatar fs-eire avatar microsoftopensource avatar msftgits avatar

Stargazers

 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

wineryjs's Issues

Failure during registration in remote Napa zone doesn't trigger exception in Hub.register

Code

const napa = require('napajs');
const winery = require('winery');

const zone = napa.zone.create('z1');
const host = winery.hub();
host.register('<some-bad-app>', ['app-name']);

Expect:

host.register shall throw.

Actual:

host.register doesn't throw, but program ends because of unhandled exception in asynchronous call to napa.zone.broadcast within host.register.

[Action Needed] This repo is inactive

This GitHub repository has been identified as a candidate for archival

This repository has had no activity in more than [x amount of time]. Long periods of inactivity present security and code hygiene risks. Archiving will not prevent users from viewing or forking the code. A banner will appear on the repository alerting users that the repository is archived.

Please see https://aka.ms/sunsetting-faq to learn more about this process.

Action

✍️

❗**If this repository is still actively maintained, please simply close this issue. Closing an issue on a repository is considered activity and the repository will not be archived.🔒

If you take no action, this repository is still inactive 30 days from today it will be automatically archived..

Need more help? 🖐️

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.