Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Organize articles from 'Discussions' into the blog column #765

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions blog/2022-09-13-develop-linkis-code.md
Original file line number Diff line number Diff line change
@@ -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 [email protected]: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
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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 [email protected]: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

Loading