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

Docs for Kedro-Viz CLI #2044

Merged
merged 7 commits into from
Aug 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
162 changes: 162 additions & 0 deletions docs/source/cli-docs.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,162 @@
# Kedro Viz CLI reference

Check warning on line 1 in docs/source/cli-docs.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/source/cli-docs.md#L1

[Kedro-viz.headings] 'Kedro Viz CLI reference' should use sentence-style capitalization.
Raw output
{"message": "[Kedro-viz.headings] 'Kedro Viz CLI reference' should use sentence-style capitalization.", "location": {"path": "docs/source/cli-docs.md", "range": {"start": {"line": 1, "column": 3}}}, "severity": "WARNING"}

The Kedro Viz CLI provides commands to visualise Kedro pipelines, deploy them to cloud platforms, and export the visualisation data. Below is a detailed description of the available commands and options.

## Commands

### `kedro viz`

Launches a local Kedro Viz instance to visualise a Kedro pipeline.

**Usage:**

```bash
kedro viz [OPTIONS]
```

**Description:**

This command launches the Kedro Viz server to visualise a Kedro pipeline. It is functionally the same as `kedro viz run`. If no sub-command is provided, `run` is used by default.

**Options:**

This command accepts all the options that are available in the `kedro viz`, `kedro viz run` command. See the `kedro viz run` section for a complete list of options.

### `kedro viz run`

Launches a local Kedro Viz instance to visualise a Kedro pipeline.

**Usage:**

```bash
kedro viz run [OPTIONS]
```

**Options:**

- `--host <host>`
- Host that Kedro Viz will listen to. Defaults to `localhost`.

- `--port <port>`
- TCP port that Kedro Viz will listen to. Defaults to `4141`.

- `--browser / --no-browser`
- Whether to open the Kedro Viz interface in the default browser. The browser will open if the host is `localhost`. Defaults to `True`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need this here ? - The browser will open if the host is localhost

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, i got it from the docs. Maybe we can reword it in cli, and then change it here.


- `--load-file <path>`
- Path to load Kedro Viz data from a directory. If provided, Kedro Viz will load the visualisation data from this path instead of generating it from the pipeline.

- `--save-file <path>`
- Path to save Kedro Viz data to a directory. If provided, the visualisation data will be saved to this path for later use.

- `--pipeline, -p <pipeline>`
- Name of the registered pipeline to visualise. If not set, the default pipeline is visualised.

- `--env, -e {environment>}`
- Kedro configuration environment. If not specified, the catalog config in `local` will be used. You can also set this through the `KEDRO_ENV` environment variable.

- `--autoreload, -a`
- Enable autoreload of the Kedro Viz server when a Python or YAML file changes in the Kedro project.

Check warning on line 59 in docs/source/cli-docs.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/source/cli-docs.md#L59

[Kedro-viz.Spellings] Did you really mean 'autoreload'?
Raw output
{"message": "[Kedro-viz.Spellings] Did you really mean 'autoreload'?", "location": {"path": "docs/source/cli-docs.md", "range": {"start": {"line": 59, "column": 12}}}, "severity": "WARNING"}

- `--include-hooks`
- Include all registered hooks in the Kedro project for visualisation.

- `--params <params>`
- Specify extra parameters for the Kedro Viz run. This option supports the same format as the `params` option in the Kedro CLI.


```{note}
When running Kedro Viz locally with the `--autoreload` option, the server will automatically restart whenever there are changes to Python, YAML, or JSON files in the Kedro project. This is particularly useful during development.
```


### `kedro viz deploy`

Deploy and host Kedro Viz on a specified cloud platform.

```{note}
The `deploy` command supports deployment to AWS, Azure and GCP. Ensure that your cloud credentials and configurations are correctly set up before deploying.
```

**Usage:**

```bash
kedro viz deploy [OPTIONS]
```

**Options:**

- `--platform <platform>`
- The cloud platform to host Kedro Viz on. Supported platforms include `aws` `azure` and `gcp`. This option is required.

- `--endpoint <endpoint>`
- The static website hosted endpoint. This option is required.

- `--bucket-name <bucket-name>`
- The name of the bucket where Kedro Viz will be hosted. This option is required.

- `--include-hooks`
- Include all registered hooks in the Kedro project in the deployed visualisation.

- `--include-previews`
- Include previews for all datasets in the deployed visualisation.

### `kedro viz build`

Create a build directory of a local Kedro Viz instance with Kedro project data.

**Usage:**

```bash
kedro viz build [OPTIONS]
```

**Options:**

- `--include-hooks`
- Include all registered hooks in the Kedro project in the built visualisation.

- `--include-previews`
- Include previews for all datasets in the built visualisation.


## Examples

### Running Kedro Viz locally

Check warning on line 125 in docs/source/cli-docs.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/source/cli-docs.md#L125

[Kedro-viz.headings] 'Running Kedro Viz locally' should use sentence-style capitalization.
Raw output
{"message": "[Kedro-viz.headings] 'Running Kedro Viz locally' should use sentence-style capitalization.", "location": {"path": "docs/source/cli-docs.md", "range": {"start": {"line": 125, "column": 5}}}, "severity": "WARNING"}

To run Kedro Viz on your local machine, use:

```bash
kedro viz
```

To specify a particular pipeline and environment:

```bash
kedro viz -p my_pipeline -e dev
```

or

```bash
kedro viz run -p my_pipeline -e dev
```

### Deploying Kedro Viz to AWS

Check warning on line 145 in docs/source/cli-docs.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/source/cli-docs.md#L145

[Kedro-viz.headings] 'Deploying Kedro Viz to AWS' should use sentence-style capitalization.
Raw output
{"message": "[Kedro-viz.headings] 'Deploying Kedro Viz to AWS' should use sentence-style capitalization.", "location": {"path": "docs/source/cli-docs.md", "range": {"start": {"line": 145, "column": 5}}}, "severity": "WARNING"}

To deploy Kedro Viz to an S3 bucket on AWS:

```bash
kedro viz deploy --platform aws --endpoint http://mybucket.s3-website-us-west-2.amazonaws.com --bucket-name mybucket
```

### Building Kedro Viz to host on multiple platforms

Check warning on line 153 in docs/source/cli-docs.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/source/cli-docs.md#L153

[Kedro-viz.toowordy] 'multiple' is too wordy
Raw output
{"message": "[Kedro-viz.toowordy] 'multiple' is too wordy", "location": {"path": "docs/source/cli-docs.md", "range": {"start": {"line": 153, "column": 35}}}, "severity": "WARNING"}

To create a build directory with the visualisation data:

```bash
kedro viz build --include-previews
```



7 changes: 7 additions & 0 deletions docs/source/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,10 @@ share_kedro_viz
preview_datasets
experiment_tracking
```

```{toctree}
:caption: Other Documentation
:maxdepth: 1

cli-docs
```
Loading