From 1c1078c09700e9e7a7b30dcfe2c9f59de864beaa Mon Sep 17 00:00:00 2001 From: lsy <1945708180@qq.com> Date: Sun, 29 Oct 2023 21:27:30 +0800 Subject: [PATCH 1/2] =?UTF-8?q?'=E6=95=B4=E7=90=86=E6=96=87=E6=A1=A3?= =?UTF-8?q?=E2=80=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- blog/2022-09-13-develop-linkis-code.md | 41 +++++++++++++++++++ .../2022-09-13-develop-linkis-code.md | 41 +++++++++++++++++++ 2 files changed, 82 insertions(+) create mode 100644 blog/2022-09-13-develop-linkis-code.md create mode 100644 i18n/zh-CN/docusaurus-plugin-content-blog/2022-09-13-develop-linkis-code.md diff --git a/blog/2022-09-13-develop-linkis-code.md b/blog/2022-09-13-develop-linkis-code.md new file mode 100644 index 00000000000..9feb60578f8 --- /dev/null +++ b/blog/2022-09-13-develop-linkis-code.md @@ -0,0 +1,41 @@ +--- +title: Develop and debug the source code of Linkis locally +authors: [Jie Longping] +tags: [blog,guide] +--- +> This article records in detail how to configure and start various microservices of Linkis in IDEA, and implement the submission and execution of scripts such as JDBC, Python, and Shell. +###1 Code debugging environment +- Mac OS m1 chip, linkis-cg-engineplugin and linkis-cg-engineconnmanager services do not support debugging on Windows for the time being, you can refer to the development documents on the official website for remote debugging. +- Zulu openjdk 1.8 +- maven3.6.3 +- Linkis 1.2.0 (under development), this article can theoretically support local development and debugging of Linkis 1.0.3 and later versions +###2 Prepare the code and compile it + +```shell script +git clone git@github.com:apache/incubator-linkis.git + +cd incubator-linkis + +git checkout dev-1.2.0 +``` +Clone the source code of Linkis to the local computer, and open it with IDEA, the first time you open the project, you will download the dependency jar package required for the compilation of the Linkis project from the maven repository. When the dependent jar package is loaded, run the following compilation and packaging commands: +```shell script +mvn -N install +mvn clean Install +``` +After the compilation command is successfully run, the compiled installation package can be found in the directory incubator-linkis/linkis-dist/target/: apache-linkis-version-incubating-bin.tar.gz +###3 Configure and start the service +####3.1 add mysql-connector-java to classpath +If you encounter the situation that the mysql driver class cannot be found during the service startup process, you can add mysql-connector-java-version number .jar to the classpath of the corresponding service module, please refer to section 3.5 for detailed operations. + +Currently, the following services rely on MySQL: + +- linkis-mg-gateway + +- linkis-ps-publicservice + +- linkis-cg-linkismanage +####3.2Adjust the log4j2 .xml configuration +Under the Linkis source code folder, in the subdirectory linkis-dist/package/conf, are some default configuration files of Linkis, first edit the log4j2 .xml file, and add the configuration of log output to the console. + +For more information, please visit https://mp.weixin.qq.com/s?__biz=MzI4MDkxNzUxMg==&mid=2247489146&idx=1&sn=b455fbda66d6714693681eb53182caee&chksm=ebb0751ddcc7fc0b6cc43226a34fb4e72724b4fb4a359171d686f294025a814dfc416e3eef1d&token=173691862&lang=zh_CN#rd diff --git a/i18n/zh-CN/docusaurus-plugin-content-blog/2022-09-13-develop-linkis-code.md b/i18n/zh-CN/docusaurus-plugin-content-blog/2022-09-13-develop-linkis-code.md new file mode 100644 index 00000000000..8c63453554a --- /dev/null +++ b/i18n/zh-CN/docusaurus-plugin-content-blog/2022-09-13-develop-linkis-code.md @@ -0,0 +1,41 @@ +--- +title: 在本地开发调试Linkis的源码 +authors: [介龙平] +tags: [blog,guide] +--- +> 本文详细记录了如何在 IDEA 中配置和启动 Linkis 的各个微服务,并实现 JDBC、Python、Shell 等脚本的提交和执行。 +###1 代码调试环境 +- Mac OS m1 芯片,Linkis 的linkis-cg-engineplugin和linkis-cg-engineconnmanager两个服务暂不支持在 Windows 上进行调试,可参考官网的开发文档进行远程调试。 +- Zulu openjdk 1.8 +- maven3.6.3 +- Linkis 1.2.0(开发中) ,本篇文章理论上可支持对 Linkis1.0.3 和以上版本的本地开发调试 +###2 准备代码并编译 + +```shell script +git clone git@github.com:apache/incubator-linkis.git + +cd incubator-linkis + +git checkout dev-1.2.0 +``` +克隆 Linkis 的源码到本地,并用 IDEA 打开,首次打开项目会从 maven 仓库中下载 Linkis 项目编译所需的依赖 jar 包。当依赖 jar 包加载完毕之后,运行如下编译打包命令。 +```shell script +mvn -N install +mvn clean Install +``` +编译命令运行成功之后,在目录 incubator-linkis/linkis-dist/target/下可找到编译好的安装包:apache-linkis-版本号-incubating-bin.tar.gz +###3 配置并启动服务 +####3.1 add mysql-connector-java 到 classpath 中 +服务启动过程中如果遇到 mysql 驱动类找不到的情况,可以把 mysql-connector-java-版本号.jar 添加到对应服务模块的 classpath 下,详细操作请参考 3.5 小节。 + +目前依赖 mysql 的服务有: +- linkis-mg-gateway + +- linkis-ps-publicservice + +- linkis-cg-linkismanage +####3.2调整 log4j2.xml 配置 +在 Linkis 源码文件夹下,子目录 linkis-dist/package/conf 中,是 Linkis 的一些默认配置文件,首先对 log4j2.xml 文件进行编辑,在其中增加日志输出到控制台的配置。 + +更多内容请访问 https://mp.weixin.qq.com/s?__biz=MzI4MDkxNzUxMg==&mid=2247489146&idx=1&sn=b455fbda66d6714693681eb53182caee&chksm=ebb0751ddcc7fc0b6cc43226a34fb4e72724b4fb4a359171d686f294025a814dfc416e3eef1d&token=173691862&lang=zh_CN#rd + From e5658a720f2f4b8e84a3957623687a17ab037923 Mon Sep 17 00:00:00 2001 From: lsy <1945708180@qq.com> Date: Sun, 29 Oct 2023 21:29:07 +0800 Subject: [PATCH 2/2] =?UTF-8?q?'=E6=95=B4=E7=90=86=E6=96=87=E6=A1=A32.0?= =?UTF-8?q?=E2=80=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../2022-07-04-how-to-add-auto-bot.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/i18n/zh-CN/docusaurus-plugin-content-blog/2022-07-04-how-to-add-auto-bot.md b/i18n/zh-CN/docusaurus-plugin-content-blog/2022-07-04-how-to-add-auto-bot.md index 2da2916519f..b4cea6f5ddf 100644 --- a/i18n/zh-CN/docusaurus-plugin-content-blog/2022-07-04-how-to-add-auto-bot.md +++ b/i18n/zh-CN/docusaurus-plugin-content-blog/2022-07-04-how-to-add-auto-bot.md @@ -11,7 +11,7 @@ Github为广大开发者提供了一个[github action市场](https://github.com/ ## 2 一些名词术语 #### 2.1 什么是持续集成 -简单说就是自动化程序,举个例子,对于前端程序员每次提交代码到 Github 的仓库后,Github 都会自动创建一个虚拟机(Mac / Windows / Linux 任我们选),来执行一段或多段指令(由我们定),例如: +简单说就是自动化程序,举个例子,对于前端程序员每次提交代码到 Github 的仓库,Github 都会自动创建一个虚拟机(Mac / Windows / Linux 任我们选),来执行一段或多段指令(由我们定),例如: ```bash npm install