Skip to content

Commit 28e2b9b

Browse files
author
yuehuazhang
committed
feature:Init LangGraph-Chatchat.
0 parents  commit 28e2b9b

File tree

229 files changed

+2329435
-0
lines changed

Some content is hidden

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

229 files changed

+2329435
-0
lines changed

.github/workflows/docker-build.yaml

Lines changed: 143 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,143 @@
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: 30720 # 给 / 预留 30GiB 空间( 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: ${{ vars.DOCKER_HUB_USERNAME }}
101+
password: ${{ secrets.DOCKER_HUB_SECRET }}
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+
chatchatspace/langgraph-chatchat:${{ env.image_tag }}
118+
platforms: |
119+
linux/amd64, linux/arm64
120+
- name: Logout from Docker Hub
121+
run: docker logout
122+
- name: Logout from Tencent Cloud Container Registry
123+
run: docker logout ccr.ccs.tencentyun.com
124+
- name: Update Doc and Create Pull Request
125+
run: |
126+
# 更新文件内容
127+
sed -i -E "s|chatchatspace/langgraph-chatchat:[a-zA-Z0-9._-]+|chatchatspace/langgraph-chatchat:${{ env.image_tag }}|g" README.md README_en.md docker/docker-compose.yaml
128+
# sed -i -E "s|ccr.ccs.tencentyun.com/langchain-chatchat/langgraph-chatchat:[a-zA-Z0-9._-]+|ccr.ccs.tencentyun.com/langchain-chatchat/keng:${{ env.image_tag }}|g" README.md README_en.md docker/docker-compose.yaml
129+
# 配置 Git 用户信息
130+
git config --local user.email "[email protected]"
131+
git config --local user.name "GitHub Action"
132+
# 创建新的分支
133+
git checkout -b update-docker-image-${{ env.image_tag }}
134+
# 提交更改
135+
git commit -am "feat: update docker image to ${{ env.image_tag }}"
136+
# 推送到新的分支
137+
git push origin update-docker-image-${{ env.image_tag }}
138+
# 安装 hub 命令行工具
139+
wget -qO- https://github.com/github/hub/releases/download/v2.14.2/hub-linux-amd64-2.14.2.tgz | tar xvz
140+
sudo ./hub-linux-amd64-2.14.2/install
141+
# 使用 hub 命令行工具创建 PR
142+
export GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}
143+
hub pull-request -b master -h update-docker-image-${{ env.image_tag }} -m "Update Docker image to ${{ env.image_tag }}" -l docker,automated-pr

.gitignore

Lines changed: 163 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,163 @@
1+
# Byte-compiled / optimized / DLL files
2+
__pycache__/
3+
*.py[cod]
4+
*$py.class
5+
6+
# C extensions
7+
*.so
8+
9+
# Distribution / packaging
10+
.Python
11+
build/
12+
develop-eggs/
13+
dist/
14+
downloads/
15+
eggs/
16+
.eggs/
17+
lib/
18+
lib64/
19+
parts/
20+
sdist/
21+
var/
22+
wheels/
23+
share/python-wheels/
24+
*.egg-info/
25+
.installed.cfg
26+
*.egg
27+
MANIFEST
28+
29+
# PyInstaller
30+
# Usually these files are written by a python script from a template
31+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
32+
*.manifest
33+
*.spec
34+
35+
# Installer logs
36+
pip-log.txt
37+
pip-delete-this-directory.txt
38+
39+
# Unit test / coverage reports
40+
htmlcov/
41+
.tox/
42+
.nox/
43+
.coverage
44+
.coverage.*
45+
.cache
46+
nosetests.xml
47+
coverage.xml
48+
*.cover
49+
*.py,cover
50+
.hypothesis/
51+
.pytest_cache/
52+
cover/
53+
54+
# Translations
55+
*.mo
56+
*.pot
57+
58+
# Django stuff:
59+
*.log
60+
local_settings.py
61+
db.sqlite3
62+
db.sqlite3-journal
63+
64+
# Flask stuff:
65+
instance/
66+
.webassets-cache
67+
68+
# Scrapy stuff:
69+
.scrapy
70+
71+
# Sphinx documentation
72+
docs/_build/
73+
74+
# PyBuilder
75+
.pybuilder/
76+
target/
77+
78+
# Jupyter Notebook
79+
.ipynb_checkpoints
80+
81+
# IPython
82+
profile_default/
83+
ipython_config.py
84+
85+
# pyenv
86+
# For a library or package, you might want to ignore these files since the code is
87+
# intended to run in multiple environments; otherwise, check them in:
88+
# .python-version
89+
90+
# pipenv
91+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
92+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
93+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
94+
# install all needed dependencies.
95+
#Pipfile.lock
96+
97+
# poetry
98+
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
99+
# This is especially recommended for binary packages to ensure reproducibility, and is more
100+
# commonly ignored for libraries.
101+
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
102+
#poetry.lock
103+
104+
# pdm
105+
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
106+
#pdm.lock
107+
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
108+
# in version control.
109+
# https://pdm.fming.dev/latest/usage/project/#working-with-version-control
110+
.pdm.toml
111+
.pdm-python
112+
.pdm-build/
113+
114+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
115+
__pypackages__/
116+
117+
# Celery stuff
118+
celerybeat-schedule
119+
celerybeat.pid
120+
121+
# SageMath parsed files
122+
*.sage.py
123+
124+
# Environments
125+
.env
126+
.venv
127+
env/
128+
venv/
129+
ENV/
130+
env.bak/
131+
venv.bak/
132+
133+
# Spyder project settings
134+
.spyderproject
135+
.spyproject
136+
137+
# Rope project settings
138+
.ropeproject
139+
140+
# mkdocs documentation
141+
/site
142+
143+
# mypy
144+
.mypy_cache/
145+
.dmypy.json
146+
dmypy.json
147+
148+
# Pyre type checker
149+
.pyre/
150+
151+
# pytype static type analyzer
152+
.pytype/
153+
154+
# Cython debug symbols
155+
cython_debug/
156+
157+
# PyCharm
158+
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
159+
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
160+
# and can be added to the global gitignore or merged into this file. For a more nuclear
161+
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
162+
.idea/
163+
langgraph.json

0 commit comments

Comments
 (0)