Git Product home page Git Product logo

cadence-web's Introduction

Cadence Web UI

Build Status Docker Status

Cadence is a distributed, scalable, durable, and highly available orchestration engine we developed at Uber Engineering to execute asynchronous long-running business logic in a scalable and resilient way.

This web UI is used to view workflows from Cadence, see what's running, and explore and debug workflow executions.

Demo Usage

Getting Started

Configuration

Set these environment variables if you need to change their defaults

Variable Description Default
CADENCE_TCHANNEL_PEERS Comma-delmited list of tchannel peers 127.0.0.1:7933
CADENCE_TCHANNEL_SERVICE Name of the cadence tchannel service to call cadence-frontend
CADENCE_WEB_PORT HTTP port to serve on 8088
CADENCE_EXTERNAL_SCRIPTS Addtional JavaScript tags to serve in the UI
ENABLE_AUTH Enable auth feature false
AUTH_TYPE concurrently supports ADMIN_JWT ''
AUTH_ADMIN_JWT_PRIVATE_KEY JWT signing private key for ADMIN_JWT type ''

Running locally

cadence-web requires node v10.22.1 or greater to be able to run correctly. cadence-web uses all the standard npm scripts to install dependencies, run the server, and run tests. Additionally to run locally with webpack hot reloading and other conveniences, use

npm run dev

For development and contributing to cadence-web, please see the contributing guide.

You may also use docker by pulling ubercadence/web. It is also included in the Cadence server's local docker setup.

API

If you need to extend cadence-web to add middleware to the server, you can install cadence-web as a dependecy, and it will export the Koa web server that has not yet been started or configured. It includes an additional init function that will then compose the built-in middleware. This gives you an option to add middleware before or after you call init so it will add the middleware at the beginning or the end of the chain, respectively.

init(options)

All options are optional.

useWebpack: If true, starts webpack and adds the middleware, otherwise if false, it assumes the UI bundle was already built and serves it statically. Defaults to process.env.NODE_ENV === 'production'.

logErrors: If true, thrown errors are logged to console.error. Defaults to true.

For example, here is how you would add a request count metric using uber-statsd-client:

var app = require('cadence-web')
var createStatsd = require('uber-statsd-client')
var sdc = createStatsd({
    host: 'statsd.example.com'
})

app.use(async function(ctx, next) {
  sdc.increment('http.request')
  await next()
})
.init()
.listen(7000)

The webpack configuration is also exported as webpackConfig, and can be modified before calling init().

Licence

MIT License, please see LICENSE for details.

cadence-web's People

Contributors

just-at-uber avatar nathanboktae avatar longquanzheng avatar dmetzgar avatar sokada1221 avatar vancexu avatar wtoma avatar vytautas-karpavicius avatar yycptt avatar yux0 avatar

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.