You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@linkis.apache.org by pe...@apache.org on 2022/06/24 09:53:41 UTC

[incubator-linkis] branch dev-1.1.3 updated: [Issue-2318] Change ENABLE METADATA MANAGE default from false to true (#2319)

This is an automated email from the ASF dual-hosted git repository.

peacewong pushed a commit to branch dev-1.1.3
in repository https://gitbox.apache.org/repos/asf/incubator-linkis.git


The following commit(s) were added to refs/heads/dev-1.1.3 by this push:
     new ebb271534 [Issue-2318] Change ENABLE METADATA MANAGE default from false to true (#2319)
ebb271534 is described below

commit ebb2715347dbb11e82e94425523b169e1b6f3514
Author: Casion <ca...@gmail.com>
AuthorDate: Fri Jun 24 17:53:37 2022 +0800

    [Issue-2318] Change ENABLE METADATA MANAGE default from false to true (#2319)
    
    * 1. remove unused token.properties
    2. change ENABLE_METADATA_MANAGE default as true
    3. fix dml
    
    * code format
---
 .../assembly-combined/conf/token.properties        | 23 ----------------
 .../deploy-config/linkis-env.sh                    |  2 +-
 db/linkis_dml.sql                                  |  2 +-
 .../common/entity/enumeration/MaintainType.java    | 14 ++++++----
 .../gateway/config/GatewayConfiguration.scala      |  2 +-
 .../security/token/TokenAuthentication.scala       | 31 ----------------------
 6 files changed, 12 insertions(+), 62 deletions(-)

diff --git a/assembly-combined-package/assembly-combined/conf/token.properties b/assembly-combined-package/assembly-combined/conf/token.properties
deleted file mode 100644
index f7cc2d409..000000000
--- a/assembly-combined-package/assembly-combined/conf/token.properties
+++ /dev/null
@@ -1,23 +0,0 @@
-# 
-# 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.
-#
-## http API token authentication
-## Token-Code=Token-User
-##eg:TEST-AUTH=hadoop,root,user01
-### http request with header { Token-Code:TEST-AUTH,Token-User:user01}
-QML-AUTH=*
-BML-AUTH=*
-WS-AUTH=*
-dss-AUTH=*
-QUALITIS-AUTH=*
\ No newline at end of file
diff --git a/assembly-combined-package/deploy-config/linkis-env.sh b/assembly-combined-package/deploy-config/linkis-env.sh
index 717e0f473..5c9ef618e 100644
--- a/assembly-combined-package/deploy-config/linkis-env.sh
+++ b/assembly-combined-package/deploy-config/linkis-env.sh
@@ -176,7 +176,7 @@ LINKIS_PUBLIC_MODULE=lib/linkis-commons/public-module
 export PROMETHEUS_ENABLE=false
 
 #If you want to start metadata related microservices, you can set this export ENABLE_METADATA_MANAGE=true
-export ENABLE_METADATA_MANAGER=false
+export ENABLE_METADATA_MANAGER=true
 
 #If you only want to experience linkis streamlined services, not rely on hdfs
 #you can set the following configuration to false  and for the configuration related to the file directory,
diff --git a/db/linkis_dml.sql b/db/linkis_dml.sql
index e4bed1afe..18c7dfc95 100644
--- a/db/linkis_dml.sql
+++ b/db/linkis_dml.sql
@@ -66,7 +66,7 @@ INSERT INTO `linkis_ps_configuration_config_key` (`key`, `description`, `name`,
 -- spark
 INSERT INTO `linkis_ps_configuration_config_key` (`key`, `description`, `name`, `default_value`, `validate_type`, `validate_range`, `is_hidden`, `is_advanced`, `level`, `treeName`, `engine_conn_type`) VALUES ('wds.linkis.rm.instance', '范围:1-20,单位:个', 'spark引擎最大并发数', '10', 'NumInterval', '[1,20]', '0', '0', '1', '队列资源', 'spark');
 INSERT INTO `linkis_ps_configuration_config_key` (`key`, `description`, `name`, `default_value`, `validate_type`, `validate_range`, `is_hidden`, `is_advanced`, `level`, `treeName`, `engine_conn_type`) VALUES ('spark.executor.instances', '取值范围:1-40,单位:个', 'spark执行器实例最大并发数', '1', 'NumInterval', '[1,40]', '0', '0', '2', 'spark资源设置', 'spark');
-INSERT INTO `linkis_ps_configuration_config_key` (`key`, `description`, `name`, `default_value`, `validate_type`, `validate_range`, `is_hidden`, `is_advanced`, `level`, `treeName`, `engine_conn_type`) VALUES ('spark.executor.cores', '取值范围:1-8,单位:个', 'spark执行器核心个数',  '1', 'NumInterval', '[1,2]', '0', '0', '1','spark资源设置', 'spark');
+INSERT INTO `linkis_ps_configuration_config_key` (`key`, `description`, `name`, `default_value`, `validate_type`, `validate_range`, `is_hidden`, `is_advanced`, `level`, `treeName`, `engine_conn_type`) VALUES ('spark.executor.cores', '取值范围:1-8,单位:个', 'spark执行器核心个数',  '1', 'NumInterval', '[1,8]', '0', '0', '1','spark资源设置', 'spark');
 INSERT INTO `linkis_ps_configuration_config_key` (`key`, `description`, `name`, `default_value`, `validate_type`, `validate_range`, `is_hidden`, `is_advanced`, `level`, `treeName`, `engine_conn_type`) VALUES ('spark.executor.memory', '取值范围:1-15,单位:G', 'spark执行器内存大小', '1g', 'Regex', '^([1-9]|1[0-5])(G|g)$', '0', '0', '3', 'spark资源设置', 'spark');
 INSERT INTO `linkis_ps_configuration_config_key` (`key`, `description`, `name`, `default_value`, `validate_type`, `validate_range`, `is_hidden`, `is_advanced`, `level`, `treeName`, `engine_conn_type`) VALUES ('spark.driver.cores', '取值范围:只能取1,单位:个', 'spark驱动器核心个数', '1', 'NumInterval', '[1,1]', '0', '1', '1', 'spark资源设置','spark');
 INSERT INTO `linkis_ps_configuration_config_key` (`key`, `description`, `name`, `default_value`, `validate_type`, `validate_range`, `is_hidden`, `is_advanced`, `level`, `treeName`, `engine_conn_type`) VALUES ('spark.driver.memory', '取值范围:1-15,单位:G', 'spark驱动器内存大小','1g', 'Regex', '^([1-9]|1[0-5])(G|g)$', '0', '0', '1', 'spark资源设置', 'spark');
diff --git a/linkis-computation-governance/linkis-manager/linkis-manager-commons/linkis-manager-common/src/main/java/org/apache/linkis/manager/common/entity/enumeration/MaintainType.java b/linkis-computation-governance/linkis-manager/linkis-manager-commons/linkis-manager-common/src/main/java/org/apache/linkis/manager/common/entity/enumeration/MaintainType.java
index 394ecca56..553dd59a2 100644
--- a/linkis-computation-governance/linkis-manager/linkis-manager-commons/linkis-manager-common/src/main/java/org/apache/linkis/manager/common/entity/enumeration/MaintainType.java
+++ b/linkis-computation-governance/linkis-manager/linkis-manager-commons/linkis-manager-common/src/main/java/org/apache/linkis/manager/common/entity/enumeration/MaintainType.java
@@ -17,12 +17,16 @@
 
 package org.apache.linkis.manager.common.entity.enumeration;
 
+/**
+ * Engine remains unreleased type
+ *
+ * <pre>
+ * Default: automatic release;
+ * day: keep one engine during working hours from 9:00 to 21:00;
+ * week: weekdays Monday to Friday keep one engine;
+ * </pre>
+ */
 public enum MaintainType {
-
-    /**
-     * Engine remains unreleased type Default: automatic release day: keep one engine during working
-     * hours from 9:00 to 21:00 week: weekdays Monday to Friday keep one engine
-     */
     Default,
     day,
     week
diff --git a/linkis-spring-cloud-services/linkis-service-gateway/linkis-gateway-core/src/main/scala/org/apache/linkis/gateway/config/GatewayConfiguration.scala b/linkis-spring-cloud-services/linkis-service-gateway/linkis-gateway-core/src/main/scala/org/apache/linkis/gateway/config/GatewayConfiguration.scala
index cb69cc584..4cf8788eb 100644
--- a/linkis-spring-cloud-services/linkis-service-gateway/linkis-gateway-core/src/main/scala/org/apache/linkis/gateway/config/GatewayConfiguration.scala
+++ b/linkis-spring-cloud-services/linkis-service-gateway/linkis-gateway-core/src/main/scala/org/apache/linkis/gateway/config/GatewayConfiguration.scala
@@ -28,7 +28,7 @@ object GatewayConfiguration {
   val TOKEN_KEY = "Token-Code"
   val TOKEN_USER_KEY = "Token-User"
   val ENABLE_TOKEN_AUTHENTICATION = CommonVars("wds.linkis.gateway.conf.enable.token.auth", false)
-  val TOKEN_AUTHENTICATION_CONFIG = CommonVars("wds.linkis.gateway.conf.token.auth.config", "token.properties")
+
   val TOKEN_AUTHENTICATION_SCAN_INTERVAL = CommonVars("wds.linkis.gateway.conf.token.auth.scan.interval", 1000 * 60 * 10)
 
   val PASS_AUTH_REQUEST_URI = CommonVars("wds.linkis.gateway.conf.url.pass.auth", "/dws/").getValue.split(",")
diff --git a/linkis-spring-cloud-services/linkis-service-gateway/linkis-gateway-core/src/main/scala/org/apache/linkis/gateway/security/token/TokenAuthentication.scala b/linkis-spring-cloud-services/linkis-service-gateway/linkis-gateway-core/src/main/scala/org/apache/linkis/gateway/security/token/TokenAuthentication.scala
index 224955e33..dc985510d 100644
--- a/linkis-spring-cloud-services/linkis-service-gateway/linkis-gateway-core/src/main/scala/org/apache/linkis/gateway/security/token/TokenAuthentication.scala
+++ b/linkis-spring-cloud-services/linkis-service-gateway/linkis-gateway-core/src/main/scala/org/apache/linkis/gateway/security/token/TokenAuthentication.scala
@@ -35,37 +35,6 @@ object TokenAuthentication extends Logging {
     this.tokenService = tokenService
   }
 
-  //  private val (props, file) = if(ENABLE_TOKEN_AUTHENTICATION.getValue)
-  //    (new Properties, new File(this.getClass.getClassLoader.getResource(TOKEN_AUTHENTICATION_CONFIG.getValue).toURI.getPath))
-  //  else (null, null)
-  //  private var lastModified = 0l
-  //
-  //  def init(): Unit = {
-  //    if(ENABLE_TOKEN_AUTHENTICATION.getValue) {
-  //      Utils.defaultScheduler.scheduleAtFixedRate(new Runnable {
-  //        override def run(): Unit = Utils.tryAndError(tokenService.init())
-  //      }, TOKEN_AUTHENTICATION_SCAN_INTERVAL.getValue, TOKEN_AUTHENTICATION_SCAN_INTERVAL.getValue, TimeUnit.MILLISECONDS)
-  //      //    init()
-  //      tokenService.init()
-  //    }
-  //  }
-
-  //
-  //  private def init(): Unit = if(file.lastModified() > lastModified) {
-  //    lastModified = file.lastModified()
-  //    info(s"loading token authentication file $file.")
-  //    val newProps = new Properties
-  //    val input = FileUtils.openInputStream(file)
-  //    Utils.tryFinally(newProps.load(input))(IOUtils.closeQuietly(input))
-  //    props.putAll(newProps)
-  //  }
-  //
-  //  private def validateTokenUser(token: String, tokenUser: String): Boolean = {
-  //    val tokenUsers = props.getProperty(token)
-  //    if(tokenUsers == "*" || (StringUtils.isNotBlank(tokenUsers) && tokenUsers.contains(tokenUser))) true
-  //    else false
-  //  }
-
   def isTokenRequest(gatewayContext: GatewayContext) : Boolean = {
     (gatewayContext.getRequest.getHeaders.containsKey(TOKEN_KEY) &&
       gatewayContext.getRequest.getHeaders.containsKey(TOKEN_USER_KEY)) || (


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@linkis.apache.org
For additional commands, e-mail: commits-help@linkis.apache.org