<< 点击显示目录 >> 主页 exOS使用助手 > exOS Automation Help > Development > exOS Package > Deployment sequence |
部署序列 是作为 ExDeploy 库的后台进程启动的,它会连接到 Linux 目标机,以便
▪传输/删除文件
▪创建/删除服务
▪启动/停止服务
在这里, exOS 目标和所有引用 的exOS 组件 配置对象为部署序列创建指令。
▪只要 exOS 目标 或 exOS 组件 配置发生变化,或者要部署到系统的文件发生变化,部署序列就会重新启动。
有关部署输出的说明,请参阅 ExDeploy Logger。
当部署序列启动时,它会连接到 exos-服务器,并检查与目标系统相比,配置中是否有任何更改。
▪在 AR 初始启动时(冷启动/热启动后),目标系统上的所有组件都会重新启动( RestartEvent = Ignore的组件除外 )。
▪无论何时更改 exOS 目标机 配置,目标机上的所有组件都会重新启动(请参阅 下面的exos-data.conf 示例)
▪在所有其他情况下,只有在其他组件需要重启(通过 RestartEvent = Target)或 文件 被修改需要重启或重新安装(通过 ChangeEvent 配置 )组件时,才会重启 组件。
属于 exOS 组件的所有文件都要经过检查,以确定日期或大小是否发生变化。如果与目标文件存在差异,则会进行传输。
传输完所有文件后,将安装并启动发生变化的组件。在某些情况下,整个组件需要卸载、移除,然后重新安装。有时只需启动组件即可。除文件 更改事件 设置外 ,还适用以下规则:
▪如果只 更改了运行时 服务,则会移除并重新创建这些服务,然后重新启动组件。
1.停止所有先前配置的服务
2.执行当前配置的所有启动服务
3.启动当前配置的所有运行时服务
▪如果 更改了移除 服务,则只移除和重新创建这些服务脚本,组件不一定会重启。
▪如果 更改或添加了启动/安装 服务,则会重新安装整个组件。
1.停止所有先前配置的服务
2.执行所有先前配置的移除服务
3.执行所有当前配置的安装程序服务
4.执行所有当前配置的启动服务
5.启动当前配置的所有运行时服务
下面通过一个简单的示例解释部署机制。
一个脚本文件被修改 ,例如types.py ,它是 exOS 组件 "Types "的一部分。
▪从 AS 成功转移后,部署序列重新启动,并读取所有 exostarget、 exoscomponent 指令
▪types.py 需要通过 ChangeEvent=Restart重新启动
▪类型 "组件被停止
▪types.py 将转移到 Linux
▪ 为 "类型 "组件运行启动 脚本(例如,将 types.py 复制到 /home/user/types)
▪ 启动"类型 "运行时服务
如果 要更改exostarget 配置(例如更改日志级别),则要更改数据连接配置
▪数据连接配置文件 exos-data.conf 使用 ChangeEvent=Restart 而数据连接组件 使用RestartEvent=Target
▪数据连接组件与所有其他组件一起停止(它强制执行目标重启)
▪更改后的文件(本例中为 exos-data.conf)将被传输到 Linux中
▪ 运行 启动 脚本(在本例中 ,它会将/opt/exos/exos-api.conf 复制到 /etc/中)
▪运行之前停止的所有组件的启动脚本
▪ 启动数据连接的所有 运行时服务
▪在 Linux 和 AR 上启动数据连接(读取新的日志级别)
▪启动超时后 , 启动之前停止的所有其他组件的所有运行时服务
The deployment sequence is started as a background process of the ExDeploy library, where it connects to the Linux target, in order to
•transfer / delete files
•create / delete services
•start / stop services
Here, the exOS Target- and all referenced exOS Components configuration objects create the instructions for the deployment sequence.
•Whenever an exOS Target or exOS Component configuration changes, or there are changes in the files that are to be deployed to the system, the deployment sequence restarts.
For a description of the deployment output, see ExDeploy Logger.
When the deployment sequence starts, it will connect to the exos-server, and check if there are any changes in the configuration compared to the target system.
•At the initial start of AR (after a cold/warmstart), all components on the target are restarted (except the ones with the RestartEvent = Ignore).
•Whenever a change in the exOS Target configuration is made, all components on the target are restarted (see the exos-data.conf example below)
•In all other cases, components are only restarted if other components require restart (via the RestartEvent = Target) or if a File is modified which requires a restart or reinstallation (configured via the ChangeEvent) of the component.
All files that belong to exOS components are checked for changes in date or size. The are transferred, if there are differences towards the file on the target.
After having transferred all files, the components that have changed are installed and started up. In some cases the complete component needs to be uninstalled, removed, and then reinstalled. Sometimes the component will just be started. Additional to the File ChangeEvent settings, following rules apply:
•If only Runtime services are changed, then these services are removed and recreated, and the component restarts.
1.Stop all previously configured services
2.Execute all currently configured startup services
3.Start all currently configured runtime services
•If Remove services are changed, then only these service scripts are removed and recreated, the component does not necessarily restart.
•If Startup/Install services are changed or added, the complete component is reinstalled.
1.Stop all previously configured services
2.Execute all previously configured removal services
3.Execute all currently configured installer services
4.Execute all currently configured startup services
5.Start all currently configured runtime services
The following explains the deployment mechanism via a simple example.
A script file is changed, for example types.py which is part of an exOS component "Types".
•After a successful transfer from AS, the deplopyment sequence restarts, and reads all exostarget, exoscomponent instructions
•The types.py requires a restart via the ChangeEvent=Restart
•The "Types" component is stopped
•types.py will be transferred to Linux
•The Startup scripts are run for the "Types" component (for example copying types.py to /home/user/types)
•The "Types" Runtime services are started
If a change in the exostarget configuration is made (for example, changing the log level), the data-connection configuration is changed
•The data-connection configuration file exos-data.conf uses ChangeEvent=Restart and the data-connection component uses RestartEvent=Target
•The data-connection component is stopped together with all other components (it enforces a target restart)
•The changed files (in this case exos-data.conf) will be transferred to Linux
•The Startup scripts are run (in this case it copies /opt/exos/exos-api.conf to /etc/)
•All components previously stopped, run their startup scripts
•All Runtime services of the data-connection are started
•Data connection is started on Linux and AR (reading the new log level)
•After the StartupTimeout, all Runtime services from all other components previously stopped, are started