Skip to content

Commit

Permalink
Merge branch 'dev' of https://github.com/SLSJL/eventmesh-dashboard in…
Browse files Browse the repository at this point in the history
…to dev

* 'dev' of https://github.com/SLSJL/eventmesh-dashboard:
  [ISSUE apache#73] Add remoting service (apache#74)
  [ISSUE apache#45] Implement methods from storage-plugin.admin(rocketmq) (apache#66)
  [ISSUE apache#71] Reduce log file size and Streamline debug output (apache#72)
  [ISSUE apache#69] Integrate database credentials in auto-deploy (apache#70)
  [ISSUE apache#67] Fix HealthCheckResultMapper which leads to application error
  [ISSUE apache#64] Support automated deployment and Fix runtime packaging errors (apache#65)
  [ISSUE apache#60] add SDK manager (apache#62)
  [ISSUE apache#57] Modify the field, synchronize the modification, and add the mapper method (apache#58)
  [ISSUE apache#29] Set up EventMesh Dashboard Front-end (apache#56)
  [ISSUE apache#49] RocketMQ and Nacos health check (apache#53)
  [ISSUE apache#51] Config Mgmt basic function and config,runtime,store,cluster SQL (apache#52)

# Conflicts:
#	eventmesh-dashboard-view/public/index.html
#	eventmesh-dashboard-view/src/App.tsx
#	eventmesh-dashboard-view/src/index.tsx
#	eventmesh-dashboard-view/src/routes/RootLayout.tsx
#	eventmesh-dashboard-view/src/routes/navigation/Navigation.tsx
#	eventmesh-dashboard-view/src/routes/navigation/NavigationItem.tsx
#	eventmesh-dashboard-view/src/routes/topic/Topic.tsx
#	eventmesh-dashboard-view/src/routes/topic/stats/AbnormalTopicCount.tsx
#	eventmesh-dashboard-view/src/routes/topic/stats/Stats.tsx
#	eventmesh-dashboard-view/src/routes/topic/stats/StatsChart.tsx
#	eventmesh-dashboard-view/src/routes/topic/stats/TopicCount.tsx
#	eventmesh-dashboard-view/src/routes/topic/topic-list/TopicList.tsx
  • Loading branch information
SUN committed Mar 31, 2024
2 parents 7f2bd82 + 13eae3f commit e75f4ae
Show file tree
Hide file tree
Showing 222 changed files with 7,456 additions and 393 deletions.
18 changes: 11 additions & 7 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
.gradle
build/
!gradle/wrapper/gradle-wrapper.jar
!**/src/main/**/build/
!**/src/test/**/build/

### STS ###
.apt_generated
.classpath
Expand Down Expand Up @@ -78,8 +72,18 @@ dependency-reduced-pom.xml
buildNumber.properties
.mvn/timing.properties

### Gradle ###
.gradle
build/
!gradle/wrapper/gradle-wrapper.jar
!**/src/main/**/build/
!**/src/test/**/build/

### Log Files ###
*.log
logs/
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*
hs_err_pid*

### Devops ###
.env
25 changes: 25 additions & 0 deletions deployment/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#
# Licensed to Apache Software Foundation (ASF) under one or more contributor
# license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright
# ownership. Apache Software Foundation (ASF) licenses this file to you 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.

# Copy this .env.example file to the .env file
# and edit your credentials.

# Database credentials
DB_ADDRESS=localhost:3306
DB_USERNAME=root
DB_PASSWORD=password
27 changes: 27 additions & 0 deletions deployment/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
## Auto Deploy EventMesh Dashboard

### Usage

```
cd ~/service
git clone -b dev https://github.com/apache/eventmesh-dashboard.git
cd eventmesh-dashboard
chmod +x deployment/auto-deploy-eventmesh-dashboard.sh
```

Edit credentials:

```
cp deployment/.env.example deployment/.env
vim deployment/.env
```

Add task to crontab:

```
crontab -e
```

```
0 * * * * ~/service/eventmesh-dashboard/deployment/auto-deploy-eventmesh-dashboard.sh
```
88 changes: 88 additions & 0 deletions deployment/auto-deploy-eventmesh-dashboard.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
#!/bin/bash
#
# Licensed to Apache Software Foundation (ASF) under one or more contributor
# license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright
# ownership. Apache Software Foundation (ASF) licenses this file to you 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.

# Git repository path
REPO_PATH=~/service/eventmesh-dashboard

# SpringBoot process ID file path
PID_LOG=~/service/eventmesh-dashboard/deployment/eventmesh-dashboard-pid.log

# Automatic deployment shell script log file path
AUTO_DEPLOY_LOG=~/service/eventmesh-dashboard/deployment/auto-deploy-eventmesh-dashboard.log

# Jar file path
JAR_FILE_PATH=~/service/eventmesh-dashboard/eventmesh-dashboard-console/target/eventmesh-dashboard-console-0.0.1-SNAPSHOT.jar

# Load environment variables from external file
ENV_FILE=~/service/eventmesh-dashboard/deployment/.env
source $ENV_FILE

# Update the git repository
cd $REPO_PATH
git fetch origin dev
LOCAL=$(git rev-parse @)
REMOTE=$(git rev-parse origin/dev)

if [ $LOCAL != $REMOTE ]; then
# If the remote dev branch is newer than the local one, update the local dev branch code
git pull origin dev

# Log the event
echo "$(date +"%Y-%m-%d %H:%M:%S") - change detected." >> $AUTO_DEPLOY_LOG

# Terminate the old process
if [ -s $PID_LOG ]; then
PID=$(cat $PID_LOG)
if [ -n "$PID" ]; then
kill $PID
# Log the event
echo "$(date +"%Y-%m-%d %H:%M:%S") - kill running application." >> $AUTO_DEPLOY_LOG
fi
fi

# Compile and package the Jar file
mvn clean package -DskipTests

# Start the springboot application and record the process id to pid.log file
nohup java -DDB_ADDRESS=$DB_ADDRESS -DDB_USERNAME=$DB_USERNAME -DDB_PASSWORD=$DB_PASSWORD -jar $JAR_FILE_PATH > /dev/null 2>&1 &
echo $! > $PID_LOG

# Log the event
echo "$(date +"%Y-%m-%d %H:%M:%S") - start new application." >> $AUTO_DEPLOY_LOG
else
# If there are no new changes in the remote dev branch

# Log the event
echo "$(date +"%Y-%m-%d %H:%M:%S") - no change detected." >> $AUTO_DEPLOY_LOG

if [ -s $PID_LOG ]; then
# If the pid.log file exists, no action is performed
echo "$(date +"%Y-%m-%d %H:%M:%S") - application running, no operation performed." >> $AUTO_DEPLOY_LOG
else
# If the pid.log file does not exist, compile and package the Jar file
mvn clean package -DskipTests

# Start the springboot application and record the process id to pid.log file
nohup java -DDB_ADDRESS=$DB_ADDRESS -DDB_USERNAME=$DB_USERNAME -DDB_PASSWORD=$DB_PASSWORD -jar $JAR_FILE_PATH > /dev/null 2>&1 &
echo $! > $PID_LOG

# Log the event
echo "$(date +"%Y-%m-%d %H:%M:%S") - no pid.log file, start application." >> $AUTO_DEPLOY_LOG
fi
fi
24 changes: 24 additions & 0 deletions eventmesh-dashboard-common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,30 @@
<artifactId>fastjson2</artifactId>
<version>2.0.40</version>
</dependency>

<!-- todo These SDKs should be placed in the core module after the console module's usage of these SDKs has been migrated to the core module. -->
<!-- storage redis client -->
<dependency>
<groupId>io.lettuce</groupId>
<artifactId>lettuce-core</artifactId>
</dependency>
<!-- Meta - nacos client -->
<dependency>
<groupId>com.alibaba.nacos</groupId>
<artifactId>nacos-client</artifactId>
<version>${nacos.version}</version>
</dependency>
<!-- rocketmq client -->
<dependency>
<groupId>org.apache.rocketmq</groupId>
<artifactId>rocketmq-client</artifactId>
<version>${rocketmq.version}</version>
</dependency>
<dependency>
<groupId>org.apache.rocketmq</groupId>
<artifactId>rocketmq-tools</artifactId>
<version>${rocketmq.version}</version>
</dependency>
</dependencies>

</project>
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* limitations under the License.
*/

package org.apache.eventmesh.dashboard.console.constant;
package org.apache.eventmesh.dashboard.common.constant;

public class ApiPrefix {
public static final String API_PREFIX = "/eventmesh-dashboard/";
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You 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 org.apache.eventmesh.dashboard.common.constant.health;

public class HealthCheckTypeConstant {

public static final String HEALTH_CHECK_TYPE_UNKNOWN = "unknown";

public static final String HEALTH_CHECK_TYPE_CLUSTER = "cluster";

public static final String HEALTH_CHECK_TYPE_RUNTIME = "runtime";
public static final String HEALTH_CHECK_TYPE_STORAGE = "storage";
public static final String HEALTH_CHECK_TYPE_META = "meta";
public static final String HEALTH_CHECK_TYPE_TOPIC = "topic";

public static final String HEALTH_CHECK_SUBTYPE_REDIS = "redis";
public static final String HEALTH_CHECK_SUBTYPE_MYSQL = "mysql";
public static final String HEALTH_CHECK_SUBTYPE_ROCKETMQ_BROKER = "rocketmq4-broker";
public static final String HEALTH_CHECK_SUBTYPE_ROCKETMQ_NAMESERVER = "rocketmq4-nameserver";
public static final String HEALTH_CHECK_SUBTYPE_ROCKETMQ_TOPIC = "rocketmq4-topic";

public static final String HEALTH_CHECK_SUBTYPE_NACOS_CONFIG = "nacos-config";
public static final String HEALTH_CHECK_SUBTYPE_NACOS_REGISTRY = "nacos-registry";
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You 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 org.apache.eventmesh.dashboard.common.constant.health;

public class HealthConstant {
public static final String NEW_LINE_ENDING = "\n";

public static final String RUNTIME_CHECK_TOPIC = "eventmesh-dashboard-healthcheck-topic";

public static final String RUNTIME_CHECK_CONTENT_KEY = "eventmesh-dashboard-healthcheck-content";

public static final String RUNTIME_CHECK_CONTENT_BODY = "eventmesh-dashboard-healthcheck-content-body";

public static final String CLOUDEVENT_CONTENT_TYPE = "application/cloudevents+json";


public static final String ENV = "test";
public static final String HOST = "localhost";
public static final String PASSWORD = "PASSWORD";
public static final String USER_NAME = "PU4283";
public static final String GROUP = "EventmeshTestGroup";
public static final String PATH = "/data/app/umg_proxy";
public static final Integer PORT = 8362;
public static final String VERSION = "2.0.11";
public static final String IDC = "FT";
public static final String SUBSYSTEM = "5023";

public static final String ROCKETMQ_CHECK_PRODUCER_GROUP = "eventmesh-dashboard-healthcheck-rocketmq-producer-group";

public static final String ROCKETMQ_CHECK_CONSUMER_GROUP = "eventmesh-dashboard-healthcheck-rocketmq-consumer-group";

public static final String ROCKETMQ_CHECK_TOPIC = "DO-NOT-USE-THIS-TOPIC-"
+ "eventmesh-dashboard-healthcheck-rocketmq-topic-90a78a5d-b803-447e-8c48-1c87ab0c74d9";
public static final String ROCKETMQ_CHECK_TOPIC_MSG = "eventmesh-dashboard-healthcheck-rocketmq-message";

public static final String NACOS_CHECK_DATA_ID = "DO-NOT-USE-THIS-"
+ "eventmesh-dashboard-healthcheck-nacos-data-id-28e2933f-a47b-439d-b14b-7d9970c37042";

public static final String NACOS_CHECK_GROUP = "EVENTMESH_DASHBOARD_HEALTH_CHECK_GROUP";

public static final String NACOS_CHECK_CONTENT = "eventmesh-dashboard";

public static final String NACOS_CHECK_SERVICE_NAME = "eventmesh-dashboard-healthcheck-nacos-service-name";

public static final String NACOS_CHECK_SERVICE_CLUSTER_NAME = "eventmesh-dashboard-healthcheck-nacos-service-cluster-name";
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* limitations under the License.
*/

package org.apache.eventmesh.dashboard.console.enums;
package org.apache.eventmesh.dashboard.common.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@
* limitations under the License.
*/

package org.apache.eventmesh.dashboard.console.enums;
package org.apache.eventmesh.dashboard.common.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

@Getter
@AllArgsConstructor
public enum StatusEnum {
public enum RecordStatus {
INACTIVE(0, "Inactive"),
ACTIVE(1, "Active");

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You 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 org.apache.eventmesh.dashboard.common.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

@AllArgsConstructor
public enum StoreType {

STANDALONE(0, "Standalone"),
ROCKETMQ(1, "RocketMQ"),
KAFKA(2, "Kafka"),
PULSAR(3, "Pulsar"),
RABBITMQ(4, "RabbitMQ"),
REDIS(5, "Redis");

@Getter
private final Integer number;
@Getter
private final String name;
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* limitations under the License.
*/

package org.apache.eventmesh.dashboard.console.enums.health;
package org.apache.eventmesh.dashboard.common.enums.health;

import lombok.AllArgsConstructor;
import lombok.Getter;
Expand Down
Loading

0 comments on commit e75f4ae

Please sign in to comment.