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

Migrate Demo from AWS Lightsail to GitPages #2034

Merged
merged 14 commits into from
Aug 12, 2024
Merged

Migrate Demo from AWS Lightsail to GitPages #2034

merged 14 commits into from
Aug 12, 2024

Conversation

rashidakanchwala
Copy link
Contributor

@rashidakanchwala rashidakanchwala commented Aug 8, 2024

Description

Migration of Demo Project from AWS to GitHub Pages

Rationale for Migration:

  • Cost: AWS is expensive.
  • Compliance: The internal AWS account requires us to meet McK Infosec requirements.

Challenges with Migration:

We couldn't migrate earlier because static hosting worked for the flowchart but not for experiment tracking.

Updates in This PR:

  • Generated all static JSON files needed for experiment tracking (47/50 file changes -- so you can ignore those). This allows experiment tracking to use static data as a fallback when it can't connect to the backend GraphQL, enabling us to fully static host the demo site.
  • Updated the GitHub workflow to:
    • Install Kedro and its dependencies.
    • Install Node.js.
    • Build the React app.
    • Pip install the latest development version of Kedro.
    • Build Kedro-viz using this latest dev version.
    • Host the demo site on GitHub Pages.

Next Steps:

Eventually, we will transition to using publish-share-kedro-viz action. For now, until we release the above changes, this method will allow our demo site to function. We plan to test publish-share-kedro-viz action on a test repo after the release to ensure it works as expected.

Once this PR is approved, I will merge it to main and push it to the demo branch, triggering the 'new' deploy-demo workflow. Afterward, I will update demo.kedro.org to point to the GitHub Pages site.

Test link - https://kedro-org.github.io/kedro-viz/?types=nodes,datasets&pid=__default__&expandAllPipelines=false

Checklist

  • Read the contributing guidelines
  • Opened this PR as a 'Draft Pull Request' if it is work-in-progress
  • Updated the documentation to reflect the code changes
  • Added new entries to the RELEASE.md file
  • Added tests to cover my changes

@rashidakanchwala rashidakanchwala self-assigned this Aug 9, 2024
@rashidakanchwala rashidakanchwala marked this pull request as ready for review August 9, 2024 12:14
@rashidakanchwala rashidakanchwala changed the title Demo Test Migrate Demo from AWS Lightsail to GitPages Aug 9, 2024
@rashidakanchwala rashidakanchwala requested a review from jitu5 August 9, 2024 13:31
@@ -24,7 +24,7 @@ cypress/screenshots
cypress/downloads/

# production
build/
/build/
Copy link
Contributor

Choose a reason for hiding this comment

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

build seems to be in the root similar to lib. Why is this needed ?

Copy link
Contributor Author

@rashidakanchwala rashidakanchwala Aug 9, 2024

Choose a reason for hiding this comment

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

we want to ignore the root build but keep the demo/build. build folder is created when you do npm run build and we don't want to accidentally push that to github.

Copy link
Contributor

Choose a reason for hiding this comment

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

yes, I understand that. Before this change we were doing the same right. The forward slash might not be needed I guess

Copy link
Contributor Author

Choose a reason for hiding this comment

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

when i remove the forward slash, it also ignores the demo/build which we don't want to ignore anymore as it has static graphql files

@jitu5
Copy link
Contributor

jitu5 commented Aug 9, 2024

@rashidakanchwala In this PR we are adding all the required files in demo-project/build but what happens for new release? will it overwrite existing build folder ?

@rashidakanchwala
Copy link
Contributor Author

@rashidakanchwala In this PR we are adding all the required files in demo-project/build but what happens for new release? will it overwrite existing build folder ?

@jitu5 ,

In the current build folder, I’ve included only the GraphQL files and the .api/packages-compatibilities file. I tested the setup, and during the kedro viz build, these files are not deleted. Additionally, other files, such as api/main, api/nodes, and api/pipelines, are added during the GitHub workflow but these are not persistant like the one's I have added.

if (networkError) {
console.error(`[Network error]: ${networkError}`);

// Try reading from static file if network error occurs
Copy link
Contributor

Choose a reason for hiding this comment

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

Instead of checking for network error and then reading from a static file path, can we check for the host url ? Like if the url host is the demo site, then fetch from file instead of making a network call ? This seems like a round-trip which is not needed if we already know the request is made from demo site

Copy link
Contributor

Choose a reason for hiding this comment

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

But we still cant ignore below errors, right ?

Screenshot 2024-08-09 at 3 35 57 p m

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I am thinking doing this but first I want to test it out with demo.kedro.org. So I will make this change in a follow up PR where I update the github workflow to 'public-kedro-viz' actions

src/utils/index.js Outdated Show resolved Hide resolved
src/utils/index.js Outdated Show resolved Hide resolved
rashidakanchwala and others added 4 commits August 9, 2024 17:15
Co-authored-by: Ravi Kumar Pilla <ravi_kumar_pilla@mckinsey.com>
Signed-off-by: rashidakanchwala <37628668+rashidakanchwala@users.noreply.github.com>
Co-authored-by: Ravi Kumar Pilla <ravi_kumar_pilla@mckinsey.com>
Signed-off-by: rashidakanchwala <37628668+rashidakanchwala@users.noreply.github.com>
Co-authored-by: Ravi Kumar Pilla <ravi_kumar_pilla@mckinsey.com>
Signed-off-by: rashidakanchwala <37628668+rashidakanchwala@users.noreply.github.com>
Co-authored-by: Ravi Kumar Pilla <ravi_kumar_pilla@mckinsey.com>
Signed-off-by: rashidakanchwala <37628668+rashidakanchwala@users.noreply.github.com>
@rashidakanchwala rashidakanchwala merged commit b9bfbbb into main Aug 12, 2024
20 checks passed
@rashidakanchwala rashidakanchwala deleted the demo-test branch August 12, 2024 08:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants