build.py 文件源码

python
阅读 26 收藏 0 点赞 0 评论 0

项目:kolla-kubernetes-personal 作者: rthallisey 项目源码 文件源码
def main():
    conf = cfg.ConfigOpts()
    common_config.parse(conf, sys.argv[1:], prog='kolla-build')

    if conf.debug:
        LOG.setLevel(logging.DEBUG)

    kolla = KollaWorker(conf)
    kolla.setup_working_dir()
    kolla.find_dockerfiles()
    kolla.create_dockerfiles()

    if conf.template_only:
        LOG.info('Dockerfiles are generated in %s', kolla.working_dir)
        return

    # We set the atime and mtime to 0 epoch to preserve allow the Docker cache
    # to work like we want. A different size or hash will still force a rebuild
    kolla.set_time()

    queue = kolla.build_queue()
    push_queue = six.moves.queue.Queue()

    if conf.save_dependency:
        kolla.save_dependency(conf.save_dependency)
        LOG.info('Docker images dependency is saved in %s',
                 conf.save_dependency)
        return

    for x in six.moves.range(conf.threads):
        worker = WorkerThread(queue, push_queue, conf)
        worker.setDaemon(True)
        worker.start()

    for x in six.moves.range(conf.push_threads):
        push_thread = PushThread(conf, push_queue)
        push_thread.start()

    # block until queue is empty
    queue.join()
    push_queue.join()

    kolla.summary()
    kolla.cleanup()

    return kolla.get_image_statuses()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号