You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kylin.apache.org by xx...@apache.org on 2022/09/20 10:20:22 UTC

[kylin] branch doc5.0 updated: KYLIN-5269 add local debug mode for kylin5

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

xxyu pushed a commit to branch doc5.0
in repository https://gitbox.apache.org/repos/asf/kylin.git


The following commit(s) were added to refs/heads/doc5.0 by this push:
     new ed161988e6 KYLIN-5269 add local debug mode for kylin5
ed161988e6 is described below

commit ed161988e61ea7a18ec2b3dba76f50114cb1f64c
Author: Mukvin <bo...@163.com>
AuthorDate: Tue Sep 20 17:32:57 2022 +0800

    KYLIN-5269 add local debug mode for kylin5
---
 .../docs/development/how_to_debug_kylin_in_ide.md  |  10 +-
 .../development/how_to_debug_kylin_in_local.md     | 158 +++++++++++++++++++++
 .../IDEA_Install_Scala_plugin.png                  | Bin 0 -> 333636 bytes
 .../IDEA_LOCAL_INIT.png                            | Bin 0 -> 32610 bytes
 .../IDEA_Notify_Install_SDK.png                    | Bin 0 -> 406049 bytes
 .../IDEA_RELOAD_ALL_MAVEN_PROJECT.png              | Bin 0 -> 474625 bytes
 .../OPEN_KYLIN_PROJECT.png                         | Bin 0 -> 187986 bytes
 .../PROJECT_BUILD_SUCCEED.png                      | Bin 0 -> 1005844 bytes
 .../RUN_KYLIN_IN_IDEA.png                          | Bin 0 -> 25198 bytes
 .../docker-engine-resource.png                     | Bin 0 -> 46338 bytes
 .../how_to_debug_kylin_in_local/docker_ps.png      | Bin 0 -> 28567 bytes
 .../how_to_debug_kylin_in_local/docker_up.png      | Bin 0 -> 73091 bytes
 .../how_to_debug_kylin_in_local/kylin_ui.png       | Bin 0 -> 55860 bytes
 .../images/how_to_debug_kylin_in_local/laptop.png  | Bin 0 -> 192867 bytes
 .../local-build-succeed.png                        | Bin 0 -> 58856 bytes
 .../local-query-succeed.png                        | Bin 0 -> 82152 bytes
 .../how_to_debug_kylin_in_local/spark_ui.png       | Bin 0 -> 97012 bytes
 .../start_front_end.png                            | Bin 0 -> 111330 bytes
 website/docusaurus.config.js                       |   1 -
 website/sidebars.js                                |   4 +
 20 files changed, 166 insertions(+), 7 deletions(-)

diff --git a/website/docs/development/how_to_debug_kylin_in_ide.md b/website/docs/development/how_to_debug_kylin_in_ide.md
index 92199b8478..74944ac7eb 100644
--- a/website/docs/development/how_to_debug_kylin_in_ide.md
+++ b/website/docs/development/how_to_debug_kylin_in_ide.md
@@ -1,11 +1,11 @@
 ---
-title: How to debug Kylin in IDEA
+title: How to debug Kylin in IDEA with Hadoop
 language: en
-sidebar_label: How to debug in IDEA
-pagination_label: How to debug in IDEA
+sidebar_label: How to debug in IDEA with Hadoop
+pagination_label: How to debug in IDEA with Hadoop
 toc_min_heading_level: 2
 toc_max_heading_level: 6
-pagination_prev: development/how_to_write_doc
+pagination_prev: development/how_to_debug_kylin_in_local
 pagination_next: development/how_to_test
 keywords:
     - developer
@@ -16,8 +16,6 @@ last_update:
     author: Xiaoxiang Yu
 ---
 
-## Debug Kylin in IDE with Hadoop
-
 ### Background
 #### Why debug Kylin in IDEA using docker
 This article aims to introduce a simple and useful way to develop and debug Kylin for developer, and provided similar deployment to user's real scenario.
diff --git a/website/docs/development/how_to_debug_kylin_in_local.md b/website/docs/development/how_to_debug_kylin_in_local.md
new file mode 100644
index 0000000000..2ce2595310
--- /dev/null
+++ b/website/docs/development/how_to_debug_kylin_in_local.md
@@ -0,0 +1,158 @@
+---
+title: How to debug Kylin in IDEA without Hadoop
+language: en
+sidebar_label: How to debug in IDEA without Hadoop
+pagination_label: How to debug in IDEA without Hadoop
+toc_min_heading_level: 2
+toc_max_heading_level: 6
+pagination_prev: development/how_to_write_doc
+pagination_next: development/how_to_debug_kylin_in_ide
+keywords:
+    - developer
+    - debug
+draft: false
+last_update:
+    date: 09/19/2022
+    author: Tengting Xu
+---
+
+### Background
+
+#### Why debug Kylin in IDEA without Hadoop
+This article aims to introduce a simple and useful way to develop and debug Kylin for developer.
+
+#### Deployment architecture
+
+Following is architecture of current deployment.
+
+![debug_in_laptop](./images/how_to_debug_kylin_in_local/laptop.png)
+
+This guide **assumes** you have prepared the following things:
+
+- [X] A **laptop** with MacOS installed to do development work (Windows is not verified at the moment)
+- [X] kylin's source code is cloned into some directory in your laptop
+
+### Prepare IDEA and build source code
+
+#### Step 1: Check Software Requirement
+
+Please visit [Software Requirement](how_to_package#software_reqiurement), make sure your laptop has meet the requirement.
+
+#### Step 2: Build source code
+
+- Build back-end source code before your start debug.
+  
+    ```shell
+    cd <path-to-kylin-source>
+    mvn clean install -DskipTests
+    ```
+
+- Build front-end source code.
+  
+    (Please use node.js **v12.14.0**, for how to use specific version of node.js, please check [how to switch to specific node js](how_to_package#install_older_node) )
+    
+    ```shell
+    cd kystudio
+    npm install
+    ```
+#### Step 3: Install IntelliJ IDEA and build the source
+
+1. Install IDEA Community edition (Ultimate edition is ok too).
+
+2. Import the source code into IDEA. Click the **Open**, and choose the directory of **kylin source code**.
+   ![](images/how_to_debug_kylin_in_local/OPEN_KYLIN_PROJECT.png)
+
+3. Install scala plugin and restart
+   ![](images/how_to_debug_kylin_in_local/IDEA_Install_Scala_plugin.png)
+
+4. Configure SDK(JDK and Scala), make sure you use **JDK 1.8.X** and **Scala 2.12.X**.
+   ![](images/how_to_debug_kylin_in_local/IDEA_Notify_Install_SDK.png)
+
+5. Reload maven projects, and directory `scala` will be marked as source root(in blue color).
+   ![](images/how_to_debug_kylin_in_local/IDEA_RELOAD_ALL_MAVEN_PROJECT.png)
+
+6. Build the projects.(make sure you have executed `mvn clean package -DskipTests`, otherwise some source code is not generated by maven javacc plugin)
+   ![](images/how_to_debug_kylin_in_local/PROJECT_BUILD_SUCCEED.png)
+
+#### Step 4: Prepare IDEA configuration
+
+1. Download spark and create running IDEA configuration for debug purpose and initialize the frontend env.
+  ```shell
+  ./dev-support/local/local.sh init
+  ```
+
+Following is the shell output.
+![local.sh init](images/how_to_debug_kylin_in_local/IDEA_LOCAL_INIT.png)
+
+### Prepare the Requirements
+
+#### Deploy Zookeeper(Current only need Zookeeper)
+
+1. Install latest docker desktop in your laptop
+
+2. Check available resource of your docker desktop in laptop, make sure you leave 1 CPUs and 1 GB memory at least .
+
+Following is the setting page of Docker Desktop of MacBook.
+
+![resources](images/how_to_debug_kylin_in_local/docker-engine-resource.png)
+
+3. Start Zookeeper service via docker compose on laptop.
+
+  ```shell
+  ./dev-support/local/local.sh up
+  ```
+
+![local.sh up](images/how_to_debug_kylin_in_local/docker_up.png)
+
+#### Check status of Require services
+- Check health of Zookeeper, you can use following command to check status
+
+```shell
+./dev-support/local/local.sh ps
+```
+
+Following output content shows all hadoop component are in health state.
+
+![sandbox.sh ps](images/how_to_debug_kylin_in_local/docker_ps.png)
+
+### Debug Kylin in IDEA
+
+#### Start backend in IDEA
+
+- Select "BootstrapServer[Local]" on top of IDEA and click **Run** .
+
+![click BootstrapServer[local]](images/how_to_debug_kylin_in_local/RUN_KYLIN_IN_IDEA.png)
+
+- Check if SparkUI of Sparder is started.
+
+![Spark UI](images/how_to_debug_kylin_in_local/spark_ui.png)
+
+#### Start frontend in IDEA
+
+- Set up dev proxy
+```shell
+cd kystudio
+npm run devproxy
+```
+
+![setup front end](images/how_to_debug_kylin_in_local/start_front_end.png)
+
+#### Validate Kylin's core functions
+
+- Visit Kylin WEB UI in your laptop
+
+![setup front end](images/how_to_debug_kylin_in_local/kylin_ui.png)
+
+- Create a new project, load table and create model
+
+- Validate Cube Build and Query function
+
+![build job](images/how_to_debug_kylin_in_local/local-build-succeed.png)
+
+![query a agg index](images/how_to_debug_kylin_in_local/local-query-succeed.png)
+
+### Command manual
+1. Use `./dev-support/local/local.sh stop` to stop all containers
+2. Use `./dev-support/local/local.sh start` to start all containers
+3. Use `./dev-support/local/local.sh ps` to check status of all containers
+4. Use `./dev-support/local/local.sh down` to stop all containers and delete them
diff --git a/website/docs/development/images/how_to_debug_kylin_in_local/IDEA_Install_Scala_plugin.png b/website/docs/development/images/how_to_debug_kylin_in_local/IDEA_Install_Scala_plugin.png
new file mode 100644
index 0000000000..4f76d76b48
Binary files /dev/null and b/website/docs/development/images/how_to_debug_kylin_in_local/IDEA_Install_Scala_plugin.png differ
diff --git a/website/docs/development/images/how_to_debug_kylin_in_local/IDEA_LOCAL_INIT.png b/website/docs/development/images/how_to_debug_kylin_in_local/IDEA_LOCAL_INIT.png
new file mode 100644
index 0000000000..ab2562c2ce
Binary files /dev/null and b/website/docs/development/images/how_to_debug_kylin_in_local/IDEA_LOCAL_INIT.png differ
diff --git a/website/docs/development/images/how_to_debug_kylin_in_local/IDEA_Notify_Install_SDK.png b/website/docs/development/images/how_to_debug_kylin_in_local/IDEA_Notify_Install_SDK.png
new file mode 100644
index 0000000000..be07c15fdb
Binary files /dev/null and b/website/docs/development/images/how_to_debug_kylin_in_local/IDEA_Notify_Install_SDK.png differ
diff --git a/website/docs/development/images/how_to_debug_kylin_in_local/IDEA_RELOAD_ALL_MAVEN_PROJECT.png b/website/docs/development/images/how_to_debug_kylin_in_local/IDEA_RELOAD_ALL_MAVEN_PROJECT.png
new file mode 100644
index 0000000000..1ec4a8b0da
Binary files /dev/null and b/website/docs/development/images/how_to_debug_kylin_in_local/IDEA_RELOAD_ALL_MAVEN_PROJECT.png differ
diff --git a/website/docs/development/images/how_to_debug_kylin_in_local/OPEN_KYLIN_PROJECT.png b/website/docs/development/images/how_to_debug_kylin_in_local/OPEN_KYLIN_PROJECT.png
new file mode 100644
index 0000000000..fc77c2df70
Binary files /dev/null and b/website/docs/development/images/how_to_debug_kylin_in_local/OPEN_KYLIN_PROJECT.png differ
diff --git a/website/docs/development/images/how_to_debug_kylin_in_local/PROJECT_BUILD_SUCCEED.png b/website/docs/development/images/how_to_debug_kylin_in_local/PROJECT_BUILD_SUCCEED.png
new file mode 100644
index 0000000000..6959d7f053
Binary files /dev/null and b/website/docs/development/images/how_to_debug_kylin_in_local/PROJECT_BUILD_SUCCEED.png differ
diff --git a/website/docs/development/images/how_to_debug_kylin_in_local/RUN_KYLIN_IN_IDEA.png b/website/docs/development/images/how_to_debug_kylin_in_local/RUN_KYLIN_IN_IDEA.png
new file mode 100644
index 0000000000..9f3cef79f1
Binary files /dev/null and b/website/docs/development/images/how_to_debug_kylin_in_local/RUN_KYLIN_IN_IDEA.png differ
diff --git a/website/docs/development/images/how_to_debug_kylin_in_local/docker-engine-resource.png b/website/docs/development/images/how_to_debug_kylin_in_local/docker-engine-resource.png
new file mode 100644
index 0000000000..7b96301345
Binary files /dev/null and b/website/docs/development/images/how_to_debug_kylin_in_local/docker-engine-resource.png differ
diff --git a/website/docs/development/images/how_to_debug_kylin_in_local/docker_ps.png b/website/docs/development/images/how_to_debug_kylin_in_local/docker_ps.png
new file mode 100644
index 0000000000..85a6c92ea8
Binary files /dev/null and b/website/docs/development/images/how_to_debug_kylin_in_local/docker_ps.png differ
diff --git a/website/docs/development/images/how_to_debug_kylin_in_local/docker_up.png b/website/docs/development/images/how_to_debug_kylin_in_local/docker_up.png
new file mode 100644
index 0000000000..29ba92574a
Binary files /dev/null and b/website/docs/development/images/how_to_debug_kylin_in_local/docker_up.png differ
diff --git a/website/docs/development/images/how_to_debug_kylin_in_local/kylin_ui.png b/website/docs/development/images/how_to_debug_kylin_in_local/kylin_ui.png
new file mode 100644
index 0000000000..7655a85700
Binary files /dev/null and b/website/docs/development/images/how_to_debug_kylin_in_local/kylin_ui.png differ
diff --git a/website/docs/development/images/how_to_debug_kylin_in_local/laptop.png b/website/docs/development/images/how_to_debug_kylin_in_local/laptop.png
new file mode 100644
index 0000000000..4b1d9c88c2
Binary files /dev/null and b/website/docs/development/images/how_to_debug_kylin_in_local/laptop.png differ
diff --git a/website/docs/development/images/how_to_debug_kylin_in_local/local-build-succeed.png b/website/docs/development/images/how_to_debug_kylin_in_local/local-build-succeed.png
new file mode 100644
index 0000000000..23d9a06a89
Binary files /dev/null and b/website/docs/development/images/how_to_debug_kylin_in_local/local-build-succeed.png differ
diff --git a/website/docs/development/images/how_to_debug_kylin_in_local/local-query-succeed.png b/website/docs/development/images/how_to_debug_kylin_in_local/local-query-succeed.png
new file mode 100644
index 0000000000..8dc4f2b3fc
Binary files /dev/null and b/website/docs/development/images/how_to_debug_kylin_in_local/local-query-succeed.png differ
diff --git a/website/docs/development/images/how_to_debug_kylin_in_local/spark_ui.png b/website/docs/development/images/how_to_debug_kylin_in_local/spark_ui.png
new file mode 100644
index 0000000000..0551f88e84
Binary files /dev/null and b/website/docs/development/images/how_to_debug_kylin_in_local/spark_ui.png differ
diff --git a/website/docs/development/images/how_to_debug_kylin_in_local/start_front_end.png b/website/docs/development/images/how_to_debug_kylin_in_local/start_front_end.png
new file mode 100644
index 0000000000..6287160792
Binary files /dev/null and b/website/docs/development/images/how_to_debug_kylin_in_local/start_front_end.png differ
diff --git a/website/docusaurus.config.js b/website/docusaurus.config.js
index 7e640b14f3..9d37dd635d 100644
--- a/website/docusaurus.config.js
+++ b/website/docusaurus.config.js
@@ -21,7 +21,6 @@ const config = {
   deploymentBranch:'kylin5_doc',
 
   // add search plugin
-  plugins: [require.resolve("@cmfcmf/docusaurus-search-local")],
   plugins: [
     [
       require.resolve("@cmfcmf/docusaurus-search-local"),
diff --git a/website/sidebars.js b/website/sidebars.js
index 94cabbf514..a1043e0181 100644
--- a/website/sidebars.js
+++ b/website/sidebars.js
@@ -950,6 +950,10 @@ const sidebars = {
                     type: 'doc',
                     id: 'development/how_to_write_doc'
                 },
+                {
+                    type: 'doc',
+                    id: 'development/how_to_debug_kylin_in_local'
+                },
                 {
                     type: 'doc',
                     id: 'development/how_to_debug_kylin_in_ide'