eclipse/che-plugin-broker本仓库包含多个Che插件Broker的实现,主要用于Eclipse Che环境中插件的生命周期管理。这些Broker负责插件的下载、解析、配置评估、依赖处理及部署协调,确保插件在Che工作空间中正确集成(如部署至sidecar容器或本地目录),是Che插件生态的核心组件。
che-plugin.yaml的配置,结合工作目录(或通过参数指定路径)下config.json(包含插件/编辑器元数据meta.yaml信息),评估Che工作空间sidecar配置。dependencies.yaml中指定的依赖文件/目录至目标位置。.theia格式的插件归档文件,支持Theia插件在Che工作空间中的本地或远程部署,具体流程:
.theia归档解压至临时目录。package.json:
{"engines.cheRuntimeContainer"}字段,则以此值作为远程插件sidecar的容器镜像;若缺失或为空,则判定为非远程插件。.theia文件复制至/plugins/目录。.theia目录复制至/plugins/目录,并生成sidecar配置,包括:
port<port>的端点。THEIA_PLUGIN_REMOTE_ENDPOINT_<plugin_publisher_and_name>(值为ws://port<port>:<port>,其中<plugin_publisher_and_name>取自package.json)。THEIA_PLUGIN_ENDPOINT_PORT(值为分配的端口)。/plugins/目录内容,确保插件目录初始状态一致。| Broker类型 | 参数说明 | 示例值 |
|---|---|---|
| che-plugin-broker | config.json文件路径(通过Broker参数指定) | --config-path /custom/config.json |
| theia-plugin-broker | 远程插件端口范围 | 4000-6000(默认) |
| 环境变量名称格式 | 作用域 | 说明 |
|---|---|---|
THEIA_PLUGIN_REMOTE_ENDPOINT_<plugin_publisher_and_name> | 工作空间级 | 远程插件WebSocket端点地址,格式为ws://port<port>:<port> |
THEIA_PLUGIN_ENDPOINT_PORT | sidecar级 | 远程插件sidecar内部使用的端口号 |
init-plugin-broker清理/plugins/。
shelldocker run --rm -v /path/to/plugins:/plugins eclipse/init-plugin-broker:latest
che-plugin-broker处理tar.gz插件包。
shelldocker run --rm -v /path/to/plugins:/plugins -v /path/to/config:/config \ eclipse/che-plugin-broker:latest --config-path /config/config.json
theia-plugin-broker处理.theia插件包。
shelldocker run --rm -v /path/to/plugins:/plugins -v /path/to/theia-archive:/archive \ eclipse/theia-plugin-broker:latest /archive/plugin.theia
shellCGO_ENABLED=0 GOOS=linux go build -a -ldflags '-w -s' -a -installsuffix cgo ./...
shellCGO_ENABLED=0 GOOS=linux go build -a -ldflags '-w -s' -a -installsuffix cgo -o che-plugin-broker brokers/che-plugin-broker/main.go
shellCGO_ENABLED=0 GOOS=linux go build -a -ldflags '-w -s' -a -installsuffix cgo -o theia-plugin-broker brokers/theia-plugin-broker/main.go
shellCGO_ENABLED=0 GOOS=linux go build -a -ldflags '-w -s' -a -installsuffix cgo -o init-plugin-broker brokers/init/main.go
shellgo test -v -race ./...
shellgolangci-lint run -v
shelldocker build -f Dockerfile.CI .
vendor目录和依赖锁文件,并提交变更:
shelldep ensure
dep ensure不会自动修改Gopkg.toml(依赖约束文件),需手动更新以反映依赖变更。shelldocker build -t eclipse/che-plugin-broker:latest -f Dockerfile.cpb .
shelldocker build -t eclipse/theia-plugin-broker:latest -f Dockerfile.tpb .
shelldocker build -t eclipse/init-plugin-broker:latest -f Dockerfile.ipb .
manifest unknown 错误
TLS 证书验证失败
DNS 解析超时
410 错误:版本过低
402 错误:流量耗尽
身份认证失败错误
429 限流错误
凭证保存错误
来自真实用户的反馈,见证轩辕镜像的优质服务