This is an automated email from the ASF dual-hosted git repository.
peacewong pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/linkis-website.git
The following commit(s) were added to refs/heads/dev by this push:
new b34d0ad08bd Add repl engine docs (#770)
b34d0ad08bd is described below
commit b34d0ad08bdf859068524f23c83e03379a4e64ec
Author: ChengJie1053 <[email protected]>
AuthorDate: Tue Nov 28 16:09:47 2023 +0800
Add repl engine docs (#770)
* Add repl.md
* Add repl.md
---
docs/engine-usage/repl.md | 108 +++++++++++++++++++++
.../current/engine-usage/repl.md | 107 ++++++++++++++++++++
2 files changed, 215 insertions(+)
diff --git a/docs/engine-usage/repl.md b/docs/engine-usage/repl.md
new file mode 100644
index 00000000000..a2f54a5347b
--- /dev/null
+++ b/docs/engine-usage/repl.md
@@ -0,0 +1,108 @@
+---
+title: Repl Engine
+sidebar_position: 15
+---
+
+# Repl engine usage documentation
+
+This article mainly introduces the installation, use and configuration of the
`Repl` engine plugin in `Linkis`.
+
+## 1. Preliminary work
+
+### 1.1 Engine Verification
+
+It is strongly recommended that you check these environment variables for the
executing user before executing `Repl` tasks. The specific way is
+
+```
+sudo su - ${username}
+echo ${JAVA_HOME}
+```
+
+## 2. Engine plugin installation
+
+### 2.1 Engine plugin preparation [non-default engine](./overview.md)
+
+Compile the engine plug-in separately (requires a `maven` environment)
+
+```
+# compile
+cd ${linkis_code_dir}/linkis-engineconn-plugins/repl/
+mvn clean install
+
+# The compiled engine plug-in package is located in the following directory
+${linkis_code_dir}/linkis-engineconn-plugins/repl/target/out/
+```
+
+[EngineConnPlugin engine plugin
installation](../deployment/install-engineconn.md)
+
+### 2.2 Upload and load engine plugins
+
+Upload the engine plug-in package in 2.1 to the engine directory of the server
+
+```bash
+${LINKIS_HOME}/lib/linkis-engineplugins
+```
+The directory structure after uploading is as follows
+```
+linkis-engineconn-plugins/
+├── repl
+│ ├── dist
+│ │ └── 1
+│ │ ├── conf
+│ │ └── lib
+│ └── plugin
+│ └── 1
+```
+### 2.3 Engine refresh
+
+#### 2.3.1 Restart and refresh
+Refresh the engine by restarting the `linkis-cg-linkismanager` service
+```bash
+cd ${LINKIS_HOME}/sbin
+sh linkis-daemon.sh restart cg-linkismanager
+```
+
+### 2.3.2 Check if the engine is refreshed successfully
+You can check whether the `last_update_time` of this table in the
`linkis_engine_conn_plugin_bml_resources` in the database is the time when the
refresh is triggered.
+
+```sql
+#Login to the linkis database
+select * from linkis_cg_engine_conn_plugin_bml_resources;
+```
+
+
+## 3. Use of Repl engine
+
+### 3.1 Submit `java` tasks through `Linkis-cli`
+
+```shell
+ sh bin/linkis-cli -engineType repl-1 -code \
+"import org.apache.commons.lang3.StringUtils;
+ public void sayHello() {
+ System.out.println(\"hello\");
+ System.out.println(StringUtils.isEmpty(\"hello\"));
+ }" \
+ -codeType repl -runtimeMap linkis.repl.type=java
+```
+
+### 3.2 Submit `scala` tasks through `Linkis-cli`
+
+```shell
+ sh bin/linkis-cli -engineType repl-1 -code \
+"import org.apache.commons.io.FileUtils
+import java.io.File
+
+val x = 2 + 3;
+println(x);
+FileUtils.forceMkdir(new File(\"/tmp/linkis_repl_scala_test\"));" \
+ -codeType repl -runtimeMap linkis.repl.type=scala
+```
+
+More `Linkis-Cli` command parameter reference: [`Linkis-Cli`
usage](../user-guide/linkiscli-manual.md)
+
+Repl engine supports connection parameters:
+
+| Configuration name | Remarks and default value | Is it necessary |
+| --- | --- | --- |
+| linkis.repl.type | repl type, supports java and scala, default value: java |
Optional |
+| linkis.repl.method.name | The name of the method to execute. The default
value is null | Optional |
diff --git
a/i18n/zh-CN/docusaurus-plugin-content-docs/current/engine-usage/repl.md
b/i18n/zh-CN/docusaurus-plugin-content-docs/current/engine-usage/repl.md
new file mode 100644
index 00000000000..ff78fd35a39
--- /dev/null
+++ b/i18n/zh-CN/docusaurus-plugin-content-docs/current/engine-usage/repl.md
@@ -0,0 +1,107 @@
+---
+title: Repl
+sidebar_position: 16
+---
+
+# Repl 引擎使用文档
+
+本文主要介绍在 `Linkis` 中,`Repl` 引擎插件的安装、使用和配置。
+
+## 1. 前置工作
+
+### 1.1 引擎验证
+
+强烈建议您在执行 `Repl` 任务之前,检查下执行用户的这些环境变量。具体方式是
+```
+sudo su - ${username}
+echo ${JAVA_HOME}
+```
+
+## 2. 引擎插件安装
+
+### 2.1 引擎插件准备[非默认引擎](./overview.md)
+
+单独编译引擎插件(需要有 `maven` 环境)
+
+```
+# 编译
+cd ${linkis_code_dir}/linkis-engineconn-plugins/repl/
+mvn clean install
+
+# 编译出来的引擎插件包,位于如下目录中
+${linkis_code_dir}/linkis-engineconn-plugins/repl/target/out/
+```
+
+[EngineConnPlugin 引擎插件安装](../deployment/install-engineconn.md)
+
+### 2.2 引擎插件的上传和加载
+
+将 2.1 中的引擎插件包上传到服务器的引擎目录下
+```bash
+${LINKIS_HOME}/lib/linkis-engineplugins
+```
+上传后目录结构如下所示
+```
+linkis-engineconn-plugins/
+├── repl
+│ ├── dist
+│ │ └── 1
+│ │ ├── conf
+│ │ └── lib
+│ └── plugin
+│ └── 1
+```
+### 2.3 引擎刷新
+
+#### 2.3.1 重启刷新
+通过重启 `linkis-cg-linkismanager` 服务刷新引擎
+```bash
+cd ${LINKIS_HOME}/sbin
+sh linkis-daemon.sh restart cg-linkismanager
+```
+
+### 2.3.2 检查引擎是否刷新成功
+可以查看数据库中的 `linkis_engine_conn_plugin_bml_resources` 这张表的 `last_update_time`
是否为触发刷新的时间。
+
+```sql
+#登陆到linkis的数据库
+select * from linkis_cg_engine_conn_plugin_bml_resources;
+```
+
+
+## 3. Repl引擎的使用
+
+### 3.1 通过 `Linkis-cli` 提交`java`任务
+
+```shell
+ sh bin/linkis-cli -engineType repl-1 -code \
+"import org.apache.commons.lang3.StringUtils;
+ public void sayHello() {
+ System.out.println(\"hello\");
+ System.out.println(StringUtils.isEmpty(\"hello\"));
+ }" \
+ -codeType repl -runtimeMap linkis.repl.type=java
+```
+
+### 3.2 通过 `Linkis-cli` 提交`scala`任务
+
+```shell
+ sh bin/linkis-cli -engineType repl-1 -code \
+"import org.apache.commons.io.FileUtils
+import java.io.File
+
+val x = 2 + 3;
+println(x);
+FileUtils.forceMkdir(new File(\"/tmp/linkis_repl_scala_test\"));" \
+ -codeType repl -runtimeMap linkis.repl.type=scala
+```
+
+更多 `Linkis-Cli` 命令参数参考: [`Linkis-Cli` 使用](../user-guide/linkiscli-manual.md)
+
+
+Repl引擎,支持的连接参数有:
+
+| 配置名称 | 备注及默认值信息 | 是否必须
|
+|-----------------|------------------------------|----------------------------------------|
+| linkis.repl.type | repl类型,支持java和scala,默认值:java | 非必须 |
+| linkis.repl.method.name | 执行的方法名称,默认值为空 | 非必须 |
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]