Skip to content

Commit ba7fa23

Browse files
authored
[Feature][Engine UI] partial pages of the engine (#7602)
1 parent 4ff3338 commit ba7fa23

File tree

100 files changed

+14528
-2
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

100 files changed

+14528
-2
lines changed

.github/workflows/backend.yml

+31
Original file line numberDiff line numberDiff line change
@@ -306,6 +306,37 @@ jobs:
306306
npm set strict-ssl false
307307
npm install
308308
npm run build
309+
310+
seatunnel-ui:
311+
if: needs.changes.outputs.api == 'true'
312+
needs: [ changes, sanity-check ]
313+
name: Build SeaTunnel UI
314+
runs-on: ubuntu-latest
315+
timeout-minutes: 60
316+
steps:
317+
- name: Checkout PR
318+
uses: actions/checkout@v3
319+
320+
- uses: actions/setup-node@v2
321+
with:
322+
node-version: 20.x
323+
324+
- name: Install Dependencies and Check Code Style
325+
run: |
326+
cd seatunnel-engine/seatunnel-engine-ui/
327+
npm install
328+
npm run lint
329+
330+
- name: Run unit tests
331+
run: |
332+
cd seatunnel-engine/seatunnel-engine-ui/
333+
npm run test:unit
334+
335+
- name: Build SeaTunnel UI
336+
run: |
337+
cd seatunnel-engine/seatunnel-engine-ui/
338+
npm run build
339+
309340
unit-test:
310341
needs: [ changes, sanity-check ]
311342
if: needs.changes.outputs.api == 'true' || (needs.changes.outputs.api == 'false' && needs.changes.outputs.ut-modules != '')

.gitignore

+5
Original file line numberDiff line numberDiff line change
@@ -55,3 +55,8 @@ seatunnel-examples
5555

5656
/lib/*
5757
version.properties
58+
node/
59+
60+
dist/
61+
62+
seatunnel-engine/seatunnel-engine-server/**/ui/*

docs/en/seatunnel-engine/web-ui.md

+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# Apache SeaTunnel Web UI Documentation
2+
3+
## Access
4+
5+
Before accessing the web ui we need to enable the http rest api. first you need to configure it in the `seatunnel.yaml` configuration file
6+
7+
```
8+
seatunnel:
9+
engine:
10+
http:
11+
enable-http: true
12+
port: 8080
13+
14+
```
15+
16+
Then visit `http://ip:8080/#/overview`
17+
18+
## Overview
19+
20+
The Web UI of Apache SeaTunnel offers a user-friendly interface for monitoring and managing SeaTunnel jobs. Through the Web UI, users can view real-time information on currently running jobs, finished jobs, and the status of worker and master nodes within the cluster. The main functional modules include Jobs, Workers, and Master, each providing detailed status information and operational options to help users efficiently manage and optimize their data processing workflows.
21+
![overview.png](../../images/ui/overview.png)
22+
23+
## Jobs
24+
25+
### Running Jobs
26+
27+
The "Running Jobs" section lists all SeaTunnel jobs that are currently in execution. Users can view basic information for each job, including Job ID, submission time, status, execution time, and more. By clicking on a specific job, users can access detailed information such as task distribution, resource utilization, and log outputs, allowing for real-time monitoring of job progress and timely handling of potential issues.
28+
![running.png](../../images/ui/running.png)
29+
![detail.png](../../images/ui/detail.png)
30+
31+
### Finished Jobs
32+
33+
The "Finished Jobs" section displays all SeaTunnel jobs that have either successfully completed or failed. This section provides execution results, completion times, durations, and failure reasons (if any) for each job. Users can review past job records through this module to analyze job performance, troubleshoot issues, or rerun specific jobs as needed.
34+
![finished.png](../../images/ui/finished.png)
35+
36+
## Workers
37+
38+
### Workers Information
39+
40+
The "Workers" section displays detailed information about all worker nodes in the cluster, including each worker's address, running status, CPU and memory usage, number of tasks being executed, and more. Through this module, users can monitor the health of each worker node, promptly identify and address resource bottlenecks or node failures, ensuring the stable operation of the SeaTunnel cluster.
41+
![workers.png](../../images/ui/workers.png)
42+
43+
## Master
44+
45+
### Master Information
46+
47+
The "Master" section provides the status and configuration information of the master node in the SeaTunnel cluster. Users can view the master's address, running status, job scheduling responsibilities, and overall resource allocation within the cluster. This module helps users gain a comprehensive understanding of the cluster's core management components, facilitating cluster configuration optimization and troubleshooting.
48+
![master.png](../../images/ui/master.png)

docs/images/ui/detail.png

141 KB
Loading

docs/images/ui/finished.png

55 KB
Loading

docs/images/ui/master.png

73.2 KB
Loading

docs/images/ui/overview.png

191 KB
Loading

docs/images/ui/running.png

39.7 KB
Loading

docs/images/ui/workers.png

73.5 KB
Loading

docs/sidebars.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,8 @@ const sidebars = {
206206
"seatunnel-engine/rest-api-v2",
207207
"seatunnel-engine/user-command",
208208
"seatunnel-engine/logging",
209-
"seatunnel-engine/telemetry"
209+
"seatunnel-engine/telemetry",
210+
"seatunnel-engine/web-ui"
210211
]
211212
},
212213
{

docs/zh/seatunnel-engine/web-ui.md

+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# Apache SeaTunnel Web UI 文档
2+
3+
## 访问
4+
5+
在访问 web ui 之前我们需要开启 http rest api。首先需要在`seatunnel.yaml`配置文件中配置
6+
7+
```
8+
seatunnel:
9+
engine:
10+
http:
11+
enable-http: true
12+
port: 8080
13+
```
14+
15+
然后访问 `http://ip:8080/#/overview`
16+
17+
## 概述
18+
19+
Apache SeaTunnel 的 Web UI 提供了一个友好的用户界面,用于监控和管理 SeaTunnel 作业。通过 Web UI,用户可以实时查看当前运行的作业、已完成的作业,以及集群中工作节点和管理节点的状态。主要功能模块包括 Jobs、Workers 和 Master,每个模块都提供了详细的状态信息和操作选项,帮助用户高效地管理和优化其数据处理流程。
20+
![overview.png](../../images/ui/overview.png)
21+
22+
## 作业
23+
24+
### 运行中的作业
25+
26+
“运行中的作业”模块列出了当前正在执行的所有 SeaTunnel 作业。用户可以查看每个作业的基本信息,包括作业 ID、提交时间、状态、执行时间等。点击具体作业可以查看更多详细信息,如任务分布、资源使用情况和日志输出,便于用户实时监控作业进度并及时处理潜在问题。
27+
![running.png](../../images/ui/running.png)
28+
![detail.png](../../images/ui/detail.png)
29+
30+
### 已完成的作业
31+
32+
“已完成的作业”模块展示了所有已成功完成或失败的 SeaTunnel 作业。此部分提供了每个作业的执行结果、完成时间、耗时以及失败原因(如果有)。用户可以通过此模块回顾过去的作业记录,分析作业性能,进行故障排查或重复执行某些特定作业。
33+
![finished.png](../../images/ui/finished.png)
34+
35+
## 工作节点
36+
37+
### 工作节点信息
38+
39+
“工作节点”模块展示了集群中所有工作节点的详细信息,包括每个工作节点的地址、运行状态、CPU 和内存使用情况、正在执行的任务数量等。通过该模块,用户可以监控各个工作节点的健康状况,及时发现和处理资源瓶颈或节点故障,确保 SeaTunnel 集群的稳定运行。
40+
![workers.png](../../images/ui/workers.png)
41+
42+
## 管理节点
43+
44+
### 管理节点信息
45+
46+
“管理节点”模块提供了 SeaTunnel 集群中主节点的状态和配置信息。用户可以查看 Master 节点的地址、运行状态、负责的作业调度情况以及整体集群的资源分配情况。该模块帮助用户全面了解集群的核心管理部分,便于进行集群配置优化和故障排查。
47+
![master.png](../../images/ui/master.png)

seatunnel-engine/pom.xml

+1
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
<module>seatunnel-engine-core</module>
3333
<module>seatunnel-engine-storage</module>
3434
<module>seatunnel-engine-serializer</module>
35+
<module>seatunnel-engine-ui</module>
3536
</modules>
3637

3738
<properties>

seatunnel-engine/seatunnel-engine-server/pom.xml

+5
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,11 @@
3333
<artifactId>seatunnel-engine-core</artifactId>
3434
<version>${project.version}</version>
3535
</dependency>
36+
<dependency>
37+
<groupId>org.apache.seatunnel</groupId>
38+
<artifactId>seatunnel-engine-ui</artifactId>
39+
<version>${project.version}</version>
40+
</dependency>
3641
<dependency>
3742
<groupId>org.apache.seatunnel</groupId>
3843
<artifactId>checkpoint-storage-hdfs</artifactId>

seatunnel-engine/seatunnel-engine-server/src/main/java/org/apache/seatunnel/engine/server/JettyService.java

+10-1
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747

4848
import javax.servlet.DispatcherType;
4949

50+
import java.net.URL;
5051
import java.util.EnumSet;
5152

5253
import static org.apache.seatunnel.engine.server.rest.RestConstant.ENCRYPT_CONFIG;
@@ -88,7 +89,15 @@ public void createJettyServer() {
8889
FilterHolder filterHolder = new FilterHolder(new ExceptionHandlingFilter());
8990
context.addFilter(filterHolder, "/*", EnumSet.of(DispatcherType.REQUEST));
9091

91-
context.addServlet(new ServletHolder("default", new DefaultServlet()), "/");
92+
ServletHolder defaultServlet = new ServletHolder("default", DefaultServlet.class);
93+
URL uiResource = JettyService.class.getClassLoader().getResource("ui");
94+
if (uiResource != null) {
95+
defaultServlet.setInitParameter("resourceBase", uiResource.toExternalForm());
96+
} else {
97+
log.warn("UI resources not found in classpath");
98+
}
99+
100+
context.addServlet(defaultServlet, "/");
92101

93102
ServletHolder overviewHolder = new ServletHolder(new OverviewServlet(nodeEngine));
94103
ServletHolder runningJobsHolder = new ServletHolder(new RunningJobsServlet(nodeEngine));
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one or more
2+
# contributor license agreements. See the NOTICE file distributed with
3+
# this work for additional information regarding copyright ownership.
4+
# The ASF licenses this file to You under the Apache License, Version 2.0
5+
# (the "License"); you may not use this file except in compliance with
6+
# the License. You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
16+
NODE_ENV=development
17+
18+
# if you want to use the online server, you need to set this to `http://124.221.211.72:8081`
19+
# VITE_APP_API_SERVICE='http://localhost:5801'
20+
VITE_APP_API_SERVICE='http://124.221.211.72:8081'
21+
# the context path of api service
22+
VITE_APP_API_BASE='/api'
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one or more
2+
# contributor license agreements. See the NOTICE file distributed with
3+
# this work for additional information regarding copyright ownership.
4+
# The ASF licenses this file to You under the Apache License, Version 2.0
5+
# (the "License"); you may not use this file except in compliance with
6+
# the License. You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
16+
NODE_ENV=production
17+
18+
# the context path of api service
19+
VITE_APP_API_BASE=''
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one or more
3+
* contributor license agreements. See the NOTICE file distributed with
4+
* this work for additional information regarding copyright ownership.
5+
* The ASF licenses this file to You under the Apache License, Version 2.0
6+
* (the "License"); you may not use this file except in compliance with
7+
* the License. You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
18+
/* eslint-env node */
19+
require('@rushstack/eslint-patch/modern-module-resolution')
20+
21+
module.exports = {
22+
root: true,
23+
'extends': [
24+
'plugin:vue/vue3-essential',
25+
'eslint:recommended',
26+
'@vue/eslint-config-typescript',
27+
'@vue/eslint-config-prettier/skip-formatting'
28+
],
29+
overrides: [
30+
{
31+
files: [
32+
'cypress/e2e/**/*.{cy,spec}.{js,ts,jsx,tsx}',
33+
'cypress/support/**/*.{js,ts,jsx,tsx}'
34+
],
35+
'extends': [
36+
'plugin:cypress/recommended'
37+
]
38+
}
39+
],
40+
parserOptions: {
41+
ecmaVersion: 'latest'
42+
},
43+
rules: {
44+
"vue/multi-word-component-names": "off"
45+
}
46+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
yarn-debug.log*
6+
yarn-error.log*
7+
pnpm-debug.log*
8+
lerna-debug.log*
9+
10+
node_modules
11+
.DS_Store
12+
dist
13+
dist-ssr
14+
coverage
15+
*.local
16+
17+
/cypress/videos/
18+
/cypress/screenshots/
19+
20+
# Editor directories and files
21+
.vscode/*
22+
!.vscode/extensions.json
23+
.idea
24+
*.suo
25+
*.ntvs*
26+
*.njsproj
27+
*.sln
28+
*.sw?
29+
30+
*.tsbuildinfo
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"$schema": "https://json.schemastore.org/prettierrc",
3+
"semi": false,
4+
"tabWidth": 2,
5+
"singleQuote": true,
6+
"printWidth": 100,
7+
"trailingComma": "none"
8+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# seatunnel-engine-ui
2+
3+
## Development Environment Dependencies
4+
5+
- Node 18+/20+ required
6+
- npm 7+
7+
8+
- modify `VITE_APP_API_SERVICE` and `VITE_APP_API_BASE` in `.env.development`
9+
- quick start
10+
11+
```sh
12+
npm install
13+
npm run dev
14+
```
15+
16+
## Project Setup
17+
18+
```sh
19+
npm install
20+
```
21+
22+
### Compile and Hot-Reload for Development
23+
24+
```sh
25+
npm run dev
26+
```
27+
28+
### Type-Check, Compile and Minify for Production
29+
30+
```sh
31+
npm run build
32+
```
33+
34+
### Run Unit Tests with [Vitest]
35+
36+
```sh
37+
npm run test:unit
38+
```
39+
40+
### Run End-to-End Tests with [Cypress]
41+
42+
```sh
43+
npm run test:e2e:dev
44+
```
45+
46+
This runs the end-to-end tests against the Vite development server.
47+
It is much faster than the production build.
48+
49+
But it's still recommended to test the production build with `test:e2e` before deploying (e.g. in CI environments):
50+
51+
```sh
52+
npm run build
53+
npm run test:e2e
54+
```
55+
56+
### Lint with [ESLint]
57+
58+
```sh
59+
npm run lint
60+
```

0 commit comments

Comments
 (0)