-
Notifications
You must be signed in to change notification settings - Fork 692
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
39 changed files
with
1,926 additions
and
386 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
name: Build Base Image | ||
on: | ||
push: | ||
branches: | ||
- 'update_base_image**' | ||
jobs: | ||
build_base: | ||
name: Build Base | ||
runs-on: ubuntu-latest | ||
steps: | ||
- | ||
name: Checkout | ||
uses: actions/checkout@v3 | ||
- | ||
name: Set up QEMU | ||
uses: docker/setup-qemu-action@v2 | ||
- | ||
name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
- | ||
name: Login to Docker Hub | ||
uses: docker/login-action@v2 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
- | ||
name: Get current date | ||
id: date | ||
run: echo "::set-output name=today::$(date +'%Y-%m-%d')" | ||
- | ||
name: Build and push | ||
uses: docker/build-push-action@v4 | ||
with: | ||
context: . | ||
file: docker_compose_deploy/loonflow-base/Dockerfile | ||
platforms: linux/amd64 | ||
push: true | ||
tags: blackholll/loonflow-base:latest,blackholll/loonflow-base:${{ steps.date.outputs.today }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
name: Build Task Image | ||
on: | ||
push: | ||
tags: | ||
- 'r**' | ||
jobs: | ||
build_task: | ||
name: Build Task | ||
runs-on: ubuntu-latest | ||
steps: | ||
- | ||
name: Checkout | ||
uses: actions/checkout@v3 | ||
- | ||
name: Set up QEMU | ||
uses: docker/setup-qemu-action@v2 | ||
- | ||
name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
- | ||
name: Login to Docker Hub | ||
uses: docker/login-action@v2 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
- | ||
name: Build and push | ||
uses: docker/build-push-action@v4 | ||
with: | ||
context: . | ||
file: docker_compose_deploy/loonflow-task/Dockerfile | ||
platforms: linux/amd64 | ||
push: true | ||
tags: blackholll/loonflow-task:latest,blackholll/loonflow-task:${{ github.ref_name }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
name: Build Web Image | ||
on: | ||
push: | ||
tags: | ||
- 'r**' | ||
jobs: | ||
build_web: | ||
name: Build Web | ||
runs-on: ubuntu-latest | ||
steps: | ||
- | ||
name: Checkout | ||
uses: actions/checkout@v3 | ||
- | ||
name: Set up QEMU | ||
uses: docker/setup-qemu-action@v2 | ||
- | ||
name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
- | ||
name: Login to Docker Hub | ||
uses: docker/login-action@v2 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
- | ||
name: Build and push | ||
uses: docker/build-push-action@v4 | ||
with: | ||
context: . | ||
file: docker_compose_deploy/loonflow-web/Dockerfile | ||
platforms: linux/amd64 | ||
push: true | ||
tags: blackholll/loonflow-web:latest,blackholll/loonflow-web:${{ github.ref_name }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,51 @@ | ||
|
||
为了方便的数据的持久化以及升级操作,本部署方案需要使用外部数据库(mysql),请事先准备好数据库 | ||
|
||
|
||
# 准备工作 | ||
- 准备一台linux系统(建议centos7)的服务器,需要4G以上内存(因为编译前端比较需要内存) | ||
- 准备一台linux系统(建议centos7)的服务器,建议4G以上内存 | ||
- 安装好python3(请自行百度或者google) | ||
- 安装好docker-compose(请自行百度或者google) | ||
- 配置容器镜像加速(请自行百度或者google) | ||
- 准备好数据库,并授予权限 | ||
|
||
# 部署及启动服务 | ||
## 使用容器mysql | ||
``` | ||
# 启动服务 | ||
cd docker_compose_deploy | ||
docker compose -f docker-compse.yml up -d | ||
# 停止服务 | ||
docker compose -f docker-compse.yml stop | ||
``` | ||
|
||
## 使用自己的mysql | ||
|
||
``` | ||
# 进入mysql后创建数据库并授权 | ||
mysql> create database loonflow character set utf8mb4; # 注意要使用utf8mb4字符集 | ||
mysql> grant all privileges on loonflow.* to loonflow@'%' identified by '123456'; | ||
``` | ||
- 修改run.py中相关配置 | ||
``` | ||
db_host = '' # loonflow使用的数据库的ip | ||
db_port = '' # loonflow使用的数据库的端口 | ||
db_name = '' # loonflow使用的数据库的名称 | ||
db_user = '' # loonflow使用的数据库的用户 | ||
db_password = '' # loonflow使用的数据库的用户密码 | ||
# 移除及更新docker-compose.yml中mysql相关配置 | ||
移除loonflow-mysql服务 | ||
移除loonflow-task和loonflow-web服务中depends_on的oonflow-mysql | ||
修改loonflow-task和loonflow-web服务中的mysql地址、用户、密码 | ||
ddl_db_user = '' # 可以执行ddl(拥有修改表结构权限)的用户 | ||
ddl_db_password = '' # 可以执行ddl(拥有修改表结构权限)的用户的密码 | ||
# 启动服务 | ||
cd docker_compose_deploy | ||
docker compose -f docker-compse.yml up -d | ||
# 停止服务 | ||
docker compose -f docker-compse.yml stop | ||
``` | ||
|
||
# 常见问题 | ||
- 如何修改mysql的密码 | ||
|
||
#### 启动方式 | ||
cd 到 docker_compose_deploy目录后,执行以下命令 | ||
容器mysql服务的root密码:docker_compose_deploy/docker-compose.yml中MYSQL_ROOT_PASSWORD(需要第一次启动服务之前修改) | ||
|
||
``` | ||
# 安装并启动服务 | ||
python3 run.py install # 此命令后修改dockerfile中的数据库配置,然后启动 | ||
容器mysql服务loonflow的密码: docker_compose_deploy/loonflow-mysql/init/create_database.sql(需要第一次启动服务之前修改) | ||
|
||
# 启动服务 | ||
python3 run.py start # 此命令直接启动服务,请保证之前install过(也就是dockerfile中数据库配置已被修改) | ||
- 如何修改redis的密码 | ||
|
||
# 停止服务, 这种方式对于celery task任务非优雅停止,可以使用flower(celery的监控系统),将任务消费停止,并且等待所有任务都结束后再执行 | ||
python3 run.py stop | ||
``` | ||
docker_compose_deploy/docker-compose.yml中loonflow-redis中requirepass及其他服务环境变量中的密码 | ||
|
||
- 支持ARM架构下docker方式启动么 | ||
|
||
开发环境直参考https://loonflow.readthedocs.io 直接启动. 生成环境别折腾了,找个linux服务器吧 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
FROM centos:7 | ||
LABEL [email protected] | ||
|
||
RUN mkdir -p /var/log/loonflow & \ | ||
yum install -y wget make mysql-devel gcc gcc-devel python3-devel mysql-devel zlib-devel openssl-devel git automake libtool libffi-devel | ||
|
||
WORKDIR /tmp | ||
|
||
RUN wget http://www.openssl.org/source/openssl-1.1.1q.tar.gz --no-check-certificate | ||
RUN tar -zxvf openssl-1.1.1q.tar.gz | ||
RUN cd openssl-1.1.1q && ./config shared --openssldir=/usr/local/openssl --prefix=/usr/local/openssl \ | ||
&& make && make install \ | ||
&& echo "/usr/local/lib64/" >> /etc/ld.so.conf \ | ||
&& echo "/usr/local/openssl/lib" >> /etc/ld.so.conf \ | ||
&& ldconfig \ | ||
&& ln -s /usr/local/openssl/bin/openssl /usr/bin/openssl \ | ||
&& ln -s /usr/local/openssl/include/openssl /usr/include/openssl | ||
|
||
|
||
RUN wget https://www.python.org/ftp/python/3.10.9/Python-3.10.9.tgz | ||
RUN tar zxvf Python-3.10.9.tgz | ||
RUN cd Python-3.10.9 && ./configure --with-openssl=/usr/local/openssl --enable-optimizations && make altinstall | ||
|
||
|
||
RUN wget http://nginx.org/download/nginx-1.22.1.tar.gz --no-check-certificate | ||
RUN tar zxvf nginx-1.22.1.tar.gz | ||
RUN sed -i "s/\/.openssl//g" /tmp/nginx-1.22.1/auto/lib/openssl/conf | ||
RUN cd nginx-1.22.1 && ./configure --with-openssl=/usr/local/openssl --with-http_stub_status_module --with-http_ssl_module && make && make install | ||
|
||
WORKDIR /opt | ||
RUN wget -c https://nodejs.org/download/release/v14.3.0/node-v14.3.0-linux-x64.tar.xz --no-check-certificate | ||
RUN tar -xvf node-v14.3.0-linux-x64.tar.xz | ||
RUN mv node-v14.3.0-linux-x64 nodejs | ||
RUN ln -s /opt/nodejs/bin/node /usr/local/bin/node | ||
RUN ln -s /opt/nodejs/bin/npm /usr/local/bin/npm |
Oops, something went wrong.