Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

more documentation #936

Merged
merged 6 commits into from
Nov 15, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
more documentation
adrianmroz-allegro committed Nov 14, 2022

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit 64542485fd31622977db21407efe9d1e4ae7a997
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -72,18 +72,18 @@ Install Turnilo distribution using [npm](https://www.npmjs.com/).
npm install -g turnilo
```

Start off by running an example with Covid-19 and Wikipedia datasets
Start off by running turnilo with example datasets
adrianmroz-allegro marked this conversation as resolved.
Show resolved Hide resolved
and open [http://localhost:9090/](http://localhost:9090/).

```
turnilo --examples
turnilo run-examples
```

Or connect to the existing Druid broker using `--druid` command line option.
Or connect to the existing Druid broker using `connect-druid` command.
adrianmroz-allegro marked this conversation as resolved.
Show resolved Hide resolved
Turnilo will automatically introspect your Druid broker and figure out available datasets.

```
turnilo --druid http[s]://druid-broker-hostname[:port]
turnilo connect-druid http[s]://druid-broker-hostname[:port]
```

## Documentation
@@ -107,7 +107,7 @@ npm run build

### Run project

Run Covid-19 and Wikipedia examples.
Run example datasets.

```
npm run start:examples
@@ -116,20 +116,20 @@ npm run start:examples
Connect to the existing Druid broker.

```
npm run start -- --druid http[s]://druid-broker-hostname[:port]
npm run start -- connect-druid http[s]://druid-broker-hostname[:port]
```

Connect to the existing Druid broker using your config file.

```
npm run start -- --config path/to/config.yml
npm run start -- run-config path/to/config.yml
```

### Run project in developer mode

Every change in frontend code would recompile project and reload page.

Run Covid-19 and Wikipedia examples.
Run example datasets.

```
npm run start:dev:examples
@@ -138,13 +138,13 @@ npm run start:dev:examples
Connect to the existing Druid broker.

```
npm run start:dev -- --druid http[s]://druid-broker-hostname[:port]
npm run start:dev -- connect-druid http[s]://druid-broker-hostname[:port]
```

Connect to the existing Druid broker using your config file.

```
npm run start:dev -- --config path/to/config.yml
npm run start:dev -- run-config path/to/config.yml
```


18 changes: 12 additions & 6 deletions src/server/cli.ts
Original file line number Diff line number Diff line change
@@ -45,7 +45,8 @@ program

program
.command("run-config")
.argument("<file>", "path of config file")
.description("Runs Turnilo using config file")
.argument("<config-path>", "Path to config file")
.addOption(portOption)
.addOption(serverRootOption)
.addOption(serverHostOption)
@@ -74,6 +75,7 @@ program

program
.command("run-examples")
.description("Runs Turnilo with example datasets")
.addOption(portOption)
.addOption(serverRootOption)
.addOption(serverHostOption)
@@ -95,7 +97,8 @@ program

program
.command("connect-druid")
.argument("<url>", "druid url")
.description("Runs turnilo that connects to Druid cluster and introspects it for datasets")
.argument("<druid-url>", "Url of Druid cluster")
.addOption(portOption)
.addOption(serverRootOption)
.addOption(serverHostOption)
@@ -116,8 +119,9 @@ program

program
.command("load-file")
.argument("<file>", "json file")
.requiredOption("-t, --time-attribute <attribute>", "time attribute")
.description("Runs turnilo and loads json file as a dataset")
adrianmroz-allegro marked this conversation as resolved.
Show resolved Hide resolved
.argument("<file-path>", "Path to json file with data")
.requiredOption("-t, --time-attribute <field-name>", "JSON field name with time column")
.addOption(portOption)
.addOption(serverRootOption)
.addOption(serverHostOption)
@@ -140,7 +144,8 @@ program

program
.command("verify-config")
.argument("<file>", "path to config file")
.description("Runs verification of provided config file")
.argument("<file-path>", "Path to config file to verify")
.addOption(verboseOption)
.action((file, { verbose }) => {
try {
@@ -153,7 +158,8 @@ program

program
.command("introspect-druid")
.argument("<url>", "druid url")
.description("Connects to Druid cluster and prints introspected data in config file format")
.argument("<druid-url>", "Url of Druid cluster")
.addOption(verboseOption)
.addOption(usernameOption)
.addOption(passwordOption)
33 changes: 27 additions & 6 deletions src/server/cli/options.ts
Original file line number Diff line number Diff line change
@@ -15,11 +15,32 @@
*/

import { Option } from "commander";
import { DEFAULT_PORT } from "../models/server-settings/server-settings";
import { parseInteger } from "./utils";

export const portOption = new Option("-p, --port <number>", "port number").argParser(parseInteger);
export const serverRootOption = new Option("--server-root <root>", "server root");
export const serverHostOption = new Option("--server-host <host>", "server host");
export const verboseOption = new Option("--verbose", "verbose mode");
export const usernameOption = new Option("--username <username>", "username");
export const passwordOption = new Option("--password <password>", "password");
export const portOption = new Option(
"-p, --port <number>",
`Port number to start server on. Default: ${DEFAULT_PORT}`
).argParser(parseInteger);

export const serverRootOption = new Option(
"--server-root <path>",
"Custom path to act as turnilo root"
);
export const serverHostOption = new Option(
"--server-host <hostname>",
"Hast that server will bind to"
adrianmroz-allegro marked this conversation as resolved.
Show resolved Hide resolved
);
export const verboseOption = new Option(
"--verbose",
"Verbose mode"
);

export const usernameOption = new Option(
"--username <username>",
"Username that will be used in HTTP Basic authentication to Druid cluster"
);
export const passwordOption = new Option(
"--password <password>",
"Password that will be used in HTTP Basic authentication to Druid cluster"
);