Module Expr Str Import alias Import alias Import alias Import alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias Assign NameStore AttributeLoad NameLoad attr ClassDef bases AttributeLoad NameLoad attr body Expr Str Assign NameStore Str FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam defaults NameLoad NameLoad NameLoad NameLoad Num NameLoad NameLoad NameLoad kwarg body Expr Str Expr Call AttributeLoad Call NameLoad NameLoad NameLoad attr NameLoad NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr ListComp Call AttributeLoad NameLoad attr Call AttributeLoad Str attr NameLoad NameLoad NameLoad comprehension TupleStore NameStore NameStore Call NameLoad BoolOpOr NameLoad TupleLoad decorator_list decorator_list ClassDef bases AttributeLoad NameLoad attr body Expr Str FunctionDef arguments args NameParam defaults body Expr Str Pass decorator_list FunctionDef arguments args NameParam defaults body Expr Str Pass decorator_list FunctionDef arguments args NameParam defaults body Expr Str Pass decorator_list FunctionDef arguments args NameParam defaults body Expr Str Pass decorator_list decorator_list ClassDef bases AttributeLoad NameLoad attr body Expr Str Assign NameStore Str Assign NameStore NameLoad Assign NameStore Call AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr FunctionDef arguments args NameParam NameParam defaults body Expr Str Expr Call AttributeLoad Call NameLoad NameLoad NameLoad attr NameLoad Assign AttributeStore NameLoad attr AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr BoolOpOr AttributeLoad NameLoad attr BinOpMod Str TupleLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Pass decorator_list FunctionDef arguments args NameParam defaults body Expr Str If AttributeLoad NameLoad attr body With AttributeLoad NameLoad attr body Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore SubscriptLoad AttributeLoad NameLoad attr Index Call NameLoad AttributeLoad NameLoad attr Expr Call AttributeLoad AttributeLoad NameLoad attr attr Call NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Pass decorator_list FunctionDef arguments args NameParam defaults body Expr Str Return ListComp AttributeLoad NameLoad attr comprehension NameStore AttributeLoad NameLoad attr AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad If UnaryOpNot Call NameLoad NameLoad NameLoad body Raise Call NameLoad BinOpMod Str Call NameLoad NameLoad Assign NameStore Call NameLoad ListLoad Str Str Assign NameStore BinOpBitOr NameLoad Call NameLoad ListLoad Str Assign NameStore Dict AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr BinOpBitOr NameLoad Call NameLoad ListLoad Str NameLoad NameLoad NameLoad Assign NameStore SubscriptLoad NameLoad Index AttributeLoad NameLoad attr Assign NameStore Call NameLoad ListLoad Str Str Str Str Str Str Str Assign NameStore BinOpBitOr NameLoad NameLoad FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call NameLoad NameLoad Assign NameStore Call NameLoad BinOpSub NameLoad NameLoad Assign NameStore BinOpSub NameLoad NameLoad If NameLoad body Raise Call NameLoad Call AttributeLoad Str attr Call AttributeLoad Str attr NameLoad orelse If NameLoad body Raise Call NameLoad Call AttributeLoad Str attr Call AttributeLoad Str attr NameLoad decorator_list For NameStore NameLoad body Expr Call NameLoad NameLoad Assign NameStore SubscriptLoad NameLoad Index Str Assign NameStore SubscriptLoad NameLoad Index Str Assign NameStore Call AttributeLoad NameLoad attr Str Assign NameStore Call AttributeLoad NameLoad attr Str Assign NameStore Call AttributeLoad NameLoad attr Str Assign NameStore Call AttributeLoad NameLoad attr Str ListLoad Assign NameStore Call AttributeLoad NameLoad attr Str If UnaryOpNot Call NameLoad NameLoad NameLoad body Raise Call NameLoad Call AttributeLoad Str attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr Str ListLoad If UnaryOpNot Call NameLoad NameLoad NameLoad body Raise Call NameLoad Call AttributeLoad Str attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr Str Num Assign NameStore Call AttributeLoad NameLoad attr Str Assign NameStore Call AttributeLoad NameLoad attr Str NameLoad If BoolOpOr BoolOpAnd CompareEq NameLoad AttributeLoad NameLoad attr CompareNotEq AttributeLoad NameLoad attr AttributeLoad NameLoad attr BoolOpAnd CompareNotEq NameLoad AttributeLoad NameLoad attr CompareEq AttributeLoad NameLoad attr AttributeLoad NameLoad attr body Raise Call NameLoad Str Assign NameStore ListLoad For NameStore NameLoad body Expr Call AttributeLoad NameLoad attr Dict Str NameLoad For NameStore NameLoad body Expr Call AttributeLoad NameLoad attr Dict Str NameLoad Assign NameStore Call NameLoad Str keyword NameLoad keyword NameLoad keyword NameLoad keyword NameLoad keyword NameLoad keyword NameLoad keyword NameLoad keyword NameLoad keyword NameLoad Assign NameStore Call NameLoad NameLoad Assign NameStore Call NameLoad NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad decorator_list NameLoad FunctionDef arguments args NameParam defaults body Expr Str With AttributeLoad NameLoad attr body If AttributeLoad NameLoad attr body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Assign AttributeStore NameLoad attr NameLoad Return NameLoad orelse Return NameLoad decorator_list NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Dict AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr NameLoad NameLoad NameLoad NameLoad If CompareIn NameLoad NameLoad body Return SubscriptLoad NameLoad Index NameLoad orelse Expr Call AttributeLoad NameLoad attr Str Return NameLoad decorator_list ClassDef bases NameLoad AttributeLoad NameLoad attr body Pass decorator_list ClassDef bases NameLoad AttributeLoad NameLoad attr body Pass decorator_list ClassDef bases NameLoad AttributeLoad NameLoad attr body Pass decorator_list ClassDef bases NameLoad AttributeLoad NameLoad attr body Pass decorator_list
N/A N/A Class to represent a Static Virtual Machine object.

All static VMs provided in a given group will be used before any non-static
VMs are provisioned. For example, in a test that uses 4 VMs, if 3 static VMs
are provided, all of them will be used and one additional non-static VM
will be provisioned. The VM's should be set up with passwordless ssh and
passwordless sudo (neither sshing nor running a sudo command should prompt
the user for a password).

All VM specifics are self-contained and the class provides methods to
operate on the VM: boot, shutdown, etc.
 N/A collections N/A json N/A logging N/A threading perfkitbenchmarker disk perfkitbenchmarker flags perfkitbenchmarker linux_virtual_machine perfkitbenchmarker os_types perfkitbenchmarker virtual_machine perfkitbenchmarker windows_virtual_machine N/A FLAGS N/A flags FLAGS StaticVmSpec N/A N/A virtual_machine BaseVmSpec N/A N/A Object containing all info needed to create a Static VM. N/A CLOUD Static __init__ N/A N/A self component_full_name ip_address user_name ssh_private_key internal_ip ssh_port password disk_specs os_type N/A None None None None 22 None None None kwargs N/A N/A Initialize the StaticVmSpec object.

    Args:
      component_full_name: string. Fully qualified name of the configurable
          component containing the config options.
      ip_address: The public ip address of the VM.
      user_name: The username of the VM that the keyfile corresponds to.
      ssh_private_key: The absolute path to the private keyfile to use to ssh
          to the VM.
      internal_ip: The internal ip address of the VM.
      ssh_port: The port number to use for SSH and SCP commands.
      password: The password used to log into the VM (Windows Only).
      disk_specs: None or a list of dictionaries containing kwargs used to
          create disk.BaseDiskSpecs.
      os_type: The OS type of the VM. See the flag of the same name for more
          information.
     N/A N/A N/A N/A super StaticVmSpec self __init__ component_full_name kwargs N/A N/A self ip_address ip_address N/A N/A self user_name user_name N/A N/A self ssh_private_key ssh_private_key N/A N/A self internal_ip internal_ip N/A N/A self ssh_port ssh_port N/A N/A self password password N/A N/A self os_type os_type N/A N/A self disk_specs N/A N/A N/A disk BaseDiskSpec N/A N/A {0}.disk_specs[{1}] format component_full_name i disk_spec N/A N/A i disk_spec N/A enumerate N/A disk_specs N/A N/A N/A StaticDisk N/A N/A disk BaseDisk N/A N/A Object representing a static Disk. _Create N/A N/A self N/A N/A N/A StaticDisks don't implement _Create(). N/A N/A _Delete N/A N/A self N/A N/A N/A StaticDisks don't implement _Delete(). N/A N/A Attach N/A N/A self N/A N/A N/A StaticDisks don't implement Attach(). N/A N/A Detach N/A N/A self N/A N/A N/A StaticDisks don't implement Detach(). N/A N/A N/A StaticVirtualMachine N/A N/A virtual_machine BaseVirtualMachine N/A N/A Object representing a Static Virtual Machine. N/A CLOUD Static N/A is_static True N/A vm_pool N/A N/A collections deque N/A vm_pool_lock N/A N/A threading Lock __init__ N/A N/A self vm_spec N/A N/A N/A Initialize a static virtual machine.

    Args:
      vm_spec: A StaticVmSpec object containing arguments.
     N/A N/A N/A N/A super StaticVirtualMachine self __init__ vm_spec N/A N/A self ip_address N/A vm_spec ip_address N/A N/A self user_name N/A vm_spec user_name N/A N/A self ssh_private_key N/A vm_spec ssh_private_key N/A N/A self internal_ip N/A vm_spec internal_ip N/A N/A self zone N/A N/A self zone N/A Static - %s@%s N/A N/A self user_name N/A self ip_address N/A N/A self ssh_port N/A vm_spec ssh_port N/A N/A self password N/A vm_spec password N/A N/A self disk_specs N/A vm_spec disk_specs N/A N/A self from_pool False N/A _Create N/A N/A self N/A N/A N/A StaticVirtualMachines do not implement _Create(). N/A N/A _Delete N/A N/A self N/A N/A N/A Returns the virtual machine to the pool. N/A N/A self from_pool N/A N/A N/A self vm_pool_lock N/A N/A N/A N/A N/A self vm_pool appendleft self N/A CreateScratchDisk N/A N/A self disk_spec N/A N/A N/A Create a VM's scratch disk.

    Args:
      disk_spec: virtual_machine.BaseDiskSpec object of the disk.
     N/A spec N/A N/A self disk_specs N/A N/A len N/A self scratch_disks N/A N/A N/A N/A self scratch_disks append N/A StaticDisk spec N/A DeleteScratchDisks N/A N/A self N/A N/A N/A StaticVirtualMachines do not delete scratch disks. N/A N/A GetLocalDisks N/A N/A self N/A N/A N/A Returns a list of local disks on the VM. N/A N/A N/A disk_spec device_path N/A disk_spec N/A self disk_specs N/A disk_spec device_path N/A ReadStaticVirtualMachineFile N/A N/A cls file_obj N/A N/A N/A Read a file describing the static VMs to use.

    This function will read the static VM information from the provided file,
    instantiate VMs corresponding to the info, and add the VMs to the static
    VM pool. The provided file should contain a single array in JSON-format.
    Each element in the array must be an object with required format:

      ip_address: string.
      user_name: string.
      keyfile_path: string.
      ssh_port: integer, optional. Default 22
      internal_ip: string, optional.
      zone: string, optional.
      local_disks: array of strings, optional.
      scratch_disk_mountpoints: array of strings, optional
      os_type: string, optional (see package_managers)
      install_packages: bool, optional

    Args:
      file_obj: An open handle to a file containing the static VM info.

    Raises:
      ValueError: On missing required keys, or invalid keys.
     N/A vm_arr N/A N/A json load file_obj N/A N/A N/A isinstance vm_arr list N/A N/A N/A ValueError N/A Invalid static VM file. Expected array, got: %s. N/A type vm_arr N/A required_keys N/A frozenset N/A ip_address user_name N/A linux_required_keys N/A required_keys N/A frozenset N/A keyfile_path N/A required_keys_by_os N/A N/A os_types WINDOWS N/A os_types DEBIAN N/A os_types RHEL N/A os_types UBUNTU_CONTAINER N/A required_keys N/A frozenset N/A password linux_required_keys linux_required_keys linux_required_keys N/A required_keys N/A required_keys_by_os N/A N/A FLAGS os_type N/A optional_keys N/A frozenset N/A internal_ip zone local_disks scratch_disk_mountpoints os_type ssh_port install_packages N/A allowed_keys N/A required_keys optional_keys VerifyItemFormat N/A N/A item N/A N/A N/A Verify that the decoded JSON object matches the required schema. N/A item_keys N/A frozenset item N/A extra_keys N/A sorted N/A item_keys allowed_keys N/A missing_keys N/A required_keys item_keys N/A extra_keys N/A N/A N/A ValueError N/A N/A Unexpected keys: {0} format N/A N/A ,  join extra_keys N/A N/A missing_keys N/A N/A N/A ValueError N/A N/A Missing required keys: {0} format N/A N/A ,  join missing_keys N/A N/A item vm_arr N/A N/A N/A VerifyItemFormat item N/A ip_address N/A item N/A ip_address N/A user_name N/A item N/A user_name N/A keyfile_path N/A N/A item get keyfile_path N/A internal_ip N/A N/A item get internal_ip N/A zone N/A N/A item get zone N/A local_disks N/A N/A item get local_disks N/A N/A password N/A N/A item get password N/A N/A N/A isinstance local_disks list N/A N/A N/A ValueError N/A N/A Expected a list of local disks, got: {0} format local_disks N/A scratch_disk_mountpoints N/A N/A item get scratch_disk_mountpoints N/A N/A N/A N/A isinstance scratch_disk_mountpoints list N/A N/A N/A ValueError N/A N/A Expected a list of disk mount points, got: {0} format scratch_disk_mountpoints N/A ssh_port N/A N/A item get ssh_port 22 N/A os_type N/A N/A item get os_type N/A install_packages N/A N/A item get install_packages True N/A N/A N/A N/A os_type N/A os_types WINDOWS N/A N/A FLAGS os_type N/A os_types WINDOWS N/A N/A os_type N/A os_types WINDOWS N/A N/A FLAGS os_type N/A os_types WINDOWS N/A N/A N/A ValueError Please only use Windows VMs when using --os_type=windows and vice versa. N/A disk_kwargs_list N/A N/A path scratch_disk_mountpoints N/A N/A N/A N/A disk_kwargs_list append N/A mount_point path N/A local_disk local_disks N/A N/A N/A N/A disk_kwargs_list append N/A device_path local_disk N/A vm_spec N/A StaticVmSpec static_vm_file ip_address ip_address user_name user_name ssh_port ssh_port install_packages install_packages ssh_private_key keyfile_path internal_ip internal_ip zone zone disk_specs disk_kwargs_list password password N/A vm_class N/A GetStaticVmClass os_type N/A vm N/A vm_class vm_spec N/A N/A N/A N/A cls vm_pool append vm N/A classmethod GetStaticVirtualMachine N/A N/A cls N/A N/A N/A Pull a Static VM from the pool of static VMs.

    If there are no VMs left in the pool, the method will return None.

    Returns:
        A static VM from the pool, or None if there are no static VMs left.
     N/A N/A cls vm_pool_lock N/A N/A N/A cls vm_pool N/A N/A vm N/A N/A N/A cls vm_pool popleft N/A N/A vm from_pool True N/A vm N/A N/A None N/A classmethod N/A GetStaticVmClass N/A N/A os_type N/A N/A N/A Returns the static VM class that corresponds to the os_type. N/A class_dict N/A N/A os_types DEBIAN N/A os_types RHEL N/A os_types WINDOWS N/A os_types UBUNTU_CONTAINER DebianBasedStaticVirtualMachine RhelBasedStaticVirtualMachine WindowsBasedStaticVirtualMachine ContainerizedStaticVirtualMachine N/A N/A os_type class_dict N/A N/A N/A class_dict N/A os_type N/A N/A N/A N/A logging warning Could not find os type for VM. Defaulting to debian. N/A DebianBasedStaticVirtualMachine N/A ContainerizedStaticVirtualMachine N/A StaticVirtualMachine N/A linux_virtual_machine ContainerizedDebianMixin N/A N/A N/A DebianBasedStaticVirtualMachine N/A StaticVirtualMachine N/A linux_virtual_machine DebianMixin N/A N/A N/A RhelBasedStaticVirtualMachine N/A StaticVirtualMachine N/A linux_virtual_machine RhelMixin N/A N/A N/A WindowsBasedStaticVirtualMachine N/A StaticVirtualMachine N/A windows_virtual_machine WindowsMixin N/A N/A N/A