This page describes how to publish Kedro-Viz on GCP to share it with others. It uses the spaceflights tutorial as an example.
If you haven't installed Kedro {doc}follow the documentation to get set up<kedro:get_started/install>
.
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:
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:
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:
fsspec>=2023.9.0
kedro>=0.18.2
pip install 'kedro-viz[gcp]'
You can host your Kedro-Viz project on Google Cloud Storage (GCS) bucket.
- Enable static website hosting: Follow the GCP tutorial to configure static website hosting on GCS.
The process of uploading your site's files will be done through Kedro-Viz.
-
Ensure the
Compute Engine API
is enabled for your project as mentioned in the tutorial. -
Set up a load balancer to serve your website. If you are serving it via HTTPS, also configure an SSL certificate.
-
Obtain application credentials: Follow these steps:
- Create a service account from the IAM & admin dashboard in the GCP Portal.
- Generate a service account key and download it.
Once that's completed, you'll need to set your generated service account key file absolute path as environment variable in your terminal window, as shown below:
export GOOGLE_APPLICATION_CREDENTIALS="absolute-path-to-downloaded-service-account-key-file"
For more information, see the official Google documentation about how to work with environmental credentials.
Once your cloud storage is configured and the credentials are set, you are now ready to publish and share your Kedro-Viz project.
Start Kedro-Viz by running the following command in your terminal:
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.
The endpoint link can be found under your **Application Load Balancer -> Frontend -> IP:Port** if you are using `HTTP`.
If you have set up SSL certificate and serve your site using `HTTPS` then provide your root domain.
Once those details are complete, click Publish. A hosted, shareable URL will be returned to you after the process completes.
Use the kedro viz deploy
command to publish Kedro-Viz on GCP. You can execute the following command from your project's root folder:
kedro viz deploy --platform=gcp --endpoint=[gcp-endpoint] --bucket-name=[gcp-bucket-name]
Kedro-Viz does not manage permissions or access control. GCP 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 IAM permissions and ACLs. See the official Google documentation for more information.
Kedro-Viz does not handle billing. You pay for storing objects on your Google Cloud Storage. The amount you pay depends on the amount of data stored, data processing and network usage. Additionally you may be charged for using cloud load balancing.
See the official Google Cloud Storage Billing and Google Cloud Load Balancer Billing for more information.