Skip to content

Commit

Permalink
Change Name
Browse files Browse the repository at this point in the history
  • Loading branch information
zhishufei committed Dec 14, 2023
1 parent c58792b commit 8d8cc79
Show file tree
Hide file tree
Showing 14 changed files with 256 additions and 256 deletions.
18 changes: 9 additions & 9 deletions .env.template
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
#HOLMES environment variables
#DEEPBI environment variables
#log level
HOLMES_LOG_LEVEL=INFO
DEEPBI_LOG_LEVEL=INFO
# use other redis config; default: docker redis://redis:6379/0
# HOLMES_REDIS_URL=redis://127.0.0.1:6379/0
# DEEPBI_REDIS_URL=redis://127.0.0.1:6379/0
# session encryption string
HOLMES_COOKIE_SECRET=SEC_KEY
# database encryption string, same with HOLMES_SECRET_KEY, you can change
HOLMES_SECRET_KEY=SEC_KEY
DEEPBI_COOKIE_SECRET=SEC_KEY
# database encryption string, same with DEEPBI_SECRET_KEY, you can change
DEEPBI_SECRET_KEY=SEC_KEY
# use other postgresql database; default docker postgresql://postgres@postgres/postgres
# HOLMES_DATABASE_URL="postgresql://user:pwd@ip/database"
# DEEPBI_DATABASE_URL="postgresql://user:pwd@ip/database"
# allow custom js visualizations
HOLMES_FEATURE_ALLOW_CUSTOM_JS_VISUALIZATIONS=True
DEEPBI_FEATURE_ALLOW_CUSTOM_JS_VISUALIZATIONS=True
# Language CN/EN, only ip address ,no
WEB_LANGUAGE=LANGTYPE
# web server ip address or domain,for ai get database config option. port 5000,same with Docker
WEB_SERVER=IP:WEB_PORT
# api secret key for ai get database config option
DB_API_SECRET_KEY=SEC_KEY
# web content security policy
HOLMES_CONTENT_SECURITY_POLICY="style-src 'self' 'unsafe-inline'; font-src 'self' data:; img-src 'self' http: https: data: blob:; object-src 'none'; frame-ancestors 'none';"
DEEPBI_CONTENT_SECURITY_POLICY="style-src 'self' 'unsafe-inline'; font-src 'self' data:; img-src 'self' http: https: data: blob:; object-src 'none'; frame-ancestors 'none';"
# socket dir, need set Localhost ip
REACT_APP_SOCKET_URL=IP:SOCKET_PORT/chat/
# static file CDN
Expand Down
4 changes: 2 additions & 2 deletions Docker_install.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ sudo ln -s /usr/bin/docker-compose /usr/local/bin/docker-compose
- Start the docker command ```sudo service docker start```
- Check the docker running status command``` service docker status``` It should be "active (running)"
- Install network management commands```sudo apt install net-tools```
- Download the Holmes code by the command : ```git clone [email protected]:DeepThought-AI/Holmes.git```
- Run the command ```cd Holmes``` to the corresponding folder and run install file ```sudo ./install.sh```
- Download the DeepBi code by the command : ```git clone [email protected]:DeepThought-AI/DeepBi.git```
- Run the command ```cd DeepBi``` to the corresponding folder and run install file ```sudo ./install.sh```

## Ubuntu
- Run the command as follows:
Expand Down
36 changes: 18 additions & 18 deletions Docker_install_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,38 +55,38 @@ sudo ln -s /usr/bin/docker-compose /usr/local/bin/docker-compose
```
11. 安装网络管理 命令: ```sudo apt install net-tools```
12. 上面安装完毕docker ,以后就不用再次安装
## 配置Holmes
## 配置DeepBi
13. 运行命令 ```service docker status``` 确认docker是在运行 "active (running)" <br>
14. 获取本机内网IP地址,记录下来,一般是192.168.1.xxx,稍后可以用在安装路径下 如下图:<br>
![ip.png](user_manual/cn/img/ip.png)

15.然后,安装Holmes有两种方式,任选其一 如下
15.然后,安装DeepBi有两种方式,任选其一 如下

- (1)直接下载压做包 (推荐)
- 在WSL命令行中运行命令 : ```pwd``` 你会看到你目前的文件夹地址 比如 ```/mnt/c/Windows/system32```
- 点击”<a href="https://github.com/DeepThought-AI/Holmes" target='_blank'>链接</a>“通过网页下载我们的代码 如下图
- 点击”<a href="https://github.com/DeepThought-AI/DeepBi" target='_blank'>链接</a>“通过网页下载我们的代码 如下图
- ![download.png](user_manual/cn/img/download.png)
- 解压后的文件夹 "Holmes" 移动到 C:/Windows/system32 (也就是上面看到的文件夹地址,c表示C盘)
- 回到WSL命令行,运行命令```cd Holmes ```进入项目文件夹
- 解压后的文件夹 "DeepBi" 移动到 C:/Windows/system32 (也就是上面看到的文件夹地址,c表示C盘)
- 回到WSL命令行,运行命令```cd DeepBi ```进入项目文件夹
- 修改权限 ```sudo chmod +x ./Install.sh```
- 运行命令```sudo ./Install_cn.sh ``` 开始安装,安装结束后会有一个网址提示,直接浏览器访问即可

- (2)通过命令下载代码 (需要本地github公钥)
- 下载我们的代码,```git clone [email protected]:DeepThought-AI/Holmes.git```
- 下载我们的代码,```git clone [email protected]:DeepThought-AI/DeepBi.git```
- 出现 ```Are you sure you want to continue connecting (yes/no/[fingerprint])? ```
- 输入 ```yes``` 回车
- 进入项目文件夹 ```cd Holmes ```
- 进入项目文件夹 ```cd DeepBi ```
- 修改权限 ```sudo chmod +x ./Install.sh```
- 运行命令```sudo ./Install_cn.sh ``` 开始安装<br>
16. 安装结束后会有一个网址提示,直接浏览器访问即可<br>
(注意*关闭命令符窗口将无法访问属于Holmes网址
再次使用Holmes,打开“命令提示符”窗口“以管理员身份运行”
(注意*关闭命令符窗口将无法访问属于DeepBi网址
再次使用DeepBi,打开“命令提示符”窗口“以管理员身份运行”
```
1.运行“wsl”命令
2.运行“cd Holmes”命令
2.运行“cd DeepBi”命令
3.运行“sudo docker-compose start”命令
```
就可以去浏览器中打开自己Holmes网址了【网址都是http://‘本机内网IP地址’:8338】
就可以去浏览器中打开自己DeepBi网址了【网址都是http://‘本机内网IP地址’:8338】


# Ubuntu
Expand All @@ -108,14 +108,14 @@ systemctl start docker
sud apt-get -y install apt-transport-https ca-certificates curl software-properties-common
sudo systemctl enable docker
```
## 配置Holmes
## 配置DeepBi
3. 开始下载我们的代码文件
```
git clone [email protected]:DeepThought-AI/Holmes.git
git clone [email protected]:DeepThought-AI/DeepBi.git
```
4. 解压后重命名为 "Holmes" 然后进入目录
4. 解压后重命名为 "DeepBi" 然后进入目录
```
cd Holmes && sudo chmod+x./Install.sh
cd DeepBi && sudo chmod+x./Install.sh
. Install_cn.sh
```
5. 注意上面运行的是 . Install_cn.sh
Expand Down Expand Up @@ -146,9 +146,9 @@ git clone [email protected]:DeepThought-AI/Holmes.git
- 运行命令:```brew services start docker```
- 检查命令:```brew services list |grep docker```

## 配置Holmes
- 下载代码```git clone [email protected]:DeepThought-AI/Holmes.git```
- 运行命令到对应文件夹 ```cd Holmes ```
## 配置DeepBi
- 下载代码```git clone [email protected]:DeepThought-AI/DeepBi.git```
- 运行命令到对应文件夹 ```cd DeepBi ```
- 修改权限 ```sudo chmod+x ./Install.sh```
- 运行命令```sudo ./Install_cn.sh ``` 开始安装,安装结束后会有一个网址提示,直接浏览器访问即可

4 changes: 2 additions & 2 deletions Dockerfile.template
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ RUN apt-get clean && apt-get update && \
# ali pip source
#CN#RUN pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
#CN#RUN pip install --upgrade pip
COPY --chown=holmes . /app
COPY --chown=deepbi . /app
WORKDIR /app
## Disable PIP Cache and Version Check
ENV PIP_DISABLE_PIP_VERSION_CHECK=1
Expand All @@ -55,7 +55,7 @@ RUN pip install -r requirements.txt && pip install -r requirements_ai.txt
## fix python 3.8.18 error import .
RUN sed -i 's/from importlib_resources import path/from importlib.resources import path/g' /usr/local/lib/python3.8/site-packages/saml2/sigver.py && \
sed -i 's/from importlib_resources import path/from importlib.resources import path/g' /usr/local/lib/python3.8/site-packages/saml2/xml/schema/__init__.py && \
chown holmes /app && chmod +x /app/ai/main.py
chown deepbi /app && chmod +x /app/ai/main.py

ENTRYPOINT ["/app/bin/docker-entrypoint"]
CMD ["server"]
Expand Down
34 changes: 17 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<h1 align="center">Holmes</h1>
<h1 align="center">DeepBi</h1>

<div align="center">

Holmes is an AI-native data analysis platform. Holmes leverages the power of large language models to explore, query, visualize, and share data from any data source. Users can use Holmes to gain data insight and make data-driven decisions.
DeepBi is an AI-native data analysis platform. DeepBi leverages the power of large language models to explore, query, visualize, and share data from any data source. Users can use DeepBi to gain data insight and make data-driven decisions.


</div>
Expand All @@ -14,7 +14,7 @@ Developer:[email protected] Business:[email protected]

<div style="display: flex; align-items: center;">

If you think Holmes is helpful to you, please help by clicking <a style="display: flex; align-items: center;margin:0px 6px" target="_blank" href='https://github.com/DeepThought-AI/Holmes'>here</a> on the ⭐ Star and Fork in the upper right corner. Your support is the greatest driving force for Holmes to become better.
If you think DeepBi is helpful to you, please help by clicking <a style="display: flex; align-items: center;margin:0px 6px" target="_blank" href='https://github.com/DeepThought-AI/DeepBi'>here</a> on the ⭐ Star and Fork in the upper right corner. Your support is the greatest driving force for DeepBi to become better.


</div>
Expand All @@ -24,11 +24,11 @@ If you think Holmes is helpful to you, please help by clicking <a style="display

## Video example

https://github.com/DeepThought-AI/Holmes/assets/151519374/d1effbe1-5c11-4c77-86ef-e01b1ea7f2f6
https://github.com/DeepThought-AI/DeepBi/assets/151519374/d1effbe1-5c11-4c77-86ef-e01b1ea7f2f6


## user manual
[Holmes user manual](client/app/assets/images/en/user_manual_en.md)
[DeepBi user manual](client/app/assets/images/en/user_manual_en.md)


## ✨ Features
Expand All @@ -44,7 +44,7 @@ https://github.com/DeepThought-AI/Holmes/assets/151519374/d1effbe1-5c11-4c77-86e

## 🚀 Supported Databases

The database connections supported by Holmes are:
The database connections supported by DeepBi are:
- MySQL
- PostgreSQL
- csv/Excel Import
Expand All @@ -53,11 +53,11 @@ The database connections supported by Holmes are:

- The local environment needs to have docker and docker-compose. <br>
- [Installl docker](Docker_install.md)
- Download project files by git:``` git clone https://github.com/DeepThought-AI/Holmes.git ``` <br>
- Download project files by git:``` git clone https://github.com/DeepThought-AI/DeepBi.git ``` <br>
or drirect download zip file, unzip it. <br>
![download.png](user_manual/cn/img/download.png)

- Enter the project directory:``` cd Holmes ```
- Enter the project directory:``` cd DeepBi ```
- Just run``` ./Install.sh ```directly
- Default port: 8338 8339
- Web access: http://ip:8338
Expand All @@ -75,22 +75,22 @@ Install directly on the ubuntu system, you need to install redis, postgresql pyt
- Web access: http://ip:8338


## Holmes command
- Enter project Holmes dir:
## DeepBi command
- Enter project DeepBi dir:
```
docker-compose start # start Holmes servie
docker-compose stop # stop Holmes servie
docker-compose ps # see Holmes servie states
docker-compose start # start DeepBi servie
docker-compose stop # stop DeepBi servie
docker-compose ps # see DeepBi servie states
```
- If it appears... PermissionError ... ' or ' Permission denied', please add 'sudo' before executing the command
```
sudo docker-compose start # start Holmes servie
sudo docker-compose stop # stop Holmes servie
sudo docker-compose ps # see Holmes servie states
sudo docker-compose start # start DeepBi servie
sudo docker-compose stop # stop DeepBi servie
sudo docker-compose ps # see DeepBi servie states
```


## 📑 Other
- We have tested on Mac OS 12.7/13.X /14.1.1, Ubuntu 20.04/22.04, and Windows11 WSL 22.04. <br>If you have any question, please contact us at [email protected]
- <a href="https://github.com/DeepThought-AI/Holmes/issues">Issue</a>
- <a href="https://github.com/DeepThought-AI/DeepBi/issues">Issue</a>

34 changes: 17 additions & 17 deletions README_CN.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<h1 align="center">Holmes</h1>
<h1 align="center">DeepBi</h1>

<div align="center">

Holmes是一款AI原生的数据分析平台。Holmes充分利用大语言模型的能力来探索、查询、可视化和共享来自任何数据源的数据。用户可以使用Holmes洞察数据并做出数据驱动的决策
DeepBi是一款AI原生的数据分析平台。DeepBi充分利用大语言模型的能力来探索、查询、可视化和共享来自任何数据源的数据。用户可以使用DeepBi洞察数据并做出数据驱动的决策


</div>
Expand All @@ -16,19 +16,19 @@ Holmes是一款AI原生的数据分析平台。Holmes充分利用大语言模型
开发:[email protected],工作及商务:[email protected]

<div style="display: flex; align-items: center;">
如果觉得 Holmes 对您有帮助的话,请帮忙<a style="display: flex; align-items: center;margin:0px 6px" target="_blank" href='https://github.com/DeepThought-AI/Holmes'></a>
的右上角点个⭐ Star 和 Fork,您的支持是 Holmes 变得更好最大的动力
如果觉得 DeepBi 对您有帮助的话,请帮忙<a style="display: flex; align-items: center;margin:0px 6px" target="_blank" href='https://github.com/DeepThought-AI/DeepBi'></a>
的右上角点个⭐ Star 和 Fork,您的支持是 DeepBi 变得更好最大的动力
</div>
</div>



## 案例视频

https://github.com/DeepThought-AI/Holmes/assets/151519374/f0d2fcd4-32b0-4095-a892-b9bbf8a51602
https://github.com/DeepThought-AI/DeepBi/assets/151519374/f0d2fcd4-32b0-4095-a892-b9bbf8a51602

## 使用说明
[Holmes 使用说明](client/app/assets/images/cn/user_manual_cn.md)
[DeepBi 使用说明](client/app/assets/images/cn/user_manual_cn.md)


## ✨ 特性
Expand All @@ -44,14 +44,14 @@ https://github.com/DeepThought-AI/Holmes/assets/151519374/f0d2fcd4-32b0-4095-a89

## 🚀 支持的数据库

Holmes 支持的数据库连接有:
DeepBi 支持的数据库连接有:
- MySQL
- PostgreSQL
- csv/Excel导入

## 📦 Docker 安装部署

按照 [使用 Docker 安装](Docker_install_CN.md) 中对应自己的系统操作步骤操作,最后获取Holmes网址,即可使用
按照 [使用 Docker 安装](Docker_install_CN.md) 中对应自己的系统操作步骤操作,最后获取DeepBi网址,即可使用

## 📦 Ubuntu 直接安装

Expand All @@ -61,27 +61,27 @@ Holmes 支持的数据库连接有:
1. redis 可以直接通过127.0.0.1,无密码命令行访问
2. python版本要求3.8+ 建议使用pyenv coda 等虚拟环境
3. postgresql 需要安装postgresql-16 版本
- 下载代码``` git clone [email protected]:DeepThought-AI/Holmes.git ```
- 下载代码``` git clone [email protected]:DeepThought-AI/DeepBi.git ```
- 直接运行 ```. ubuntu_CN_install.sh ```即可 <br>(注意,这里运行的是 . ubuntu_CN_install.sh 而不是sh xxx, 因为需要运行python 虚拟环境)
- 默认使用端口 8338 8339
- web访问: http://[ip]:8338
- 如果数据库或者redis本地已经安装,可以在.env 中修改
完成安装后, 请看上面的使用说明进行设置和使用
- 查看本机IP ```ifconfig | grep -Eo 'inet (addr:)?([0-9]*\.){3}[0-9]*' | grep -vE '^inet 127(\.[0-9]{1,3}){3}'```

## Holmes 命令
## DeepBi 命令

- 进入项目目录后运行命令:
```
docker-compose start # 启动Holmes 服务
docker-compose stop # 停止Holmes 服务
docker-compose ps # 查看 Holmes 服务
docker-compose start # 启动DeepBi 服务
docker-compose stop # 停止DeepBi 服务
docker-compose ps # 查看 DeepBi 服务
```
- 如果出现 ```... PermissionError ...``` 或者 ```... Permission denied ...``` 请在执行命令前 加sudo
```
sudo docker-compose start # 启动Holmes 服务
sudo docker-compose stop # 停止Holmes 服务
sudo docker-compose ps # 查看 Holmes 服务
sudo docker-compose start # 启动DeepBi 服务
sudo docker-compose stop # 停止DeepBi 服务
sudo docker-compose ps # 查看 DeepBi 服务
```


Expand All @@ -90,5 +90,5 @@ Holmes 支持的数据库连接有:
## 📑 文档
- 我们已经在 Mac OS 12.7/13.X /14.1.1 , Ubuntu 20.04/22.04 和 Windows11 WSL 22.04 系统测试。
<br> 如果有什么问题,可以联系我们 [email protected]
- <a href="https://github.com/DeepThought-AI/Holmes/issues">Issue</a>
- <a href="https://github.com/DeepThought-AI/DeepBi/issues">Issue</a>

8 changes: 4 additions & 4 deletions ai/backend/util/db/postgresql_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
import psycopg2

# 创建数据库连接引擎,URL 形式
HOLMES_DATABASE_URL = os.environ.get("HOLMES_DATABASE_URL", "postgresql://postgres@postgres/postgres")
print('HOLMES_DATABASE_URL : ', HOLMES_DATABASE_URL)
DEEPBI_DATABASE_URL = os.environ.get("DEEPBI_DATABASE_URL", "postgresql://postgres@postgres/postgres")
print('DEEPBI_DATABASE_URL : ', DEEPBI_DATABASE_URL)


class PsgReport:
def connect(self):
try:
conn = psycopg2.connect(HOLMES_DATABASE_URL)
conn = psycopg2.connect(DEEPBI_DATABASE_URL)
print("Connected to PostgreSQL database!")
return conn
except (Exception, psycopg2.Error) as error:
Expand Down Expand Up @@ -68,7 +68,7 @@ def update_data(self, data):

# 示例用法
if __name__ == "__main__":
HOLMES_DATABASE_URL = "postgresql://redash:[email protected]/redash"
DEEPBI_DATABASE_URL = "postgresql://redash:[email protected]/redash"
psg = PsgReport()
data = (0, 37)
re = psg.update_data(data)
Expand Down
Loading

0 comments on commit 8d8cc79

Please sign in to comment.