metaparticle-ast

module
v0.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 22, 2018 License: MIT

README

Metaparticle Compiler

This compiler transforms the metaparticle domain-specific language into execution on various backends (e.g. Kubernetes)

Status

This documentation is woefully incomplete, but fortunately, this tool is an implementation detail.

Schema

The OpenAPI Schema for the metaparticle DSL can be found here

Specification examples

Simple server

{
    "name": "server",
    "guid": 1234567, 
    "services": [ 
        {
                "name": "server",
            "replicas": 4,
            "containers": [
                { "image": "nginx" }
            ],
            "ports": [{
                "number": 80
            }]
        }
    ],
    "serve": {
        "name": "server",
        "public": true
    }
}

Sharded server

{
    "name": "name",
    "guid": 1234567, 
    "services": [ 
        {
            "name": "server",
            "shardSpec": {
                "shards": 4,
                "urlPattern": "user/(.*)/"
            },
            "containers": [
                { "image": "brendanburns/node-hostname" }
            ],
            "ports": [{
                "number": 80
            }]
        }
    ],
    "serve": {
        "name": "server",
        "public": true
    }
}

Command line examples

# Run a file in kubernetes
mp-compiler -f metaparticle-spec.json

# Attach to the logs, but don't re-deploy
mp-compiler -f metaparticle-spec.json --attach=true --deploy=false

# Tear down an existing service
mp-compiler -f metaparticle-spec.json --deploy=false --delete=true

Contribute

There are many ways to contribute to Metaparticle

  • Submit bugs and help us verify fixes as they are checked in.
  • Review the source code changes.
  • Engage with other Metaparticle users and developers on gitter.
  • Join the #metaparticle discussion on Twitter.
  • Contribute bug fixes.

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.

Directories

Path Synopsis
cmd
Package restapi An application for easier distributed application generation The metaparticle API Schemes: http Host: localhost BasePath: / Version: 0.0.1 Consumes: - application/json Produces: - application/json swagger:meta
Package restapi An application for easier distributed application generation The metaparticle API Schemes: http Host: localhost BasePath: / Version: 0.0.1 Consumes: - application/json Produces: - application/json swagger:meta

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL