Skip to content

[#716][#719] feat(UI): Initial frontend framework and Metalake page#788

Merged
jerryshao merged 12 commits intoapache:mainfrom
ch3yne:issue-719
Nov 23, 2023
Merged

[#716][#719] feat(UI): Initial frontend framework and Metalake page#788
jerryshao merged 12 commits intoapache:mainfrom
ch3yne:issue-719

Conversation

@ch3yne
Copy link
Contributor

@ch3yne ch3yne commented Nov 21, 2023

What changes were proposed in this pull request?

Initial frontend and add Metalakes page Create Metalake Metalake Details with mock data.

Run below commands:

./gradlew compileDistribution -x test
./dirstribution/package/bin/gravitino.sh start

You can access the Gravitino WEB UI by typing http://localhost:8090/ in your browser.

Previews:

  • Metalakes page

Snipaste_2023-11-21_22-08-12

  • Create Metalake

Snipaste_2023-11-21_22-05-04

  • Metalake Details

Snipaste_2023-11-21_22-04-49

Why are the changes needed?

Fix: #716
Fix: #719

Does this PR introduce any user-facing change?

No

How was this patch tested?

No

@ch3yne ch3yne requested review from jerryshao and xunliu November 21, 2023 14:12
@ch3yne ch3yne self-assigned this Nov 21, 2023
@xunliu xunliu added this to the Gravitino 0.3.0 milestone Nov 21, 2023
@github-actions
Copy link

github-actions bot commented Nov 21, 2023

Code Coverage Report

Overall Project 65.52% -0.41% 🟢
Files changed 7.28% 🔴

Module Coverage
server 88.04% 🟢
catalog-lakehouse-iceberg 82.46% -0.14% 🔴
server-common 71.42% -12.21% 🔴
Files
Module File Coverage
server GravitinoServer.java 53.05% 🟢
catalog-lakehouse-iceberg IcebergRESTService.java 0% -4.32% 🔴
server-common JettyServer.java 59.17% -29.51% 🔴

web/.gitignore Outdated

# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
Copy link
Member

@xunliu xunliu Nov 21, 2023

Choose a reason for hiding this comment

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

I have modified the .gitignor file, Cloud you please review it?
Do we really need to include icons-bundle-react.js in the source code? It's very huge. Perhaps we should consider ignore it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It is necessary to retain these ignored rules that have been removed, because some development environments may generate unnecessary submitted files or folders, such as using other package managers, error files generated by build failures, local environments, etc.
The .vscode folder needs to be kept in the repository, as it provides all the extensions and settings required for the project to run smoothly. Similarly, in the future, editor development environment files or folders like .idea will also be created as needed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The file icons-bundle-react.js is generated using yarn build:icons and utilizes the iconify third-party dependency to provide the SVG icons used in the project.
Once generated, it does not require any further modification, making it convenient to locate the corresponding icons.
This also resolves issues related to icon loading due to network reasons, eliminating the dependency on third-party services.
The required icons can be found at https://icon-sets.iconify.design/.

If necessary, I will modify the configuration to only generate the icons that are already in use.

Copy link
Member

Choose a reason for hiding this comment

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

Ok, you can improve it.

@jerryshao
Copy link
Contributor

@xunliu please help to review this PR and get it merged this week.

@xunliu
Copy link
Member

xunliu commented Nov 22, 2023

Because we changed JettyServer code, So I manually completed this test.

curl http://localhost:8090/api/metalakes
curl http://127.0.0.1:9001/iceberg/application.wadl

This test case needs to be added to the next PR.

@xunliu xunliu force-pushed the issue-719 branch 5 times, most recently from 9ae6589 to 2400e0b Compare November 22, 2023 13:09
@xunliu xunliu changed the title [#716][#719] feat(UI): Initial frontend and add Metalakes page with mock data [#716][#719] feat(UI): Initial frontend framework and Metalake page Nov 22, 2023
@xunliu
Copy link
Member

xunliu commented Nov 22, 2023

@jerryshao I fixed all the problems in the comments. Please help me review it again. Thanks!

build.gradle.kts Outdated
from(projectDir.dir("conf")) {
into("package/conf")
filter { line ->
line.replace("{version}", "${version}")
Copy link
Contributor

Choose a reason for hiding this comment

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

What is the usage of this code?

Copy link
Contributor

Choose a reason for hiding this comment

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

I think it is not used anymore.

Copy link
Member

Choose a reason for hiding this comment

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

I removed it.


public synchronized void initialize(JettyServerConfig serverConfig, String serverName) {
public synchronized void initialize(
JettyServerConfig serverConfig, String serverName, boolean isWebApp) {
Copy link
Contributor

Choose a reason for hiding this comment

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

isWebApp -> shouldEnableUI

Copy link
Member

Choose a reason for hiding this comment

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

Done.

web/package.json Outdated
@@ -0,0 +1,68 @@
{
"name": "gravitino-web",
"version": "0.1.0",
Copy link
Contributor

Choose a reason for hiding this comment

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

I think the version should be aligned with Gravitino, like "0.3.0-SNAPSHOT"

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 removed "version" in package.json.

from("dist") {
into("")
}
this.archiveFileName.set("${rootProject.name}-web.war")
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 a version number for war package?

Copy link
Member

Choose a reason for hiding this comment

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

Modified to ${rootProject.name}-web-${version}.war

// config.watchOptions = {
// poll: 1000,
// aggregateTimeout: 300
// }
Copy link
Contributor

Choose a reason for hiding this comment

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

You should remove any unwanted code here.

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 will remember.

JettyServerConfig serverConfig = JettyServerConfig.fromConfig(icebergConfig);
server = new JettyServer();
server.initialize(serverConfig, SERVICE_NAME);
server.initialize(serverConfig, SERVICE_NAME, false);
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you please change to this style: false /* shouldEnableUI */

Copy link
Member

Choose a reason for hiding this comment

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

DONE.

JettyServerConfig jettyServerConfig =
JettyServerConfig.fromConfig(serverConfig, WEBSERVER_CONF_PREFIX);
server.initialize(jettyServerConfig, SERVER_NAME);
server.initialize(jettyServerConfig, SERVER_NAME, true);
Copy link
Contributor

@jerryshao jerryshao Nov 23, 2023

Choose a reason for hiding this comment

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

Can you please change to this style: true /* shouldEnableUI */

Copy link
Member

Choose a reason for hiding this comment

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

DONE.

@xunliu
Copy link
Member

xunliu commented Nov 23, 2023

@jerryshao , I and @ch3yne fixed all the problems in the comments. Please help me review it again. Thanks!

@jerryshao jerryshao merged commit 5b2bcab into apache:main Nov 23, 2023
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.

[Subtask] Develop the Metalakes page [Subtask] Building the base Frontend Framework for GravitinoUI

3 participants