Skip to content

Commit 1b1b916

Browse files
authored
Merge pull request #15 from chatchat-space/dev
Dev
2 parents 45bb246 + a3f02b7 commit 1b1b916

File tree

89 files changed

+2975
-5379
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

89 files changed

+2975
-5379
lines changed

.github/workflows/docker-build.yaml

Lines changed: 144 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,144 @@
1+
name: docker-build
2+
on:
3+
push:
4+
branches:
5+
- master
6+
paths-ignore:
7+
- 'README.md'
8+
- 'README_en.md'
9+
- 'docs/**'
10+
- '.github/actions/**'
11+
- '.github/ISSUE_TEMPLATE/**'
12+
- 'docker/docker-compose.yaml'
13+
pull_request:
14+
branches:
15+
- master
16+
types:
17+
- closed
18+
paths-ignore:
19+
- 'README.md'
20+
- 'README_en.md'
21+
- 'docs/**'
22+
- '.github/actions/**'
23+
- '.github/ISSUE_TEMPLATE/**'
24+
- 'docker/docker-compose.yaml'
25+
env:
26+
TZ: Asia/Shanghai
27+
jobs:
28+
docker-build:
29+
runs-on: ubuntu-latest
30+
steps:
31+
- name: Optimize Disk Space
32+
uses: hugoalh/[email protected]
33+
with:
34+
operate_sudo: "True"
35+
general_include: ".+"
36+
general_exclude: |-
37+
^GCC$
38+
^G\+\+$
39+
Clang
40+
LLVM
41+
docker_include: ".+"
42+
docker_prune: "True"
43+
docker_clean: "True"
44+
apt_prune: "True"
45+
apt_clean: "True"
46+
homebrew_prune: "True"
47+
homebrew_clean: "True"
48+
npm_prune: "True"
49+
npm_clean: "True"
50+
os_swap: "True"
51+
- name: Remove Unnecessary Tools And Files
52+
env:
53+
DEBIAN_FRONTEND: noninteractive
54+
run: |
55+
sudo apt-get remove -y '^dotnet-.*' '^llvm-.*' 'php.*' azure-cli google-chrome-stable firefox powershell mono-devel
56+
sudo apt-get autoremove --purge -y
57+
sudo find /var/log -name "*.gz" -type f -delete
58+
sudo rm -rf /var/cache/apt/archives
59+
sudo rm -rf /tmp/*
60+
sudo rm -rf /etc/apt/sources.list.d/* /usr/share/dotnet /usr/local/lib/android /opt/ghc /etc/mysql /etc/php
61+
sudo -E apt-get -y purge azure-cli* docker* ghc* zulu* hhvm* llvm* firefox* google* dotnet* aspnetcore* powershell* openjdk* adoptopenjdk* mysql* php* mongodb* moby* snap* || true
62+
sudo rm -rf /etc/apt/sources.list.d/* /usr/local/lib/android /opt/ghc /usr/share/dotnet /usr/local/graalvm /usr/local/.ghcup \
63+
/usr/local/share/powershell /usr/local/share/chromium /usr/local/lib/node_modules
64+
sudo rm -rf /etc/apt/sources.list.d/* /usr/share/dotnet /usr/local/lib/android /opt/ghc /etc/mysql /etc/php
65+
sudo -E apt-get -y purge azure-cli* docker* ghc* zulu* hhvm* llvm* firefox* google* dotnet* aspnetcore* powershell* openjdk* adoptopenjdk* mysql* php* mongodb* moby* snap* || true
66+
sudo -E apt-get -qq update
67+
sudo -E apt-get -qq install libfuse-dev $(curl -fsSL git.io/depends-ubuntu-2204)
68+
sudo -E apt-get -qq autoremove --purge
69+
sudo -E apt-get -qq clean
70+
sudo apt-get clean
71+
rm -rf /opt/hostedtoolcache
72+
sudo timedatectl set-timezone "$TZ"
73+
- name: Free Up Disk Space
74+
uses: easimon/maximize-build-space@master
75+
with:
76+
root-reserve-mb: 20480 # 给 / 预留 20GiB 空间( docker 预留)
77+
swap-size-mb: 1
78+
remove-dotnet: 'true'
79+
remove-android: 'true'
80+
remove-haskell: 'true'
81+
remove-codeql: 'true'
82+
remove-docker-images: 'true'
83+
- name: Checkout Repository
84+
uses: actions/checkout@v4
85+
- name: Get Version
86+
id: version
87+
run: |
88+
VERSION=$(awk -F'"' '/__version__ =/ {print $2}' libs/chatchat-server/chatchat/__init__.py)
89+
echo "RELEASE_VERSION=$VERSION" >> $GITHUB_ENV
90+
- name: Set DockerImage Tag
91+
id: imageTag
92+
run: echo "image_tag=${RELEASE_VERSION}-$(git rev-parse --short HEAD)-$(date +%Y%m%d)" >> $GITHUB_ENV
93+
- name: Set Up QEMU
94+
uses: docker/setup-qemu-action@v2
95+
- name: Set Up Docker Buildx
96+
uses: docker/setup-buildx-action@v2
97+
- name: Login To Docker Hub
98+
uses: docker/login-action@v2
99+
with:
100+
username: ${{ secrets.DOCKERHUB_REGISTRY_USERNAME }}
101+
password: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }}
102+
- name: Login To Tencent CCR
103+
uses: docker/login-action@v2
104+
with:
105+
registry: ccr.ccs.tencentyun.com
106+
username: ${{ secrets.CCR_REGISTRY_USERNAME }}
107+
password: ${{ secrets.CCR_REGISTRY_PASSWORD }}
108+
- name: Show Runner Disk
109+
run: df -hT
110+
- name: Build and push Docker image
111+
uses: docker/build-push-action@v4
112+
with:
113+
context: ./docker
114+
file: ./docker/Dockerfile
115+
push: true
116+
tags: |
117+
chatimage/keng:${{ env.image_tag }}
118+
ccr.ccs.tencentyun.com/langchain-chatchat/keng:${{ env.image_tag }}
119+
platforms: |
120+
linux/amd64, linux/arm64
121+
- name: Logout from Docker Hub
122+
run: docker logout
123+
- name: Logout from Tencent Cloud Container Registry
124+
run: docker logout ccr.ccs.tencentyun.com
125+
- name: Update Doc and Create Pull Request
126+
run: |
127+
# 更新文件内容
128+
sed -i -E "s|chatimage/chatchat:[a-zA-Z0-9._-]+|chatimage/keng:${{ env.image_tag }}|g" README.md README_en.md docker/docker-compose.yaml
129+
sed -i -E "s|ccr.ccs.tencentyun.com/langchain-chatchat/keng:[a-zA-Z0-9._-]+|ccr.ccs.tencentyun.com/langchain-chatchat/keng:${{ env.image_tag }}|g" README.md README_en.md docker/docker-compose.yaml
130+
# 配置 Git 用户信息
131+
git config --local user.email "[email protected]"
132+
git config --local user.name "GitHub Action"
133+
# 创建新的分支
134+
git checkout -b update-docker-image-${{ env.image_tag }}
135+
# 提交更改
136+
git commit -am "feat: update docker image to ${{ env.image_tag }}"
137+
# 推送到新的分支
138+
git push origin update-docker-image-${{ env.image_tag }}
139+
# 安装 hub 命令行工具
140+
wget -qO- https://github.com/github/hub/releases/download/v2.14.2/hub-linux-amd64-2.14.2.tgz | tar xvz
141+
sudo ./hub-linux-amd64-2.14.2/install
142+
# 使用 hub 命令行工具创建 PR
143+
export GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}
144+
hub pull-request -b master -h update-docker-image-${{ env.image_tag }} -m "Update Docker image to ${{ env.image_tag }}" -l docker,automated-pr

README.md

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -349,23 +349,17 @@ docker pull ccr.ccs.tencentyun.com/langchain-chatchat/chatchat:0.3.1.3-93e2c87-2
349349

350350
🎉 Langchain-Chatchat 项目微信交流群,如果你也对本项目感兴趣,欢迎加入群聊参与讨论交流。
351351

352-
### 公众号
353-
354-
<img src="docs/img/official_wechat_mp_account.png" alt="二维码" width="300" />
355-
356-
🎉 Langchain-Chatchat 项目官方公众号,欢迎扫码关注。
357-
358352
## 引用
359353

360354
如果本项目有帮助到您的研究,请引用我们:
361355

362356
```
363-
@software{langchain_chatchat,
364-
title = {{langchain-chatchat}},
365-
author = {Liu, Qian and Song, Jinke, and Huang, Zhiguo, and Zhang, Yuxuan, and glide-the, and liunux4odoo},
357+
@software{langchain-chatchat/keng,
358+
title = {{langchain-chatchat/keng}},
359+
author = {Liu, Qian and Zhang, Yuehua, and Song, Jinke, and Huang, Zhiguo, and Zhang, Yuxuan, and glide-the, and liunux4odoo},
366360
year = 2024,
367361
journal = {GitHub repository},
368362
publisher = {GitHub},
369-
howpublished = {\url{https://github.com/chatchat-space/Langchain-Chatchat}}
363+
howpublished = {\url{https://github.com/chatchat-space/Keng}}
370364
}
371365
```

docker/Dockerfile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# 基础镜像
2-
FROM python:3.11
3-
LABEL maintainer=Langchain-Chatchat
2+
FROM python:3.12
3+
LABEL maintainer=yuehua-s
44
WORKDIR /root
55

66
# 环境变量
@@ -21,8 +21,8 @@ RUN pip install --index-url https://pypi.python.org/simple/ pipx && \
2121
# Add poetry to PATH
2222
ENV PATH="/root/.local/bin:${PATH}"
2323

24-
# 下载 Langchain-Chatchat
25-
RUN git clone https://github.com/chatchat-space/Langchain-Chatchat.git
24+
# 下载 Keng
25+
RUN git clone https://github.com/chatchat-space/Keng.git
2626

2727
# 安装依赖
2828
WORKDIR /root/Langchain-Chatchat/libs/chatchat-server

docs/contributing/README.md

Lines changed: 0 additions & 32 deletions
This file was deleted.

docs/contributing/agent.md

Lines changed: 0 additions & 132 deletions
This file was deleted.

0 commit comments

Comments
 (0)