Teuthology docker 目标 hack (2/4)
teuthology 的 容器 hack 得到了 改进,以便在安装 Ceph 及其依赖项之后快照容器。 这有助于快速测试 ceph-qa-suite 任务。 一个仅安装 Firefly 版本 Ceph 的任务在初始安装(这可能需要 5 到 15 分钟,具体取决于机器的速度和可用带宽)之后需要 14 秒。
... 2014-11-17 01:21:00,067.067 INFO:teuthology.worker:Reserved job 42 2014-11-17 01:21:00,067.067 INFO:teuthology.worker:Config is: machine_type: container name: foo os_type: ubuntu os_version: '14.04' overrides: install: ceph: {branch: firefly} owner: loic@dachary.org priority: 1000 roles
- [mon.a, osd.0, osd.1, client.0] tasks
- {install: null} tube: container verbose: false
Fetching from upstream into /home/loic/src/ceph-qa-suite_master ... completed on container001: sudo lsb_release '-is': Ubuntu reusing existing image ceph-base-ubuntu-14.04-firefly running 'docker' 'stop' 'container001' completed ('docker', 'stop', u'container001') on container001: container001 ... 2014-11-17 01:21:31,677.677 INFO:teuthology.run:Summary data: {duration: 14, flavor: basic, success: true} 2014-11-17 01:21:31,677.677 INFO:teuthology.run:pass
install.py 任务的 install_packages 检测到远程端是一个容器
if hasattr(remote, 'type') and remote.type == 'container'
并且不并行地在所有远程端安装软件包,而是检查是否存在一个与要安装的 Ceph 软件包分支名称相同的 docker 镜像(它应该使用提交哈希 ID 代替)
remote.commit_name = config['branch'] if remote.image_exists()
如果不存在这样的镜像,它将安装软件包并创建镜像。
f = install_pkgs[system_type] f(ctx, remote, pkgs[system_type], config) remote.commit(config['branch'])
然后,它停止所有远程端(即所有容器)。 当将命令发送到远程端执行时,它将基于包含已安装软件包的镜像启动 docker 容器,而不是仅包含基本操作系统的容器。
for remote in ctx.cluster.remotes.iterkeys(): remote.commit_name = config['branch'] remote.stop()
代码没有显示它启动的原因,因为 它在运行第一个命令时隐式发生。