-
Notifications
You must be signed in to change notification settings - Fork 3k
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
New (preview) Web UI scaffolding #22695
Conversation
Thank you for your pull request and welcome to the Trino community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. Continue to work with us on the review and improvements in this PR, and submit the signed CLA to [email protected]. Photos, scans, or digitally-signed PDF files are all suitable. Processing may take a few days. The CLA needs to be on file before we merge your changes. For more information, see https://github.com/trinodb/cla |
Thank you for your pull request and welcome to the Trino community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. Continue to work with us on the review and improvements in this PR, and submit the signed CLA to [email protected]. Photos, scans, or digitally-signed PDF files are all suitable. Processing may take a few days. The CLA needs to be on file before we merge your changes. For more information, see https://github.com/trinodb/cla |
<button onClick={() => setCount((count) => count + 1)}> | ||
count is {count} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😆
.github/DEVELOPMENT.md
Outdated
@@ -256,6 +256,32 @@ To iterate quickly, simply re-build the project in IntelliJ after packaging is | |||
complete. Project resources will be hot-reloaded and changes are reflected on | |||
browser refresh. | |||
|
|||
## Building the Preview Web UI |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this likely shouldn't go straight into development.md yet - that file is for core development, and we can maintain this information closer to where the work is being done for now, as most people running/building Trino won't be interacting with the preview Web UI, especially when it's this barebones.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
make sense. I moved it to README.md under the webapp-preview
directory
@@ -0,0 +1,42 @@ | |||
#root { | |||
max-width: 1280px; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this play nicely with 4K monitors as well as mobile?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good question. It's generated by vite using the react-typescript
template documented in the getting started section:
npm create vite@latest webapp-preview -- --template react-ts
I think we should review these defaults and customise separately in another PR if needed.
I like the idea. I always wanted to get rid of the old UI but never had the time or experience to start working on that. Thanks, @koszti for bringing this up! |
I think you'll need to squash some of these commits before merge - Trino practice is to have each commit perform an atomic unit of work, so a commit and revert commit in the same PR should be removed/squashed into something else, and the empty CI commit needs to go. Force pushing is encouraged! Otherwise, though, this looks like a solid start to me, and I'm excited to collaborate and get more done. |
4f5deb1
to
8c3fa19
Compare
squashed everything to a single commit. 1 CI check failed. Seems like it's because of some timing issue which is not related to this PR. Is making all CI checks to be green a requirement to get things merged? |
Generally we can merge through unrelated CI failures, though I'm not 100% sure that this is unrelated - it's a test for web UI authentication, which could be adjacent to this. You may need to add the new config property to |
Hmm, authentication should not be changed by this PR. Can we somehow re-run only the failed test? I'm nearly sure it was passing earlier
I might be wrong but re-triggering the failed tests would give some confidence. UPDATE: Here is the latest GHA on the last commit before the squash: https://github.com/trinodb/trino/actions/runs/10012690646/job/27678754938 . The problematic test passed but another one failed ( |
I've retriggered trino-main alone. This could be a flaky test. Let's see :) |
@@ -25,6 +25,8 @@ scheduler.http-client.idle-timeout=1m | |||
query.client.timeout=5m | |||
query.min-expire-age=30m | |||
|
|||
web-ui.preview.enabled=true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd prefer not to add this here. Instead you can create a QueryRunner that exposes new web UI.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you please give a bit more details or instructions how to do that by any chance? I'm not familiar with QueryRunner
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.trino.server.ui;
import io.airlift.log.Logger;
import io.trino.server.testing.TestingTrinoServer;
import io.trino.testing.StandaloneQueryRunner;
import static io.trino.testing.TestingHandles.TEST_CATALOG_NAME;
import static io.trino.testing.TestingSession.testSessionBuilder;
public class PreviewUiQueryRunner
{
private PreviewUiQueryRunner() {}
public static void main(String[] args)
{
StandaloneQueryRunner queryRunner = new StandaloneQueryRunner(testSessionBuilder()
.setCatalog(TEST_CATALOG_NAME)
.setSchema("tiny")
.build(), PreviewUiQueryRunner::configureTrinoServer);
Logger log = Logger.get(PreviewUiQueryRunner.class);
log.info("======== SERVER STARTED ========");
log.info("\n====\n%s\n====", queryRunner.getCoordinator().getBaseUrl());
}
private static void configureTrinoServer(TestingTrinoServer.Builder builder)
{
builder.addProperty("web-ui.preview.enabled", "true");
builder.addProperty("http-server.http.port", "8080");
}
}
Something like that :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks added. Indeed, using this class is a a much faster option rather than running the full dev sever.
Yeah, it was flake after all :) |
8c3fa19
to
845c102
Compare
@koszti rebased on master to resolve conflict with pom.xml |
5dfb733
to
2a672e4
Compare
Good question .. probably should chat at maintainer meet and contributor call this week. Personally I think we want to move this forward. |
2a672e4
to
0ca04ea
Compare
If it helps, I can add a few items I have in mind into #22697 as a starting point for a proper roadmap. But this will likely change, as I'm sure many of you have other ideas, and I can't create a complete list on my own. Let me know your thoughts. |
@koszti fleshing out the roadmap would be great .. just through your ideas on the issue and we can discuss and sort out more .. probably need to arrange sync calls over time |
@mosabua the only concern that I have at the moment with landing this is whether it will break reproducible builds. |
@@ -0,0 +1,44 @@ | |||
/* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that this file should land in trino-main test sources
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed, thanks
@mosabua nevermind, tested, vite actually produces reproducible output |
path = "index.html"; | ||
} | ||
|
||
String fullPath = "/webapp-preview/dist/" + path; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we drop dist from the final build dir? just /webapp-preview/
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The path needs to be the same in dev and in the prod build. I don't know how we can make it without having the dist
subdir right now TBH.
By moving everything to webapp-preview
we'll include all source files in the final build which isn't what we want to do.
@@ -0,0 +1,18 @@ | |||
module.exports = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this could live in the directory: core/trino-main/src/javascript/
rather than in the resources as this will basically bundle sources with the target jar and we don't want that. we just want a build distribution being part of the jar.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
0ca04ea
to
6483023
Compare
6483023
to
0002afa
Compare
blaa the rebase hell kills my brain :< I messed up the PR. I'll try to fix in later today. |
my bad. I accidentally discarded and closed the original PR. As a workaround I created another PR with all the changes discussed in this PR at #22783. Let's continue there please 🙇 |
Description
This scaffolding PR aims to modernize the web UI for Trino, incorporating up-to-date tools and a contemporary look and feel.
Partially addressing and proposing technical solutions for #22697
Additional context and related issues
Currently, the Trino web UI uses outdated components like React 16, jQuery, and Bootstrap 3. Updating the UI to use more recent tools and frameworks will provide a fresher appearance and improved functionality. For instance, the Trino gateway utilizes Vite with modern dependencies, suggesting that the Trino web UI could benefit from adopting a similar approach for consistency.
Original slack thread: https://trinodb.slack.com/archives/CKCEWGYT0/p1720904086284609
IMPORTANT: This PR does not disrupt the current web app. Instead, it introduces a new web app scaffolding accessible at a new endpoint (
/ui/preview
), which is visible only in development mode. This approach allows for further development and testing and can switch to the new web app once migrating of all functionalities is completed.This PR Utilizes the Following Tools and Development Features:
What's not included:
To Develop the preview webapp locally
Start the Full Development Server as documented here. This step is only necessary once, and you won't need to restart it while developing the Preview Web UI. It is required solely to proxy API requests to valid server endpoints.
Once the full dev server is running start the preview webapp in dev mode:
To Build and package the preview webapp
Build steps are fully automated using Maven, eliminating the need to commit generated JS files to the git repository as was done with the current web app.
The preview web app is disabled by default and enabled only in the full development server by setting the
web-ui.preview.enabled=true
property. This ensures that the preview web app is available only to developers and not to production end users. Once all functionalities are migrated from the old web app to the new one, we can swap them, making the new web app the default for end users.If the preview webapp is enabled then it's running in parallel to the current one and accessible at
/ui/preview
:Release notes
(x) This is not user-visible or is docs only, and no release notes are required.
( ) Release notes are required. Please propose a release note for me.
( ) Release notes are required, with the following suggested text: