From ffce9d6449c9269ab28d9d41aa634a8413608130 Mon Sep 17 00:00:00 2001 From: Adhitya Mamallan Date: Tue, 7 Nov 2023 19:57:19 +0530 Subject: [PATCH 1/6] Update README.md --- README.md | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index de62b5917..4b735da73 100644 --- a/README.md +++ b/README.md @@ -27,15 +27,24 @@ Set these environment variables if you need to change their defaults ### 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](https://docs.npmjs.com/misc/scripts) to install dependencies, run the -server, and run tests. To provide a consistent environment we recommend using docker in development. -To start local server with live reload on code change you can run: +server, and run tests. + +To provide a consistent environment we recommend using docker in development. We use VSCode with [Remote Containers plugin](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers). +We provide a default configuration for remote containers using docker-compose. + +#### Using VSCode Dev Containers + +1. Set up the [Remote Containers plugin](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers) in VSCode. +2. Open the cadence-web directory in VSCode. +3. Use the Command Palette to select the "Reopen folder in Container" option. `npm install` should run locally upon doing so. +4. Run the app with `npm start`. + +Alternatively, to start local server with live reload on code change you can run: ``` docker-compose up ``` -For development we recommend using VSCode with [Remote Containers plugin](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers). We provide a default configuration for remote container using docker-compose. - For development and contributing to `cadence-web`, please see the [contributing guide](https://github.com/uber/cadence-web/blob/master/CONTRIBUTING.md). You may also use docker by pulling [ubercadence/web](https://hub.docker.com/r/ubercadence/web/). It is also included in the Cadence server's [local docker setup](https://github.com/uber/cadence/tree/master/docker). From d60f0a05c83ac73fbcbca41b95f614999eaf79b3 Mon Sep 17 00:00:00 2001 From: Adhitya Mamallan Date: Tue, 7 Nov 2023 16:02:21 +0100 Subject: [PATCH 2/6] Update readme and remove npm run dev from docker-compose --- README.md | 58 ++++++++++++++++++++++------------------------ docker-compose.yml | 2 +- 2 files changed, 29 insertions(+), 31 deletions(-) diff --git a/README.md b/README.md index 4b735da73..246369fdc 100644 --- a/README.md +++ b/README.md @@ -14,36 +14,34 @@ This web UI is used to view workflows from [Cadence][cadence], see what's runnin 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 | '' | +| 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](https://docs.npmjs.com/misc/scripts) to install dependencies, run the -server, and run tests. +server, and run tests. -To provide a consistent environment we recommend using docker in development. We use VSCode with [Remote Containers plugin](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers). -We provide a default configuration for remote containers using docker-compose. +To provide a consistent environment we recommend using docker in development. We provide a default configuration for remote containers using docker-compose. #### Using VSCode Dev Containers 1. Set up the [Remote Containers plugin](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers) in VSCode. 2. Open the cadence-web directory in VSCode. -3. Use the Command Palette to select the "Reopen folder in Container" option. `npm install` should run locally upon doing so. -4. Run the app with `npm start`. +3. Use the Command Palette to select the "Reopen folder in Container" option. `npm install` should run automatically in the container upon doing so. +4. Run the app in the container with `npm start`. +5. Open `localhost:8088` (or the custom Cadence Web port you have defined) to load the webapp. -Alternatively, to start local server with live reload on code change you can run: +#### Using docker-compose to start the dev container -``` -docker-compose up -``` +To start local server with live reload on code change you can run `docker-compose up`. For development and contributing to `cadence-web`, please see the [contributing guide](https://github.com/uber/cadence-web/blob/master/CONTRIBUTING.md). @@ -64,21 +62,21 @@ All options are optional. For example, here is how you would add a request count metric using `uber-statsd-client`: ```javascript -var app = require('cadence-web') -var createStatsd = require('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) + host: "statsd.example.com", +}); + +app + .use(async function(ctx, next) { + sdc.increment("http.request"); + await next(); + }) + .init() + .listen(7000); ``` - The [webpack](https://webpack.js.org/) configuration is also exported as `webpackConfig`, and can be modified before calling `init()`. ### Licence diff --git a/docker-compose.yml b/docker-compose.yml index d6af9dc6f..74571faae 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -11,4 +11,4 @@ services: install: extends: base - command: /bin/sh -c "npm install --no-save --unsafe-perm && npm run dev" + command: /bin/sh -c "npm install --no-save --unsafe-perm" From a5d0799da8d929bf39f376a707897494191d1890 Mon Sep 17 00:00:00 2001 From: Adhitya Mamallan Date: Tue, 7 Nov 2023 16:13:44 +0100 Subject: [PATCH 3/6] undo some readme formatting --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 246369fdc..792132a2e 100644 --- a/README.md +++ b/README.md @@ -62,15 +62,15 @@ All options are optional. For example, here is how you would add a request count metric using `uber-statsd-client`: ```javascript -var app = require("cadence-web"); -var createStatsd = require("uber-statsd-client"); +var app = require('cadence-web'); +var createStatsd = require('uber-statsd-client'); var sdc = createStatsd({ - host: "statsd.example.com", + host: 'statsd.example.com', }); app .use(async function(ctx, next) { - sdc.increment("http.request"); + sdc.increment('http.request'); await next(); }) .init() From 26b4217fc28d7a7a008732700f2a71f41d89da38 Mon Sep 17 00:00:00 2001 From: Adhitya Mamallan Date: Tue, 7 Nov 2023 16:15:13 +0100 Subject: [PATCH 4/6] Revert "undo some readme formatting" This reverts commit a5d0799da8d929bf39f376a707897494191d1890. --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 792132a2e..246369fdc 100644 --- a/README.md +++ b/README.md @@ -62,15 +62,15 @@ All options are optional. For example, here is how you would add a request count metric using `uber-statsd-client`: ```javascript -var app = require('cadence-web'); -var createStatsd = require('uber-statsd-client'); +var app = require("cadence-web"); +var createStatsd = require("uber-statsd-client"); var sdc = createStatsd({ - host: 'statsd.example.com', + host: "statsd.example.com", }); app .use(async function(ctx, next) { - sdc.increment('http.request'); + sdc.increment("http.request"); await next(); }) .init() From 92e9289f0f035f9365cdf618373b79411c19922c Mon Sep 17 00:00:00 2001 From: Adhitya Mamallan Date: Thu, 9 Nov 2023 10:06:07 +0100 Subject: [PATCH 5/6] Update run command --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 246369fdc..9e4b85107 100644 --- a/README.md +++ b/README.md @@ -36,7 +36,7 @@ To provide a consistent environment we recommend using docker in development. We 1. Set up the [Remote Containers plugin](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers) in VSCode. 2. Open the cadence-web directory in VSCode. 3. Use the Command Palette to select the "Reopen folder in Container" option. `npm install` should run automatically in the container upon doing so. -4. Run the app in the container with `npm start`. +4. Run the app in the container with `npm run dev`. 5. Open `localhost:8088` (or the custom Cadence Web port you have defined) to load the webapp. #### Using docker-compose to start the dev container From 32fa48f189a29db7fe9c15462abc0b5d7e9b088c Mon Sep 17 00:00:00 2001 From: Adhitya Mamallan Date: Thu, 9 Nov 2023 10:55:14 +0100 Subject: [PATCH 6/6] use single quotes --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 9e4b85107..b9b9d342b 100644 --- a/README.md +++ b/README.md @@ -35,7 +35,7 @@ To provide a consistent environment we recommend using docker in development. We 1. Set up the [Remote Containers plugin](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers) in VSCode. 2. Open the cadence-web directory in VSCode. -3. Use the Command Palette to select the "Reopen folder in Container" option. `npm install` should run automatically in the container upon doing so. +3. Use the Command Palette to select the 'Reopen folder in Container' option. `npm install` should run automatically in the container upon doing so. 4. Run the app in the container with `npm run dev`. 5. Open `localhost:8088` (or the custom Cadence Web port you have defined) to load the webapp. @@ -62,15 +62,15 @@ All options are optional. For example, here is how you would add a request count metric using `uber-statsd-client`: ```javascript -var app = require("cadence-web"); -var createStatsd = require("uber-statsd-client"); +var app = require('cadence-web'); +var createStatsd = require('uber-statsd-client'); var sdc = createStatsd({ - host: "statsd.example.com", + host: 'statsd.example.com', }); app .use(async function(ctx, next) { - sdc.increment("http.request"); + sdc.increment('http.request'); await next(); }) .init()