Skip to content

Commit

Permalink
Merge branch 'dev-1.1.2' into dev-1.1.2-frontend_xxzhou
Browse files Browse the repository at this point in the history
  • Loading branch information
starchouzz committed Aug 14, 2023
2 parents dd7fe89 + a7feca1 commit d53fa51
Show file tree
Hide file tree
Showing 125 changed files with 1,245 additions and 839 deletions.
Empty file.
66 changes: 0 additions & 66 deletions assembly-package/config/exchangis-server.properties

This file was deleted.

Empty file.
2 changes: 1 addition & 1 deletion assembly-package/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<parent>
<artifactId>exchangis</artifactId>
<groupId>com.webank.wedatasphere.exchangis</groupId>
<version>1.1.1</version>
<version>1.1.2</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>assembly-package</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion assembly-package/sbin/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@
#

declare -A MODULE_MAIN_CLASS
MODULE_MAIN_CLASS["exchangis-server"]="com.webank.wedatasphere.exchangis.server.boot.ExchangisServerApplication"
MODULE_MAIN_CLASS["dss-exchangis-main-server-dev"]="com.webank.wedatasphere.exchangis.server.boot.ExchangisServerApplication"
2 changes: 1 addition & 1 deletion assembly-package/sbin/daemon.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ else
fi

usage(){
echo "Usage is [start|stop|restart {service}]"
echo "Usage is [start|stop|restart {server}]"
}

start(){
Expand Down
8 changes: 4 additions & 4 deletions assembly-package/sbin/env.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
EXCHANGIS_CONF_PATH="/appcom/config/exchangis-config"
EXCHANGIS_LOG_PATH="/appcom/logs/exchangis-log"
MODULE_DEFAULT_PREFIX="exchangis-server"
MODULE_DEFAULT_SUFFIX=""
EXCHANGIS_CONF_PATH=/appcom/config/exchangis-config/background
EXCHANGIS_LOG_PATH=/appcom/logs/exchangis/background
MODULE_DEFAULT_PREFIX="dss-exchangis-main-"
MODULE_DEFAULT_SUFFIX="-dev"
63 changes: 21 additions & 42 deletions assembly-package/sbin/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -123,57 +123,36 @@ interact_echo(){
done
}

# Initalize database
init_database(){
BOOTSTRAP_PROP_FILE="${CONF_PATH}/exchangis-server.properties"
# Start to initalize database
if [ "x${SQL_SOURCE_PATH}" != "x" ] && [ -f "${SQL_SOURCE_PATH}" ]; then
`mysql --version >/dev/null 2>&1`
interact_echo "Do you want to initalize database with sql?"
if [ $? == 0 ]; then
LOG INFO "\033[1m Scan out mysql command, so begin to initalize the database\033[0m"
#interact_echo "Do you want to initalize database with sql: [${SQL_SOURCE_PATH}]?"
#if [ $? == 0 ]; then
BOOTSTRAP_PROP_FILE="${CONF_PATH}/exchangis-server.properties"
if [ "x${SQL_SOURCE_PATH}" != "x" ] && [ -f "${SQL_SOURCE_PATH}" ]; then
`mysql --version >/dev/null 2>&1`
DATASOURCE_URL="jdbc:mysql:\/\/${MYSQL_HOST}:${MYSQL_PORT}\/${DATABASE}\?useSSL=false\&characterEncoding=UTF-8\&allowMultiQueries=true"
mysql -h ${MYSQL_HOST} -P ${MYSQL_PORT} -u ${MYSQL_USERNAME} -p${MYSQL_PASSWORD} --default-character-set=utf8 -e \
"CREATE DATABASE IF NOT EXISTS ${DATABASE}; USE ${DATABASE}; source ${SQL_SOURCE_PATH};"
#sed -ri "s![#]?(DB_HOST=)\S*!\1${HOST}!g" ${BOOTSTRAP_PROP_FILE}
#sed -ri "s![#]?(DB_PORT=)\S*!\1${PORT}!g" ${BOOTSTRAP_PROP_FILE}
sed -ri "s![#]?(wds.linkis.server.mybatis.datasource.username=)\S*!\1${MYSQL_USERNAME}!g" ${BOOTSTRAP_PROP_FILE}
sed -ri "s![#]?(wds.linkis.server.mybatis.datasource.password=)\S*!\1${MYSQL_PASSWORD}!g" ${BOOTSTRAP_PROP_FILE}
sed -ri "s![#]?(wds.linkis.server.mybatis.datasource.url=)\S*!\1${DATASOURCE_URL}!g" ${BOOTSTRAP_PROP_FILE}
#fi
fi
fi
interact_echo "Do you want to initalize database with sql: [${SQL_SOURCE_PATH}]?"
if [ $? == 0 ]; then
LOG INFO "\033[1m Scan out mysql command, so begin to initalize the database\033[0m"
mysql -h ${MYSQL_HOST} -P ${MYSQL_PORT} -u ${MYSQL_USERNAME} -p${MYSQL_PASSWORD} --default-character-set=utf8 -e \
"CREATE DATABASE IF NOT EXISTS ${DATABASE}; USE ${DATABASE}; source ${SQL_SOURCE_PATH};"
fi
fi
}

init_properties(){
BOOTSTRAP_PROP_FILE="${CONF_PATH}/exchangis-server.properties"
APPLICATION_YML="${CONF_PATH}/application-exchangis.yml"
# Start to initalize propertis
#interact_echo "Do you want to initalize exchangis-server.properties?"
#if [ $? == 0 ]; then

LINKIS_GATEWAY_URL="http:\/\/${LINKIS_GATEWAY_HOST}:${LINKIS_GATEWAY_PORT}\/"

if [ "x${LINKIS_SERVER_URL}" == "x" ]; then
LINKIS_SERVER_URL="http://127.0.0.1:3306"
fi
if [ "x${LINKIS_SERVER_URL}" == "x" ]; then
LINKIS_SERVER_URL="http://127.0.0.1:3306"
fi
BOOTSTRAP_PROP_FILE="${CONF_PATH}/exchangis-server.properties"
APPLICATION_YML="${CONF_PATH}/application-exchangis.yml"
LINKIS_GATEWAY_URL="http:\/\/${LINKIS_GATEWAY_HOST}:${LINKIS_GATEWAY_PORT}\/"
if [ "x${LINKIS_SERVER_URL}" == "x" ]; then
LINKIS_SERVER_URL="http://127.0.0.1:9001"
fi

sed -ri "s![#]?(wds.linkis.gateway.ip=)\S*!\1${LINKIS_GATEWAY_HOST}!g" ${BOOTSTRAP_PROP_FILE}
sed -ri "s![#]?(wds.linkis.gateway.port=)\S*!\1${LINKIS_GATEWAY_PORT}!g" ${BOOTSTRAP_PROP_FILE}
sed -ri "s![#]?(wds.linkis.gateway.url=)\S*!\1${LINKIS_GATEWAY_URL}!g" ${BOOTSTRAP_PROP_FILE}
sed -ri "s![#]?(wds.exchangis.datasource.client.serverurl=)\S*!\1${LINKIS_GATEWAY_URL}!g" ${BOOTSTRAP_PROP_FILE}
sed -ri "s![#]?(wds.exchangis.client.linkis.server-url=)\S*!\1${LINKIS_GATEWAY_URL}!g" ${BOOTSTRAP_PROP_FILE}
#sed -ri "s![#]?(wds.exchangis.datasource.client.authtoken.key=)\S*!\1${LINKIS_TOKEN}!g" ${BOOTSTRAP_PROP_FILE}
#sed -ri "s![#]?(wds.exchangis.datasource.client.authtoken.value=)\S*!\1${LINKIS_TOKEN}!g" ${BOOTSTRAP_PROP_FILE}
#sed -ri "s![#]?(wds.exchangis.client.linkis.token.value=)\S*!\1${LINKIS_TOKEN}!g" ${BOOTSTRAP_PROP_FILE}
sed -ri "s![#]?(wds.linkis.gateway.port=)\S*!\1${LINKIS_GATEWAY_PORT}!g" ${BOOTSTRAP_PROP_FILE}
sed -ri "s![#]?(port: )\S*!\1${EXCHANGIS_PORT}!g" ${APPLICATION_YML}
sed -ri "s![#]?(defaultZone: )\S*!\1${EUREKA_URL}!g" ${APPLICATION_YML}
#fi
sed -ri "s![#]?(wds.exchangis.datasource.client.serverurl=)\S*!\1${LINKIS_GATEWAY_URL}!g" ${BOOTSTRAP_PROP_FILE}
sed -ri "s![#]?(wds.exchangis.client.linkis.server-url=)\S*!\1${LINKIS_GATEWAY_URL}!g" ${BOOTSTRAP_PROP_FILE}
sed -ri "s![#]?(port: )\S*!\1${EXCHANGIS_PORT}!g" ${APPLICATION_YML}
sed -ri "s![#]?(defaultZone: )\S*!\1${EUREKA_URL}!g" ${APPLICATION_YML}
}

install_modules(){
Expand Down
11 changes: 6 additions & 5 deletions assembly-package/sbin/launcher.sh
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,6 @@ load_env_definitions(){
fi
}



construct_java_command(){
verify_java_env
if [[ "x${EXCHANGIS_CONF_PATH}" == "x" ]]; then
Expand All @@ -114,7 +112,7 @@ construct_java_command(){
mkdir -p ${EXCHANGIS_PID_PATH}
local classpath=${EXCHANGIS_CONF_PATH}":."
local opts=""
classpath=${EXCHANGIS_LIB_PATH}/exchangis-server/*":"${classpath}
classpath=${EXCHANGIS_LIB_PATH}/"exchangis-server/*:"${classpath}
LOG INFO "classpath:"${classpath}
if [[ "x${EXCHANGIS_JAVA_OPTS}" == "x" ]]; then
# Use G1 garbage collector
Expand Down Expand Up @@ -175,7 +173,7 @@ wait_for_startup(){
return 0
fi
sleep ${SLEEP_TIMEREVAL_S}
now_s=`date '+%s'` #计算当前时间时间戳
now_s=`date '+%s'`
done
return 1
}
Expand Down Expand Up @@ -204,14 +202,17 @@ launcher_start(){
fi
construct_java_command $1 $2
# Execute
echo ${EXEC_JAVA}
LOG INFO ${EXEC_JAVA}
nohup ${EXEC_JAVA} >/dev/null 2>&1 &
LOG INFO "Launcher: waiting [ $1 ] to start complete ..."
wait_for_startup 20 $1 $2
if [[ $? -eq 0 ]]; then
LOG INFO "Launcher: [ $1 ] start success"
LOG INFO ${EXCHANGIS_CONF_PATH}
APPLICATION_YML="${EXCHANGIS_CONF_PATH}/application-exchangis.yml"
EUREKA_URL=`cat ${APPLICATION_YML} | grep Zone | sed -n '1p'`
echo "${EUREKA_URL}"
LOG INFO "Please check exchangis server in EUREKA_ADDRESS: ${EUREKA_URL#*:} "
else
LOG ERROR "Launcher: [ $1 ] start fail over 20 seconds, please retry it"
Expand Down Expand Up @@ -249,4 +250,4 @@ launcher_stop(){
LOG ERROR "Launcher: [ $1 ] stop exceeded over 20s " >&2
return 1
fi
}
}
88 changes: 88 additions & 0 deletions db/1.1.1/exchangis_ddl.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
-- exchangis_job_func definition
DROP TABLE IF EXISTS `exchangis_job_func`;
CREATE TABLE `exchangis_job_func` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`func_type` varchar(50) NOT NULL,
`func_name` varchar(100) NOT NULL,
`tab_name` varchar(50) NOT NULL COMMENT 'Tab',
`name_dispaly` varchar(100) DEFAULT NULL,
`param_num` int(11) DEFAULT '0',
`ref_name` varchar(100) DEFAULT NULL,
`description` varchar(200) DEFAULT NULL,
`modify_time` datetime DEFAULT NULL,
`create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`),
UNIQUE KEY `job_func_tab_name_idx` (`tab_name`,`func_name`)
) ENGINE=InnoDB AUTO_INCREMENT=12 DEFAULT CHARSET=utf8;

-- exchangis_job_func_params definition
DROP TABLE IF EXISTS `exchangis_job_func_params`;
CREATE TABLE IF NOT EXISTS `exchangis_job_func_params`(
`func_id` INT(11) NOT NULL,
`param_name` VARCHAR(100) NOT NULL,
`order` INT(11) DEFAULT 0,
`name_display` VARCHAR(100),
`create_time` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY(`func_id`, `param_name`)
)Engine=InnoDB DEFAULT CHARSET=utf8;

-- exchangis_job_param_config definition
DROP TABLE IF EXISTS `exchangis_job_param_config`;
CREATE TABLE `exchangis_job_param_config` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`config_key` varchar(64) NOT NULL,
`config_name` varchar(64) NOT NULL,
`config_direction` varchar(16) DEFAULT NULL,
`type` varchar(32) NOT NULL,
`ui_type` varchar(32) DEFAULT NULL,
`ui_field` varchar(64) DEFAULT NULL,
`ui_label` varchar(32) DEFAULT NULL,
`unit` varchar(32) DEFAULT NULL,
`required` bit(1) DEFAULT b'0',
`value_type` varchar(32) DEFAULT NULL,
`value_range` varchar(255) DEFAULT NULL,
`default_value` varchar(255) DEFAULT NULL,
`validate_type` varchar(64) DEFAULT NULL,
`validate_range` varchar(64) DEFAULT NULL,
`validate_msg` varchar(255) DEFAULT NULL,
`is_hidden` bit(1) DEFAULT NULL,
`is_advanced` bit(1) DEFAULT NULL,
`source` varchar(255) DEFAULT NULL,
`level` tinyint(4) DEFAULT NULL,
`treename` varchar(32) DEFAULT NULL,
`sort` int(11) DEFAULT NULL,
`description` varchar(255) DEFAULT NULL,
`status` tinyint(4) DEFAULT NULL,
`ref_id` bigint(20) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=32 DEFAULT CHARSET=utf8;

-- exchangis_engine_settings definition
DROP TABLE IF EXISTS `exchangis_engine_settings`;
CREATE TABLE `exchangis_engine_settings` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`engine_name` varchar(50) NOT NULL,
`engine_desc` varchar(500) NOT NULL,
`engine_settings_value` text,
`engine_direction` varchar(255) NOT NULL,
`res_loader_class` varchar(255),
`res_uploader_class` varchar(255),
`modify_time` datetime DEFAULT NULL,
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`),
UNIQUE KEY `engine_setting_idx` (`engine_name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- exchangis_job_transform_rule
DROP TABLE IF EXISTS `exchangis_job_transform_rule`;
CREATE TABLE `exchangis_job_transform_rule` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`rule_name` varchar(100) NOT NULL DEFAULT 'transform_rule',
`rule_type` varchar(64) NOT NULL DEFAULT 'DEF',
`rule_source` varchar(600) DEFAULT '{}',
`data_source_type` varchar(64) NOT NULL,
`engine_type` varchar(32),
`direction` varchar(32) NOT NULL DEFAULT 'NONE',
`create_time` datetime DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
Loading

0 comments on commit d53fa51

Please sign in to comment.