-
Notifications
You must be signed in to change notification settings - Fork 114
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Shareableviz Docs for Azure and GCP (#1748)
Provides documentation for updated shareableviz support to Azure and GCP
- Loading branch information
1 parent
1d2496d
commit 3923cf0
Showing
12 changed files
with
421 additions
and
128 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
# Platform-agnostic sharing with Kedro-Viz | ||
|
||
Introduced in Kedro-Viz version 7.1.0, the `kedro viz build` command allows seamless publishing and sharing of Kedro-Viz on any static website hosting platform. Running this command from the CLI generates a `build` folder within your Kedro project, containing a static Kedro-Viz app package. | ||
|
||
This page describes how to publish Kedro-Viz on a static website hosting platform using `kedro viz build`. It uses the spaceflights tutorial as an example. | ||
|
||
## Setup your kedro project | ||
|
||
If you haven't installed Kedro {doc}`follow the documentation to get set up<kedro:get_started/install>`. | ||
|
||
```{important} | ||
We recommend that you use the same version of Kedro that was most recently used to test this tutorial (0.19.1). To check the version installed, type `kedro -V` in your terminal window. | ||
``` | ||
|
||
1. In your terminal window, navigate to the folder you want to store the project. Generate the spaceflights tutorial project with all the code in place by using the [Kedro starter for the spaceflights tutorial](https://github.com/kedro-org/kedro-starters/tree/main/spaceflights-pandas): | ||
|
||
|
||
```bash | ||
kedro new --starter=spaceflights-pandas | ||
``` | ||
|
||
When prompted for a project name, you can enter anything, but we will assume `Spaceflights` throughout. | ||
|
||
2. When your project is ready, navigate to the root directory of the project. Install the dependencies from the project root directory by typing the following in your terminal: | ||
|
||
```bash | ||
pip install -r requirements.txt | ||
``` | ||
|
||
3. Kedro-Viz requires specific minimum versions of `fsspec`, and `kedro` to publish your project. Ensure you have these correct versions by updating the `requirements.txt` file of the Kedro project to add the following: | ||
|
||
```text | ||
fsspec>=2023.9.0 | ||
kedro>=0.18.2 | ||
``` | ||
|
||
4. Execute the following command from your project's root directory: | ||
|
||
```bash | ||
kedro viz build | ||
``` | ||
|
||
This creates a `build` folder containing your Kedro-Viz app package in your project directory. | ||
|
||
## Static website hosting platforms such as GitHub Pages | ||
|
||
Follow the steps [listed in the GitHub pages documentation](https://docs.github.com/en/pages/quickstart) to create a Git repository that supports GitHub Pages. On completion, push the contents of the previously created `build` folder to this new repository. Your site will be available at the following URL: `http://<username>.github.io` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,119 @@ | ||
# Publish and share on AWS | ||
|
||
This page describes how to publish Kedro-Viz on AWS to share it with others. It uses the spaceflights tutorial as an example. | ||
|
||
## Setup your kedro project | ||
|
||
If you haven't installed Kedro {doc}`follow the documentation to get set up<kedro:get_started/install>`. | ||
|
||
```{important} | ||
We recommend that you use the same version of Kedro that was most recently used to test this tutorial (0.19.1). To check the version installed, type `kedro -V` in your terminal window. | ||
``` | ||
|
||
In your terminal window, navigate to the folder you want to store the project. Generate the spaceflights tutorial project with all the code in place by using the [Kedro starter for the spaceflights tutorial](https://github.com/kedro-org/kedro-starters/tree/main/spaceflights-pandas): | ||
|
||
|
||
```bash | ||
kedro new --starter=spaceflights-pandas | ||
``` | ||
|
||
When prompted for a project name, you can enter anything, but we will assume `Spaceflights` throughout. | ||
|
||
When your project is ready, navigate to the root directory of the project. Install the dependencies from the project root directory by typing the following in your terminal: | ||
|
||
```bash | ||
pip install -r requirements.txt | ||
``` | ||
|
||
Kedro-Viz requires specific minimum versions of `fsspec`, and `kedro` to publish your project. Ensure you have these correct versions by updating the `requirements.txt` file of the Kedro project to add the following: | ||
|
||
```text | ||
fsspec>=2023.9.0 | ||
kedro>=0.18.2 | ||
``` | ||
|
||
## Install cloud dependencies | ||
|
||
```bash | ||
pip install 'kedro-viz[aws]' | ||
``` | ||
|
||
## Configure your AWS S3 bucket | ||
|
||
1. Create S3 bucket: Follow the [AWS tutorial](https://docs.aws.amazon.com/AmazonS3/latest/userguide/HostingWebsiteOnS3Setup.html) to create an S3 bucket and enable static website hosting. | ||
|
||
```{note} | ||
The process of uploading your site's files will be done through Kedro-Viz. | ||
``` | ||
|
||
2. Set IAM user: Sign in to the [AWS Management Console](https://console.aws.amazon.com/s3/) and create an IAM user account. Refer to the official AWS documentation about [IAM Identities](https://docs.aws.amazon.com/IAM/latest/UserGuide/id.html). | ||
|
||
3. Generate access keys: Create an [IAM user groups](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_groups.html?icmpid=docs_iam_help_panel) with full access to the AWS S3 policy. Add the IAM user to the group and generate access keys. Refer to AWS documentation for detailed instructions on [creating and managing access keys](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_access-keys.html). | ||
|
||
## Set credentials | ||
|
||
Once that's completed, you'll need to set your AWS credentials as environment variables in your terminal window, as shown below: | ||
|
||
```bash | ||
export AWS_ACCESS_KEY_ID="your_access_key_id" | ||
export AWS_SECRET_ACCESS_KEY="your_secret_access_key" | ||
``` | ||
|
||
For more information, see the official AWS documentation about [how to work with credentials](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-envvars.html). | ||
|
||
|
||
## Publish and share the project | ||
|
||
Once your cloud storage is configured and the credentials are set, you are now ready to publish and share your Kedro-Viz project. | ||
|
||
### Publish and share via Kedro-Viz UI | ||
|
||
Start Kedro-Viz by running the following command in your terminal: | ||
|
||
```bash | ||
kedro viz run | ||
``` | ||
|
||
Navigate to the **Publish and share** icon located in the lower-left corner of the application interface. A modal dialog will appear, prompting you to select your hosting platform and provide your bucket name and endpoint link. | ||
|
||
Set up endpoint | ||
--------------- | ||
|
||
```{important} | ||
The endpoint link can be found under **S3 bucket -> Properties -> Static website hosting -> Bucket website endpoint**. | ||
``` | ||
|
||
Once those details are complete, click **Publish**. A hosted, shareable URL will be returned to you after the process completes. | ||
|
||
 | ||
|
||
```{note} | ||
On Kedro-Viz version 7.0.0, you will see a modal dialog to select your region and bucket name. | ||
``` | ||
|
||
### Publish and share via CLI | ||
|
||
Use the `kedro viz deploy` command to publish Kedro-Viz on AWS. You can execute the following command from your project's root folder: | ||
|
||
```bash | ||
kedro viz deploy --platform=aws --endpoint=[s3-endpoint] --bucket-name=[s3-bucket-name] | ||
``` | ||
|
||
If you are on Kedro-Viz 7.0.0 you can still publish and share Kedro-Viz project using the existing command | ||
|
||
```bash | ||
kedro viz deploy --region=[aws-bucket-region] --bucket-name=[aws-bucket-name] | ||
``` | ||
|
||
## Permissions and access control | ||
|
||
Kedro-Viz does not manage permissions or access control. AWS manages all permissions and access control. As a user, you have the choice to allow anyone to view your project or restrict access to specific IP addresses, users, or groups. | ||
|
||
Control who can access your visualization using [bucket and user policies](https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-iam-policies.html) or [access control lists](https://docs.aws.amazon.com/AmazonS3/latest/userguide/acls.html). Refer to the official AWS documentation for further details. | ||
|
||
## Billing | ||
|
||
Kedro-Viz does not handle billing. You pay for storing objects in your S3 buckets. The amount you pay depends on your objects’ size, how long you stored the object during the month, and the storage class. | ||
|
||
See the official [AWS documentation](https://aws.amazon.com/s3/pricing/?nc=sn&loc=4) for more information. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,128 @@ | ||
# Publish and share on Azure | ||
|
||
This page describes how to publish Kedro-Viz on Azure to share it with others. It uses the spaceflights tutorial as an example. | ||
|
||
## Setup your kedro project | ||
|
||
If you haven't installed Kedro {doc}`follow the documentation to get set up<kedro:get_started/install>`. | ||
|
||
```{important} | ||
We recommend that you use the same version of Kedro that was most recently used to test this tutorial (0.19.1). To check the version installed, type `kedro -V` in your terminal window. | ||
``` | ||
|
||
In your terminal window, navigate to the folder you want to store the project. Generate the spaceflights tutorial project with all the code in place by using the [Kedro starter for the spaceflights tutorial](https://github.com/kedro-org/kedro-starters/tree/main/spaceflights-pandas): | ||
|
||
|
||
```bash | ||
kedro new --starter=spaceflights-pandas | ||
``` | ||
|
||
When prompted for a project name, you can enter anything, but we will assume `Spaceflights` throughout. | ||
|
||
When your project is ready, navigate to the root directory of the project. Install the dependencies from the project root directory by typing the following in your terminal: | ||
|
||
```bash | ||
pip install -r requirements.txt | ||
``` | ||
|
||
Kedro-Viz requires specific minimum versions of `fsspec`, and `kedro` to publish your project. Ensure you have these correct versions by updating the `requirements.txt` file of the Kedro project to add the following: | ||
|
||
```text | ||
fsspec>=2023.9.0 | ||
kedro>=0.18.2 | ||
``` | ||
|
||
## Install cloud dependencies | ||
|
||
Step 1: | ||
|
||
```bash | ||
pip install 'kedro-viz[azure]' | ||
``` | ||
|
||
## Configure your Azure Blob Storage | ||
|
||
You can host your Kedro-Viz project on Azure Blob Storage. | ||
|
||
1. Enable static website hosting - Follow the [Azure tutorial](https://learn.microsoft.com/en-us/azure/storage/blobs/storage-blob-static-website-how-to?tabs=azure-portal) to configure static website hosting on Azure Blob Storage. | ||
|
||
```{note} | ||
The process of uploading your site's files will be done through Kedro-Viz. | ||
``` | ||
|
||
2. Register an app: Sign in to the Azure Portal and create an [App Registration](https://learn.microsoft.com/en-us/entra/identity-platform/quickstart-register-app). | ||
|
||
3. Obtain parameters: In the app registration's overview pane, note down the Application (Client) ID and Directory (Tenant) ID. | ||
|
||
4. Add client secret: Create a [client secret](https://learn.microsoft.com/en-us/entra/identity-platform/quickstart-register-app#add-a-client-secret) | ||
for the app registration. | ||
|
||
5. Assign IAM role: Assign an [Access Control (IAM) role](https://learn.microsoft.com/en-us/azure/role-based-access-control/role-assignments-portal?tabs=delegate-condition) to the storage account. | ||
|
||
|
||
```{note} | ||
Kedro-Viz uses Gen2 filesystem protocol `abfs` to write files on AzureBlobStorage. | ||
``` | ||
|
||
```{important} | ||
Having a `$web` container in your AzureBlobStorage is mandatory to use Kedro-Viz publish and share feature on Azure. For more information, see the official Azure documentation about | ||
[Setting up a static website](https://learn.microsoft.com/en-us/azure/storage/blobs/storage-blob-static-website#setting-up-a-static-website). | ||
``` | ||
|
||
## Set credentials | ||
|
||
Once that's completed, you'll need to set your Azure credentials as environment variables in your terminal window, as shown below: | ||
|
||
```bash | ||
export AZURE_STORAGE_TENANT_ID="your-app-tenant-id" | ||
export AZURE_STORAGE_CLIENT_ID="your-app-client-id" | ||
export AZURE_STORAGE_CLIENT_SECRET="your-app-client-secret-value" | ||
``` | ||
|
||
For more information, see the official Azure documentation about [how to work with environmental credentials](https://learn.microsoft.com/en-us/dotnet/api/azure.identity.environmentcredential?view=azure-dotnet). | ||
|
||
|
||
## Publish and share the project | ||
|
||
Once your cloud storage is configured and the credentials are set, you are now ready to publish and share your Kedro-Viz project. | ||
|
||
### Publish and share via Kedro-Viz UI | ||
|
||
Start Kedro-Viz by running the following command in your terminal: | ||
|
||
```bash | ||
kedro viz run | ||
``` | ||
|
||
Navigate to the **Publish and share** icon located in the lower-left corner of the application interface. A modal dialog will appear, prompting you to select your hosting platform and provide your bucket name and endpoint link. | ||
|
||
Set up endpoint | ||
--------------- | ||
|
||
```{important} | ||
The endpoint link can be found under **Storage account -> Capabilities -> Static website -> Primary endpoint**. | ||
``` | ||
|
||
Once those details are complete, click **Publish**. A hosted, shareable URL will be returned to you after the process completes. | ||
|
||
 | ||
|
||
### Publish and share via CLI | ||
|
||
Use the `kedro viz deploy` command to publish Kedro-Viz on Azure. You can execute the following command from your project's root folder: | ||
|
||
```bash | ||
kedro viz deploy --platform=azure --endpoint=[azure-endpoint] --bucket-name=[azure-bucket-name] | ||
``` | ||
|
||
## Permissions and access control | ||
|
||
Kedro-Viz does not manage permissions or access control. Azure manages all permissions and access control. As a user, you have the choice to allow anyone to view your project or restrict access to specific IP addresses, users, or groups. | ||
|
||
You can control who can view your visualisation using [attribute-based access control](https://learn.microsoft.com/en-us/azure/storage/blobs/storage-auth-abac). See the official Azure documentation for more information. | ||
|
||
## Billing | ||
|
||
Kedro-Viz does not handle billing. You pay for storing objects on your AzureBlobStorage. The amount you pay depends on the volume of data stored per month, quantity and types of operations performed, along with any data transfer costs, data redundancy option selected. | ||
|
||
See the official [Azure documentation](https://azure.microsoft.com/en-us/pricing/details/storage/blobs/) for more information. |
Oops, something went wrong.