diff --git a/OmniVirt-MacOS.spec b/EulerLauncher-MacOS.spec similarity index 73% rename from OmniVirt-MacOS.spec rename to EulerLauncher-MacOS.spec index 12a5e6107cc60713cdc3f5876a71d7d687391a6f..758124f0e2169535f8dc32f5f0c8415eb20d7381 100644 --- a/OmniVirt-MacOS.spec +++ b/EulerLauncher-MacOS.spec @@ -5,10 +5,10 @@ block_cipher = None a = Analysis( - ['omnivirt/macos-gui.py'], + ['eulerlauncher/macos-gui.py'], pathex=[], - binaries=[('dist/OmniVirtd', './bin')], - datas=[('etc/omnivirt.conf', './etc'), ('etc/images/favicon.png', './etc'), ('resources/qemu/edk2-aarch64-code.fd', './etc'), ('resources/qemu/edk2-x86_64-code.fd', './etc')], + binaries=[('dist/EulerLauncherd', './bin')], + datas=[('etc/eulerlauncher.conf', './etc'), ('etc/images/favicon.png', './etc'), ('resources/qemu/edk2-aarch64-code.fd', './etc'), ('resources/qemu/edk2-x86_64-code.fd', './etc')], hiddenimports=[], hookspath=[], hooksconfig={}, @@ -28,7 +28,7 @@ exe = EXE( a.zipfiles, a.datas, [], - name='OmniVirt', + name='EulerLauncher', debug=False, bootloader_ignore_signals=False, strip=False, @@ -46,7 +46,7 @@ exe = EXE( ) app = BUNDLE( exe, - name='OmniVirt.app', + name='EulerLauncher.app', icon='etc/images/favicon.ico', bundle_identifier=None, ) diff --git a/OmniVirtd-Mac.spec b/EulerLauncherd-Mac.spec similarity index 91% rename from OmniVirtd-Mac.spec rename to EulerLauncherd-Mac.spec index 3a8748b2e3f00adb0942f8a96cfbcc92ae4d44c0..f6cc3726b7cdd936cd547671e63d28c04942708b 100644 --- a/OmniVirtd-Mac.spec +++ b/EulerLauncherd-Mac.spec @@ -5,7 +5,7 @@ block_cipher = None a = Analysis( - ['omnivirt/omnivirtd.py'], + ['eulerlauncher/eulerlauncherd.py'], pathex=[], binaries=[], datas=[], @@ -28,7 +28,7 @@ exe = EXE( a.zipfiles, a.datas, [], - name='OmniVirtd', + name='EulerLauncherd', debug=False, bootloader_ignore_signals=False, strip=False, diff --git a/cli.spec b/cli.spec index bfaf66db082b0bba4cfc518da6555f5f396e1c21..574d7c73137d1d18af49608ff0e2c8d02889de31 100644 --- a/cli.spec +++ b/cli.spec @@ -5,7 +5,7 @@ block_cipher = None a = Analysis( - ['omnivirt/cli.py'], + ['eulerlauncher/cli.py'], pathex=[], binaries=[], datas=[], @@ -28,7 +28,7 @@ exe = EXE( a.zipfiles, a.datas, [], - name='omnivirt', + name='eulerlauncher', debug=False, bootloader_ignore_signals=False, strip=False, diff --git a/docs/developer-manual.md b/docs/developer-manual.md index 86c398e43e68ad2007e3e091197ec113ec265473..89e4eea6120754561c40c76713ffeb18506343b7 100644 --- a/docs/developer-manual.md +++ b/docs/developer-manual.md @@ -46,25 +46,25 @@ pip3 install -r requirements.txt EulerLauncher可执行文件包括以下几个部分: -1. EulerLauncherd: omnivirt守护进程,以root权限运行在后台,与调用虚拟化组件(Qemu、HyperV、KVM等)及镜像组件进行相关操作; -2. EulerLauncher.app: OmniVirt服务端主程序,将omnivirtd及其他相关程序、数据、文件等打包为MacOS APP软件包,便于分发和使用。 -3. EulerLauncher: MacOS可执行文件,OmniVirt客户端CLI工具,用于与服务端交互。 -4. install: MacOS可执行文件,将OmniVirt运行所需配置文件及相关数据文件安装至`Application Support`文件夹。 +1. EulerLauncherd: EulerLauncher守护进程,以root权限运行在后台,与调用虚拟化组件(Qemu、HyperV、KVM等)及镜像组件进行相关操作; +2. EulerLauncher.app: EulerLauncher服务端主程序,将EulerLauncher及其他相关程序、数据、文件等打包为MacOS APP软件包,便于分发和使用。 +3. EulerLauncher: MacOS可执行文件,EulerLauncher客户端CLI工具,用于与服务端交互。 +4. install: MacOS可执行文件,将EulerLauncher运行所需配置文件及相关数据文件安装至`Application Support`文件夹。 由于`EulerLauncher.app`对`EulerLauncherd`有依赖关系,请严格按照以下顺序构建`EulerLauncherd`及`EulerLauncher.app`: 1. EulerLauncherd: - 项目源码中已包含用于构建OmniVirtd的Spec脚本`OmniVirtd-Mac.spec`, 若非必要,请勿修改该文件,使用一下命令开始构建: + 项目源码中已包含用于构建EulerLauncherd的Spec脚本`EulerLauncherd-Mac.spec`, 若非必要,请勿修改该文件,使用一下命令开始构建: ``` Shell - pyinstaller --clean --noconfirm OmniVirtd-Mac.spec + pyinstaller --clean --noconfirm EulerLauncherd-Mac.spec ``` 2. EulerLauncher.app: - 项目源码中已包含用于构建OmniVirt的Spec脚本`OmniVirt-MacOS.spec`, 若非必要,请勿修改该文件,使用一下命令开始构建: + 项目源码中已包含用于构建EulerLauncher的Spec脚本`EulerLauncher-MacOS.spec`, 若非必要,请勿修改该文件,使用一下命令开始构建: ``` Shell - pyinstaller --clean --noconfirm OmniVirt-MacOS.spec + pyinstaller --clean --noconfirm EulerLauncher-MacOS.spec ``` 构建`omnivirt` CLI 及 `install` 脚本, cli与install之间有依赖关系,请严格按照下面的顺序进行构建: @@ -79,12 +79,12 @@ pyinstaller --clean --noconfirm install.spec 首先,我们创建一个新目录并将文件移动到其中。 ``` Shell mkdir -p dist/dmg -cp -R dist/OmniVirt.app dist/dmg +cp -R dist/EulerLauncher.app dist/dmg ``` 然后,我们可以使用下面的命令来制作磁盘镜像文件: ``` Shell -create-dmg --volname "OmniVirt" --volicon "etc/images/favicon.png" --window-pos 200 120 --window-size 600 300 --icon-size 100 --icon "OmniVirt.app" 175 120 --hide-extension "OmniVirt.app" --app-drop-link 425 120 "dist/OmniVirt.dmg" "dist/dmg/" +create-dmg --volname "EulerLauncher" --volicon "etc/images/favicon.png" --window-pos 200 120 --window-size 600 300 --icon-size 100 --icon "EulerLauncher.app" 175 120 --hide-extension "EulerLauncher.app" --app-drop-link 425 120 "dist/EulerLauncher.dmg" "dist/dmg/" ``` `EulerLauncher.dmg`中将只包含`EulerLauncher.app`主程序,需要将`install`脚本及`EulerLauncher` CLI工具一并压缩后再进行分发。 diff --git a/docs/mac-user-manual.md b/docs/mac-user-manual.md index a73ed4169c6bfd8b896ba56bf873fa34fe3693b3..54fb6885d6cea5457c62299c7fa2cbfd4394cd0d 100644 --- a/docs/mac-user-manual.md +++ b/docs/mac-user-manual.md @@ -1,4 +1,4 @@ -# 在MacOS下安装与运行OmniVirt +# 在MacOS下安装与运行EulerLauncher ## 准备工作 @@ -23,7 +23,7 @@ Homebrew是一款Mac OS平台下的软件包管理工具,拥有安装、卸载 ### 安装Qemu及wget -**OmniVirt**在MacOS上运行依赖于`QEMU`,镜像下载依赖于`wget`,使用`Homebrew`可以非常方便的下载和管理此类软件,使用以下命令进行安装: +**EulerLauncher**在MacOS上运行依赖于`QEMU`,镜像下载依赖于`wget`,使用`Homebrew`可以非常方便的下载和管理此类软件,使用以下命令进行安装: ``` Shell brew install qemu @@ -32,7 +32,7 @@ brew install wget ### 配置sudo免密码权限 -**OmniVirt**在MacOS上运行依赖于`QEMU`,为了使用户的网络体验更加优秀,因此采用了MacOS的[vmnet framework][1]来提供虚拟机的网络能力,当前`vmnet`使用时需要使用管理员权限,因此在使用`QEMU`后端创建带有`vmnet`类型网络设备的虚拟机时,需要启用管理员权限,OmniVirt在启动时会自动使用`sudo`命令来实现这一过程,因此需要为当前用户配置`sudo`免密码使用权限,如您介意此配置,请停止使用OmniVirt。 +**EulerLauncher**在MacOS上运行依赖于`QEMU`,为了使用户的网络体验更加优秀,因此采用了MacOS的[vmnet framework][1]来提供虚拟机的网络能力,当前`vmnet`使用时需要使用管理员权限,因此在使用`QEMU`后端创建带有`vmnet`类型网络设备的虚拟机时,需要启用管理员权限,EulerLauncher在启动时会自动使用`sudo`命令来实现这一过程,因此需要为当前用户配置`sudo`免密码使用权限,如您介意此配置,请停止使用EulerLauncher。 1. 在MacOS桌面下敲击 `command` + `shift` + `u` 组合键,打开`访达`中的`实用工具`,并找到`终端.app` @@ -44,19 +44,19 @@ brew install wget 4. 敲击`ESC`,再输入`:WQ`进行保存 -## 安装OmniVirt +## 安装EulerLauncher -**OmniVirt**当前支持MacOS Ventura, 支持Apple Silicon芯片版及x86芯片版,前往[OmniVirt最新版下载][1]下载MacOS版软件包并解压到期望的位置。 +**EulerLauncher**当前支持MacOS Ventura, 支持Apple Silicon芯片版及x86芯片版,前往[EulerLauncher最新版下载][1]下载MacOS版软件包并解压到期望的位置。 解压后的目录包含以下文件: -其中`install`可执行文件为安装文件,用于将**OmniVirt**所需支持文件安装到指定位置,`OmniVirt.dmg`为主程序的磁盘映象。 +其中`install`可执行文件为安装文件,用于将**EulerLauncher**所需支持文件安装到指定位置,`EulerLauncher.dmg`为主程序的磁盘映象。 1. 安装支持文件(本操作需要sudo权限,请先完成前面的步骤):双击`install`可执行文件,等待程序完成执行。 -2. 配置**OmniVirt**: +2. 配置**EulerLauncher**: - 查看`qemu`及`wget`所处位置,`qemu`二进制文件在不同架构下名称不同,请根据自身情况选择正确的名称(Apple Silicon: qemu-system-aarch64; Intel: qemu-system-x86_64): ``` Shell @@ -70,16 +70,16 @@ brew install wget ``` 查看完成后,记录路径结果,在接下来的步骤中将会使用到。 - - 打开`omnivirt.conf`并进行配置: + - 打开`eulerlauncher.conf`并进行配置: ``` Shell - sudo vi /Library/Application\ Support/org.openeuler.omnivirt/omnivirt.conf + sudo vi /Library/Application\ Support/org.openeuler.eulerlauncher/eulerlauncher.conf ``` - omnivirt的配置如下 + eulerlauncher的配置如下 ``` [default] log_dir = # 日志文件位置(xxx.log) - work_dir = # omnivirt工作目录,用于存储虚拟机镜像、虚拟机文件等 + work_dir = # eulerlauncher工作目录,用于存储虚拟机镜像、虚拟机文件等 wget_dir = # wget的可执行文件路径,请参考上一步的内容进行配置 qemu_dir = # qemu的可执行文件路径,请参考上一步的内容进行配置 debug = True @@ -89,27 +89,27 @@ brew install wget memory = 1024 # 配置虚拟机的内存大小,单位为M,M1用户请勿配置超过2048 ``` -3. 安装**OmniVirt.app**: +3. 安装**EulerLauncher.app**: - - 双击`OmniVirt.dmg`,在弹出的窗口中用鼠标将`OmniVirt.app`拖动到`Applications`中,即可完成安装,并可在应用程序中找到`OmniVirt.app` + - 双击`EulerLauncher.dmg`,在弹出的窗口中用鼠标将`EulerLauncher.app`拖动到`Applications`中,即可完成安装,并可在应用程序中找到`EulerLauncher.app` -## 使用OmniVirt +## 使用EulerLauncher -1. 在应用程序中找到`OmniVirt.app`,单击启动程序。 +1. 在应用程序中找到`EulerLauncher.app`,单击启动程序。 -2. OmniVirt需要访问网络,在弹出如下窗口时点击`允许`: +2. EulerLauncher需要访问网络,在弹出如下窗口时点击`允许`: -3. OmniVirt当前仅支持命令行方式进行访问,请打开`终端.app`,使用命令行进行操作。 +3. EulerLauncher当前仅支持命令行方式进行访问,请打开`终端.app`,使用命令行进行操作。 ### 镜像操作 1. 获取可用镜像列表: ```Shell -omnivirt images +eulerlauncher images +-----------+----------+--------------+ | Images | Location | Status | @@ -120,12 +120,12 @@ omnivirt images +-----------+----------+--------------+ ``` -**OmniVirt**镜像有两种位置属性:1)远端镜像 2)本地镜像,只有处于本地且状态为 `Ready` 的镜像可以直接用来创建虚拟机,位于远端的镜像需要下载后才能够使用;你也可以加载已经预先下载好的本地镜像到**OmniVirt**中,具体操作方法可以参考接下来的操作指导。 +**EulerLauncher**镜像有两种位置属性:1)远端镜像 2)本地镜像,只有处于本地且状态为 `Ready` 的镜像可以直接用来创建虚拟机,位于远端的镜像需要下载后才能够使用;你也可以加载已经预先下载好的本地镜像到**EulerLauncher**中,具体操作方法可以参考接下来的操作指导。 2. 下载远端镜像 ```Shell -omnivirt download-image 22.03-LTS +eulerlauncher download-image 22.03-LTS Downloading: 22.03-LTS, this might take a while, please check image status with "images" command. ``` @@ -133,7 +133,7 @@ Downloading: 22.03-LTS, this might take a while, please check image status with 镜像下载请求是一个异步请求,具体的下载动作将在后台完成,具体耗时与你的网络情况相关,整体的镜像下载流程包括下载、解压缩、格式转换等相关子流程,在下载过程中可以通过 `image` 命令随时查看下载进展与镜像状态: ```Shell -omnivirt images +eulerlauncher images +-----------+----------+--------------+ | Images | Location | Status | @@ -148,7 +148,7 @@ omnivirt images 当镜像状态转变为 `Ready` 时,表示镜像下载完成,处于 `Ready` 状态的镜像可被用来创建虚拟机: ```Shell -omnivirt images +eulerlauncher images +-----------+----------+--------------+ | Images | Location | Status | @@ -161,10 +161,10 @@ omnivirt images 3. 加载本地镜像 -用户也可以加载自定义镜像或预先下载到本地的镜像到OmniVirt中用于创建自定义虚拟机: +用户也可以加载自定义镜像或预先下载到本地的镜像到EulerLauncher中用于创建自定义虚拟机: ```Shell -omnivirt load-image --path {image_file_path} IMAGE_NAME +eulerlauncher load-image --path {image_file_path} IMAGE_NAME ``` 当前支持加载的镜像格式有 `xxx.qcow2.xz`,`xxx.qcow2` @@ -172,15 +172,15 @@ omnivirt load-image --path {image_file_path} IMAGE_NAME 例如: ```Shell -omnivirt load-image --path /opt/openEuler-22.03-LTS-x86_64.qcow2.xz 2203-load +eulerlauncher load-image --path /opt/openEuler-22.03-LTS-x86_64.qcow2.xz 2203-load Loading: 2203-load, this might take a while, please check image status with "images" command. ``` -将位于 `/opt` 目录下的 `openEuler-22.03-LTS-x86_64.qcow2.xz` 加载到OmniVirt系统中,并命名为 `2203-load`,与下载命令一样,加载命令也是一个异步命令,用户需要用镜像列表命令查询镜像状态直到显示为 `Ready`, 但相对于直接下载镜像,加载镜像的速度会快很多: +将位于 `/opt` 目录下的 `openEuler-22.03-LTS-x86_64.qcow2.xz` 加载到EulerLauncher系统中,并命名为 `2203-load`,与下载命令一样,加载命令也是一个异步命令,用户需要用镜像列表命令查询镜像状态直到显示为 `Ready`, 但相对于直接下载镜像,加载镜像的速度会快很多: ```Shell -omnivirt images +eulerlauncher images +-----------+----------+--------------+ | Images | Location | Status | @@ -190,7 +190,7 @@ omnivirt images | 2203-load | Local | Loading | +-----------+----------+--------------+ -omnivirt images +eulerlauncher images +-----------+----------+--------------+ | Images | Location | Status | @@ -203,10 +203,10 @@ omnivirt images 4. 删除镜像: -通过下面的命令将镜像从OmniVirt系统中删除: +通过下面的命令将镜像从EulerLauncher系统中删除: ```Shell -omnivirt delete-image 2203-load +eulerlauncher delete-image 2203-load Image: 2203-load has been successfully deleted. ``` @@ -216,7 +216,7 @@ Image: 2203-load has been successfully deleted. 1. 获取虚拟机列表: ```shell -omnivirt list +eulerlauncher list +----------+-----------+---------+---------------+ | Name | Image | State | IP | @@ -241,14 +241,14 @@ ssh root@{instance_ip} 3. 创建虚拟机 ```Shell -omnivirt launch --image {image_name} {instance_name} +eulerlauncher launch --image {image_name} {instance_name} ``` 通过 `--image` 指定镜像,同时指定虚拟机名称。 4. 删除虚拟机 ```Shell -omnivirt delete-instance {instance_name} +eulerlauncher delete-instance {instance_name} ``` 根据虚拟机名称删除指定的虚拟机。 diff --git a/docs/win-user-manual.md b/docs/win-user-manual.md index 6329c7a4fc100cf644783899c6a02a60203e1e01..4c11459d22280d4c43b88332285396581e93ce26 100644 --- a/docs/win-user-manual.md +++ b/docs/win-user-manual.md @@ -6,40 +6,40 @@ **EulerLauncher**解压后包含以下几个部分: -- omnivirtd.exe:OmniVirt的主进程,是运行在后台的守护进程,负责与各类虚拟化后端交互,管理虚拟机、容器以及镜像的生命周期,omnivirtd.exe是运行在后台的守护进程。 -- onivirt.exe:OmniVirt的CLI客户端,用户通过该客户端与omnivirtd守护进程交互,对虚拟机、镜像等进行相关操作。 -- omnivirt-win.conf:OmniVirt配置文件,需与omnivirtd.exe放置于同一目录下,参考下面配置进行相应配置: +- eulerlauncherd.exe:EulerLauncher的主进程,是运行在后台的守护进程,负责与各类虚拟化后端交互,管理虚拟机、容器以及镜像的生命周期,eulerlauncherd.exe是运行在后台的守护进程。 +- eulerlauncher.exe:EulerLauncher的CLI客户端,用户通过该客户端与eulerlauncherd守护进程交互,对虚拟机、镜像等进行相关操作。 +- eulerlauncher-win.conf:OmniVirt配置文件,需与eulerlauncherd.exe放置于同一目录下,参考下面配置进行相应配置: ```Conf [default] # 配置日志文件的存储目录 -log_dir = D:\omnivirt-workdir\logs +log_dir = D:\eulerlauncher-workdir\logs # 配置日志等级是否开启Debug debug = True # 配置OmniVirt的工作目录 -work_dir = D:\omnivirt-workdir +work_dir = D:\eulerlauncher-workdir # 配置OmniVirt的镜像目录,镜像目录为对工作目录的相对目录 image_dir = images # 配置OmniVirt的虚拟机文件目录,虚拟机文件目录为对工作目录的相对目录 instance_dir = instances ``` -配置完成后请右键点击omnivirtd.exe,选择以管理员身份运行,点击后omnivird.exe将以守护进程的形式在后台运行。 +配置完成后请右键点击eulerlauncherd.exe,选择以管理员身份运行,点击后eulerlauncherd.exe将以守护进程的形式在后台运行。 打开 `PowerShell` 或 `Terminal` ,准备进行对应的操作。 ### Windows下退出EulerLauncherd后台进程 -当omnivirtd.exe运行后,会在操作系统右下角托盘区域生成omnivirtd托盘图标: +当eulerlauncherd.exe运行后,会在操作系统右下角托盘区域生成eulerlauncherd托盘图标: -鼠标右键点击托盘图标,并选择 `Exit OmniVirt` 即可退出omnivirtd后台进程。 +鼠标右键点击托盘图标,并选择 `Exit EulerLauncher` 即可退出EulerLauncherd后台进程。 ### 镜像操作 1. 获取可用镜像列表: ```PowerShell -omnivirt.exe images +eulerlauncher.exe images +-----------+----------+--------------+ | Images | Location | Status | @@ -50,12 +50,12 @@ omnivirt.exe images +-----------+----------+--------------+ ``` -**EulerLauncher**镜像有两种位置属性:1)远端镜像 2)本地镜像,只有处于本地且状态为 `Ready` 的镜像可以直接用来创建虚拟机,位于远端的镜像需要下载后才能够使用;你也可以加载已经预先下载好的本地镜像到**OmniVirt**中,具体操作方法可以参考接下来的操作指导。 +**EulerLauncher**镜像有两种位置属性:1)远端镜像 2)本地镜像,只有处于本地且状态为 `Ready` 的镜像可以直接用来创建虚拟机,位于远端的镜像需要下载后才能够使用;你也可以加载已经预先下载好的本地镜像到**EulerLauncher**中,具体操作方法可以参考接下来的操作指导。 2. 下载远端镜像 ```PowerShell -omnivirt.exe download-image 22.03-LTS +eulerlauncher.exe download-image 22.03-LTS Downloading: 22.03-LTS, this might take a while, please check image status with "images" command. ``` @@ -63,7 +63,7 @@ Downloading: 22.03-LTS, this might take a while, please check image status with 镜像下载请求是一个异步请求,具体的下载动作将在后台完成,具体耗时与你的网络情况相关,整体的镜像下载流程包括下载、解压缩、格式转换等相关子流程,在下载过程中可以通过 `image` 命令随时查看下载进展与镜像状态: ```PowerShell -omnivirt.exe images +eulerlauncher.exe images +-----------+----------+--------------+ | Images | Location | Status | @@ -78,7 +78,7 @@ omnivirt.exe images 当镜像状态转变为 `Ready` 时,表示镜像下载完成,处于 `Ready` 状态的镜像可被用来创建虚拟机: ```PowerShell -omnivirt.exe images +eulerlauncher.exe images +-----------+----------+--------------+ | Images | Location | Status | @@ -91,10 +91,10 @@ omnivirt.exe images 3. 加载本地镜像 -用户也可以加载自定义镜像或预先下载到本地的镜像到OmniVirt中用于创建自定义虚拟机: +用户也可以加载自定义镜像或预先下载到本地的镜像到EulerLauncher中用于创建自定义虚拟机: ```PowerShell -omnivirt.exe load-image --path {image_file_path} IMAGE_NAME +eulerlauncher.exe load-image --path {image_file_path} IMAGE_NAME ``` 当前支持加载的镜像格式有 `xxx.qcow2.xz`,`xxx.qcow2` @@ -102,7 +102,7 @@ omnivirt.exe load-image --path {image_file_path} IMAGE_NAME 例如: ```PowerShell -omnivirt.exe load-image --path D:\openEuler-22.03-LTS-x86_64.qcow2.xz 2203-load +eulerlauncher.exe load-image --path D:\openEuler-22.03-LTS-x86_64.qcow2.xz 2203-load Loading: 2203-load, this might take a while, please check image status with "images" command. ``` @@ -110,7 +110,7 @@ Loading: 2203-load, this might take a while, please check image status with "ima 将位于 `D:\` 目录下的 `openEuler-22.03-LTS-x86_64.qcow2.xz` 加载到OmniVirt系统中,并命名为 `2203-load`,与下载命令一样,加载命令也是一个异步命令,用户需要用镜像列表命令查询镜像状态直到显示为 `Ready`, 但相对于直接下载镜像,加载镜像的速度会快很多: ```PowerShell -omnivirt.exe images +eulerlauncher.exe images +-----------+----------+--------------+ | Images | Location | Status | @@ -120,7 +120,7 @@ omnivirt.exe images | 2203-load | Local | Loading | +-----------+----------+--------------+ -omnivirt images +eulerlauncher images +-----------+----------+--------------+ | Images | Location | Status | @@ -133,10 +133,10 @@ omnivirt images 4. 删除镜像: -通过下面的命令将镜像从OmniVirt系统中删除: +通过下面的命令将镜像从EulerLauncher系统中删除: ```PowerShell -omnivirt.exe delete-image 2203-load +eulerlauncher.exe delete-image 2203-load Image: 2203-load has been successfully deleted. ``` @@ -146,7 +146,7 @@ Image: 2203-load has been successfully deleted. 1. 获取虚拟机列表: ```Powershell -omnivirt.exe list +eulerlauncher.exe list +----------+-----------+---------+---------------+ | Name | Image | State | IP | @@ -171,14 +171,14 @@ ssh root@{instance_ip} 3. 创建虚拟机 ```PowerShell -omnivirt.exe launch --image {image_name} {instance_name} +eulerlauncher.exe launch --image {image_name} {instance_name} ``` 通过 `--image` 指定镜像,同时指定虚拟机名称。 4. 删除虚拟机 ```PowerShell -omnivirt.exe delete-instance {instance_name} +eulerlauncher.exe delete-instance {instance_name} ``` 根据虚拟机名称删除指定的虚拟机。 diff --git a/etc/omnivirt-win.conf b/etc/eulerlauncher-win.conf similarity index 100% rename from etc/omnivirt-win.conf rename to etc/eulerlauncher-win.conf diff --git a/etc/omnivirt.conf b/etc/eulerlauncher.conf similarity index 100% rename from etc/omnivirt.conf rename to etc/eulerlauncher.conf diff --git a/omnivirt/__init__.py b/eulerlauncher/__init__.py similarity index 100% rename from omnivirt/__init__.py rename to eulerlauncher/__init__.py diff --git a/eulerlauncher/__pycache__/__init__.cpython-310.pyc b/eulerlauncher/__pycache__/__init__.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..aa4d9fe9fafd6f23842793f4c5acdd3d798b652a Binary files /dev/null and b/eulerlauncher/__pycache__/__init__.cpython-310.pyc differ diff --git a/omnivirt/backends/__init__.py b/eulerlauncher/backends/__init__.py similarity index 100% rename from omnivirt/backends/__init__.py rename to eulerlauncher/backends/__init__.py diff --git a/eulerlauncher/backends/__pycache__/__init__.cpython-310.pyc b/eulerlauncher/backends/__pycache__/__init__.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..7624ca5522e260bd9716a8884a3b4a7a251a2387 Binary files /dev/null and b/eulerlauncher/backends/__pycache__/__init__.cpython-310.pyc differ diff --git a/omnivirt/backends/mac/image_handler.py b/eulerlauncher/backends/mac/image_handler.py similarity index 94% rename from omnivirt/backends/mac/image_handler.py rename to eulerlauncher/backends/mac/image_handler.py index c11f03dec66bee18cf347d1108e741b10bcc167a..f9c8ec6753466f9183fc2d0a6a2fde0e08ac2f1e 100644 --- a/omnivirt/backends/mac/image_handler.py +++ b/eulerlauncher/backends/mac/image_handler.py @@ -6,9 +6,9 @@ import subprocess import shutil import ssl -from omnivirt.utils import constants -from omnivirt.utils import utils as omni_utils -from omnivirt.utils import objs +from eulerlauncher.utils import constants +from eulerlauncher.utils import utils as omni_utils +from eulerlauncher.utils import objs ssl._create_default_https_context = ssl._create_unverified_context diff --git a/omnivirt/backends/mac/instance_handler.py b/eulerlauncher/backends/mac/instance_handler.py similarity index 94% rename from omnivirt/backends/mac/instance_handler.py rename to eulerlauncher/backends/mac/instance_handler.py index a7aa10d83d15165522bd3d47290cbb142133880a..a53e78d81925ece983d717e04f3151860cc6b26e 100644 --- a/omnivirt/backends/mac/instance_handler.py +++ b/eulerlauncher/backends/mac/instance_handler.py @@ -8,10 +8,10 @@ import time from oslo_utils import uuidutils -from omnivirt.utils import constants -from omnivirt.utils import utils as omni_utils -from omnivirt.utils import objs -from omnivirt.backends.mac import qemu +from eulerlauncher.utils import constants +from eulerlauncher.utils import utils as omni_utils +from eulerlauncher.utils import objs +from eulerlauncher.backends.mac import qemu class MacInstanceHandler(object): diff --git a/omnivirt/backends/mac/qemu.py b/eulerlauncher/backends/mac/qemu.py similarity index 94% rename from omnivirt/backends/mac/qemu.py rename to eulerlauncher/backends/mac/qemu.py index 732bd3f459f96f06c8acf39f0c13457c13eb7495..eebe066ed02c245f50eb8471081ea2917a5cd1be 100644 --- a/omnivirt/backends/mac/qemu.py +++ b/eulerlauncher/backends/mac/qemu.py @@ -2,7 +2,7 @@ import platform import subprocess import os -from omnivirt.utils import constants +from eulerlauncher.utils import constants class QemuDriver(object): diff --git a/omnivirt/backends/win/__init__.py b/eulerlauncher/backends/win/__init__.py similarity index 100% rename from omnivirt/backends/win/__init__.py rename to eulerlauncher/backends/win/__init__.py diff --git a/eulerlauncher/backends/win/__pycache__/__init__.cpython-310.pyc b/eulerlauncher/backends/win/__pycache__/__init__.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..a08ef7cb2427c4206694f198f8746c20d0d9ef22 Binary files /dev/null and b/eulerlauncher/backends/win/__pycache__/__init__.cpython-310.pyc differ diff --git a/omnivirt/backends/win/image_handler.py b/eulerlauncher/backends/win/image_handler.py similarity index 94% rename from omnivirt/backends/win/image_handler.py rename to eulerlauncher/backends/win/image_handler.py index be040fe857420506afd0ed8db3e902a3e1e3ac6f..9f09f4d13bcea66cc39a418e200ccabfdcd582dd 100644 --- a/omnivirt/backends/win/image_handler.py +++ b/eulerlauncher/backends/win/image_handler.py @@ -5,10 +5,10 @@ import os import shutil import ssl -from omnivirt.backends.win import powershell -from omnivirt.utils import constants -from omnivirt.utils import utils as omni_utils -from omnivirt.utils import objs +from eulerlauncher.backends.win import powershell +from eulerlauncher.utils import constants +from eulerlauncher.utils import utils as omni_utils +from eulerlauncher.utils import objs ssl._create_default_https_context = ssl._create_unverified_context diff --git a/omnivirt/backends/win/instance_handler.py b/eulerlauncher/backends/win/instance_handler.py similarity index 94% rename from omnivirt/backends/win/instance_handler.py rename to eulerlauncher/backends/win/instance_handler.py index bbcc0e3837d8e137ae2d7d797e5559deb200b217..7b27055300490a449c7efdfa61fdb997e03cc2c0 100644 --- a/omnivirt/backends/win/instance_handler.py +++ b/eulerlauncher/backends/win/instance_handler.py @@ -6,11 +6,11 @@ from oslo_utils import uuidutils from os_win import constants as os_win_const from os_win import exceptions as os_win_exc -from omnivirt.backends.win import powershell -from omnivirt.backends.win import vmops -from omnivirt.utils import constants -from omnivirt.utils import utils as omni_utils -from omnivirt.utils import objs +from eulerlauncher.backends.win import powershell +from eulerlauncher.backends.win import vmops +from eulerlauncher.utils import constants +from eulerlauncher.utils import utils as omni_utils +from eulerlauncher.utils import objs _vmops = vmops.VMOps() diff --git a/omnivirt/backends/win/powershell.py b/eulerlauncher/backends/win/powershell.py similarity index 100% rename from omnivirt/backends/win/powershell.py rename to eulerlauncher/backends/win/powershell.py diff --git a/omnivirt/backends/win/vmops.py b/eulerlauncher/backends/win/vmops.py similarity index 94% rename from omnivirt/backends/win/vmops.py rename to eulerlauncher/backends/win/vmops.py index 6882803cc2a3e2399e0c19fe9e02628d1d6d4da0..69355a3227f8037d0a0ddceb4c6cd321b47e27b7 100644 --- a/omnivirt/backends/win/vmops.py +++ b/eulerlauncher/backends/win/vmops.py @@ -6,10 +6,10 @@ from os_win.utils.compute import vmutils10 from os_win import utilsfactory from oslo_utils import uuidutils -from omnivirt.utils import objs -from omnivirt.utils import constants -from omnivirt.utils import utils as omni_utils -from omnivirt.backends.win import powershell +from eulerlauncher.utils import objs +from eulerlauncher.utils import constants +from eulerlauncher.utils import utils as omni_utils +from eulerlauncher.backends.win import powershell SWITCH_NAME = 'Default Switch' diff --git a/omnivirt/cli.py b/eulerlauncher/cli.py similarity index 64% rename from omnivirt/cli.py rename to eulerlauncher/cli.py index 5d6217bd329fe4471d2dc76f4590be1fef6f5ca0..56972a1573780b1c5660695f3e7a3cc55009d430 100644 --- a/omnivirt/cli.py +++ b/eulerlauncher/cli.py @@ -1,21 +1,19 @@ import click import prettytable as pt -from omnivirt.grpcs import client -from omnivirt.utils import utils as omni_utils -from omnivirt.utils import exceptions +from eulerlauncher.grpcs import client -omnivirt_client = client.Client() +launcher_client = client.Client() # List all instances on the host @click.command() def list(): try: - ret = omnivirt_client.list_instances() + ret = launcher_client.list_instances() except Exception: - print('Calling to OmniVirtd daemon failed, please check OmniVirtd daemon status ...') + print('Calling to EulerLauncherd daemon failed, please check EulerLauncherd daemon status ...') else: tb = pt.PrettyTable() @@ -39,9 +37,9 @@ def list(): def images(): try: - ret = omnivirt_client.list_images() + ret = launcher_client.list_images() except Exception: - print('Calling to OmniVirtd daemon failed, please check OmniVirtd daemon status ...') + print('Calling to EulerLauncherd daemon failed, please check EulerLauncherd daemon status ...') else: tb = pt.PrettyTable() @@ -59,9 +57,9 @@ def images(): def download_image(name): try: - ret = omnivirt_client.download_image(name) + ret = launcher_client.download_image(name) except Exception: - print('Calling to OmniVirtd daemon failed, please check OmniVirtd daemon status ...') + print('Calling to EulerLauncherd daemon failed, please check EulerLauncherd daemon status ...') else: print(ret['msg']) @@ -72,9 +70,9 @@ def download_image(name): def load_image(name, path): try: - ret = omnivirt_client.load_image(name, path) + ret = launcher_client.load_image(name, path) except Exception: - print('Calling to OmniVirtd daemon failed, please check OmniVirtd daemon status ...') + print('Calling to EulerLauncherd daemon failed, please check EulerLauncherd daemon status ...') else: print(ret['msg']) @@ -84,9 +82,9 @@ def load_image(name, path): def delete_image(name): try: - ret = omnivirt_client.delete_image(name) + ret = launcher_client.delete_image(name) except Exception: - print('Calling to OmniVirtd daemon failed, please check OmniVirtd daemon status ...') + print('Calling to EulerLauncherd daemon failed, please check EulerLauncherd daemon status ...') else: print(ret['msg']) @@ -96,9 +94,9 @@ def delete_image(name): def delete_instance(name): try: - ret = omnivirt_client.delete_instance(name) + ret = launcher_client.delete_instance(name) except Exception: - print('Calling to OmniVirtd daemon failed, please check OmniVirtd daemon status ...') + print('Calling to EulerLauncherd daemon failed, please check EulerLauncherd daemon status ...') else: print(ret['msg']) @@ -108,9 +106,9 @@ def delete_instance(name): def launch(vm_name, image): try: - ret = omnivirt_client.create_instance(vm_name, image) + ret = launcher_client.create_instance(vm_name, image) except Exception: - print('Calling to OmniVirtd daemon failed, please check OmniVirtd daemon status ...') + print('Calling to EulerLauncherd daemon failed, please check EulerLauncherd daemon status ...') else: if ret['ret'] == 1: diff --git a/omnivirt/omnivirtd.py b/eulerlauncher/eulerlauncherd.py similarity index 82% rename from omnivirt/omnivirtd.py rename to eulerlauncher/eulerlauncherd.py index 08b7a60e5cde2a14831cc08e9316480ed7ff2ab7..fd8e435f216fb986d5c835a9ab725089cc5f4707 100644 --- a/omnivirt/omnivirtd.py +++ b/eulerlauncher/eulerlauncherd.py @@ -12,15 +12,15 @@ import subprocess import sys import time -from omnivirt.grpcs.omnivirt_grpc import images_pb2, images_pb2_grpc -from omnivirt.grpcs.omnivirt_grpc import instances_pb2, instances_pb2_grpc -from omnivirt.services import imager_service, instance_service -from omnivirt.utils import constants -from omnivirt.utils import objs -from omnivirt.utils import utils +from eulerlauncher.grpcs.eulerlauncher_grpc import images_pb2, images_pb2_grpc +from eulerlauncher.grpcs.eulerlauncher_grpc import instances_pb2, instances_pb2_grpc +from eulerlauncher.services import imager_service, instance_service +from eulerlauncher.utils import constants +from eulerlauncher.utils import objs +from eulerlauncher.utils import utils -IMG_URL = 'https://gitee.com/openeuler/omnivirt/raw/master/etc/supported_images.json' +IMG_URL = 'https://gitee.com/openeuler/eulerlauncher/raw/master/etc/supported_images.json' # Avoid create zombie children in MacOS and Linux signal.signal(signal.SIGCHLD, signal.SIG_IGN) @@ -37,7 +37,7 @@ def config_logging(config): if not os.path.exists(log_dir): os.makedirs(log_dir) - log_file = os.path.join(log_dir, 'omnivirt.log') + log_file = os.path.join(log_dir, 'eulerlauncher.log') if debug == 'True': log_level = logging.DEBUG @@ -55,7 +55,7 @@ def init(arch, config, LOG): instance_record_file = os.path.join(instance_dir, 'instances.json') img_record_file = os.path.join(image_dir, 'images.json') - LOG.debug('Initializing OmniVirtd ...') + LOG.debug('Initializing EulerLauncherd ...') LOG.debug('Checking for work directory ...') if not os.path.exists(work_dir): LOG.debug('Create %s as working directory ...' % work_dir) @@ -97,14 +97,14 @@ def init(arch, config, LOG): def serve(arch, host_os, CONF, LOG, base_dir): ''' - Run the Omnivirtd Service + Run the EulerLauncherd Service ''' server = grpc.server(futures.ThreadPoolExecutor(max_workers=10)) images_pb2_grpc.add_ImageGrpcServiceServicer_to_server(imager_service.ImagerService(arch, host_os, CONF, base_dir), server) instances_pb2_grpc.add_InstanceGrpcServiceServicer_to_server(instance_service.InstanceService(arch, host_os, CONF, base_dir), server) server.add_insecure_port('[::]:50052') server.start() - LOG.debug('OmniVirtd Service Started ...') + LOG.debug('EulerLauncherd Service Started ...') def term_handler(signum, frame): pid = os.getpid() @@ -116,7 +116,7 @@ def serve(arch, host_os, CONF, LOG, base_dir): while True: time.sleep(1) -def init_omnivirtd(conf, base_dir): +def init_launcherd(conf, base_dir): CONF = objs.Conf(conf) config_logging(CONF) @@ -145,4 +145,4 @@ if __name__ == '__main__': except Exception as e: print('Error: ' + str(e)) else: - init_omnivirtd(conf_file, args.base_dir) + init_launcherd(conf_file, args.base_dir) diff --git a/omnivirt/grpcs/__init__.py b/eulerlauncher/grpcs/__init__.py similarity index 100% rename from omnivirt/grpcs/__init__.py rename to eulerlauncher/grpcs/__init__.py diff --git a/eulerlauncher/grpcs/__pycache__/__init__.cpython-310.pyc b/eulerlauncher/grpcs/__pycache__/__init__.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..41be88f9d49c26234188f8aabf89035a4c6f7041 Binary files /dev/null and b/eulerlauncher/grpcs/__pycache__/__init__.cpython-310.pyc differ diff --git a/omnivirt/grpcs/client.py b/eulerlauncher/grpcs/client.py similarity index 85% rename from omnivirt/grpcs/client.py rename to eulerlauncher/grpcs/client.py index fe4c065ad2e78421cef3f130dc4effc968709377..66adb9afa25f9ddfecc4e33297e7d7cea29ddfaf 100644 --- a/omnivirt/grpcs/client.py +++ b/eulerlauncher/grpcs/client.py @@ -1,11 +1,11 @@ import grpc import os -from omnivirt.grpcs.omnivirt_grpc import images_pb2, images_pb2_grpc -from omnivirt.grpcs.omnivirt_grpc import instances_pb2, instances_pb2_grpc -from omnivirt.grpcs import images, instances -from omnivirt.utils import constants -from omnivirt.utils import utils as omnivirt_utils +from eulerlauncher.grpcs.eulerlauncher_grpc import images_pb2, images_pb2_grpc +from eulerlauncher.grpcs.eulerlauncher_grpc import instances_pb2, instances_pb2_grpc +from eulerlauncher.grpcs import images, instances +from eulerlauncher.utils import constants +from eulerlauncher.utils import utils as omnivirt_utils class Client(object): diff --git a/omnivirt/grpcs/omnivirt_grpc/__init__.py b/eulerlauncher/grpcs/eulerlauncher_grpc/__init__.py similarity index 100% rename from omnivirt/grpcs/omnivirt_grpc/__init__.py rename to eulerlauncher/grpcs/eulerlauncher_grpc/__init__.py diff --git a/eulerlauncher/grpcs/eulerlauncher_grpc/__pycache__/__init__.cpython-310.pyc b/eulerlauncher/grpcs/eulerlauncher_grpc/__pycache__/__init__.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..2ccb400858f7bd29995488f430e9558dc1166925 Binary files /dev/null and b/eulerlauncher/grpcs/eulerlauncher_grpc/__pycache__/__init__.cpython-310.pyc differ diff --git a/omnivirt/grpcs/omnivirt_grpc/images.proto b/eulerlauncher/grpcs/eulerlauncher_grpc/images.proto similarity index 100% rename from omnivirt/grpcs/omnivirt_grpc/images.proto rename to eulerlauncher/grpcs/eulerlauncher_grpc/images.proto diff --git a/omnivirt/grpcs/omnivirt_grpc/images_pb2.py b/eulerlauncher/grpcs/eulerlauncher_grpc/images_pb2.py similarity index 100% rename from omnivirt/grpcs/omnivirt_grpc/images_pb2.py rename to eulerlauncher/grpcs/eulerlauncher_grpc/images_pb2.py diff --git a/omnivirt/grpcs/omnivirt_grpc/images_pb2_grpc.py b/eulerlauncher/grpcs/eulerlauncher_grpc/images_pb2_grpc.py similarity index 98% rename from omnivirt/grpcs/omnivirt_grpc/images_pb2_grpc.py rename to eulerlauncher/grpcs/eulerlauncher_grpc/images_pb2_grpc.py index f3735391eedce4f83ff43310ae64ebf9bc3dac23..28eb2df9c2085b818c685fe2958f4ffc8bc90904 100644 --- a/omnivirt/grpcs/omnivirt_grpc/images_pb2_grpc.py +++ b/eulerlauncher/grpcs/eulerlauncher_grpc/images_pb2_grpc.py @@ -2,7 +2,7 @@ """Client and server classes corresponding to protobuf-defined services.""" import grpc -from omnivirt.grpcs.omnivirt_grpc import images_pb2 as images__pb2 +from eulerlauncher.grpcs.eulerlauncher_grpc import images_pb2 as images__pb2 class ImageGrpcServiceStub(object): diff --git a/omnivirt/grpcs/omnivirt_grpc/instances.proto b/eulerlauncher/grpcs/eulerlauncher_grpc/instances.proto similarity index 100% rename from omnivirt/grpcs/omnivirt_grpc/instances.proto rename to eulerlauncher/grpcs/eulerlauncher_grpc/instances.proto diff --git a/omnivirt/grpcs/omnivirt_grpc/instances_pb2.py b/eulerlauncher/grpcs/eulerlauncher_grpc/instances_pb2.py similarity index 100% rename from omnivirt/grpcs/omnivirt_grpc/instances_pb2.py rename to eulerlauncher/grpcs/eulerlauncher_grpc/instances_pb2.py diff --git a/omnivirt/grpcs/omnivirt_grpc/instances_pb2_grpc.py b/eulerlauncher/grpcs/eulerlauncher_grpc/instances_pb2_grpc.py similarity index 98% rename from omnivirt/grpcs/omnivirt_grpc/instances_pb2_grpc.py rename to eulerlauncher/grpcs/eulerlauncher_grpc/instances_pb2_grpc.py index b9288b85ebec4249e64a16de253c9c3656c1968c..970781c046dbdda278277ff639fd0e0addcb983a 100644 --- a/omnivirt/grpcs/omnivirt_grpc/instances_pb2_grpc.py +++ b/eulerlauncher/grpcs/eulerlauncher_grpc/instances_pb2_grpc.py @@ -2,7 +2,7 @@ """Client and server classes corresponding to protobuf-defined services.""" import grpc -from omnivirt.grpcs.omnivirt_grpc import instances_pb2 as instances__pb2 +from eulerlauncher.grpcs.eulerlauncher_grpc import instances_pb2 as instances__pb2 class InstanceGrpcServiceStub(object): diff --git a/omnivirt/grpcs/images.py b/eulerlauncher/grpcs/images.py similarity index 90% rename from omnivirt/grpcs/images.py rename to eulerlauncher/grpcs/images.py index ba452d38d3d664a42cbfc9242b35410c03eeaf90..98b6611044e039fbe8fa815c5f808406624fb5da 100644 --- a/omnivirt/grpcs/images.py +++ b/eulerlauncher/grpcs/images.py @@ -1,4 +1,4 @@ -from omnivirt.grpcs.omnivirt_grpc import images_pb2 +from eulerlauncher.grpcs.eulerlauncher_grpc import images_pb2 class Image(object): diff --git a/omnivirt/grpcs/instances.py b/eulerlauncher/grpcs/instances.py similarity index 88% rename from omnivirt/grpcs/instances.py rename to eulerlauncher/grpcs/instances.py index b630a7f177d272384897ed0dd2abaee698d074ea..ec6bc292e07034c3048cb506ae546462e468b134 100644 --- a/omnivirt/grpcs/instances.py +++ b/eulerlauncher/grpcs/instances.py @@ -1,4 +1,4 @@ -from omnivirt.grpcs.omnivirt_grpc import instances_pb2 +from eulerlauncher.grpcs.eulerlauncher_grpc import instances_pb2 class Instance(object): def __init__(self, client): diff --git a/omnivirt/install.py b/eulerlauncher/install.py similarity index 65% rename from omnivirt/install.py rename to eulerlauncher/install.py index 8e7d6def8bc1f7b035946a3ba04218c4676ff20a..30db7ec10654d26e81197fa2149aaab49fef37b7 100644 --- a/omnivirt/install.py +++ b/eulerlauncher/install.py @@ -5,23 +5,23 @@ import subprocess if __name__ == '__main__': base_dir = os.path.dirname(__file__) - print('Welcome to use OmniVirt, a tool allows users to develop openEuler on favourate desktop.') + print('Welcome to use EulerLauncher, a tool allows users to develop openEuler on favourate desktop.') print('Creating folder for supporting files ...') - folder_cmd = ['sudo', 'mkdir', '-p', '/Library/Application\ Support/org.openeuler.omnivirt'] + folder_cmd = ['sudo', 'mkdir', '-p', '/Library/Application\ Support/org.openeuler.eulerlauncher'] subprocess.run(' '.join(folder_cmd), shell=True) print('Copy all supporting files to the folder ...') - cp_cmd = ['sudo', 'cp -r', os.path.join(base_dir,'./etc/*'), '/Library/Application\ Support/org.openeuler.omnivirt/'] + cp_cmd = ['sudo', 'cp -r', os.path.join(base_dir,'./etc/*'), '/Library/Application\ Support/org.openeuler.eulerlauncher/'] subprocess.run(' '.join(cp_cmd), shell=True) print('Change supporting file rights ...') - chmod_cmd = ['sudo', 'chmod -R', '775', '/Library/Application\ Support/org.openeuler.omnivirt/'] + chmod_cmd = ['sudo', 'chmod -R', '775', '/Library/Application\ Support/org.openeuler.eulerlauncher/'] subprocess.run(' '.join(chmod_cmd), shell=True) print('Create softlink for the CLI binary ...') - ln_cmd = ['sudo', 'ln', '-s', '/Library/Application\ Support/org.openeuler.omnivirt/omnivirt', '/usr/local/bin/'] + ln_cmd = ['sudo', 'ln', '-s', '/Library/Application\ Support/org.openeuler.eulerlauncher/eulerlauncher', '/usr/local/bin/'] subprocess.run(' '.join(ln_cmd), shell=True) print('Done ...') - print('Please update omnivirt.conf according to your own environment, enjoy your openEuler trip ...') \ No newline at end of file + print('Please update eulerlauncher.conf according to your own environment, enjoy your openEuler trip ...') \ No newline at end of file diff --git a/omnivirt/macos-gui.py b/eulerlauncher/macos-gui.py similarity index 58% rename from omnivirt/macos-gui.py rename to eulerlauncher/macos-gui.py index b5b63532dc6bc49cc4fd4cabecf89f4cefa99e23..fc867855b7ee93de4ad60672a0a9187c17f0ba79 100644 --- a/omnivirt/macos-gui.py +++ b/eulerlauncher/macos-gui.py @@ -6,12 +6,12 @@ import subprocess import signal import sys -from omnivirt.utils import constants -from omnivirt.utils import objs +from eulerlauncher.utils import constants +from eulerlauncher.utils import objs -CONF_DIR_SHELL = '/Library/Application\ Support/org.openeuler.omnivirt/omnivirt.conf' -CONF_DIR = '/Library/Application Support/org.openeuler.omnivirt/omnivirt.conf' +CONF_DIR_SHELL = '/Library/Application\ Support/org.openeuler.eulerlauncher/eulerlauncher.conf' +CONF_DIR = '/Library/Application Support/org.openeuler.eulerlauncher/eulerlauncher.conf' # Avoid create zombie children in MacOS and Linux signal.signal(signal.SIGCHLD, signal.SIG_IGN) @@ -34,18 +34,18 @@ if __name__ == '__main__': icon.stop() - icon = pystray.Icon('OmniVirt', logo, menu=pystray.Menu( - pystray.MenuItem('Exit OmniVirt', on_clicked) + icon = pystray.Icon('EulerLauncher', logo, menu=pystray.Menu( + pystray.MenuItem('Exit EulerLauncher', on_clicked) )) except Exception as e: print('Error: ' + str(e)) else: - omnivirtd_cmd = ['sudo', os.path.join(base_dir,'./bin/OmniVirtd'), CONF_DIR_SHELL, base_dir] - omnivirtd = subprocess.Popen(' '.join(omnivirtd_cmd), shell=True, preexec_fn=os.setsid) + launcherd_cmd = ['sudo', os.path.join(base_dir,'./bin/EulerLauncherd'), CONF_DIR_SHELL, base_dir] + launcherd = subprocess.Popen(' '.join(launcherd_cmd), shell=True, preexec_fn=os.setsid) def term_handler(signum, frame): - subprocess.check_call(['sudo', 'kill', str(omnivirtd.pid)]) + subprocess.check_call(['sudo', 'kill', str(launcherd.pid)]) # Avoid create orphan children in MacOS and Linux signal.signal(signal.SIGTERM, term_handler) @@ -53,6 +53,6 @@ if __name__ == '__main__': icon.run() # Shutdown omnivirtd, we created it with sudo, so kill it with sudo - subprocess.check_call(['sudo', 'kill', str(omnivirtd.pid)]) - os.waitpid(omnivirtd.pid, 0) + subprocess.check_call(['sudo', 'kill', str(launcherd.pid)]) + os.waitpid(launcherd.pid, 0) sys.exit(0) \ No newline at end of file diff --git a/omnivirt/services/__init__.py b/eulerlauncher/services/__init__.py similarity index 100% rename from omnivirt/services/__init__.py rename to eulerlauncher/services/__init__.py diff --git a/eulerlauncher/services/__pycache__/__init__.cpython-310.pyc b/eulerlauncher/services/__pycache__/__init__.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..9afeb345ba1356c33611483ee30db7dc426e0aa5 Binary files /dev/null and b/eulerlauncher/services/__pycache__/__init__.cpython-310.pyc differ diff --git a/omnivirt/services/imager_service.py b/eulerlauncher/services/imager_service.py similarity index 90% rename from omnivirt/services/imager_service.py rename to eulerlauncher/services/imager_service.py index c2d6f28d135fcaa2bed4b5056d2e3a33f911aef9..0d1fb8eb82d23aa81d1b05117536a59856cc39e9 100644 --- a/omnivirt/services/imager_service.py +++ b/eulerlauncher/services/imager_service.py @@ -1,11 +1,11 @@ import logging import os -from omnivirt.backends.mac import image_handler as mac_image_handler -from omnivirt.backends.win import image_handler as win_image_handler -from omnivirt.grpcs.omnivirt_grpc import images_pb2, images_pb2_grpc -from omnivirt.utils import constants as omni_constants -from omnivirt.utils import utils as omni_utils +from eulerlauncher.backends.mac import image_handler as mac_image_handler +from eulerlauncher.backends.win import image_handler as win_image_handler +from eulerlauncher.grpcs.eulerlauncher_grpc import images_pb2, images_pb2_grpc +from eulerlauncher.utils import constants as omni_constants +from eulerlauncher.utils import utils as omni_utils LOG = logging.getLogger(__name__) diff --git a/omnivirt/services/instance_service.py b/eulerlauncher/services/instance_service.py similarity index 90% rename from omnivirt/services/instance_service.py rename to eulerlauncher/services/instance_service.py index e4125e9c598a1bc40e5d76311911b13424b779bf..bea002e913f7bceab9ce1b0dea845477c430938b 100644 --- a/omnivirt/services/instance_service.py +++ b/eulerlauncher/services/instance_service.py @@ -1,8 +1,8 @@ import logging import os -from omnivirt.grpcs.omnivirt_grpc import instances_pb2, instances_pb2_grpc -from omnivirt.utils import utils +from eulerlauncher.grpcs.eulerlauncher_grpc import instances_pb2, instances_pb2_grpc +from eulerlauncher.utils import utils LOG = logging.getLogger(__name__) @@ -21,11 +21,11 @@ class InstanceService(instances_pb2_grpc.InstanceGrpcServiceServicer): self.image_dir = os.path.join(self.work_dir, 'images') self.img_record_file = os.path.join(self.image_dir, 'images.json') if host_os == 'Win': - from omnivirt.backends.win import instance_handler as win_instance_handler + from eulerlauncher.backends.win import instance_handler as win_instance_handler self.backend = win_instance_handler.WinInstanceHandler( self.CONF, self.work_dir, self.instance_dir, self.image_dir, self.img_record_file, LOG) elif host_os == 'MacOS': - from omnivirt.backends.mac import instance_handler as mac_instance_handler + from eulerlauncher.backends.mac import instance_handler as mac_instance_handler self.backend = mac_instance_handler.MacInstanceHandler( self.CONF, self.work_dir, self.instance_dir, self.image_dir, self.img_record_file, LOG, self.svc_base_dir) diff --git a/omnivirt/utils/__init__.py b/eulerlauncher/utils/__init__.py similarity index 100% rename from omnivirt/utils/__init__.py rename to eulerlauncher/utils/__init__.py diff --git a/eulerlauncher/utils/__pycache__/__init__.cpython-310.pyc b/eulerlauncher/utils/__pycache__/__init__.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..47e4af3464d91d3c87657234846be67cb24b3baf Binary files /dev/null and b/eulerlauncher/utils/__pycache__/__init__.cpython-310.pyc differ diff --git a/omnivirt/utils/constants.py b/eulerlauncher/utils/constants.py similarity index 100% rename from omnivirt/utils/constants.py rename to eulerlauncher/utils/constants.py diff --git a/omnivirt/utils/exceptions.py b/eulerlauncher/utils/exceptions.py similarity index 78% rename from omnivirt/utils/exceptions.py rename to eulerlauncher/utils/exceptions.py index 3f671e1fbcca83b98d0e02f86d16ce2947f65580..cf43924c606d85c4d5543d526dd4a44dc138331d 100644 --- a/omnivirt/utils/exceptions.py +++ b/eulerlauncher/utils/exceptions.py @@ -1,12 +1,12 @@ -"""OmniVirt Base Exceptions. +"""EulerLauncher Base Exceptions. """ import logging LOG = logging.getLogger(__name__) -class OmniVirtException(Exception): - """Base OmniVirt Exception +class EulerLauncherException(Exception): + """Base EulerLauncher Exception To correctly use this class, inherit from it and define a 'msg_fmt' property. That msg_fmt will get printf'd with the keyword arguments provided to the constructor. @@ -35,7 +35,7 @@ class OmniVirtException(Exception): message = self.msg_fmt self.message = message - super(OmniVirtException, self).__init__(message) + super(EulerLauncherException, self).__init__(message) def _log_exception(self): LOG.exception('Exception in string format operation') @@ -51,11 +51,11 @@ class OmniVirtException(Exception): return str(dict_repr) -class NoSuchFile(OmniVirtException): +class NoSuchFile(EulerLauncherException): msg_fmt = "No Such File or Directory: %(file)s" -class NoConfigFileProvided(OmniVirtException): +class NoConfigFileProvided(EulerLauncherException): msg_fmt = "Config File Should Be Provided" -class OmniVirtdNotAvailable(OmniVirtException): +class OmniVirtdNotAvailable(EulerLauncherException): msg_fmt = "OmniVirtd Daemon is not available" \ No newline at end of file diff --git a/omnivirt/utils/objs.py b/eulerlauncher/utils/objs.py similarity index 90% rename from omnivirt/utils/objs.py rename to eulerlauncher/utils/objs.py index 9cb2004c83b56d75f90c0c03e27be956514e32e1..714e26d3247e638c9c7748080bb0550d2f9006d5 100644 --- a/omnivirt/utils/objs.py +++ b/eulerlauncher/utils/objs.py @@ -1,8 +1,8 @@ import os import configparser -from omnivirt.utils import exceptions -from omnivirt.utils import constants +from eulerlauncher.utils import exceptions +from eulerlauncher.utils import constants class Instance(object): diff --git a/omnivirt/utils/utils.py b/eulerlauncher/utils/utils.py similarity index 92% rename from omnivirt/utils/utils.py rename to eulerlauncher/utils/utils.py index b6f10c97872b802bfb1a92f6eea332b0c0899955..8381c74aaddaa9d9418fdc9e08dfa1c014ab1e7b 100644 --- a/omnivirt/utils/utils.py +++ b/eulerlauncher/utils/utils.py @@ -8,8 +8,8 @@ import uuid from google.protobuf.json_format import MessageToDict -from omnivirt.utils import exceptions -from omnivirt.utils import objs +from eulerlauncher.utils import exceptions +from eulerlauncher.utils import objs def asyncwrapper(fn): diff --git a/install.spec b/install.spec index cac4aec15a0e8ccc5ab82c9791ec42e9b0e9ab8d..865540162d6c0d9702c87439db750868ff0adecf 100644 --- a/install.spec +++ b/install.spec @@ -5,10 +5,10 @@ block_cipher = None a = Analysis( - ['omnivirt/install.py'], + ['eulerlauncher/install.py'], pathex=[], - binaries=[('dist/omnivirt', './etc')], - datas=[('etc/omnivirt.conf', './etc'), ('resources/qemu/edk2-aarch64-code.fd', './etc'), ('resources/qemu/edk2-x86_64-code.fd', './etc')], + binaries=[('dist/eulerlauncher', './etc')], + datas=[('etc/eulerlauncher.conf', './etc'), ('resources/qemu/edk2-aarch64-code.fd', './etc'), ('resources/qemu/edk2-x86_64-code.fd', './etc')], hiddenimports=[], hookspath=[], hooksconfig={}, diff --git a/omnivirt/__pycache__/__init__.cpython-310.pyc b/omnivirt/__pycache__/__init__.cpython-310.pyc deleted file mode 100644 index 54a26528c7bd3e1d90cc93d1ff93fc2a00ef4c2e..0000000000000000000000000000000000000000 Binary files a/omnivirt/__pycache__/__init__.cpython-310.pyc and /dev/null differ diff --git a/omnivirt/backends/__pycache__/__init__.cpython-310.pyc b/omnivirt/backends/__pycache__/__init__.cpython-310.pyc deleted file mode 100644 index 0cc9e70986476b2f6e86491b52a66164759458bd..0000000000000000000000000000000000000000 Binary files a/omnivirt/backends/__pycache__/__init__.cpython-310.pyc and /dev/null differ diff --git a/omnivirt/backends/win/__pycache__/__init__.cpython-310.pyc b/omnivirt/backends/win/__pycache__/__init__.cpython-310.pyc deleted file mode 100644 index b60b7386e1a82169ae79dfcc725df6f3ad15ec9b..0000000000000000000000000000000000000000 Binary files a/omnivirt/backends/win/__pycache__/__init__.cpython-310.pyc and /dev/null differ diff --git a/omnivirt/grpcs/__pycache__/__init__.cpython-310.pyc b/omnivirt/grpcs/__pycache__/__init__.cpython-310.pyc deleted file mode 100644 index bf26fdd57195799ee1da127e81050bcef443c378..0000000000000000000000000000000000000000 Binary files a/omnivirt/grpcs/__pycache__/__init__.cpython-310.pyc and /dev/null differ diff --git a/omnivirt/grpcs/omnivirt_grpc/__pycache__/__init__.cpython-310.pyc b/omnivirt/grpcs/omnivirt_grpc/__pycache__/__init__.cpython-310.pyc deleted file mode 100644 index 2a1637de90b2758d310773547b1292d4a736f316..0000000000000000000000000000000000000000 Binary files a/omnivirt/grpcs/omnivirt_grpc/__pycache__/__init__.cpython-310.pyc and /dev/null differ diff --git a/omnivirt/services/__pycache__/__init__.cpython-310.pyc b/omnivirt/services/__pycache__/__init__.cpython-310.pyc deleted file mode 100644 index 36d7135c5e14dd9d44dc4bcc18e8c6802bb36f98..0000000000000000000000000000000000000000 Binary files a/omnivirt/services/__pycache__/__init__.cpython-310.pyc and /dev/null differ diff --git a/omnivirt/utils/__pycache__/__init__.cpython-310.pyc b/omnivirt/utils/__pycache__/__init__.cpython-310.pyc deleted file mode 100644 index 8bf35aee4bbd06edb8b2cbc3bc15b58b80792819..0000000000000000000000000000000000000000 Binary files a/omnivirt/utils/__pycache__/__init__.cpython-310.pyc and /dev/null differ diff --git a/setup.cfg b/setup.cfg index 6a95db993d600c0af33139d63675afd10be7e9b5..5841eef71b88e004dc06a724e19d98f6b8b139e2 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,13 +1,13 @@ [metadata] -name = omnivirt -version = 0.1 +name = eulerlauncher +version = 0.2 summary = A tool to run openEuler instances on all platforms description_file = README.md author = Zhenyu Zheng author_email = zheng.zhenyu@outlook.com python_requires = >=3.8 -url = https://github.com/ZhengZhenyu/omnivirt.git +url = https://gitee.com/openeuler/eulerlauncher.git classifiers = Development Status :: 3 - Alpha Environment :: OmniVirt @@ -25,8 +25,8 @@ classifiers = [files] packages = - omnivirt + eulerlauncher [entry_points] console_scripts = - omnivirt = omnivirt.cli:main \ No newline at end of file + eulerlauncher = eulerlauncher.cli:main \ No newline at end of file