fix(fnos): FPK 部署禁止无效内置在线升级,修复原生版启动加载 common.sh - #446
Merged
jubaoliang merged 7 commits intoAug 27, 2026
Conversation
- fnos-build-fpk.yml / fnos/README.md / fnos/docker/Dockerfile / docker-compose.yaml / manifest 的镜像引用从 ghcr.io/TencentCloud/octop 改为 ghcr.io/jubaoliang/octop(Docker 仓库名必须小写,原大写 T 的 tag 无法通过 buildx) - workflow 镜像 tags 增加 ghcr.io/jubaoliang/octop:latest(Docker 版 FPK 的 docker-compose 按 :latest 拉取,此前只推 :vanilla 会导致飞牛拉不到镜像)
根据反馈,镜像仓库位于 hub.docker.com: - 镜像名从 ghcr.io/jubaoliang/octop 改为 jubaoliang/octop(docker pull jubaoliang/octop 无前缀即 Docker Hub) - workflow 登录从 GHCR/GITHUB_TOKEN 改为 Docker Hub 的 DOCKERHUB_USERNAME/DOCKERHUB_TOKEN(与 docker-publish.yml 同一套凭据)
- self_update.py:run_upgrade() 检测到 OCTOP_INSTALL_MODE=fpk-* 时直接返回失败并提示 经飞牛应用中心安装新版 FPK 完成升级。FPK 部署下在线安装到系统 Python 的版本 永远不会被 launcher 加载(PYTHONPATH 指向应用中心托管的 site-packages), 重启后仍是旧版且界面提示成功,升级形同虚设。 - fnos/native launcher(octop/octop-cli):设置 OCTOP_INSTALL_MODE=fpk-native 触发守卫; 并补充 common.sh 回退路径 /var/apps/octop-native/cmd/common.sh——FPK 解包后 cmd/ 落在 管理目录,$0/../cmd 指向载荷内不存在的位置,原 launcher 会因 find_python312 未定义 而启动失败(0.9.27 原生版复现)。 - fnos/docker compose:注入 OCTOP_INSTALL_MODE=fpk-docker,容器内同样禁止无效在线升级, 应用中心更新 FPK 时会重新拉取镜像。
上一版把 FPK 部署下的内置在线升级直接禁止,体验不可接受(发现新版本却无法 一键升级)。重新实现: - self_update.py:OCTOP_FPK_SITE_PACKAGES 非空时走 _run_fpk_upgrade(),用 pip install --target 把新版安装到 launcher 通过 PYTHONPATH 实际加载的打包 site-packages,重启服务后即加载新版;此前安装到系统 Python 的版本永远不会 被加载,导致「升级成功但重启无效」。 - fnos/native launcher(octop/octop-cli):导出 OCTOP_FPK_SITE_PACKAGES 指向打包 目录;octop-cli 在 sudo -u octop-native 时透传该变量与 OCTOP_INSTALL_MODE。 - compose:移除上一版的 OCTOP_INSTALL_MODE=fpk-docker(Docker 版在线升级本就 安装到容器内环境、重启容器生效,无需 FPK 分支,不应被禁止)。
上一版把 FPK 部署下的内置在线升级直接禁止,体验不可接受(发现新版本却无法 一键升级)。重新实现: - self_update.py:OCTOP_FPK_SITE_PACKAGES 非空时走 _run_fpk_upgrade(),用 pip install --target 把新版安装到 launcher 通过 PYTHONPATH 实际加载的打包 site-packages,重启服务后即加载新版;此前安装到系统 Python 的版本永远不会 被加载,导致「升级成功但重启无效」。 - fnos/native launcher(octop/octop-cli):导出 OCTOP_FPK_SITE_PACKAGES 指向打包 目录;octop-cli 在 sudo -u octop-native 时透传该变量与 OCTOP_INSTALL_MODE。 - compose:移除上一版的 OCTOP_INSTALL_MODE=fpk-docker(Docker 版在线升级本就 安装到容器内环境、重启容器生效,无需 FPK 分支,不应被禁止)。
上一版把 FPK 部署下的内置在线升级直接禁止,体验不可接受(发现新版本却无法 一键升级)。重新实现: - self_update.py:OCTOP_FPK_SITE_PACKAGES 非空时走 _run_fpk_upgrade(),用 pip install --target 把新版安装到 launcher 通过 PYTHONPATH 实际加载的打包 site-packages,重启服务后即加载新版;此前安装到系统 Python 的版本永远不会 被加载,导致「升级成功但重启无效」。 - fnos/native launcher(octop/octop-cli):导出 OCTOP_FPK_SITE_PACKAGES 指向打包 目录;octop-cli 在 sudo -u octop-native 时透传该变量与 OCTOP_INSTALL_MODE。 - compose:移除上一版的 OCTOP_INSTALL_MODE=fpk-docker(Docker 版在线升级本就 安装到容器内环境、重启容器生效,无需 FPK 分支,不应被禁止)。
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
背景
飞牛(FnOS)上发现新版本后,在应用内点击「立即升级」,重启服务不生效。
根因
octop update/ 面板「立即升级」把新版安装到系统 Python 或 venv,launcher 从不加载该位置;修复
src/octop/infra/setup/self_update.py:run_upgrade()检测到OCTOP_INSTALL_MODE=fpk-*时直接返回失败,给出中文提示「请在飞牛应用中心检查并安装新版 FPK 完成升级」;非 FPK 部署(环境变量为空)行为完全不变,仍可正常在线升级。fnos/native/app/bin/octop+octop-cli:OCTOP_INSTALL_MODE=fpk-native触发守卫;common.sh回退路径/var/apps/octop-native/cmd/common.sh:FPK 解包后 cmd/ 落在管理目录,$0/../cmd指向载荷内不存在的位置,原 launcher 会因find_python312未定义而启动失败(0.9.27 原生版复现)。fnos/docker/app/docker/docker-compose.yaml:注入OCTOP_INSTALL_MODE=fpk-docker,容器内同样禁止无效在线升级;应用中心更新 FPK 时会重新拉取镜像。说明
OCTOP_INSTALL_MODE以fpk开头时生效,普通 pip 安装 / Docker 直跑(不设该变量)不受影响。