diff --git a/docs/images/develop/pycharm_docker_1.png b/docs/images/develop/pycharm_docker_1.png
new file mode 100644
index 000000000..4e9f4fa94
Binary files /dev/null and b/docs/images/develop/pycharm_docker_1.png differ
diff --git a/docs/images/develop/pycharm_docker_10.png b/docs/images/develop/pycharm_docker_10.png
new file mode 100644
index 000000000..b9116f629
Binary files /dev/null and b/docs/images/develop/pycharm_docker_10.png differ
diff --git a/docs/images/develop/pycharm_docker_11.png b/docs/images/develop/pycharm_docker_11.png
new file mode 100644
index 000000000..e9e3157d9
Binary files /dev/null and b/docs/images/develop/pycharm_docker_11.png differ
diff --git a/docs/images/develop/pycharm_docker_12.png b/docs/images/develop/pycharm_docker_12.png
new file mode 100644
index 000000000..f8209ffa9
Binary files /dev/null and b/docs/images/develop/pycharm_docker_12.png differ
diff --git a/docs/images/develop/pycharm_docker_13.png b/docs/images/develop/pycharm_docker_13.png
new file mode 100644
index 000000000..3b76b18c5
Binary files /dev/null and b/docs/images/develop/pycharm_docker_13.png differ
diff --git a/docs/images/develop/pycharm_docker_14.png b/docs/images/develop/pycharm_docker_14.png
new file mode 100644
index 000000000..59f7d9f6c
Binary files /dev/null and b/docs/images/develop/pycharm_docker_14.png differ
diff --git a/docs/images/develop/pycharm_docker_15.png b/docs/images/develop/pycharm_docker_15.png
new file mode 100644
index 000000000..bf7cbd64f
Binary files /dev/null and b/docs/images/develop/pycharm_docker_15.png differ
diff --git a/docs/images/develop/pycharm_docker_16.png b/docs/images/develop/pycharm_docker_16.png
new file mode 100644
index 000000000..76c839586
Binary files /dev/null and b/docs/images/develop/pycharm_docker_16.png differ
diff --git a/docs/images/develop/pycharm_docker_17.png b/docs/images/develop/pycharm_docker_17.png
new file mode 100644
index 000000000..296828599
Binary files /dev/null and b/docs/images/develop/pycharm_docker_17.png differ
diff --git a/docs/images/develop/pycharm_docker_18.png b/docs/images/develop/pycharm_docker_18.png
new file mode 100644
index 000000000..d951296e5
Binary files /dev/null and b/docs/images/develop/pycharm_docker_18.png differ
diff --git a/docs/images/develop/pycharm_docker_2.png b/docs/images/develop/pycharm_docker_2.png
new file mode 100644
index 000000000..74faca240
Binary files /dev/null and b/docs/images/develop/pycharm_docker_2.png differ
diff --git a/docs/images/develop/pycharm_docker_3.png b/docs/images/develop/pycharm_docker_3.png
new file mode 100644
index 000000000..2a977accc
Binary files /dev/null and b/docs/images/develop/pycharm_docker_3.png differ
diff --git a/docs/images/develop/pycharm_docker_4.png b/docs/images/develop/pycharm_docker_4.png
new file mode 100644
index 000000000..9e189af37
Binary files /dev/null and b/docs/images/develop/pycharm_docker_4.png differ
diff --git a/docs/images/develop/pycharm_docker_5.png b/docs/images/develop/pycharm_docker_5.png
new file mode 100644
index 000000000..c11d4d4d8
Binary files /dev/null and b/docs/images/develop/pycharm_docker_5.png differ
diff --git a/docs/images/develop/pycharm_docker_6.png b/docs/images/develop/pycharm_docker_6.png
new file mode 100644
index 000000000..eee8d11f0
Binary files /dev/null and b/docs/images/develop/pycharm_docker_6.png differ
diff --git a/docs/images/develop/pycharm_docker_7.png b/docs/images/develop/pycharm_docker_7.png
new file mode 100644
index 000000000..76fb22822
Binary files /dev/null and b/docs/images/develop/pycharm_docker_7.png differ
diff --git a/docs/images/develop/pycharm_docker_8.png b/docs/images/develop/pycharm_docker_8.png
new file mode 100644
index 000000000..60bdf2564
Binary files /dev/null and b/docs/images/develop/pycharm_docker_8.png differ
diff --git a/docs/images/develop/pycharm_docker_9.png b/docs/images/develop/pycharm_docker_9.png
new file mode 100644
index 000000000..bd9c0afb5
Binary files /dev/null and b/docs/images/develop/pycharm_docker_9.png differ
diff --git a/docs/source/_ext/post_process.py b/docs/source/_ext/post_process.py
new file mode 100644
index 000000000..8f46285e6
--- /dev/null
+++ b/docs/source/_ext/post_process.py
@@ -0,0 +1,38 @@
+import logging
+
+from docutils import nodes
+from docutils.transforms import Transform
+
+
+class PostFixLink(Transform):
+ default_priority = 780
+
+ def __init__(self, document, startnode=None):
+ super(PostFixLink, self).__init__(document, startnode)
+
+ def apply(self, **kwargs):
+
+ def _visit(node):
+ if not node.children:
+ return
+ for child in node.children:
+ if isinstance(child, nodes.Element):
+ if 'refuri' in child.attributes and '.md#' in child.attributes[
+ 'refuri']:
+ src = child.attributes['refuri']
+ dst = src.replace('.md#', '.html#')
+ logging.info('[PostFixLink] replace %s to %s' % (src, dst))
+ child.attributes['refuri'] = dst
+ _visit(child)
+
+ _visit(self.document)
+
+
+def setup(app):
+ app.add_post_transform(PostFixLink)
+
+ return {
+ 'version': '0.1',
+ 'parallel_read_safe': True,
+ 'parallel_write_safe': True,
+ }
diff --git a/docs/source/conf.py b/docs/source/conf.py
index 19ffc5652..5caeb70b6 100644
--- a/docs/source/conf.py
+++ b/docs/source/conf.py
@@ -12,15 +12,18 @@
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#
-# import os
-# import sys
-# sys.path.insert(0, os.path.abspath('.'))
+import os
+import sys
-import sphinx_markdown_tables # NOQA
import sphinx_rtd_theme
import easy_rec
+# sys.path.insert(0, os.path.abspath('.'))
+sys.path.insert(0, os.path.abspath('_ext'))
+
+import sphinx_markdown_tables # NOQA
+
# -- Project information -----------------------------------------------------
project = 'easy_rec'
@@ -38,18 +41,11 @@
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
- 'sphinx.ext.autodoc',
- 'sphinx.ext.doctest',
- 'sphinx.ext.intersphinx',
- 'sphinx.ext.todo',
- 'sphinx.ext.coverage',
- 'sphinx.ext.mathjax',
- 'sphinx.ext.ifconfig',
- 'sphinx.ext.viewcode',
- 'sphinx.ext.githubpages',
- 'sphinx.ext.napoleon',
- 'recommonmark',
- 'sphinx_markdown_tables',
+ 'sphinx.ext.autodoc', 'sphinx.ext.doctest', 'sphinx.ext.intersphinx',
+ 'sphinx.ext.todo', 'sphinx.ext.coverage', 'sphinx.ext.mathjax',
+ 'sphinx.ext.ifconfig', 'sphinx.ext.viewcode', 'sphinx.ext.githubpages',
+ 'sphinx.ext.napoleon', 'recommonmark', 'sphinx_markdown_tables',
+ 'post_process'
]
# Add any paths that contain templates here, relative to this directory.
diff --git a/docs/source/index.rst b/docs/source/index.rst
index 470587f13..86ba28acc 100644
--- a/docs/source/index.rst
+++ b/docs/source/index.rst
@@ -85,6 +85,7 @@ Welcome to easy_rec's documentation!
:caption: DEVELOP
develop
+ pycharm_vscode_docker
release
.. toctree::
diff --git a/docs/source/pycharm_vscode_docker.md b/docs/source/pycharm_vscode_docker.md
new file mode 100644
index 000000000..ecc010baf
--- /dev/null
+++ b/docs/source/pycharm_vscode_docker.md
@@ -0,0 +1,101 @@
+# PyCharm / VSCode
+
+
+
+### 构建镜像
+
+```bash
+git clone https://github.com/Alibaba/EasyRec
+cd EasyRec
+sh scripts/build_docker.sh
+```
+
+### 运行容器
+
+- 查看docker镜像
+
+```bash
+docker images
+```
+
+![pycharm_docker_1.png](../images/develop/pycharm_docker_1.png)
+
+- 启动docker镜像
+
+```bash
+docker run -it /bin/bash
+```
+
+### vscode配置
+
+#### 连接本地容器
+
+- vscode 安装 插件 remote - containers、remote - wsl 、remote development
+
+![pycharm_docker_2.png](../images/develop/pycharm_docker_2.png)
+
+- 安装插件后,vscode 状态栏会出现远程连接的图标,点击图标。remote_explorer 选择containers ,CONTAINERS 显示出 运行的容器。点击 + ,连接容器。
+
+![pycharm_docker_3.png](../images/develop/pycharm_docker_3.png)
+
+- 弹出新的window
+
+![pycharm_docker_4.png](../images/develop/pycharm_docker_4.png)
+
+#### 连接远程容器
+
+- vscode 安装 插件docker ,remote-ssh
+
+![pycharm_docker_5.png](../images/develop/pycharm_docker_5.png)
+![pycharm_docker_6.png](../images/develop/pycharm_docker_6.png)
+
+- vscode 连接远程服务器
+
+![pycharm_docker_7.png](../images/develop/pycharm_docker_7.png)
+
+- 弹出 window , 点击 docker 图标,展示出运行的容器
+
+![pycharm_docker_8.png](../images/develop/pycharm_docker_8.png)
+
+- 选择容器,右键attach shell,打开终端
+
+![pycharm_docker_9.png](../images/develop/pycharm_docker_9.png)
+
+### pycharm配置
+
+#### pycharm版本
+
+- 本示例使用的版本是: **professional 2022.2.2**
+
+#### 安装插件 docker
+
+![image_10.png](../images/develop/pycharm_docker_10.png)
+
+- 安装插件后 pycharm 底部的services会显示docker connect
+
+#### 配置docker 连接
+
+- 菜单路径: View=>Tools=>Services
+
+![image_12.png](../images/develop/pycharm_docker_12.png)
+
+- 本地docker: 选择 docker for mac
+- 远程服务器docker 选择 ssh, 填上 @
+
+![image_15.png](../images/develop/pycharm_docker_15.png)
+
+- 确定后,显示出containers和images.
+
+![image_16.png](../images/develop/pycharm_docker_16.png)
+
+- 点击右上端terminal,进入交互.
+
+![image_17.png](../images/develop/pycharm_docker_17.png)
+
+- 选择容器,右键,点击show files ,显示容器内所有文件.
+- 选择文件,右键,查看和下载到本地.
+
+![image_18.png](../images/develop/pycharm_docker_18.png)
diff --git a/easy_rec/python/test/train_eval_test.py b/easy_rec/python/test/train_eval_test.py
index acfe81b5a..2c9fc2d14 100644
--- a/easy_rec/python/test/train_eval_test.py
+++ b/easy_rec/python/test/train_eval_test.py
@@ -7,11 +7,11 @@
import threading
import time
import unittest
+from distutils.version import LooseVersion
import numpy as np
import six
import tensorflow as tf
-from distutils.version import LooseVersion
from tensorflow.python.platform import gfile
from easy_rec.python.main import predict
diff --git a/scripts/build_docs.sh b/scripts/build_docs.sh
index aed28d384..929df6044 100644
--- a/scripts/build_docs.sh
+++ b/scripts/build_docs.sh
@@ -14,5 +14,4 @@ pip install -r requirements/docs.txt
cd docs
rm -rf build
make html
-find build/html/ -name "*.html" | xargs -I {} sed -i -e "s/\/\([a-zA-Z0-9_%-]\+\)\.md#\([a-zA-Z0-9_%-]\)/\/\1.html#\2/g" {}
rm -rf build/html/_modules
diff --git a/setup.cfg b/setup.cfg
index 8d6e2d132..b180b9fb1 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -10,7 +10,7 @@ multi_line_output = 7
force_single_line = true
known_standard_library = setuptools
known_first_party = easy_rec
-known_third_party = absl,common_io,distutils,future,google,graphlearn,kafka,matplotlib,numpy,oss2,pai,pandas,psutil,six,sklearn,sphinx_markdown_tables,sphinx_rtd_theme,tensorflow,yaml
+known_third_party = absl,common_io,docutils,future,google,graphlearn,kafka,matplotlib,numpy,oss2,pai,pandas,psutil,six,sklearn,sphinx_markdown_tables,sphinx_rtd_theme,tensorflow,yaml
no_lines_before = LOCALFOLDER
default_section = THIRDPARTY
skip = easy_rec/python/protos