You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@linkis.apache.org by GitBox <gi...@apache.org> on 2022/07/09 12:50:34 UTC

[GitHub] [incubator-linkis] AaronLinOops opened a new pull request, #2445: [Feature] Add scripts and documents for helm chart development and testing

AaronLinOops opened a new pull request, #2445:
URL: https://github.com/apache/incubator-linkis/pull/2445

   ### What is the purpose of the change
   Add scripts and documents for helm chart development and testing
   
   ### Brief change log
   - Add a document
   - Add test utils scripts to support create KinD cluster and test charts
   
   ### Verifying this change
   (Please pick either of the following options)  
   tools with no test case
   
   ### Does this pull request potentially affect one of the following parts:
   - Dependencies (does it add or upgrade a dependency): (no)
   - Anything that affects deployment: (no)
   - The MGS(Microservice Governance Services), i.e., Spring Cloud Gateway, OpenFeign, Eureka.: (no)
   
   ### Documentation
   - Does this pull request introduce a new feature? (yes)
   - If yes, how is the feature documented? (docs)


-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@linkis.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


[GitHub] [incubator-linkis] AaronLinOops commented on a diff in pull request #2445: [Feature] Add scripts and documents for helm chart development and testing

Posted by GitBox <gi...@apache.org>.
AaronLinOops commented on code in PR #2445:
URL: https://github.com/apache/incubator-linkis/pull/2445#discussion_r917392327


##########
linkis-dist/helm/README.md:
##########
@@ -0,0 +1,98 @@
+Helm charts for Linkis 
+==========
+
+# Pre-requisites
+* [Kubernetes](https://kubernetes.io/docs/setup/), minimum version v2.21.0+

Review Comment:
   good catch



-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@linkis.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


[GitHub] [incubator-linkis] AaronLinOops commented on a diff in pull request #2445: [Feature] Add scripts and documents for helm chart development and testing

Posted by GitBox <gi...@apache.org>.
AaronLinOops commented on code in PR #2445:
URL: https://github.com/apache/incubator-linkis/pull/2445#discussion_r917392031


##########
linkis-dist/helm/README.md:
##########
@@ -0,0 +1,98 @@
+Helm charts for Linkis 
+==========
+
+# Pre-requisites
+* [Kubernetes](https://kubernetes.io/docs/setup/), minimum version v2.21.0+
+* [Helm](https://helm.sh/docs/intro/install/), minimum version v3.0.0+.
+
+# Installation
+
+```shell
+# Deploy Apache Linkis on kubernetes, kubernetes 
+# namespace is 'linkis', helm release is 'linkis-demo'
+
+# Option 1, use build-in script
+$> ./scripts/install-charts.sh linkis linkis-demo
+
+# Option 2, use `helm` command line
+$> helm install --create-namespace -f ./charts/linkis/values.yaml --namespace linkis linkis-demo ./charts/linkis 
+```
+
+# Uninstallation
+
+```shell
+$> helm delete --namespace linkis linkis-demo 
+```
+
+# For developers
+
+We recommend using [KinD](https://kind.sigs.k8s.io/docs/user/quick-start/) for development and testing. 
+KinD is a tool for running local Kubernetes clusters using Docker container as โ€œKubernetes nodesโ€.
+
+Follow the link below to install the KinD in your development environment.
+
+- [KinD Installation](https://kind.sigs.k8s.io/docs/user/quick-start/#installation)
+
+## Setup a local cluster for test
+Once after you have installed KinD, you can run the following command to setup a local kubernetes cluster and deploy an Apache Linkis cluster on it.
+
+```shell
+# It will deploy a MySQL instance in the KinD cluster,
+# then deploy an Apache Linkis cluster, which will use 
+# the MySQL instances above 
+$> sh ./scripts/create-test-kind.sh \
+   && sh ./scripts/install-charts.sh
+   
+Creating cluster "test-helm" ...
+ โœ“ Ensuring node image (kindest/node:v1.21.1) ๐Ÿ–ผ 
+ โœ“ Preparing nodes ๐Ÿ“ฆ  
+ โœ“ Writing configuration ๐Ÿ“œ 
+ โœ“ Starting control-plane ๐Ÿ•น๏ธ 
+ โœ“ Installing CNI ๐Ÿ”Œ 
+ โœ“ Installing StorageClass ๐Ÿ’พ 
+Set kubectl context to "kind-test-helm"
+You can now use your cluster with:
+
+kubectl cluster-info --context kind-test-helm
+
+Have a nice day! ๐Ÿ‘‹
+Image: "linkis:1.3.0" with ID "sha256:917138e97807c3a2d7d7fe4607c1196e7c00406bb3b8f81a3b64e54a4d8fe074" not yet present on node "test-helm-control-plane", loading...
+Image: "mysql:5.7" with ID "sha256:efa50097efbdef5884e5ebaba4da5899e79609b78cd4fe91b365d5d9d3205188" not yet present on node "test-helm-control-plane", loading...
+namespace/mysql created
+service/mysql created
+deployment.apps/mysql created
+
+NAME: linkis-demo
+LAST DEPLOYED: Wed Jul  6 23:46:30 2022
+NAMESPACE: linkis
+STATUS: deployed
+REVISION: 1
+TEST SUITE: None
+NOTES:
+---
+Welcome to Apache Linkis (v1.3.0)!
+
+.___    .___ .______  .____/\ .___ .________
+|   |   : __|:      \ :   /  \: __||    ___/
+|   |   | : ||       ||.  ___/| : ||___    \
+|   |/\ |   ||   |   ||     \ |   ||       /
+|   /  \|   ||___|   ||      \|   ||__:___/
+|______/|___|    |___||___\  /|___|   : v1.3.0
+                           \/
+
+Linkis builds a layer of computation middleware between upper applications and underlying engines.
+Please visit https://linkis.apache.org/ for details.
+
+Enjoy!
+
+```
+
+## Destroy the local cluster
+```shell
+# Option 1: delete the helm release only
+$> helm delete --namespace linkis linkis-demo 
+
+# Option 2: destroy the KinD cluster, no need to delete
+# the helm release first
+$> kind delete cluster --name test-helm
+```

Review Comment:
   good catch



-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@linkis.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


[GitHub] [incubator-linkis] AaronLinOops commented on a diff in pull request #2445: [Feature] Add scripts and documents for helm chart development and testing

Posted by GitBox <gi...@apache.org>.
AaronLinOops commented on code in PR #2445:
URL: https://github.com/apache/incubator-linkis/pull/2445#discussion_r917391856


##########
linkis-dist/helm/README.md:
##########
@@ -0,0 +1,98 @@
+Helm charts for Linkis 

Review Comment:
   add [![License](https://img.shields.io/badge/license-Apache%202-4EB1BA.svg)](https://www.apache.org/licenses/LICENSE-2.0.html) as this is a markdown doc



-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@linkis.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


[GitHub] [incubator-linkis] codecov[bot] commented on pull request #2445: [Feature] Add scripts and documents for helm chart development and testing

Posted by GitBox <gi...@apache.org>.
codecov[bot] commented on PR #2445:
URL: https://github.com/apache/incubator-linkis/pull/2445#issuecomment-1179726020

   # [Codecov](https://codecov.io/gh/apache/incubator-linkis/pull/2445?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#2445](https://codecov.io/gh/apache/incubator-linkis/pull/2445?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (e4e03e0) into [dev-1.3.0](https://codecov.io/gh/apache/incubator-linkis/commit/449478a2a0b8fe5656411458e13d1a5b635f65fd?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (449478a) will **increase** coverage by `0.01%`.
   > The diff coverage is `n/a`.
   
   > :exclamation: Current head e4e03e0 differs from pull request most recent head a109b2c. Consider uploading reports for the commit a109b2c to get more accurate results
   
   ```diff
   @@               Coverage Diff               @@
   ##             dev-1.3.0    #2445      +/-   ##
   ===============================================
   + Coverage        17.82%   17.84%   +0.01%     
   - Complexity        1076     1077       +1     
   ===============================================
     Files              595      595              
     Lines            17668    17668              
     Branches          2635     2635              
   ===============================================
   + Hits              3150     3152       +2     
   + Misses           14093    14092       -1     
   + Partials           425      424       -1     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/incubator-linkis/pull/2445?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage ฮ” | |
   |---|---|---|
   | [...s/scheduler/queue/fifoqueue/FIFOUserConsumer.scala](https://codecov.io/gh/apache/incubator-linkis/pull/2445/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-bGlua2lzLWNvbW1vbnMvbGlua2lzLXNjaGVkdWxlci9zcmMvbWFpbi9zY2FsYS9vcmcvYXBhY2hlL2xpbmtpcy9zY2hlZHVsZXIvcXVldWUvZmlmb3F1ZXVlL0ZJRk9Vc2VyQ29uc3VtZXIuc2NhbGE=) | `37.77% <0.00%> (+2.22%)` | :arrow_up: |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/incubator-linkis/pull/2445?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   > `ฮ” = absolute <relative> (impact)`, `รธ = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/incubator-linkis/pull/2445?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [449478a...a109b2c](https://codecov.io/gh/apache/incubator-linkis/pull/2445?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   


-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@linkis.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


[GitHub] [incubator-linkis] legendtkl merged pull request #2445: [Feature] Add scripts and documents for helm chart development and testing

Posted by GitBox <gi...@apache.org>.
legendtkl merged PR #2445:
URL: https://github.com/apache/incubator-linkis/pull/2445


-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@linkis.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


[GitHub] [incubator-linkis] legendtkl commented on a diff in pull request #2445: [Feature] Add scripts and documents for helm chart development and testing

Posted by GitBox <gi...@apache.org>.
legendtkl commented on code in PR #2445:
URL: https://github.com/apache/incubator-linkis/pull/2445#discussion_r917378131


##########
linkis-dist/helm/scripts/resources/mysql.yaml:
##########
@@ -0,0 +1,43 @@
+---

Review Comment:
   ASF header is needed.



##########
linkis-dist/helm/README.md:
##########
@@ -0,0 +1,98 @@
+Helm charts for Linkis 
+==========
+
+# Pre-requisites
+* [Kubernetes](https://kubernetes.io/docs/setup/), minimum version v2.21.0+
+* [Helm](https://helm.sh/docs/intro/install/), minimum version v3.0.0+.
+
+# Installation
+
+```shell
+# Deploy Apache Linkis on kubernetes, kubernetes 
+# namespace is 'linkis', helm release is 'linkis-demo'
+
+# Option 1, use build-in script
+$> ./scripts/install-charts.sh linkis linkis-demo
+
+# Option 2, use `helm` command line
+$> helm install --create-namespace -f ./charts/linkis/values.yaml --namespace linkis linkis-demo ./charts/linkis 
+```
+
+# Uninstallation
+
+```shell
+$> helm delete --namespace linkis linkis-demo 
+```
+
+# For developers
+
+We recommend using [KinD](https://kind.sigs.k8s.io/docs/user/quick-start/) for development and testing. 
+KinD is a tool for running local Kubernetes clusters using Docker container as โ€œKubernetes nodesโ€.
+
+Follow the link below to install the KinD in your development environment.
+
+- [KinD Installation](https://kind.sigs.k8s.io/docs/user/quick-start/#installation)
+
+## Setup a local cluster for test
+Once after you have installed KinD, you can run the following command to setup a local kubernetes cluster and deploy an Apache Linkis cluster on it.
+
+```shell
+# It will deploy a MySQL instance in the KinD cluster,
+# then deploy an Apache Linkis cluster, which will use 
+# the MySQL instances above 
+$> sh ./scripts/create-test-kind.sh \
+   && sh ./scripts/install-charts.sh
+   
+Creating cluster "test-helm" ...
+ โœ“ Ensuring node image (kindest/node:v1.21.1) ๐Ÿ–ผ 
+ โœ“ Preparing nodes ๐Ÿ“ฆ  
+ โœ“ Writing configuration ๐Ÿ“œ 
+ โœ“ Starting control-plane ๐Ÿ•น๏ธ 
+ โœ“ Installing CNI ๐Ÿ”Œ 
+ โœ“ Installing StorageClass ๐Ÿ’พ 
+Set kubectl context to "kind-test-helm"
+You can now use your cluster with:
+
+kubectl cluster-info --context kind-test-helm
+
+Have a nice day! ๐Ÿ‘‹
+Image: "linkis:1.3.0" with ID "sha256:917138e97807c3a2d7d7fe4607c1196e7c00406bb3b8f81a3b64e54a4d8fe074" not yet present on node "test-helm-control-plane", loading...
+Image: "mysql:5.7" with ID "sha256:efa50097efbdef5884e5ebaba4da5899e79609b78cd4fe91b365d5d9d3205188" not yet present on node "test-helm-control-plane", loading...
+namespace/mysql created
+service/mysql created
+deployment.apps/mysql created
+
+NAME: linkis-demo
+LAST DEPLOYED: Wed Jul  6 23:46:30 2022
+NAMESPACE: linkis
+STATUS: deployed
+REVISION: 1
+TEST SUITE: None
+NOTES:
+---
+Welcome to Apache Linkis (v1.3.0)!
+
+.___    .___ .______  .____/\ .___ .________
+|   |   : __|:      \ :   /  \: __||    ___/
+|   |   | : ||       ||.  ___/| : ||___    \
+|   |/\ |   ||   |   ||     \ |   ||       /
+|   /  \|   ||___|   ||      \|   ||__:___/
+|______/|___|    |___||___\  /|___|   : v1.3.0
+                           \/
+
+Linkis builds a layer of computation middleware between upper applications and underlying engines.
+Please visit https://linkis.apache.org/ for details.
+
+Enjoy!
+
+```
+
+## Destroy the local cluster
+```shell
+# Option 1: delete the helm release only
+$> helm delete --namespace linkis linkis-demo 
+
+# Option 2: destroy the KinD cluster, no need to delete
+# the helm release first
+$> kind delete cluster --name test-helm
+```

Review Comment:
   An empty line is needed 



##########
linkis-dist/helm/README.md:
##########
@@ -0,0 +1,98 @@
+Helm charts for Linkis 

Review Comment:
   The ASF Header is needed.



##########
linkis-dist/helm/scripts/resources/kind-cluster.yaml:
##########
@@ -0,0 +1,15 @@
+kind: Cluster

Review Comment:
   ASF header is needed



##########
linkis-dist/helm/README.md:
##########
@@ -0,0 +1,98 @@
+Helm charts for Linkis 
+==========
+
+# Pre-requisites
+* [Kubernetes](https://kubernetes.io/docs/setup/), minimum version v2.21.0+

Review Comment:
   2.21 -> 1.21?



##########
linkis-dist/helm/scripts/create-test-kind.sh:
##########
@@ -0,0 +1,60 @@
+#!/bin/bash
+#
+# 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.
+#
+#
+
+WORK_DIR=`cd $(dirname $0); pwd -P`
+PROJECT_ROOT=${WORK_DIR}/../..
+RESOURCE_DIR=${WORK_DIR}/resources
+TMP_DIR=`mktemp -d -t kind-XXXXX`
+
+set -e
+
+KIND_CLUSTER_NAME=${KIND_CLUSTER_NAME:-test-helm}
+MYSQL_VERSION=${MYSQL_VERSION:-5.7}
+
+# evaluate project version
+PROJECT_VERSION=`cd ${PROJECT_ROOT} \
+   && MAVEN_OPTS="-Dorg.slf4j.simpleLogger.defaultLogLevel=WARN -Dorg.slf4j.simpleLogger.log.org.apache.maven.plugins.help=INFO" \
+   mvn help:evaluate -o -Dexpression=project.version | tail -1`
+echo "# Project version: ${PROJECT_VERSION}"
+
+# create kind cluster
+echo "# Creating KinD cluster ..."
+# create data dir for KinD cluster
+KIND_CLUSTER_HOST_PATH=${TMP_DIR}/data
+mkdir -p ${KIND_CLUSTER_HOST_PATH}
+# create kind cluster conf
+KIND_CLUSTER_CONF_TPL=${RESOURCE_DIR}/kind-cluster.yaml
+KIND_CLUSTER_CONF_FILE=${TMP_DIR}/kind-cluster.yaml
+KIND_CLUSTER_HOST_PATH=${KIND_CLUSTER_HOST_PATH} envsubst < ${KIND_CLUSTER_CONF_TPL} > ${KIND_CLUSTER_CONF_FILE}
+
+echo "- kind cluster config: ${KIND_CLUSTER_CONF_FILE}"
+cat ${KIND_CLUSTER_CONF_FILE}
+kind create cluster --name ${KIND_CLUSTER_NAME} --config ${KIND_CLUSTER_CONF_FILE}
+
+# load images
+echo "# Loading images into KinD cluster ..."
+kind load docker-image linkis:${PROJECT_VERSION} --name ${KIND_CLUSTER_NAME}
+kind load docker-image linkis-web:${PROJECT_VERSION} --name ${KIND_CLUSTER_NAME}
+kind load docker-image mysql:${MYSQL_VERSION} --name ${KIND_CLUSTER_NAME}
+
+# deploy mysql
+echo "# Deploying MySQL ..."
+kubectl create ns mysql
+kubectl apply -n mysql -f ${RESOURCE_DIR}/mysql.yaml
+
+

Review Comment:
   remove the extra two empty lines (one is enough)



-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@linkis.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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