Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin' into feature_branch/remove-expe…
Browse files Browse the repository at this point in the history
…riment-tracking

Signed-off-by: Huong Nguyen <[email protected]>
  • Loading branch information
Huong Nguyen committed Feb 19, 2025
2 parents 834ed78 + 1f4770f commit 2f78707
Show file tree
Hide file tree
Showing 39 changed files with 739 additions and 83 deletions.
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ strawberry-server:
strawberry server --app-dir=package kedro_viz.api.graphql.schema --host 127.0.0.1

version:
npm run build:esm
python3 tools/versioning.py $(VERSION)

sign-off:
Expand Down
16 changes: 14 additions & 2 deletions RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,27 @@ Please follow the established format:
- Use present tense (e.g. 'Add new feature')
- Include the ID number for the related PR (or PRs) in parentheses
-->
# Upcoming Release

# Release 10.2.0
## Major features and improvements

## Bug fixes and other changes

- Add ESM bundle for Kedro-Viz. (#2268)
- Fix `%run_viz` using old process in jupyter notebook. (#2267)

## Major features and improvements
## Community contributions

# Release 10.2.0

## Deprecations
- Added a deprecation warning for the removal of the Experiment Tracking feature, which will be deprecated in Kedro-Viz version 11.0.0. For more details, please refer to our [blog post](https://kedro.org/blog/deprecate-experiment-tracking-kedro-viz). (#2248, #2263)

## Bug fixes and other changes

- Fix kedro viz `--load-file` to run from any directory without requiring a Kedro project. (#2206)
- Improved modular pipeline expand/collapse logic for better state synchronisation. (#2225)
- Fix inconsistent function inspection for decorated functions. (#2246)

# Release 10.1.0

Expand Down
7 changes: 6 additions & 1 deletion cypress/support/commands.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// Add any reusable custom commands here
import { join } from 'path';
import { localStorageETDeprecationBannerSeen } from '../../src/config';

/**
* Custom command for intercepting network requests for REST
Expand Down Expand Up @@ -105,7 +106,11 @@ Cypress.Commands.add('__validateImage__', (downloadedFilename) => {
* Custom command to conditionally visit a page based on spec file path
*/
Cypress.Commands.add('__conditionalVisit__', () => {
cy.visit('/');
cy.visit('/', {
onBeforeLoad(win) {
win.localStorage.setItem(localStorageETDeprecationBannerSeen, JSON.stringify(true));
}
});
});

/**
Expand Down
4 changes: 0 additions & 4 deletions cypress/tests/ui/flowchart/banners.cy.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
describe('Banners in Kedro-Viz', () => {
beforeEach(() => {
// Clears localStorage before each test
cy.clearLocalStorage();
});

it("shows a missing dependencies banner in viz lite mode if the kedro project dependencies are not installed.", () => {
// Intercept the network request to mock with a fixture
Expand Down
4 changes: 0 additions & 4 deletions cypress/tests/ui/flowchart/shareable-urls.cy.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
describe('Shareable URLs with empty localStorage', () => {
beforeEach(() => {
// Clears localStorage before each test
cy.clearLocalStorage();
});

it('verifies that users can open the Deploy Kedro-Viz modal if the localStorage is empty. #TC-52', () => {
// Intercept the network request to mock with a fixture
Expand Down
7 changes: 6 additions & 1 deletion cypress/tests/ui/toolbar/global-toolbar.cy.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
// All E2E Tests Related to global-toolbar goes here.

import { prettifyName, stripNamespace } from '../../../../src/utils';
import { localStorageETDeprecationBannerSeen } from '../../../../src/config';

describe('Global Toolbar', () => {
before(() => {
cy.visit('/'); // Visit the application
cy.visit('/', {
onBeforeLoad(win) {
win.localStorage.setItem(localStorageETDeprecationBannerSeen, JSON.stringify(true));
}
});
cy.enablePrettyNames(); // Enable pretty names using the custom command
});

Expand Down
2 changes: 1 addition & 1 deletion demo-project/.version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
10.1.0
10.2.0
2 changes: 1 addition & 1 deletion demo-project/lightsail.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"serviceName": "kedro-viz-live-demo",
"containers": {
"kedro-viz-live-demo": {
"image": "public.ecr.aws/g0x0s3o2/kedro-viz-live-demo:10.1.0",
"image": "public.ecr.aws/g0x0s3o2/kedro-viz-live-demo:10.2.0",
"ports": {
"4141": "HTTP"
}
Expand Down
1 change: 1 addition & 0 deletions docs/source/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ kedro-viz_visualisation
share_kedro_viz
preview_datasets
slice_a_pipeline
migrate_experiment_tracking
```

```{toctree}
Expand Down
139 changes: 139 additions & 0 deletions docs/source/migrate_experiment_tracking.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,139 @@
# Migration from Kedro-Viz native experiment tracking to `kedro-mlflow`

With the deprecation of Kedro-Viz experiment tracking from version 11.0.0, transitioning to [`kedro-mlflow`](https://kedro-mlflow.readthedocs.io/en/0.14.3/) offers enhanced experiment tracking and artifact management. This guide outlines the steps to:

1. **Remove deprecated Kedro-Viz experiment tracking configurations.**
2. **Update existing dataset configurations in the catalog to use `kedro-mlflow`.**
3. **Optionally, delete old experiment tracking data.**

## Remove deprecated Kedro-Viz experiment tracking configurations

### 1. Remove session store setup

In `src/<project_name>/settings.py`, locate and remove the session store configuration:

```python
from kedro_viz.integrations.kedro.sqlite_store import SQLiteStore

SESSION_STORE_CLASS = SQLiteStore
SESSION_STORE_ARGS = {"path": str(Path(__file__).parents[2] / "data")}
```

### 2. Remove environment variables
Remove any environment variables associated with collaborative tracking:

```bash
unset KEDRO_SQLITE_STORE_USERNAME
```

### 3. Delete SQLite database
If a `session_store.db` SQLite database was created, you can delete it to clean up your project. This file is typically located in one of the following directories:

- The project root
- The `.viz` folder within the project root
- The `data` folder

## Update dataset configurations in catalog to use `kedro-mlflow`

Update the dataset configurations in your `catalog.yml` to transition to `kedro-mlflow`. Refer to the table below for the changes:

### Dataset migration table

| Kedro-Viz Dataset Type | MLflow Dataset Type | Update Instructions |
|---------------------------------|----------------------------|---------------------------------------------------------|
| `tracking.MetricsDataset` | `MlflowMetricDataset` | Update type to [`MlflowMetricDataset`](https://kedro-mlflow.readthedocs.io/en/0.14.3/source/03_experiment_tracking/01_experiment_tracking/05_version_metrics.html#saving-a-single-float-as-a-metric-with-mlflowmetricdataset) |
| `tracking.JSONDataset` | `MlflowArtifactDataset` | Wrap within [`MlflowArtifactDataset`](https://kedro-mlflow.readthedocs.io/en/0.14.3/source/05_API/01_python_objects/01_Datasets.html#mlflowartifactdataset) as `json.JSONDataset`. |
| `plotly.plotlyDataset` | `MlflowArtifactDataset` | Wrap within [`MlflowArtifactDataset`](https://kedro-mlflow.readthedocs.io/en/0.14.3/source/05_API/01_python_objects/01_Datasets.html#mlflowartifactdataset) as `plotly.HTMLDataset`. |
| `plotly.JSONDataset` | `MlflowArtifactDataset` | Wrap within [`MlflowArtifactDataset`](https://kedro-mlflow.readthedocs.io/en/0.14.3/source/05_API/01_python_objects/01_Datasets.html#mlflowartifactdataset) as `plotly.HTMLDataset`. |
| `matplotlib.MatplotlibWriter` | `MlflowArtifactDataset` | Wrap within [`MlflowArtifactDataset`](https://kedro-mlflow.readthedocs.io/en/0.14.3/source/05_API/01_python_objects/01_Datasets.html#mlflowartifactdataset). |

### Metrics dataset
For `tracking.MetricsDataset`, update its type to [`MlflowMetricDataset`](https://kedro-mlflow.readthedocs.io/en/0.14.3/source/03_experiment_tracking/01_experiment_tracking/05_version_metrics.html#saving-a-single-float-as-a-metric-with-mlflowmetricdataset):

Before:
```yaml
metrics:
type: tracking.MetricsDataset
filepath: data/09_tracking/metrics.json
versioned: true
```
After:
```yaml
metrics:
type: kedro_mlflow.io.metrics.MlflowMetricDataset
```
### JSON dataset
For `tracking.JSONDataset`, wrap it within [`MlflowArtifactDataset`](https://kedro-mlflow.readthedocs.io/en/0.14.3/source/05_API/01_python_objects/01_Datasets.html#mlflowartifactdataset) and configure it as `json.JSONDataset`:

Before:
```yaml
companies_columns:
type: tracking.JSONDataset
filepath: data/09_tracking/json_data.json
versioned: true
```

After:
```yaml
companies_columns:
type: kedro_mlflow.io.artifacts.MlflowArtifactDataset
dataset:
type: json.JSONDataset
filepath: data/02_intermediate/companies_columns.json
```

### Plotly dataset
For `plotly.plotlyDataset` and `plotly.JSONDataset`, wrap it within [`MlflowArtifactDataset`](https://kedro-mlflow.readthedocs.io/en/0.14.3/source/05_API/01_python_objects/01_Datasets.html#mlflowartifactdataset) and configure it as `plotly.HTMLDataset` to render interactive plots in the MLflow UI:

Before:
```yaml
plotly_json_data:
type: plotly.JSONDataset
filepath: data/09_tracking/plotly.json
```

After:
```yaml
plotly_json_data:
type: kedro_mlflow.io.artifacts.MlflowArtifactDataset
dataset:
type: plotly.HTMLDataset
filepath: data/08_reporting/plotly.html
```

### Matplotlib writer
For `matplotlib.MatplotlibWriter`, wrap it within [`MlflowArtifactDataset`](https://kedro-mlflow.readthedocs.io/en/0.14.3/source/05_API/01_python_objects/01_Datasets.html#mlflowartifactdataset):

Before:
```yaml
confusion_matrix:
type: matplotlib.MatplotlibWriter
filepath: data/09_tracking/confusion_matrix.png
versioned: true
```

After:
```yaml
confusion_matrix:
type: kedro_mlflow.io.artifacts.MlflowArtifactDataset
dataset:
type: matplotlib.MatplotlibWriter
filepath: data/08_reporting/confusion_matrix.png
```

## [Optional] Delete old tracking data

Old experiment tracking data stored in `data/09_tracking/` is no longer needed. You can delete this directory to clean up your project:

```bash
rm -rf data/09_tracking/
```

## Refer to the `kedro-mlflow` documentation for further setup

After completing these steps, follow the below MLflow documentation to complete your experiment tracking setup with MLflow.

- [The official Kedro + MLflow guide in the Kedro documentation](https://docs.kedro.org/en/stable/integrations/mlflow.html)
- The documentation of [`kedro-mlflow`](https://kedro-mlflow.readthedocs.io/en/0.14.3/) plugin
2 changes: 1 addition & 1 deletion docs/source/publish_and_share_kedro_viz_on_gcp.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,4 +116,4 @@ You can control who can view your visualisation using [IAM permissions and ACLs]

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](https://cloud.google.com/storage/pricing) and [Google Cloud Load Balancer Billing](https://cloud.google.com/vpc/network-pricing#lb) for more information.
See the official [Google Cloud Storage Billing](https://cloud.google.com/storage/pricing) and [Google Cloud Load Balancer Billing](https://cloud.google.com/vpc/network-pricing) for more information.
2 changes: 2 additions & 0 deletions esm/d1fbb23f3ade3692e5ec.worker.js

Large diffs are not rendered by default.

9 changes: 9 additions & 0 deletions esm/d1fbb23f3ade3692e5ec.worker.js.LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/** @license kiwi.js v1.1.2
* #------------------------------------------------------------------------------
* # Copyright (c) 2013, Nucleic Development Team & H. Rutjes.
* #
* # Distributed under the terms of the Modified BSD License.
* #
* # The full license is in the file COPYING.txt, distributed with this software.
* #------------------------------------------------------------------------------
**/
2 changes: 2 additions & 0 deletions esm/kedro-viz.production.mjs

Large diffs are not rendered by default.

Loading

0 comments on commit 2f78707

Please sign in to comment.