wu-sheng commented on a change in pull request #4514: Add selector property in 
application.yml
URL: https://github.com/apache/skywalking/pull/4514#discussion_r392643649
 
 

 ##########
 File path: docker/oap-es7/docker-entrypoint.sh
 ##########
 @@ -294,202 +33,51 @@ validateVariables() {
     fi
 }
 
-generateApplicationYaml() {
-    # validate
-    [[ -z "$SW_CLUSTER" ]] && [[ -z "$SW_STORAGE" ]] && [[ -z 
"$SW_CONFIGURATION" ]] \
-        && [[ -z "$SW_TELEMETRY" ]] \
-        && { echo "Error: please specify \"SW_CLUSTER\" \"SW_STORAGE\" 
\"SW_CONFIGURATION\" \"SW_TELEMETRY\""; exit 1; }
-
-    validateVariables "SW_CLUSTER" "$SW_CLUSTER" "standalone zookeeper 
kubernetes consul etcd nacos"
-
-    validateVariables "SW_STORAGE" "$SW_STORAGE" "elasticsearch h2 mysql 
influxdb"
-
-    validateVariables "SW_CONFIGURATION" "$SW_CONFIGURATION" "none apollo 
nacos zookeeper"
-
-    validateVariables "SW_TELEMETRY" "$SW_TELEMETRY" "none prometheus so11y"
+echo "[Entrypoint] Apache SkyWalking Docker Image"
 
-    echo "# Generated by 'docker-entrypoint.sh'" > ${var_application_file}
-    #generate cluster
-    case ${SW_CLUSTER} in
-    standalone) generateClusterStandalone;;
-    zookeeper) generateClusterZookeeper;;
-    kubernetes) generateClusterK8s;;
-    consul) generateClusterConsul;;
-    etcd) generateClusterEtcd;;
-    nacos) generateClusterNacos;;
-    esac
+# validate
+[[ -z "$SW_CLUSTER" ]] || [[ -z "$SW_STORAGE" ]] || [[ -z "$SW_CONFIGURATION" 
]] \
+    || [[ -z "$SW_TELEMETRY" ]] \
+    && { echo "Error: please specify \"SW_CLUSTER\" \"SW_STORAGE\" 
\"SW_CONFIGURATION\" \"SW_TELEMETRY\""; exit 1; }
 
-    #generate core
-    cat <<EOT >> ${var_application_file}
-core:
-  default:
-    # Mixed: Receive agent data, Level 1 aggregate, Level 2 aggregate
-    # Receiver: Receive agent data, Level 1 aggregate
-    # Aggregator: Level 2 aggregate
-    role: \${SW_CORE_ROLE:Mixed} # Mixed/Receiver/Aggregator
-    restHost: \${SW_CORE_REST_HOST:0.0.0.0}
-    restPort: \${SW_CORE_REST_PORT:12800}
-    restContextPath: \${SW_CORE_REST_CONTEXT_PATH:/}
-    gRPCHost: \${SW_CORE_GRPC_HOST:0.0.0.0}
-    gRPCPort: \${SW_CORE_GRPC_PORT:11800}
-    gRPCSslEnabled: \${SW_CORE_GRPC_SSL_ENABLED:false}
-    gRPCSslKeyPath: \${SW_CORE_GRPC_SSL_KEY_PATH:""}
-    gRPCSslCertChainPath: \${SW_CORE_GRPC_SSL_CERT_CHAIN_PATH:""}
-    gRPCSslTrustedCAPath: \${SW_CORE_GRPC_SSL_TRUSTED_CA_PATH:""}
-    downsampling:
-    - Hour
-    - Day
-    - Month
-    # Set a timeout on metrics data. After the timeout has expired, the 
metrics data will automatically be deleted.
-    enableDataKeeperExecutor: \${SW_CORE_ENABLE_DATA_KEEPER_EXECUTOR:true} # 
Turn it off then automatically metrics data delete will be close.
-    dataKeeperExecutePeriod: \${SW_CORE_DATA_KEEPER_EXECUTE_PERIOD:5} # How 
often the data keeper executor runs periodically, unit is minute
-    recordDataTTL: \${SW_CORE_RECORD_DATA_TTL:90} # Unit is minute
-    minuteMetricsDataTTL: \${SW_CORE_MINUTE_METRIC_DATA_TTL:90} # Unit is 
minute
-    hourMetricsDataTTL: \${SW_CORE_HOUR_METRIC_DATA_TTL:36} # Unit is hour
-    dayMetricsDataTTL: \${SW_CORE_DAY_METRIC_DATA_TTL:45} # Unit is day
-    monthMetricsDataTTL: \${SW_CORE_MONTH_METRIC_DATA_TTL:18} # Unit is month
-    # Cache metric data for 1 minute to reduce database queries, and if the 
OAP cluster changes within that minute,
-    # the metrics may not be accurate within that minute.
-    enableDatabaseSession: \${SW_CORE_ENABLE_DATABASE_SESSION:true}
-    topNReportPeriod: \${SW_CORE_TOPN_REPORT_PERIOD:10}
-EOT
+validateVariables "SW_CLUSTER" "$SW_CLUSTER" "standalone zookeeper kubernetes 
consul etcd nacos"
 
-    # generate storage
-    case ${SW_STORAGE} in
-    elasticsearch) generateStorageElastisearch;;
-    h2) generateStorageH2;;
-    mysql) generateStorageMySQL;;
-    influxdb) generateStorageInfluxDB;;
-    esac
+validateVariables "SW_STORAGE" "$SW_STORAGE" "elasticsearch h2 mysql influxdb"
 
-    cat <<EOT >> ${var_application_file}
-receiver-sharing-server:
-  default:
-   restHost: \${SW_RECEIVER_SHARING_REST_HOST:0.0.0.0}
-   restPort: \${SW_RECEIVER_SHARING_REST_PORT:0}
-   restContextPath: \${SW_RECEIVER_SHARING_REST_CONTEXT_PATH:/}
-   gRPCHost: \${SW_RECEIVER_SHARING_GRPC_HOST:0.0.0.0}
-   gRPCPort: \${SW_RECEIVER_SHARING_GRPC_PORT:0}
-   maxConcurrentCallsPerConnection: 
\${SW_RECEIVER_SHARING_MAX_CONCURRENT_CALL:0}
-   maxMessageSize: \${SW_RECEIVER_SHARING_MAX_MESSAGE_SIZE:0}
-   gRPCThreadPoolSize: \${SW_RECEIVER_SHARING_GRPC_THREAD_POOL_SIZE:0}
-   gRPCThreadPoolQueueSize: 
\${SW_RECEIVER_SHARING_GRPC_THREAD_POOL_QUEUE_SIZE:0}
-   authentication: \${SW_AUTHENTICATION:""}
-   gRPCSslEnabled: \${SW_RECEIVER_SHARING_GRPC_SSL_ENABLED:false}
-   gRPCSslKeyPath: \${SW_RECEIVER_SHARING_GRPC_SSL_KEY_PATH:""}
-   gRPCSslCertChainPath: \${SW_RECEIVER_SHARING_GRPC_SSL_CERT_CHAIN_PATH:""}
-receiver-register:
-  default:
-receiver-trace:
-  default:
-    bufferPath: \${SW_RECEIVER_BUFFER_PATH:../trace-buffer/}  # Path to trace 
buffer files, suggest to use absolute path
-    bufferOffsetMaxFileSize: \${SW_RECEIVER_BUFFER_OFFSET_MAX_FILE_SIZE:100} # 
Unit is MB
-    bufferDataMaxFileSize: \${SW_RECEIVER_BUFFER_DATA_MAX_FILE_SIZE:500} # 
Unit is MB
-    bufferFileCleanWhenRestart: 
\${SW_RECEIVER_BUFFER_FILE_CLEAN_WHEN_RESTART:false}
-    sampleRate: \${SW_TRACE_SAMPLE_RATE:10000} # The sample rate precision is 
1/10000. 10000 means 100% sample in default.
-    slowDBAccessThreshold: \${SW_SLOW_DB_THRESHOLD:default:200,mongodb:100} # 
The slow database access thresholds. Unit ms.
-receiver-jvm:
-  default:
-receiver-clr:
-  default:
-service-mesh:
-  default:
-    bufferPath: \${SW_SERVICE_MESH_BUFFER_PATH:../mesh-buffer/}  # Path to 
trace buffer files, suggest to use absolute path
-    bufferOffsetMaxFileSize: \${SW_SERVICE_MESH_OFFSET_MAX_FILE_SIZE:100} # 
Unit is MB
-    bufferDataMaxFileSize: \${SW_SERVICE_MESH_BUFFER_DATA_MAX_FILE_SIZE:500} # 
Unit is MB
-    bufferFileCleanWhenRestart: 
\${SW_SERVICE_MESH_BUFFER_FILE_CLEAN_WHEN_RESTART:false}
-istio-telemetry:
-  default:
-query:
-  graphql:
-    path: \${SW_QUERY_GRAPHQL_PATH:/graphql}
-alarm:
-  default:
-EOT
-    # generate telemetry
-    case ${SW_TELEMETRY} in
-    none) generateTelemetryNone;;
-    prometheus) generateTelemetryPrometheus;;
-    so11y) generateTelemetrySo11y;;
-    esac
+validateVariables "SW_CONFIGURATION" "$SW_CONFIGURATION" "none apollo nacos 
zookeeper"
 
-    # generate configuration
-    case ${SW_CONFIGURATION} in
-    none) generateConfigurationNone;;
-    apollo) generateConfigurationApollo;;
-    nacos) generateConfigurationNacos;;
-    zookeeper) generateConfigurationZookeeper;;
-    consul) generateConfigurationConsul;;
-    grpc) generateConfigurationGRPC;;
-    esac
+validateVariables "SW_TELEMETRY" "$SW_TELEMETRY" "none prometheus so11y"
 
-    cat <<EOT >> ${var_application_file}
-envoy-metric:
-  default:
-EOT
-    if [[ "$SW_ENVOY_ALS_ENABLED" = "true" ]]; then
-        cat <<EOT >> ${var_application_file}
-    alsHTTPAnalysis: \${SW_ENVOY_METRIC_ALS_HTTP_ANALYSIS:k8s-mesh}
-EOT
-    fi
-
-    if [[ "$SW_RECEIVER_ZIPKIN_ENABLED" = "true" ]]; then
-        cat <<EOT >> ${var_application_file}
-receiver_zipkin:
-  default:
-    host: \${SW_RECEIVER_ZIPKIN_HOST:0.0.0.0}
-    port: \${SW_RECEIVER_ZIPKIN_PORT:9411}
-    contextPath: \${SW_RECEIVER_ZIPKIN_CONTEXT_PATH:/}
-EOT
-    fi
+if [[ "$SW_ENVOY_ALS_ENABLED" = "true" ]]; then
+    export SW_ENVOY_METRIC_ALS_HTTP_ANALYSIS=k8s-mesh
+    echo "Set SW_ENVOY_METRIC_ALS_HTTP_ANALYSIS to 
${SW_ENVOY_METRIC_ALS_HTTP_ANALYSIS}"
+fi
 
-    if [[ "$SW_RECEIVER_JAEGER_ENABLED" = "true" ]]; then
-        cat <<EOT >> ${var_application_file}
-receiver_jaeger:
-  default:
-    gRPCHost: \${SW_RECEIVER_JAEGER_HOST:0.0.0.0}
-    gRPCPort: \${SW_RECEIVER_JAEGER_PORT:14250}
-EOT
-    fi
+if [[ "$SW_RECEIVER_ZIPKIN_ENABLED" = "true" ]]; then
+    export SW_RECEIVER_ZIPKIN=default
+    echo "Set SW_RECEIVER_ZIPKIN to ${SW_RECEIVER_ZIPKIN}"
+fi
 
-    if [[ "$SW_TELEMETRY" = "so11y" ]]; then
-        cat <<EOT >> ${var_application_file}
-receiver-so11y:
-  default:
-EOT
-    fi
+if [[ "$SW_RECEIVER_JAEGER_ENABLED" = "true" ]]; then
+    export SW_RECEIVER_JAEGER=default
+    echo "Set SW_RECEIVER_JAEGER to ${SW_RECEIVER_JAEGER}"
+fi
 
 Review comment:
   Receiver enable seems a little different, @hanahmily. They are separated new 
module, not provider. We may need another feature to resolve this for docker.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to