Dify新版离线环境安装插件正确步骤-使用dify-plugin-repackaging
·
Dify新版离线环境安装插件正确步骤-使用dify-plugin-repackaging
背景
Dify离线环境中如果使用market市场插件下载后,导入安装,如果有的插件是依赖一些pip包,那么会卡住,安装失败。如果你使用docker logs -f plugin_daemon-1这个插件容器日志,会发现报错,安装依赖的报错信息。
core.plugin.impl.exc.PluginDaemonInternalServerError: PluginDaemonInternalServerError: no available node, plugin not found
等等错误信息
当前记录的版本是:Dify1.3.1
正确下载离线插件包安装
在有网络环境运行一个完整的dify
注意:
其中docker-compose up 之前 .env 配置中需要配置pip镜像地址,默认没配置
PIP_MIRROR_URL=https://pypi.tuna.tsinghua.edu.cn/simple
等下安装pip依赖包会用到
1. 下载dify-plugin-repackaging
链接地址:https://github.com/junjiem/dify-plugin-repackaging?tab=readme-ov-file。
下载后,unzip 解压
2. 准备环境
dify-plugin-repackagin代码拷贝到容器中,伪代码
docker cp ./dify-plugin-repackaging 容器:/app/
会拷贝到容器的/app目录下
将脚本:plugin_repackaging.sh中的install_unzip调用注释调,自己手动安装,它这个是centos的yum,这个容器是ubuntu的
repackage(){
local PACKAGE_PATH=$1
PACKAGE_NAME_WITH_EXTENSION=`basename ${PACKAGE_PATH}`
PACKAGE_NAME="${PACKAGE_NAME_WITH_EXTENSION%.*}"
echo "Unziping ..."
# install_unzip 注释掉,手动安装unzip
unzip -o ${PACKAGE_PATH} -d ${CURR_DIR}/${PACKAGE_NAME}
if [[ $? -ne 0 ]]; then
echo "Unzip failed."
exit 1
fi
手动安装unizp,稍微等等,有点慢
apt update
apt install unzip
3. 下载离线插件
到这里,你就可以下载真正的离线包了。下载下来带了pip的依赖包
下载命令请使用它的使用文档里边的:
如图:
4. 安装
安装的时候,请注意dify-plugin-repackaging文档中的需要修改.env配置
nginx的上传大小配置
允许安装非market市场的插件
等等
Update Dify platform env Dify平台放开限制
your .env configuration file: Change FORCE_VERIFYING_SIGNATURE to false , the Dify platform will allow the installation of all plugins that are not listed in the Dify Marketplace.
your .env configuration file: Change PLUGIN_MAX_PACKAGE_SIZE to 524288000 , and the Dify platform will allow the installation of plug-ins within 500M.
your .env configuration file: Change NGINX_CLIENT_MAX_BODY_SIZE to 500M , and the Nginx client will allow uploading content up to 500M in size.
在 .env 配置文件将 FORCE_VERIFYING_SIGNATURE 改为 false ,Dify 平台将允许安装所有未在 Dify Marketplace 上架(审核)的插件。
在 .env 配置文件将 PLUGIN_MAX_PACKAGE_SIZE 增大为 524288000,Dify 平台将允许安装 500M 大小以内的插件。
在 .env 配置文件将 NGINX_CLIENT_MAX_BODY_SIZE 增大为 500M,Nginx客户端将允许上传 500M 大小以内的内容。
更多推荐

所有评论(0)