示例#1
0
 def nodes(self, setup_node_controller, request):
     if hasattr(request, 'param'):
         node_vars = self.override_node_parameters(**request.param)
     else:
         node_vars = env_variables
     net_asset = None
     needs_nat = node_vars.get("platform") == consts.Platforms.NONE
     try:
         if not qe_env:
             net_asset = NetworkAssets()
             node_vars["net_asset"] = net_asset.get()
         controller = setup_node_controller(**node_vars)
         nodes = Nodes(controller, node_vars["private_ssh_key_path"])
         nodes.prepare_nodes()
         if needs_nat:
             nodes.configure_nat()
         yield nodes
         if env_variables['test_teardown']:
             logging.info('--- TEARDOWN --- node controller\n')
             nodes.destroy_all_nodes()
         if needs_nat:
             nodes.unconfigure_nat()
     finally:
         if not qe_env:
             net_asset.release_all()
示例#2
0
 def nodes(self, setup_node_controller):
     net_asset = None
     try:
         if not qe_env:
             net_asset = NetworkAssets()
             env_variables["net_asset"] = net_asset.get()
         controller = setup_node_controller(**env_variables)
         nodes = Nodes(controller, env_variables["private_ssh_key_path"])
         nodes.prepare_nodes()
         yield nodes
         logging.info(f'--- TEARDOWN --- node controller\n')
         nodes.destroy_all_nodes()
     finally:
         if not qe_env:
             net_asset.release_all()
        def get_nodes_func(config: TerraformConfig = TerraformConfig()):
            if "nodes" in nodes_data:
                return nodes_data["nodes"]

            net_asset = NetworkAssets()
            config.net_asset = net_asset.get()

            nodes = Nodes(TerraformController(config),
                          config.private_ssh_key_path,
                          net_asset,
                          config.platform == consts.Platforms.NONE)

            nodes.prepare_nodes()
            nodes_data["nodes"] = nodes
            return nodes
示例#4
0
 def nodes(self, setup_node_controller, request):
     if hasattr(request, 'param'):
         node_vars = self.override_node_parameters(**request.param)
     else:
         node_vars = env_variables
     net_asset = None
     try:
         if not qe_env:
             net_asset = NetworkAssets()
             node_vars["net_asset"] = net_asset.get()
         controller = setup_node_controller(**node_vars)
         nodes = Nodes(controller, node_vars["private_ssh_key_path"])
         nodes.prepare_nodes()
         yield nodes
         logging.info('--- TEARDOWN --- node controller\n')
         nodes.destroy_all_nodes()
     finally:
         if not qe_env:
             net_asset.release_all()
        def get_nodes_func(config: TerraformConfig = TerraformConfig()):
            if "nodes" in nodes_data:
                return nodes_data["nodes"]

            nodes_data["needs_nat"] = config.platform == consts.Platforms.NONE
            nodes_data["net_asset"] = NetworkAssets()
            config.net_asset = nodes_data["net_asset"].get()

            nodes = Nodes(TerraformController(config), config.private_ssh_key_path)
            nodes.prepare_nodes()
            if nodes_data["needs_nat"]:
                nodes.configure_nat()

            nodes_data["nodes"] = nodes
            return nodes
示例#6
0
def execute_ibip_flow(args):
    openshift_release_image = os.getenv('OPENSHIFT_INSTALL_RELEASE_IMAGE')
    if not openshift_release_image:
        raise ValueError("os env OPENSHIFT_INSTALL_RELEASE_IMAGE must be provided")

    net_asset = NetworkAssets().get()
    controller = create_controller(net_asset)
    setup_files_and_folders(args, net_asset, controller.cluster_name)

    utils.extract_installer(openshift_release_image, BUILD_DIR)
    installer_generate(openshift_release_image)

    download_live_image(f"{BUILD_DIR}/installer-image.iso")
    image_path = embed("installer-image.iso", "bootstrap-in-place-for-live-iso.ign", EMBED_IMAGE_NAME)

    logging.info("Starting node...")
    controller.image_path = image_path
    controller.start_all_nodes()
    logging.info("Node started!")

    waiting_for_installation_completion(controller)