Skip to content

Commit

Permalink
Update docs.
Browse files Browse the repository at this point in the history
  • Loading branch information
shaomengwang committed Jun 11, 2021
1 parent f3153fc commit 21412ea
Show file tree
Hide file tree
Showing 2 changed files with 78 additions and 35 deletions.
56 changes: 38 additions & 18 deletions README.en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,16 @@ Welcome everyone to join the Alink open source user group to communicate.

#### About package names and versions:
- PyAlink provides different Python packages for Flink versions that Alink supports:
package `pyalink` always maintains Alink Python API against the latest Flink version, which is 1.12,
while `pyalink-flink-***` support old-version Flink, which are `pyalink-flink-1.11`, `pyalink-flink-1.10` and `pyalink-flink-1.9` for now.
- The version of python packages always follows Alink Java version, like `1.3.1`.
package `pyalink` always maintains Alink Python API against the latest Flink version, which is 1.13,
while `pyalink-flink-***` support old-version Flink, which are `pyalink-flink-1.12`, `pyalink-flink-1.11`, `pyalink-flink-1.10` and `pyalink-flink-1.9` for now.
- The version of python packages always follows Alink Java version, like `1.4.0`.

#### Installation steps:

1. Make sure the version of python3 on your computer is 3.6 or 3.7.
1. Make sure the version of python3 on your computer is 3.6, 3.7 or 3.8.
2. Make sure Java 8 is installed on your computer.
3. Use pip to install:
`pip install pyalink`, `pip install pyalink-flink-1.11`, `pip install pyalink-flink-1.10` or `pip install pyalink-flink-1.9`.
`pip install pyalink`, `pip install pyalink-flink-1.12`, `pip install pyalink-flink-1.11`, `pip install pyalink-flink-1.10` or `pip install pyalink-flink-1.9`.


#### Potential issues:
Expand All @@ -50,10 +50,11 @@ Welcome everyone to join the Alink open source user group to communicate.
If `pyalink` or `pyalink-flink-***` was/were installed, please use `pip uninstall pyalink` or `pip uninstall pyalink-flink-***` to remove them.

2. If `pip install` is slow of failed, refer to [this article](https://segmentfault.com/a/1190000006111096) to change the pip source, or use the following download links:
- Flink 1.12:[Link](https://alink-release.oss-cn-beijing.aliyuncs.com/v1.3.2/pyalink-1.3.2-py3-none-any.whl) (MD5: 80aa54edad5c3a6ca513bbf2b3ec2ebb)
- Flink 1.11:[Link](https://alink-release.oss-cn-beijing.aliyuncs.com/v1.3.2/pyalink_flink_1.11-1.3.2-py3-none-any.whl) (MD5: e832f73c9503de12a02c1824c8963b87)
- Flink 1.10:[Link](https://alink-release.oss-cn-beijing.aliyuncs.com/v1.3.2/pyalink_flink_1.10-1.3.2-py3-none-any.whl) (MD5: 145e513dae8caa85f6a32c3ad45b3c33)
- Flink 1.9: [Link](https://alink-release.oss-cn-beijing.aliyuncs.com/v1.3.2/pyalink_flink_1.9-1.3.2-py3-none-any.whl) (MD5: 6ff04cbad4e6d6e0a2137d1d76a19a45)
- Flink 1.13:[Link](https://alink-release.oss-cn-beijing.aliyuncs.com/v1.4.0/pyalink-1.4.0-py3-none-any.whl) (MD5: 94751cc1e31f174b446142455293fb30)
- Flink 1.12:[Link](https://alink-release.oss-cn-beijing.aliyuncs.com/v1.4.0/pyalink_flink_1.12-1.4.0-py3-none-any.whl) (MD5: 4cbafe08b24b3467d9096f8a8a07321f)
- Flink 1.11:[Link](https://alink-release.oss-cn-beijing.aliyuncs.com/v1.4.0/pyalink_flink_1.11-1.4.0-py3-none-any.whl) (MD5: 1810f6769bd2d2d77358f4e51948a937)
- Flink 1.10:[Link](https://alink-release.oss-cn-beijing.aliyuncs.com/v1.4.0/pyalink_flink_1.10-1.4.0-py3-none-any.whl) (MD5: 79ceea2788ad2159ae23ad3e9e83a261)
- Flink 1.9: [Link](https://alink-release.oss-cn-beijing.aliyuncs.com/v1.4.0/pyalink_flink_1.9-1.4.0-py3-none-any.whl) (MD5: fc143df37d15d6bd3b0733fef8969ef1)
3. If multiple version of Python exist, you may need to use a special version of `pip`, like `pip3`;
If Anaconda is used, the command should be run in Anaconda prompt.

Expand Down Expand Up @@ -153,12 +154,31 @@ Pipeline pipeline = new Pipeline().add(va).add(kMeans);
pipeline.fit(data).transform(data).print();
```

### With Flink-1.13
```xml
<dependency>
<groupId>com.alibaba.alink</groupId>
<artifactId>alink_core_flink-1.13_2.11</artifactId>
<version>1.4.0</version>
</dependency>
<dependency>
<groupId>org.apache.flink</groupId>
<artifactId>flink-streaming-scala_2.11</artifactId>
<version>1.13.0</version>
</dependency>
<dependency>
<groupId>org.apache.flink</groupId>
<artifactId>flink-table-planner_2.11</artifactId>
<version>1.13.0</version>
</dependency>
```

### With Flink-1.12
```xml
<dependency>
<groupId>com.alibaba.alink</groupId>
<artifactId>alink_core_flink-1.12_2.11</artifactId>
<version>1.3.2</version>
<version>1.4.0</version>
</dependency>
<dependency>
<groupId>org.apache.flink</groupId>
Expand All @@ -177,7 +197,7 @@ pipeline.fit(data).transform(data).print();
<dependency>
<groupId>com.alibaba.alink</groupId>
<artifactId>alink_core_flink-1.11_2.11</artifactId>
<version>1.3.2</version>
<version>1.4.0</version>
</dependency>
<dependency>
<groupId>org.apache.flink</groupId>
Expand All @@ -196,7 +216,7 @@ pipeline.fit(data).transform(data).print();
<dependency>
<groupId>com.alibaba.alink</groupId>
<artifactId>alink_core_flink-1.10_2.11</artifactId>
<version>1.3.2</version>
<version>1.4.0</version>
</dependency>
<dependency>
<groupId>org.apache.flink</groupId>
Expand All @@ -216,7 +236,7 @@ pipeline.fit(data).transform(data).print();
<dependency>
<groupId>com.alibaba.alink</groupId>
<artifactId>alink_core_flink-1.9_2.11</artifactId>
<version>1.3.2</version>
<version>1.4.0</version>
</dependency>
<dependency>
<groupId>org.apache.flink</groupId>
Expand All @@ -236,8 +256,8 @@ Get started to run Alink Algorithm with a Flink Cluster

1. Prepare a Flink Cluster:
```shell
wget https://archive.apache.org/dist/flink/flink-1.12.1/flink-1.12.1-bin-scala_2.11.tgz
tar -xf flink-1.12.1-bin-scala_2.11.tgz && cd flink-1.12.1
wget https://archive.apache.org/dist/flink/flink-1.13.0/flink-1.13.0-bin-scala_2.11.tgz
tar -xf flink-1.13.0-bin-scala_2.11.tgz && cd flink-1.13.0
./bin/start-cluster.sh
```

Expand All @@ -250,9 +270,9 @@ Get started to run Alink Algorithm with a Flink Cluster

3. Run Java examples:
```shell
./bin/flink run -p 1 -c com.alibaba.alink.ALSExample [path_to_Alink]/examples/target/alink_examples-1.1-SNAPSHOT.jar
# ./bin/flink run -p 1 -c com.alibaba.alink.GBDTExample [path_to_Alink]/examples/target/alink_examples-1.1-SNAPSHOT.jar
# ./bin/flink run -p 1 -c com.alibaba.alink.KMeansExample [path_to_Alink]/examples/target/alink_examples-1.1-SNAPSHOT.jar
./bin/flink run -p 1 -c com.alibaba.alink.ALSExample [path_to_Alink]/examples/target/alink_examples-1.4-SNAPSHOT.jar
# ./bin/flink run -p 1 -c com.alibaba.alink.GBDTExample [path_to_Alink]/examples/target/alink_examples-1.4-SNAPSHOT.jar
# ./bin/flink run -p 1 -c com.alibaba.alink.KMeansExample [path_to_Alink]/examples/target/alink_examples-1.4-SNAPSHOT.jar
```

Deployment
Expand Down
57 changes: 40 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@
<img src="https://img.alicdn.com/tfs/TB1kQU0sQY2gK0jSZFgXXc5OFXa-614-554.png" height="25%" width="25%">
</div>

- Alink文档:https://www.yuque.com/pinshu/alink_doc
- Alink使用指南:https://www.yuque.com/pinshu/alink_guide
- Alink插件下载器:https://www.yuque.com/pinshu/alink_guide/czg4cx

#### 开源算法列表

<div align=center>
Expand All @@ -31,24 +35,25 @@
#### 包名和版本说明:

- PyAlink 根据 Alink 所支持的 Flink 版本提供不同的 Python 包:
其中,`pyalink` 包对应为 Alink 所支持的最新 Flink 版本,当前为 1.12,而 `pyalink-flink-***` 为旧版本的 Flink 版本,当前提供 `pyalink-flink-1.11`, `pyalink-flink-1.10``pyalink-flink-1.9`
- Python 包的版本号与 Alink 的版本号一致,例如`1.3.1`
其中,`pyalink` 包对应为 Alink 所支持的最新 Flink 版本,当前为 1.13,而 `pyalink-flink-***` 为旧版本的 Flink 版本,当前提供 `pyalink-flink-1.12`, `pyalink-flink-1.11`, `pyalink-flink-1.10``pyalink-flink-1.9`
- Python 包的版本号与 Alink 的版本号一致,例如`1.4.0`

####安装步骤:
1. 确保使用环境中有Python3,版本限于 3.6 和 3.7
1. 确保使用环境中有Python3,版本限于 3.6,3.7 和 3.8
2. 确保使用环境中安装有 Java 8。
3. 使用 pip 命令进行安装:
`pip install pyalink``pip install pyalink-flink-1.11``pip install pyalink-flink-1.10` 或者 `pip install pyalink-flink-1.9`
`pip install pyalink``pip install pyalink-flink-1.12``pip install pyalink-flink-1.11``pip install pyalink-flink-1.10` 或者 `pip install pyalink-flink-1.9`

#### 安装注意事项:

1. `pyalink``pyalink-flink-***` 不能同时安装,也不能与旧版本同时安装。
如果之前安装过 `pyalink` 或者 `pyalink-flink-***`,请使用`pip uninstall pyalink` 或者 `pip uninstall pyalink-flink-***` 卸载之前的版本。
2. 出现`pip`安装缓慢或不成功的情况,可以参考[这篇文章](https://segmentfault.com/a/1190000006111096)修改pip源,或者直接使用下面的链接下载 whl 包,然后使用 `pip` 安装:
- Flink 1.12:[链接](https://alink-release.oss-cn-beijing.aliyuncs.com/v1.3.2/pyalink-1.3.2-py3-none-any.whl) (MD5: 80aa54edad5c3a6ca513bbf2b3ec2ebb)
- Flink 1.11:[链接](https://alink-release.oss-cn-beijing.aliyuncs.com/v1.3.2/pyalink_flink_1.11-1.3.2-py3-none-any.whl) (MD5: e832f73c9503de12a02c1824c8963b87)
- Flink 1.10:[链接](https://alink-release.oss-cn-beijing.aliyuncs.com/v1.3.2/pyalink_flink_1.10-1.3.2-py3-none-any.whl) (MD5: 145e513dae8caa85f6a32c3ad45b3c33)
- Flink 1.9: [链接](https://alink-release.oss-cn-beijing.aliyuncs.com/v1.3.2/pyalink_flink_1.9-1.3.2-py3-none-any.whl) (MD5: 6ff04cbad4e6d6e0a2137d1d76a19a45)
- Flink 1.13:[链接](https://alink-release.oss-cn-beijing.aliyuncs.com/v1.4.0/pyalink-1.4.0-py3-none-any.whl) (MD5: 94751cc1e31f174b446142455293fb30)
- Flink 1.12:[链接](https://alink-release.oss-cn-beijing.aliyuncs.com/v1.4.0/pyalink_flink_1.12-1.4.0-py3-none-any.whl) (MD5: 4cbafe08b24b3467d9096f8a8a07321f)
- Flink 1.11:[链接](https://alink-release.oss-cn-beijing.aliyuncs.com/v1.4.0/pyalink_flink_1.11-1.4.0-py3-none-any.whl) (MD5: 1810f6769bd2d2d77358f4e51948a937)
- Flink 1.10:[链接](https://alink-release.oss-cn-beijing.aliyuncs.com/v1.4.0/pyalink_flink_1.10-1.4.0-py3-none-any.whl) (MD5: 79ceea2788ad2159ae23ad3e9e83a261)
- Flink 1.9: [链接](https://alink-release.oss-cn-beijing.aliyuncs.com/v1.4.0/pyalink_flink_1.9-1.4.0-py3-none-any.whl) (MD5: fc143df37d15d6bd3b0733fef8969ef1)
3. 如果有多个版本的 Python,可能需要使用特定版本的 `pip`,比如 `pip3`;如果使用 Anaconda,则需要在 Anaconda 命令行中进行安装。

#### 下载安装文件系统或 Catalog 依赖 jar 包:
Expand Down Expand Up @@ -138,13 +143,31 @@ Pipeline pipeline = new Pipeline().add(va).add(kMeans);
pipeline.fit(data).transform(data).print();
```

### Flink-1.13 的 Maven 依赖
```xml
<dependency>
<groupId>com.alibaba.alink</groupId>
<artifactId>alink_core_flink-1.13_2.11</artifactId>
<version>1.4.0</version>
</dependency>
<dependency>
<groupId>org.apache.flink</groupId>
<artifactId>flink-streaming-scala_2.11</artifactId>
<version>1.13.0</version>
</dependency>
<dependency>
<groupId>org.apache.flink</groupId>
<artifactId>flink-table-planner_2.11</artifactId>
<version>1.13.0</version>
</dependency>
```

### Flink-1.12 的 Maven 依赖
```xml
<dependency>
<groupId>com.alibaba.alink</groupId>
<artifactId>alink_core_flink-1.12_2.11</artifactId>
<version>1.3.2</version>
<version>1.4.0</version>
</dependency>
<dependency>
<groupId>org.apache.flink</groupId>
Expand All @@ -163,7 +186,7 @@ pipeline.fit(data).transform(data).print();
<dependency>
<groupId>com.alibaba.alink</groupId>
<artifactId>alink_core_flink-1.11_2.11</artifactId>
<version>1.3.2</version>
<version>1.4.0</version>
</dependency>
<dependency>
<groupId>org.apache.flink</groupId>
Expand All @@ -182,7 +205,7 @@ pipeline.fit(data).transform(data).print();
<dependency>
<groupId>com.alibaba.alink</groupId>
<artifactId>alink_core_flink-1.10_2.11</artifactId>
<version>1.3.2</version>
<version>1.4.0</version>
</dependency>
<dependency>
<groupId>org.apache.flink</groupId>
Expand All @@ -202,7 +225,7 @@ pipeline.fit(data).transform(data).print();
<dependency>
<groupId>com.alibaba.alink</groupId>
<artifactId>alink_core_flink-1.9_2.11</artifactId>
<version>1.3.2</version>
<version>1.4.0</version>
</dependency>
<dependency>
<groupId>org.apache.flink</groupId>
Expand All @@ -223,8 +246,8 @@ pipeline.fit(data).transform(data).print();

1. 准备Flink集群
```shell
wget https://archive.apache.org/dist/flink/flink-1.12.1/flink-1.12.1-bin-scala_2.11.tgz
tar -xf flink-1.12.1-bin-scala_2.11.tgz && cd flink-1.12.1
wget https://archive.apache.org/dist/flink/flink-1.13.0/flink-1.13.0-bin-scala_2.11.tgz
tar -xf flink-1.13.0-bin-scala_2.11.tgz && cd flink-1.13.0
./bin/start-cluster.sh
```

Expand All @@ -237,9 +260,9 @@ pipeline.fit(data).transform(data).print();

3. 运行Java示例
```shell
./bin/flink run -p 1 -c com.alibaba.alink.ALSExample [path_to_Alink]/examples/target/alink_examples-1.1-SNAPSHOT.jar
# ./bin/flink run -p 1 -c com.alibaba.alink.GBDTExample [path_to_Alink]/examples/target/alink_examples-1.1-SNAPSHOT.jar
# ./bin/flink run -p 1 -c com.alibaba.alink.KMeansExample [path_to_Alink]/examples/target/alink_examples-1.1-SNAPSHOT.jar
./bin/flink run -p 1 -c com.alibaba.alink.ALSExample [path_to_Alink]/examples/target/alink_examples-1.4-SNAPSHOT.jar
# ./bin/flink run -p 1 -c com.alibaba.alink.GBDTExample [path_to_Alink]/examples/target/alink_examples-1.4-SNAPSHOT.jar
# ./bin/flink run -p 1 -c com.alibaba.alink.KMeansExample [path_to_Alink]/examples/target/alink_examples-1.4-SNAPSHOT.jar
```

## 部署
Expand Down

0 comments on commit 21412ea

Please sign in to comment.