code
stringlengths
66
870k
docstring
stringlengths
19
26.7k
func_name
stringlengths
1
138
language
stringclasses
1 value
repo
stringlengths
7
68
path
stringlengths
5
324
url
stringlengths
46
389
license
stringclasses
7 values
def _CalculateMetricsOverAllIterations(result_dicts, metadata={}): """Calculates stats given list of result dictionaries. Each item in the list represends the results from a single iteration. Args: result_dicts: a list of result dictionaries. Each result dictionary represents a single run of the...
Calculates stats given list of result dictionaries. Each item in the list represends the results from a single iteration. Args: result_dicts: a list of result dictionaries. Each result dictionary represents a single run of the CUDA device bandwidth test, parsed by _ParseOutputFromSingleItera...
_CalculateMetricsOverAllIterations
python
GoogleCloudPlatform/PerfKitBenchmarker
perfkitbenchmarker/linux_benchmarks/gpu_pcie_bandwidth_benchmark.py
https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/gpu_pcie_bandwidth_benchmark.py
Apache-2.0
def Run(benchmark_spec): """Sets the GPU clock speed and runs the CUDA PCIe benchmark. Args: benchmark_spec: The benchmark specification. Contains all data that is required to run the benchmark. Returns: A list of sample.Sample objects. """ vm = benchmark_spec.vms[0] num_iterations = FLAGS.g...
Sets the GPU clock speed and runs the CUDA PCIe benchmark. Args: benchmark_spec: The benchmark specification. Contains all data that is required to run the benchmark. Returns: A list of sample.Sample objects.
Run
python
GoogleCloudPlatform/PerfKitBenchmarker
perfkitbenchmarker/linux_benchmarks/gpu_pcie_bandwidth_benchmark.py
https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/gpu_pcie_bandwidth_benchmark.py
Apache-2.0
def Prepare(bm_spec: benchmark_spec.BenchmarkSpec) -> None: """Install and set up GPU PingPong on the target vm. Args: bm_spec: The benchmark specification """ for vm in bm_spec.vms: vm.RemoteCommand(f'{_ENV.value} pip install absl-py') vm.AuthenticateVm() for script in [_TEST_SCRIPT, _SERVER_S...
Install and set up GPU PingPong on the target vm. Args: bm_spec: The benchmark specification
Prepare
python
GoogleCloudPlatform/PerfKitBenchmarker
perfkitbenchmarker/linux_benchmarks/gpu_pingpong_benchmark.py
https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/gpu_pingpong_benchmark.py
Apache-2.0
def _RunGpuPingpong( vm: virtual_machine.BaseVirtualMachine, addr: str ) -> List[Tuple[float, float]]: """Returns the Ping and Pong latency times.""" stdout, stderr = vm.RemoteCommand( f'{_ENV.value} python {_TEST_SCRIPT} {addr}' ) ping_bws = [ float(bw) for bw in regex_util.ExtractAllMatc...
Returns the Ping and Pong latency times.
_RunGpuPingpong
python
GoogleCloudPlatform/PerfKitBenchmarker
perfkitbenchmarker/linux_benchmarks/gpu_pingpong_benchmark.py
https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/gpu_pingpong_benchmark.py
Apache-2.0
def Run(bm_spec: benchmark_spec.BenchmarkSpec) -> List[sample.Sample]: """Run GPU PingPong test. It tests the latency between 2 GPU in 2 VMs using TensorFlow gPRC server which were started during prepare phrase. Args: bm_spec: The benchmark specification Returns: A list of sample.Sample objects. ...
Run GPU PingPong test. It tests the latency between 2 GPU in 2 VMs using TensorFlow gPRC server which were started during prepare phrase. Args: bm_spec: The benchmark specification Returns: A list of sample.Sample objects.
Run
python
GoogleCloudPlatform/PerfKitBenchmarker
perfkitbenchmarker/linux_benchmarks/gpu_pingpong_benchmark.py
https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/gpu_pingpong_benchmark.py
Apache-2.0
def Prepare(benchmark_spec: bm_spec.BenchmarkSpec): """Prepare Hammerdbcli by installing dependencies and uploading binaries. Args: benchmark_spec: The benchmark specification. Contains all data that is required to run the benchmark. """ client_vms = benchmark_spec.vm_groups['clients'] assert len(c...
Prepare Hammerdbcli by installing dependencies and uploading binaries. Args: benchmark_spec: The benchmark specification. Contains all data that is required to run the benchmark.
Prepare
python
GoogleCloudPlatform/PerfKitBenchmarker
perfkitbenchmarker/linux_benchmarks/hammerdbcli_benchmark.py
https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/hammerdbcli_benchmark.py
Apache-2.0
def SetOptimizedServerConfiguration( optimized_server_config: str, server_vm: virtual_machine.BaseVirtualMachine, relational_db: r_db.BaseRelationalDb, db_engine: str, ): """Set the optimized configuration for hammerdb. Args: optimized_server_config: The optimized server configuration type. Cur...
Set the optimized configuration for hammerdb. Args: optimized_server_config: The optimized server configuration type. Currently support MINIMUM_RECOVERY and RESTORABLE server_vm: Server VM to host the database. relational_db: Relational database class. db_engine: Database engine type.
SetOptimizedServerConfiguration
python
GoogleCloudPlatform/PerfKitBenchmarker
perfkitbenchmarker/linux_benchmarks/hammerdbcli_benchmark.py
https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/hammerdbcli_benchmark.py
Apache-2.0
def SetMysqlOptimizedServerConfiguration( optimized_server_config: str, server_vm: virtual_machine.BaseVirtualMachine, relational_db: r_db.BaseRelationalDb, ): """Set the optimized configuration for hammerdb for Mysql. Args: optimized_server_config: The optimized server configuration type. Currentl...
Set the optimized configuration for hammerdb for Mysql. Args: optimized_server_config: The optimized server configuration type. Currently support MINIMUM_RECOVERY and RESTORABLE server_vm: Server VM to host the database. relational_db: Relational database class.
SetMysqlOptimizedServerConfiguration
python
GoogleCloudPlatform/PerfKitBenchmarker
perfkitbenchmarker/linux_benchmarks/hammerdbcli_benchmark.py
https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/hammerdbcli_benchmark.py
Apache-2.0
def SetPostgresOptimizedServerConfiguration( optimized_server_config: str, server_vm: virtual_machine.BaseVirtualMachine, relational_db: r_db.BaseRelationalDb, custom_server_config: str = '', ): """Set the optimized configuration for hammerdb for postgres. Args: optimized_server_config: The opt...
Set the optimized configuration for hammerdb for postgres. Args: optimized_server_config: The optimized server configuration type. Currently support MINIMUM_RECOVERY and RESTORABLE server_vm: Server VM to host the database. relational_db: Relational database class. custom_server_config: str = '...
SetPostgresOptimizedServerConfiguration
python
GoogleCloudPlatform/PerfKitBenchmarker
perfkitbenchmarker/linux_benchmarks/hammerdbcli_benchmark.py
https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/hammerdbcli_benchmark.py
Apache-2.0
def AddMetadata(metadata: Dict[str, Any], updates: Any) -> Dict[str, Any]: """Returns a copy of the metadata with dictionary update applied.""" result = metadata.copy() result.update(updates) return result
Returns a copy of the metadata with dictionary update applied.
AddMetadata
python
GoogleCloudPlatform/PerfKitBenchmarker
perfkitbenchmarker/linux_benchmarks/hammerdbcli_benchmark.py
https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/hammerdbcli_benchmark.py
Apache-2.0
def Run(benchmark_spec: bm_spec.BenchmarkSpec) -> List[sample.Sample]: """Run the Hammerdbcli benchmark. Args: benchmark_spec: The benchmark specification. Contains all data that is required to run the benchmark. Returns: A list of sample.Sample instances. Raises: Exception: if the script i...
Run the Hammerdbcli benchmark. Args: benchmark_spec: The benchmark specification. Contains all data that is required to run the benchmark. Returns: A list of sample.Sample instances. Raises: Exception: if the script is unknown
Run
python
GoogleCloudPlatform/PerfKitBenchmarker
perfkitbenchmarker/linux_benchmarks/hammerdbcli_benchmark.py
https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/hammerdbcli_benchmark.py
Apache-2.0
def Run(benchmark_spec: bm_spec.BenchmarkSpec) -> list[sample.Sample]: """Runs the hardinfo2 benchmark and returns a dict of performance data. Args: benchmark_spec: The benchmark spec for this sample benchmark. Returns: A list of performance samples. """ vm = benchmark_spec.vms[0] samples = [] #...
Runs the hardinfo2 benchmark and returns a dict of performance data. Args: benchmark_spec: The benchmark spec for this sample benchmark. Returns: A list of performance samples.
Run
python
GoogleCloudPlatform/PerfKitBenchmarker
perfkitbenchmarker/linux_benchmarks/hardinfo2_benchmark.py
https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/hardinfo2_benchmark.py
Apache-2.0
def _GetVMsByRole(vm_groups): """Partition "vms" by role in the benchmark. * The first VM is the master. * The first FLAGS.hbase_zookeeper_nodes form the Zookeeper quorum. * The last FLAGS.ycsb_client_vms are loader nodes. * The nodes which are neither the master nor loaders are HBase region servers. Args...
Partition "vms" by role in the benchmark. * The first VM is the master. * The first FLAGS.hbase_zookeeper_nodes form the Zookeeper quorum. * The last FLAGS.ycsb_client_vms are loader nodes. * The nodes which are neither the master nor loaders are HBase region servers. Args: vm_groups: The benchmark_spec...
_GetVMsByRole
python
GoogleCloudPlatform/PerfKitBenchmarker
perfkitbenchmarker/linux_benchmarks/hbase_ycsb_benchmark.py
https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/hbase_ycsb_benchmark.py
Apache-2.0
def Prepare(benchmark_spec): """Prepare the virtual machines to run hadoop. Args: benchmark_spec: The benchmark specification. Contains all data that is required to run the benchmark. """ by_role = _GetVMsByRole(benchmark_spec.vm_groups) loaders = by_role['clients'] assert loaders, 'No loader VM...
Prepare the virtual machines to run hadoop. Args: benchmark_spec: The benchmark specification. Contains all data that is required to run the benchmark.
Prepare
python
GoogleCloudPlatform/PerfKitBenchmarker
perfkitbenchmarker/linux_benchmarks/hbase_ycsb_benchmark.py
https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/hbase_ycsb_benchmark.py
Apache-2.0
def Run(benchmark_spec): """Spawn YCSB and gather the results. Args: benchmark_spec: The benchmark specification. Contains all data that is required to run the benchmark. Returns: A list of sample.Sample objects. """ by_role = _GetVMsByRole(benchmark_spec.vm_groups) loaders = by_role['client...
Spawn YCSB and gather the results. Args: benchmark_spec: The benchmark specification. Contains all data that is required to run the benchmark. Returns: A list of sample.Sample objects.
Run
python
GoogleCloudPlatform/PerfKitBenchmarker
perfkitbenchmarker/linux_benchmarks/hbase_ycsb_benchmark.py
https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/hbase_ycsb_benchmark.py
Apache-2.0
def _CopyAndUpdateRunScripts(model, vm): """Copy and update all necessary run scripts on the given vm. Args: model: name of the model vm: vm to place and update run scripts on """ vm.RemoteCommand( '[ -d "DeepLearningExamples" ] || git clone --branch clan-dev %s' % GITHUB_MODELS_URL ) ...
Copy and update all necessary run scripts on the given vm. Args: model: name of the model vm: vm to place and update run scripts on
_CopyAndUpdateRunScripts
python
GoogleCloudPlatform/PerfKitBenchmarker
perfkitbenchmarker/linux_benchmarks/horovod_benchmark.py
https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/horovod_benchmark.py
Apache-2.0
def PrepareHorovod(vm): """Install dependencies on a single vm. Args: vm: vm to operate on """ logging.info('Installing Horovod on %s', vm) vm.AuthenticateVm() vm.Install('google_cloud_sdk') vm.Install('openmpi') vm.InstallPackages('wget git unzip') vm.Install('nccl') pip = 'pip' if FLAGS.c...
Install dependencies on a single vm. Args: vm: vm to operate on
PrepareHorovod
python
GoogleCloudPlatform/PerfKitBenchmarker
perfkitbenchmarker/linux_benchmarks/horovod_benchmark.py
https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/horovod_benchmark.py
Apache-2.0
def Prepare(benchmark_spec): """Install and set up Horovod on the target vms. Args: benchmark_spec: The benchmark specification """ vms = benchmark_spec.vms background_tasks.RunThreaded(PrepareHorovod, vms) hpc_util.CreateMachineFile(vms, nvidia_driver.QueryNumberOfGpus, MACHINEFILE)
Install and set up Horovod on the target vms. Args: benchmark_spec: The benchmark specification
Prepare
python
GoogleCloudPlatform/PerfKitBenchmarker
perfkitbenchmarker/linux_benchmarks/horovod_benchmark.py
https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/horovod_benchmark.py
Apache-2.0
def _CreateMetadataDict(vms): """Create metadata dict to be used in run results. Args: vms: A list of worker VMs. Returns: metadata dict """ vm = vms[0] gpus_per_node = nvidia_driver.QueryNumberOfGpus(vm) num_vms = len(vms) total_gpus = gpus_per_node * num_vms metadata = dict() metadata.u...
Create metadata dict to be used in run results. Args: vms: A list of worker VMs. Returns: metadata dict
_CreateMetadataDict
python
GoogleCloudPlatform/PerfKitBenchmarker
perfkitbenchmarker/linux_benchmarks/horovod_benchmark.py
https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/horovod_benchmark.py
Apache-2.0
def _ExtractResNetThroughput(output): """Extract throughput from Horovod output. Args: output: Horovod output Returns: A tuple of: Average throuput in images per second (float) Unit of the throughput metric (str) """ # Start from last line and iterate backwards. avg_throughput = 0 fo...
Extract throughput from Horovod output. Args: output: Horovod output Returns: A tuple of: Average throuput in images per second (float) Unit of the throughput metric (str)
_ExtractResNetThroughput
python
GoogleCloudPlatform/PerfKitBenchmarker
perfkitbenchmarker/linux_benchmarks/horovod_benchmark.py
https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/horovod_benchmark.py
Apache-2.0
def _ExtractBertThroughput(output): """Extract throughput from Horovod output. Args: output: Horovod output Returns: A tuple of: Average throughput in sentences per second (float) Unit of the throughput metric (str) """ # Start from last line and iterate backwards. avg_throughput = 0 ...
Extract throughput from Horovod output. Args: output: Horovod output Returns: A tuple of: Average throughput in sentences per second (float) Unit of the throughput metric (str)
_ExtractBertThroughput
python
GoogleCloudPlatform/PerfKitBenchmarker
perfkitbenchmarker/linux_benchmarks/horovod_benchmark.py
https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/horovod_benchmark.py
Apache-2.0
def _MakeSamplesFromOutput(vms, stdout, stderr): """Create a sample continaing the measured Horovod throughput. Args: vms: a list of worker VMs stdout: stdout stderr: stderr Returns: list of a Sample containing the Horovod throughput """ metadata = _CreateMetadataDict(vms) output = stdout ...
Create a sample continaing the measured Horovod throughput. Args: vms: a list of worker VMs stdout: stdout stderr: stderr Returns: list of a Sample containing the Horovod throughput
_MakeSamplesFromOutput
python
GoogleCloudPlatform/PerfKitBenchmarker
perfkitbenchmarker/linux_benchmarks/horovod_benchmark.py
https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/horovod_benchmark.py
Apache-2.0
def RunWithVMs(vms, extra_envs=None): """Run Horovod on the cluster. Args: vms: A list of worker VMs. extra_envs: A dictionary of environment variables. Returns: A list of sample.Sample objects. """ background_tasks.RunThreaded( lambda vm: vm.RemoteCommand('rm -rf /tmp/models'), vms ) ...
Run Horovod on the cluster. Args: vms: A list of worker VMs. extra_envs: A dictionary of environment variables. Returns: A list of sample.Sample objects.
RunWithVMs
python
GoogleCloudPlatform/PerfKitBenchmarker
perfkitbenchmarker/linux_benchmarks/horovod_benchmark.py
https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/horovod_benchmark.py
Apache-2.0
def CheckPrerequisites(_) -> None: """Verifies that the required resources are present. Raises: perfkitbenchmarker.data.ResourceNotFound: On missing resource. NotImplementedError: On certain flag combination not currently supported. """ data.ResourcePath(LOCAL_HPCCINF_FILE) if FLAGS['hpcc_binary'].pr...
Verifies that the required resources are present. Raises: perfkitbenchmarker.data.ResourceNotFound: On missing resource. NotImplementedError: On certain flag combination not currently supported.
CheckPrerequisites
python
GoogleCloudPlatform/PerfKitBenchmarker
perfkitbenchmarker/linux_benchmarks/hpcc_benchmark.py
https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/hpcc_benchmark.py
Apache-2.0
def _CalculateHpccDimensions( num_vms: int, num_cpus: int, vm_memory_size_actual: int ) -> HpccDimensions: """Calculates the HPCC dimensions for the run.""" if FLAGS.memory_size_mb: total_memory = FLAGS.memory_size_mb * 1024 * 1024 * num_vms else: total_memory = vm_memory_size_actual * 1024 * num_vms ...
Calculates the HPCC dimensions for the run.
_CalculateHpccDimensions
python
GoogleCloudPlatform/PerfKitBenchmarker
perfkitbenchmarker/linux_benchmarks/hpcc_benchmark.py
https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/hpcc_benchmark.py
Apache-2.0
def _PrepareBinaries( headnode_vm: linux_vm.BaseLinuxVirtualMachine, vm: linux_vm.BaseLinuxVirtualMachine, ) -> None: """Prepares the binaries on the vm.""" vm.Install('fortran') headnode_vm.MoveFile(vm, 'hpcc', 'hpcc') headnode_vm.MoveFile(vm, '/usr/bin/orted', 'orted') vm.RemoteCommand('sudo mv orte...
Prepares the binaries on the vm.
_PrepareBinaries
python
GoogleCloudPlatform/PerfKitBenchmarker
perfkitbenchmarker/linux_benchmarks/hpcc_benchmark.py
https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/hpcc_benchmark.py
Apache-2.0
def Prepare(benchmark_spec: bm_spec.BenchmarkSpec) -> None: """Install HPCC on the target vms. Args: benchmark_spec: The benchmark specification. Contains all data that is required to run the benchmark. """ vms = benchmark_spec.vms headnode_vm = vms[0] PrepareHpcc(headnode_vm) CreateHpccinf(he...
Install HPCC on the target vms. Args: benchmark_spec: The benchmark specification. Contains all data that is required to run the benchmark.
Prepare
python
GoogleCloudPlatform/PerfKitBenchmarker
perfkitbenchmarker/linux_benchmarks/hpcc_benchmark.py
https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/hpcc_benchmark.py
Apache-2.0
def BaseMetadata(vm: linux_vm.BaseLinuxVirtualMachine) -> Dict[str, str]: """Update metadata with hpcc-related flag values.""" metadata = {} metadata['memory_size_mb'] = FLAGS.memory_size_mb if FLAGS['hpcc_binary'].present: metadata['override_binary'] = FLAGS.hpcc_binary if FLAGS['hpcc_mpi_env'].present: ...
Update metadata with hpcc-related flag values.
BaseMetadata
python
GoogleCloudPlatform/PerfKitBenchmarker
perfkitbenchmarker/linux_benchmarks/hpcc_benchmark.py
https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/hpcc_benchmark.py
Apache-2.0
def ParseOutput(hpcc_output: str) -> List[sample.Sample]: """Parses the output from HPCC. Args: hpcc_output: A string containing the text of hpccoutf.txt. Returns: A list of samples to be published (in the same format as Run() returns). """ results = [] # Parse all metrics from metric=value lines...
Parses the output from HPCC. Args: hpcc_output: A string containing the text of hpccoutf.txt. Returns: A list of samples to be published (in the same format as Run() returns).
ParseOutput
python
GoogleCloudPlatform/PerfKitBenchmarker
perfkitbenchmarker/linux_benchmarks/hpcc_benchmark.py
https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/hpcc_benchmark.py
Apache-2.0
def Run(benchmark_spec: bm_spec.BenchmarkSpec) -> List[sample.Sample]: """Run HPCC on the cluster. Args: benchmark_spec: The benchmark specification. Contains all data that is required to run the benchmark. Returns: A list of sample.Sample objects. """ # recreate the HPL config file with each ...
Run HPCC on the cluster. Args: benchmark_spec: The benchmark specification. Contains all data that is required to run the benchmark. Returns: A list of sample.Sample objects.
Run
python
GoogleCloudPlatform/PerfKitBenchmarker
perfkitbenchmarker/linux_benchmarks/hpcc_benchmark.py
https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/hpcc_benchmark.py
Apache-2.0
def _AddCommonMetadata( samples: List[sample.Sample], benchmark_spec: bm_spec.BenchmarkSpec, dimensions: Dict[str, Any], ) -> None: """Adds metadata common to all samples.""" for item in samples: item.metadata.update(BaseMetadata(benchmark_spec.vms[0])) item.metadata['num_machines'] = len(benchm...
Adds metadata common to all samples.
_AddCommonMetadata
python
GoogleCloudPlatform/PerfKitBenchmarker
perfkitbenchmarker/linux_benchmarks/hpcc_benchmark.py
https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/hpcc_benchmark.py
Apache-2.0
def RunHpccSource( vms: List[linux_vm.BaseLinuxVirtualMachine], ) -> List[sample.Sample]: """Returns the parsed output from running the compiled from source HPCC.""" headnode_vm = vms[0] # backup existing HPCC output, if any headnode_vm.RemoteCommand( 'if [ -f hpccoutf.txt ]; then ' 'mv hpccoutf...
Returns the parsed output from running the compiled from source HPCC.
RunHpccSource
python
GoogleCloudPlatform/PerfKitBenchmarker
perfkitbenchmarker/linux_benchmarks/hpcc_benchmark.py
https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/hpcc_benchmark.py
Apache-2.0
def _CreateHpccWrapper(vm: linux_vm.BaseLinuxVirtualMachine) -> None: """Creates a bash script to run HPCC on the VM. This is required for when MKL is installed via the Intel repos as the libiomp5.so file is not in /lib but rather in one found via sourcing the mklvars.sh file. Args: vm: Virtual machine ...
Creates a bash script to run HPCC on the VM. This is required for when MKL is installed via the Intel repos as the libiomp5.so file is not in /lib but rather in one found via sourcing the mklvars.sh file. Args: vm: Virtual machine to put file on.
_CreateHpccWrapper
python
GoogleCloudPlatform/PerfKitBenchmarker
perfkitbenchmarker/linux_benchmarks/hpcc_benchmark.py
https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/hpcc_benchmark.py
Apache-2.0
def Cleanup(benchmark_spec: bm_spec.BenchmarkSpec) -> None: """Cleanup HPCC on the cluster. Args: benchmark_spec: The benchmark specification. Contains all data that is required to run the benchmark. """ vms = benchmark_spec.vms headnode_vm = vms[0] headnode_vm.RemoveFile('hpcc*') headnode_vm.R...
Cleanup HPCC on the cluster. Args: benchmark_spec: The benchmark specification. Contains all data that is required to run the benchmark.
Cleanup
python
GoogleCloudPlatform/PerfKitBenchmarker
perfkitbenchmarker/linux_benchmarks/hpcc_benchmark.py
https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/hpcc_benchmark.py
Apache-2.0
def RunIntelLinpack( vms: List[linux_vm.BaseLinuxVirtualMachine], dimensions: HpccDimensions ) -> sample.Sample: """Returns the parsed output from running the Intel compiled HPCC. Unlike the compiled from source linpack run the Intel compiled linpack can handle being cut off after --hpcc_timeout_hours as it ...
Returns the parsed output from running the Intel compiled HPCC. Unlike the compiled from source linpack run the Intel compiled linpack can handle being cut off after --hpcc_timeout_hours as it parses the continuous output of linpack, reporting the last value found as the HPL_Tflops. The metadata argument valu...
RunIntelLinpack
python
GoogleCloudPlatform/PerfKitBenchmarker
perfkitbenchmarker/linux_benchmarks/hpcc_benchmark.py
https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/hpcc_benchmark.py
Apache-2.0
def _CreateIntelMpiRunCommand( vms: List[linux_vm.BaseLinuxVirtualMachine], dimensions: HpccDimensions ) -> Tuple[str, int]: """Creates the command to run HPL for Intel compiled linpack. Args: vms: List of virtual machines to run on. dimensions: The HpccDimensions for the run Returns: Tuple of t...
Creates the command to run HPL for Intel compiled linpack. Args: vms: List of virtual machines to run on. dimensions: The HpccDimensions for the run Returns: Tuple of the mpirun command and the number of processes to be used.
_CreateIntelMpiRunCommand
python
GoogleCloudPlatform/PerfKitBenchmarker
perfkitbenchmarker/linux_benchmarks/hpcc_benchmark.py
https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/hpcc_benchmark.py
Apache-2.0
def _ParseIntelLinpackOutputFile(file_text: str) -> float: """Returns the tflops for the hpcc run. The last entry that matches WR11C2R4 50688 192 6 10 551.85 1.57334e+02 is the Gflops for the run: 157.33 Args: file_text: The hpcc output file contents. """ line_re = re.compile( ...
Returns the tflops for the hpcc run. The last entry that matches WR11C2R4 50688 192 6 10 551.85 1.57334e+02 is the Gflops for the run: 157.33 Args: file_text: The hpcc output file contents.
_ParseIntelLinpackOutputFile
python
GoogleCloudPlatform/PerfKitBenchmarker
perfkitbenchmarker/linux_benchmarks/hpcc_benchmark.py
https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/hpcc_benchmark.py
Apache-2.0
def _ParseIntelLinpackStdout(stdout: str) -> Tuple[float, Dict[str, float]]: """Parse the stdout of Intel HPL returning a condensed sample of results. Sample stdout: pkb-123-0 : Column=000576 Fraction=0.005 Kernel= 0.58 Mflops=1265648.19 pkb-123-0 : Column=001152 Fraction=0.010 Kernel=969908.14 Mflops=1...
Parse the stdout of Intel HPL returning a condensed sample of results. Sample stdout: pkb-123-0 : Column=000576 Fraction=0.005 Kernel= 0.58 Mflops=1265648.19 pkb-123-0 : Column=001152 Fraction=0.010 Kernel=969908.14 Mflops=1081059.81 pkb-123-0 : Column=001728 Fraction=0.015 Kernel=956391.64 Mflops=104...
_ParseIntelLinpackStdout
python
GoogleCloudPlatform/PerfKitBenchmarker
perfkitbenchmarker/linux_benchmarks/hpcc_benchmark.py
https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/hpcc_benchmark.py
Apache-2.0
def _UpdateBenchmarkSpecWithFlags(benchmark_spec): """Update the benchmark_spec with supplied command line flags. Args: benchmark_spec: benchmark specification to update """ gpus_per_node = FLAGS.hpcg_gpus_per_node or nvidia_driver.QueryNumberOfGpus( benchmark_spec.vms[0] ) cpus_per_rank = int( ...
Update the benchmark_spec with supplied command line flags. Args: benchmark_spec: benchmark specification to update
_UpdateBenchmarkSpecWithFlags
python
GoogleCloudPlatform/PerfKitBenchmarker
perfkitbenchmarker/linux_benchmarks/hpcg_benchmark.py
https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/hpcg_benchmark.py
Apache-2.0
def _CopyAndUpdateRunScripts(vm, benchmark_spec): """Copy and update all necessary run scripts on the given vm. Args: vm: vm to place and update run scripts on benchmark_spec: benchmark specification """ config_file_context = { 'PROBLEM_SIZE': '%s %s %s' % ( benchmark_spec.hpcg_problem_...
Copy and update all necessary run scripts on the given vm. Args: vm: vm to place and update run scripts on benchmark_spec: benchmark specification
_CopyAndUpdateRunScripts
python
GoogleCloudPlatform/PerfKitBenchmarker
perfkitbenchmarker/linux_benchmarks/hpcg_benchmark.py
https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/hpcg_benchmark.py
Apache-2.0
def _PrepareHpcg(vm): """Install HPCG on a single vm. Args: vm: vm to operate on """ if FLAGS.azure_infiniband: vm.Install('mofed') logging.info('Installing HPCG on %s', vm) vm.Install('hpcg') vm.AuthenticateVm()
Install HPCG on a single vm. Args: vm: vm to operate on
_PrepareHpcg
python
GoogleCloudPlatform/PerfKitBenchmarker
perfkitbenchmarker/linux_benchmarks/hpcg_benchmark.py
https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/hpcg_benchmark.py
Apache-2.0
def Prepare(benchmark_spec): """Install and set up HPCG on the target vms. Args: benchmark_spec: The benchmark specification """ vms = benchmark_spec.vms background_tasks.RunThreaded(_PrepareHpcg, vms) _UpdateBenchmarkSpecWithFlags(benchmark_spec) for vm in vms: _CopyAndUpdateRunScripts(vm, bench...
Install and set up HPCG on the target vms. Args: benchmark_spec: The benchmark specification
Prepare
python
GoogleCloudPlatform/PerfKitBenchmarker
perfkitbenchmarker/linux_benchmarks/hpcg_benchmark.py
https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/hpcg_benchmark.py
Apache-2.0
def _CreateMetadataDict(benchmark_spec): """Create metadata dict to be used in run results. Args: benchmark_spec: benchmark spec Returns: metadata dict """ vm = benchmark_spec.vms[0] metadata = dict() metadata.update(cuda_toolkit.GetMetadata(vm)) metadata['num_nodes'] = len(benchmark_spec.vms)...
Create metadata dict to be used in run results. Args: benchmark_spec: benchmark spec Returns: metadata dict
_CreateMetadataDict
python
GoogleCloudPlatform/PerfKitBenchmarker
perfkitbenchmarker/linux_benchmarks/hpcg_benchmark.py
https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/hpcg_benchmark.py
Apache-2.0
def _GetEnvironmentVars(benchmark_spec): """Return a string containing HPCG-related environment variables. Args: benchmark_spec: benchmark spec Returns: string of environment variables """ return ' '.join([ 'NUM_GPUS=%s' % benchmark_spec.total_gpus, 'OMP_NUM_THREADS=%s' % benchmark_spec....
Return a string containing HPCG-related environment variables. Args: benchmark_spec: benchmark spec Returns: string of environment variables
_GetEnvironmentVars
python
GoogleCloudPlatform/PerfKitBenchmarker
perfkitbenchmarker/linux_benchmarks/hpcg_benchmark.py
https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/hpcg_benchmark.py
Apache-2.0
def _ExtractProblemSize(output): """Extract problem size from HPCG output. Args: output: HPCG output Returns: problem size in list format """ regex = r'(\d+)x(\d+)x(\d+)\s+local domain' match = re.search(regex, output) try: return [int(match.group(1)), int(match.group(2)), int(match.group(3)...
Extract problem size from HPCG output. Args: output: HPCG output Returns: problem size in list format
_ExtractProblemSize
python
GoogleCloudPlatform/PerfKitBenchmarker
perfkitbenchmarker/linux_benchmarks/hpcg_benchmark.py
https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/hpcg_benchmark.py
Apache-2.0
def _ExtractThroughput(output): """Extract throughput from HPCG output. Args: output: HPCG output Returns: throuput (float) """ regex = r'final\s+=\s+(\S+)\s+GF' match = re.search(regex, output) try: return float(match.group(1)) except: raise HpcgParseOutputException('Unable to parse H...
Extract throughput from HPCG output. Args: output: HPCG output Returns: throuput (float)
_ExtractThroughput
python
GoogleCloudPlatform/PerfKitBenchmarker
perfkitbenchmarker/linux_benchmarks/hpcg_benchmark.py
https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/hpcg_benchmark.py
Apache-2.0
def _MakeSamplesFromOutput(benchmark_spec, output): """Create a sample continaing the measured HPCG throughput. Args: benchmark_spec: benchmark spec output: HPCG output Returns: a Sample containing the HPCG throughput in Gflops """ actual_hpcg_problem_size = _ExtractProblemSize(output) if actu...
Create a sample continaing the measured HPCG throughput. Args: benchmark_spec: benchmark spec output: HPCG output Returns: a Sample containing the HPCG throughput in Gflops
_MakeSamplesFromOutput
python
GoogleCloudPlatform/PerfKitBenchmarker
perfkitbenchmarker/linux_benchmarks/hpcg_benchmark.py
https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/hpcg_benchmark.py
Apache-2.0
def Run(benchmark_spec): """Run HPCG on the cluster. Args: benchmark_spec: The benchmark specification. Contains all data that is required to run the benchmark. Returns: A list of sample.Sample objects. """ vms = benchmark_spec.vms master_vm = vms[0] run_command = 'cd %s && %s ./%s' % ( ...
Run HPCG on the cluster. Args: benchmark_spec: The benchmark specification. Contains all data that is required to run the benchmark. Returns: A list of sample.Sample objects.
Run
python
GoogleCloudPlatform/PerfKitBenchmarker
perfkitbenchmarker/linux_benchmarks/hpcg_benchmark.py
https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/hpcg_benchmark.py
Apache-2.0
def Prepare(bm_spec: benchmark_spec.BenchmarkSpec) -> None: """Install and set up HuggingFace BERT pretraining on the target vm. Args: bm_spec: The benchmark specification """ vm = bm_spec.vms[0] vm.Install('neuron') run_dir = 'aws-neuron-samples/torch-neuronx/training/dp_bert_hf_pretrain' bm_spec.ru...
Install and set up HuggingFace BERT pretraining on the target vm. Args: bm_spec: The benchmark specification
Prepare
python
GoogleCloudPlatform/PerfKitBenchmarker
perfkitbenchmarker/linux_benchmarks/huggingface_bert_pretraining_benchmark.py
https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/huggingface_bert_pretraining_benchmark.py
Apache-2.0
def MakeSamplesFromOutput(output: str) -> List[sample.Sample]: """Create samples containing metrics. Args: output: string, command output Example output: perfkitbenchmarker/tests/linux_benchmarks/huggingface_bert_pretraining_benchmark_test.py Returns: Samples containing training metrics, and the b...
Create samples containing metrics. Args: output: string, command output Example output: perfkitbenchmarker/tests/linux_benchmarks/huggingface_bert_pretraining_benchmark_test.py Returns: Samples containing training metrics, and the bandwidth
MakeSamplesFromOutput
python
GoogleCloudPlatform/PerfKitBenchmarker
perfkitbenchmarker/linux_benchmarks/huggingface_bert_pretraining_benchmark.py
https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/huggingface_bert_pretraining_benchmark.py
Apache-2.0
def Run(bm_spec: benchmark_spec.BenchmarkSpec) -> List[sample.Sample]: """Run HuggingFace BRET pretaining test. Args: bm_spec: The benchmark specification Returns: A list of sample.Sample objects. """ vm = bm_spec.vms[0] stdout, _ = vm.RobustRemoteCommand( f'XLA_USE_BF16=1 {bm_spec.path} ' ...
Run HuggingFace BRET pretaining test. Args: bm_spec: The benchmark specification Returns: A list of sample.Sample objects.
Run
python
GoogleCloudPlatform/PerfKitBenchmarker
perfkitbenchmarker/linux_benchmarks/huggingface_bert_pretraining_benchmark.py
https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/huggingface_bert_pretraining_benchmark.py
Apache-2.0
def _CreateMetadataDict(benchmark_spec): """Create metadata dict to be used in run results. Args: benchmark_spec: The benchmark specification. Contains all data that is required to run the benchmark. Returns: metadata dict """ metadata = mnist_benchmark.CreateMetadataDict(benchmark_spec) met...
Create metadata dict to be used in run results. Args: benchmark_spec: The benchmark specification. Contains all data that is required to run the benchmark. Returns: metadata dict
_CreateMetadataDict
python
GoogleCloudPlatform/PerfKitBenchmarker
perfkitbenchmarker/linux_benchmarks/inception3_benchmark.py
https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/inception3_benchmark.py
Apache-2.0
def Run(benchmark_spec): """Run Inception V3 on the cluster. Args: benchmark_spec: The benchmark specification. Contains all data that is required to run the benchmark. Returns: A list of sample.Sample objects. """ _UpdateBenchmarkSpecWithFlags(benchmark_spec) vm = benchmark_spec.vms[0] in...
Run Inception V3 on the cluster. Args: benchmark_spec: The benchmark specification. Contains all data that is required to run the benchmark. Returns: A list of sample.Sample objects.
Run
python
GoogleCloudPlatform/PerfKitBenchmarker
perfkitbenchmarker/linux_benchmarks/inception3_benchmark.py
https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/inception3_benchmark.py
Apache-2.0
def Prepare(benchmark_spec): """Install IOR on the vms. Args: benchmark_spec: The benchmark specification. Contains all data that is required to run the benchmark. """ vms = benchmark_spec.vms background_tasks.RunThreaded(lambda vm: vm.Install('ior'), vms) background_tasks.RunThreaded(lambda vm: ...
Install IOR on the vms. Args: benchmark_spec: The benchmark specification. Contains all data that is required to run the benchmark.
Prepare
python
GoogleCloudPlatform/PerfKitBenchmarker
perfkitbenchmarker/linux_benchmarks/ior_benchmark.py
https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/ior_benchmark.py
Apache-2.0
def Run(benchmark_spec): """Run the IOR benchmark on the vms. Args: benchmark_spec: The benchmark specification. Contains all data that is required to run the benchmark. Returns: A list of sample.Sample objects. """ master_vm = benchmark_spec.vms[0] results = [] # Run IOR benchmark. if F...
Run the IOR benchmark on the vms. Args: benchmark_spec: The benchmark specification. Contains all data that is required to run the benchmark. Returns: A list of sample.Sample objects.
Run
python
GoogleCloudPlatform/PerfKitBenchmarker
perfkitbenchmarker/linux_benchmarks/ior_benchmark.py
https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/ior_benchmark.py
Apache-2.0
def Prepare(benchmark_spec): """Install iperf and start the server on all machines. Args: benchmark_spec: The benchmark specification. Contains all data that is required to run the benchmark. """ vms = benchmark_spec.vms if len(vms) != 2: raise ValueError( f'iperf benchmark requires exa...
Install iperf and start the server on all machines. Args: benchmark_spec: The benchmark specification. Contains all data that is required to run the benchmark.
Prepare
python
GoogleCloudPlatform/PerfKitBenchmarker
perfkitbenchmarker/linux_benchmarks/iperf_benchmark.py
https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/iperf_benchmark.py
Apache-2.0
def _RunIperf( sending_vm, receiving_vm, receiving_ip_address, thread_count, ip_type, protocol, interval_size=None, ): """Run iperf using sending 'vm' to connect to 'ip_address'. Args: sending_vm: The VM sending traffic. receiving_vm: The VM receiving traffic. receiving_ip_a...
Run iperf using sending 'vm' to connect to 'ip_address'. Args: sending_vm: The VM sending traffic. receiving_vm: The VM receiving traffic. receiving_ip_address: The IP address of the iperf server (ie the receiver). thread_count: The number of threads the server will use. ip_type: The IP type of '...
_RunIperf
python
GoogleCloudPlatform/PerfKitBenchmarker
perfkitbenchmarker/linux_benchmarks/iperf_benchmark.py
https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/iperf_benchmark.py
Apache-2.0
def Run(benchmark_spec): """Run iperf on the target vm. Args: benchmark_spec: The benchmark specification. Contains all data that is required to run the benchmark. Returns: A list of sample.Sample objects. """ vms = benchmark_spec.vms results = [] logging.info('Iperf Results:') for pro...
Run iperf on the target vm. Args: benchmark_spec: The benchmark specification. Contains all data that is required to run the benchmark. Returns: A list of sample.Sample objects.
Run
python
GoogleCloudPlatform/PerfKitBenchmarker
perfkitbenchmarker/linux_benchmarks/iperf_benchmark.py
https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/iperf_benchmark.py
Apache-2.0
def Cleanup(benchmark_spec): """Cleanup iperf on the target vm (by uninstalling). Args: benchmark_spec: The benchmark specification. Contains all data that is required to run the benchmark. """ vms = benchmark_spec.vms for vm in vms: if TCP in FLAGS.iperf_benchmarks: vm.RemoteCommand( ...
Cleanup iperf on the target vm (by uninstalling). Args: benchmark_spec: The benchmark specification. Contains all data that is required to run the benchmark.
Cleanup
python
GoogleCloudPlatform/PerfKitBenchmarker
perfkitbenchmarker/linux_benchmarks/iperf_benchmark.py
https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/iperf_benchmark.py
Apache-2.0
def Prepare(bm_spec: _BenchmarkSpec) -> None: """Install KeyDB on one VM and memtier_benchmark on others.""" server_count = len(bm_spec.vm_groups['servers']) if server_count != 1: raise errors.Benchmarks.PrepareException( f'Expected servers vm count to be 1, got {server_count}' ) client_vms = bm...
Install KeyDB on one VM and memtier_benchmark on others.
Prepare
python
GoogleCloudPlatform/PerfKitBenchmarker
perfkitbenchmarker/linux_benchmarks/keydb_memtier_benchmark.py
https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/keydb_memtier_benchmark.py
Apache-2.0
def _PrepareCluster(benchmark_spec: bm_spec.BenchmarkSpec): """Prepares a cluster to run the hpa benchmark.""" cluster: container_service.KubernetesCluster = ( benchmark_spec.container_cluster ) fib_image = benchmark_spec.container_specs['kubernetes_fib'].image cluster.ApplyManifest( 'container/k...
Prepares a cluster to run the hpa benchmark.
_PrepareCluster
python
GoogleCloudPlatform/PerfKitBenchmarker
perfkitbenchmarker/linux_benchmarks/kubernetes_hpa_benchmark.py
https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/kubernetes_hpa_benchmark.py
Apache-2.0
def Prepare(benchmark_spec: bm_spec.BenchmarkSpec): """Install fib workload (and associated hpa) on the K8s Cluster. Args: benchmark_spec: The benchmark specification. Contains all data that is required to run the benchmark. """ prepare_fns = [ functools.partial(_PrepareCluster, benchmark_spec...
Install fib workload (and associated hpa) on the K8s Cluster. Args: benchmark_spec: The benchmark specification. Contains all data that is required to run the benchmark.
Prepare
python
GoogleCloudPlatform/PerfKitBenchmarker
perfkitbenchmarker/linux_benchmarks/kubernetes_hpa_benchmark.py
https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/kubernetes_hpa_benchmark.py
Apache-2.0
def Run(benchmark_spec: bm_spec.BenchmarkSpec) -> List[Sample]: """Run a benchmark against the Nginx server.""" vm = benchmark_spec.vms[0] cluster: container_service.KubernetesCluster = typing.cast( container_service.KubernetesCluster, benchmark_spec.container_cluster ) addr = cluster.DeployIngress('fib...
Run a benchmark against the Nginx server.
Run
python
GoogleCloudPlatform/PerfKitBenchmarker
perfkitbenchmarker/linux_benchmarks/kubernetes_hpa_benchmark.py
https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/kubernetes_hpa_benchmark.py
Apache-2.0
def _PollServer(vm: virtual_machine.BaseVirtualMachine, addr: str) -> None: """Polls the server to confirm it is responding.""" poller = http_poller.HttpPoller() response = poller.Run(vm, addr + '/calculate') if not response.success: raise errors.Resource.RetryableGetError( 'Failed to contact server...
Polls the server to confirm it is responding.
_PollServer
python
GoogleCloudPlatform/PerfKitBenchmarker
perfkitbenchmarker/linux_benchmarks/kubernetes_hpa_benchmark.py
https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/kubernetes_hpa_benchmark.py
Apache-2.0
def __init__(self, samples: List[Sample], stop: threading.Event): """Creates a KubernetesMetricsCollector. Args: samples: List of samples. Observed metrics will be added to this list. stop: Event indicating when the test is over. Once set, the Observe*() methods will stop. """ self....
Creates a KubernetesMetricsCollector. Args: samples: List of samples. Observed metrics will be added to this list. stop: Event indicating when the test is over. Once set, the Observe*() methods will stop.
__init__
python
GoogleCloudPlatform/PerfKitBenchmarker
perfkitbenchmarker/linux_benchmarks/kubernetes_hpa_benchmark.py
https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/kubernetes_hpa_benchmark.py
Apache-2.0
def ObserveNumNodes( self, cluster: container_service.KubernetesCluster, ) -> None: """Periodically samples the number of nodes. Adds result to self._samples. Expected to be run in a background thread. Never completes until self._stop is signaled. Args: cluster: The cluster in...
Periodically samples the number of nodes. Adds result to self._samples. Expected to be run in a background thread. Never completes until self._stop is signaled. Args: cluster: The cluster in question.
ObserveNumNodes
python
GoogleCloudPlatform/PerfKitBenchmarker
perfkitbenchmarker/linux_benchmarks/kubernetes_hpa_benchmark.py
https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/kubernetes_hpa_benchmark.py
Apache-2.0
def _Observe( self, observe_fn: Callable[[], List[Sample]], ) -> None: """Call the specified function until self._stop is signalled. Results are appended to self._samples. Timeouts are ignored. Args: observe_fn: The function to call. """ success_count = 0 failure_count = 0 ...
Call the specified function until self._stop is signalled. Results are appended to self._samples. Timeouts are ignored. Args: observe_fn: The function to call.
_Observe
python
GoogleCloudPlatform/PerfKitBenchmarker
perfkitbenchmarker/linux_benchmarks/kubernetes_hpa_benchmark.py
https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/kubernetes_hpa_benchmark.py
Apache-2.0
def GetConfig(user_config: Dict[str, Any]) -> Dict[str, Any]: """Load and return benchmark config spec.""" config = configs.LoadConfig(BENCHMARK_CONFIG, user_config, BENCHMARK_NAME) if FLAGS.memcached_memtier_client_machine_type: vm_spec = config['container_cluster']['nodepools']['clients']['vm_spec'] fo...
Load and return benchmark config spec.
GetConfig
python
GoogleCloudPlatform/PerfKitBenchmarker
perfkitbenchmarker/linux_benchmarks/kubernetes_memcached_memtier_benchmark.py
https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/kubernetes_memcached_memtier_benchmark.py
Apache-2.0
def CreateHelmCommand() -> list[str]: """Create command for helm to ccreate memcached instances.""" command = ['helm', 'install', 'benchmarkcache', 'bitnami/memcached'] for c in [ ( 'extraEnvVars=- name: MEMCACHED_MAX_CONNECTIONS\n value: "32768"\n-' f' name: MEMCACHED_THREADS\n valu...
Create command for helm to ccreate memcached instances.
CreateHelmCommand
python
GoogleCloudPlatform/PerfKitBenchmarker
perfkitbenchmarker/linux_benchmarks/kubernetes_memcached_memtier_benchmark.py
https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/kubernetes_memcached_memtier_benchmark.py
Apache-2.0
def _PrepareCluster() -> None: """Prepares a cluster to run the Memcached benchmark.""" vm_util.IssueCommand( ['helm', 'repo', 'add', 'bitnami', 'https://charts.bitnami.com/bitnami'], cwd=vm_util.GetTempDir(), ) vm_util.IssueCommand( CreateHelmCommand(), cwd=vm_util.GetTempDir(), ) ...
Prepares a cluster to run the Memcached benchmark.
_PrepareCluster
python
GoogleCloudPlatform/PerfKitBenchmarker
perfkitbenchmarker/linux_benchmarks/kubernetes_memcached_memtier_benchmark.py
https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/kubernetes_memcached_memtier_benchmark.py
Apache-2.0
def Prepare(bm_spec: _BenchmarkSpec) -> None: """Install Memcached on K8s cluster and memtier_benchmark on client VMs.""" client_vms = bm_spec.vm_groups['clients'] # Install Memtier and Memcached on the cluster prepare_fns = [functools.partial(_PrepareCluster)] + [ functools.partial(vm.Install, 'memtier')...
Install Memcached on K8s cluster and memtier_benchmark on client VMs.
Prepare
python
GoogleCloudPlatform/PerfKitBenchmarker
perfkitbenchmarker/linux_benchmarks/kubernetes_memcached_memtier_benchmark.py
https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/kubernetes_memcached_memtier_benchmark.py
Apache-2.0
def Run(bm_spec: _BenchmarkSpec): """Runs memtier against memcached and gathers the results. Args: bm_spec: The benchmark specification. Contains all data that is required to run the benchmark. Returns: A list of sample.Sample instances. """ client = bm_spec.vm_groups['clients'][0] assert bm...
Runs memtier against memcached and gathers the results. Args: bm_spec: The benchmark specification. Contains all data that is required to run the benchmark. Returns: A list of sample.Sample instances.
Run
python
GoogleCloudPlatform/PerfKitBenchmarker
perfkitbenchmarker/linux_benchmarks/kubernetes_memcached_memtier_benchmark.py
https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/kubernetes_memcached_memtier_benchmark.py
Apache-2.0
def GetConfig(user_config): """Load and return benchmark config. Args: user_config: user supplied configuration (flags and config file) Returns: loaded benchmark configuration """ config = configs.LoadConfig(BENCHMARK_CONFIG, user_config, BENCHMARK_NAME) if FLAGS['ycsb_client_vms'].present: co...
Load and return benchmark config. Args: user_config: user supplied configuration (flags and config file) Returns: loaded benchmark configuration
GetConfig
python
GoogleCloudPlatform/PerfKitBenchmarker
perfkitbenchmarker/linux_benchmarks/kubernetes_mongodb_ycsb_benchmark.py
https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/kubernetes_mongodb_ycsb_benchmark.py
Apache-2.0
def _PrepareClient(vm): """Install YCSB on the client VM.""" vm.Install('ycsb') # Disable logging for MongoDB driver, which is otherwise quite verbose. log_config = """<configuration><root level="WARN"/></configuration>""" vm.RemoteCommand( "echo '{}' > {}/logback.xml".format(log_config, ycsb.YCSB_DIR)...
Install YCSB on the client VM.
_PrepareClient
python
GoogleCloudPlatform/PerfKitBenchmarker
perfkitbenchmarker/linux_benchmarks/kubernetes_mongodb_ycsb_benchmark.py
https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/kubernetes_mongodb_ycsb_benchmark.py
Apache-2.0
def _PrepareDeployment(benchmark_spec): """Deploys MongoDB Operator and instance on the cluster.""" cluster = benchmark_spec.container_cluster storage_class = STORAGE_CLASS.value or cluster.GetDefaultStorageClass() cluster.ApplyManifest( 'container/kubernetes_mongodb/kubernetes_mongodb.yaml.j2', cpu...
Deploys MongoDB Operator and instance on the cluster.
_PrepareDeployment
python
GoogleCloudPlatform/PerfKitBenchmarker
perfkitbenchmarker/linux_benchmarks/kubernetes_mongodb_ycsb_benchmark.py
https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/kubernetes_mongodb_ycsb_benchmark.py
Apache-2.0
def Prepare(benchmark_spec): """Install MongoDB on one VM and YCSB on another. Args: benchmark_spec: The benchmark specification. Contains all data that is required to run the benchmark. """ server_partials = [functools.partial(_PrepareDeployment, benchmark_spec)] client_partials = [ functool...
Install MongoDB on one VM and YCSB on another. Args: benchmark_spec: The benchmark specification. Contains all data that is required to run the benchmark.
Prepare
python
GoogleCloudPlatform/PerfKitBenchmarker
perfkitbenchmarker/linux_benchmarks/kubernetes_mongodb_ycsb_benchmark.py
https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/kubernetes_mongodb_ycsb_benchmark.py
Apache-2.0
def _CreateNginxConfigMapDir(): """Returns a TemporaryDirectory containing files in the Nginx ConfigMap.""" if FLAGS.nginx_conf: nginx_conf_filename = FLAGS.nginx_conf else: relative_nginx_conf_filename = 'container/kubernetes_nginx/http.conf' if FLAGS.nginx_use_ssl: relative_nginx_conf_filename...
Returns a TemporaryDirectory containing files in the Nginx ConfigMap.
_CreateNginxConfigMapDir
python
GoogleCloudPlatform/PerfKitBenchmarker
perfkitbenchmarker/linux_benchmarks/kubernetes_nginx_benchmark.py
https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/kubernetes_nginx_benchmark.py
Apache-2.0
def _PrepareCluster(benchmark_spec): """Prepares a cluster to run the Nginx benchmark.""" with _CreateNginxConfigMapDir() as nginx_config_map_dirname: benchmark_spec.container_cluster.CreateConfigMap( 'default-config', nginx_config_map_dirname ) container_image = benchmark_spec.container_specs['ku...
Prepares a cluster to run the Nginx benchmark.
_PrepareCluster
python
GoogleCloudPlatform/PerfKitBenchmarker
perfkitbenchmarker/linux_benchmarks/kubernetes_nginx_benchmark.py
https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/kubernetes_nginx_benchmark.py
Apache-2.0
def Prepare(benchmark_spec): """Install Nginx on the K8s Cluster and a load generator on the clients. Args: benchmark_spec: The benchmark specification. Contains all data that is required to run the benchmark. """ clients = benchmark_spec.vm_groups['clients'] prepare_fns = [functools.partial(_Prep...
Install Nginx on the K8s Cluster and a load generator on the clients. Args: benchmark_spec: The benchmark specification. Contains all data that is required to run the benchmark.
Prepare
python
GoogleCloudPlatform/PerfKitBenchmarker
perfkitbenchmarker/linux_benchmarks/kubernetes_nginx_benchmark.py
https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/kubernetes_nginx_benchmark.py
Apache-2.0
def _PrepareCluster(bm_spec: _BenchmarkSpec): """Prepares a cluster to run the Redis benchmark.""" redis_port = redis_server.GetRedisPorts()[0] replicas = bm_spec.container_cluster.nodepools['redis'].num_nodes * 2 with kubernetes_helper.CreateRenderedManifestFile( 'container/kubernetes_redis_memtier/kuber...
Prepares a cluster to run the Redis benchmark.
_PrepareCluster
python
GoogleCloudPlatform/PerfKitBenchmarker
perfkitbenchmarker/linux_benchmarks/kubernetes_redis_memtier_benchmark.py
https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/kubernetes_redis_memtier_benchmark.py
Apache-2.0
def Prepare(bm_spec: _BenchmarkSpec) -> None: """Install Redis on K8s cluster and memtier_benchmark on client VMs.""" client_vms = bm_spec.vm_groups['clients'] # Install Memtier and Redis on the cluster prepare_fns = [functools.partial(_PrepareCluster, bm_spec)] + [ functools.partial(vm.Install, 'memtier'...
Install Redis on K8s cluster and memtier_benchmark on client VMs.
Prepare
python
GoogleCloudPlatform/PerfKitBenchmarker
perfkitbenchmarker/linux_benchmarks/kubernetes_redis_memtier_benchmark.py
https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/kubernetes_redis_memtier_benchmark.py
Apache-2.0
def _GetImage() -> str: """Get the image for the scale deployment.""" if virtual_machine.GPU_COUNT.value: return NVIDIA_GPU_IMAGE return DEFAULT_IMAGE
Get the image for the scale deployment.
_GetImage
python
GoogleCloudPlatform/PerfKitBenchmarker
perfkitbenchmarker/linux_benchmarks/kubernetes_scale_benchmark.py
https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/kubernetes_scale_benchmark.py
Apache-2.0
def _GetRolloutCreationTime(rollout_name: str) -> int: """Returns the time when the rollout was created.""" out, _, _ = container_service.RunRetryableKubectlCommand([ 'rollout', 'history', rollout_name, '-o', 'jsonpath={.metadata.creationTimestamp}', ]) return ConvertToEpochTime(ou...
Returns the time when the rollout was created.
_GetRolloutCreationTime
python
GoogleCloudPlatform/PerfKitBenchmarker
perfkitbenchmarker/linux_benchmarks/kubernetes_scale_benchmark.py
https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/kubernetes_scale_benchmark.py
Apache-2.0
def _GetScaleTimeout() -> int: """Returns the timeout for the scale up & teardown.""" base_timeout = 60 * 10 per_pod_timeout = NUM_PODS.value * 3 proposed_timeout = base_timeout + per_pod_timeout max_timeout = 2 * 60 * 60 # 2 hours return min(proposed_timeout, max_timeout)
Returns the timeout for the scale up & teardown.
_GetScaleTimeout
python
GoogleCloudPlatform/PerfKitBenchmarker
perfkitbenchmarker/linux_benchmarks/kubernetes_scale_benchmark.py
https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/kubernetes_scale_benchmark.py
Apache-2.0
def Run(bm_spec: benchmark_spec.BenchmarkSpec) -> list[sample.Sample]: """Scales a large number of pods on kubernetes.""" assert bm_spec.container_cluster cluster = bm_spec.container_cluster assert isinstance(cluster, container_service.KubernetesCluster) initial_nodes = set(cluster.GetNodeNames()) samples...
Scales a large number of pods on kubernetes.
Run
python
GoogleCloudPlatform/PerfKitBenchmarker
perfkitbenchmarker/linux_benchmarks/kubernetes_scale_benchmark.py
https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/kubernetes_scale_benchmark.py
Apache-2.0
def ScaleUpPods( cluster: container_service.KubernetesCluster, ) -> tuple[list[sample.Sample], str]: """Scales up pods on a kubernetes cluster. Returns samples & rollout name.""" samples = [] initial_pods = set(cluster.GetPodNames()) logging.info('Initial pods: %s', initial_pods) command = None if virt...
Scales up pods on a kubernetes cluster. Returns samples & rollout name.
ScaleUpPods
python
GoogleCloudPlatform/PerfKitBenchmarker
perfkitbenchmarker/linux_benchmarks/kubernetes_scale_benchmark.py
https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/kubernetes_scale_benchmark.py
Apache-2.0
def _CheckForFailures( cluster: container_service.KubernetesCluster, pod_samples: list[sample.Sample], ): """Fails the benchmark if not enough pods were created. Args: cluster: The cluster to check for failures on. pod_samples: The samples from pod transition times which includes pod Ready co...
Fails the benchmark if not enough pods were created. Args: cluster: The cluster to check for failures on. pod_samples: The samples from pod transition times which includes pod Ready count. Raises: QuotaFailure: If a quota is exceeded. RunError: If scale up failed for a non-quota reason.
_CheckForFailures
python
GoogleCloudPlatform/PerfKitBenchmarker
perfkitbenchmarker/linux_benchmarks/kubernetes_scale_benchmark.py
https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/kubernetes_scale_benchmark.py
Apache-2.0
def FromJsonPathResult( cls, resource_type: str, resource_name: str, condition: dict[str, Any] ) -> 'KubernetesResourceStatusCondition': """Parses the json result of kubectl get.""" str_time = condition['lastTransitionTime'] return cls( resource_type, resource_name, epoch_tim...
Parses the json result of kubectl get.
FromJsonPathResult
python
GoogleCloudPlatform/PerfKitBenchmarker
perfkitbenchmarker/linux_benchmarks/kubernetes_scale_benchmark.py
https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/kubernetes_scale_benchmark.py
Apache-2.0
def _GetResourceStatusConditions( resource_type: str, resource_name: str ) -> list[KubernetesResourceStatusCondition]: """Returns the status conditions for a resource. Args: resource_type: The type of the resource to get the status conditions for. resource_name: The name of the resource to get the stat...
Returns the status conditions for a resource. Args: resource_type: The type of the resource to get the status conditions for. resource_name: The name of the resource to get the status conditions for. Should not have a prefix (eg pods/). Returns: A list of status condition, where each condition i...
_GetResourceStatusConditions
python
GoogleCloudPlatform/PerfKitBenchmarker
perfkitbenchmarker/linux_benchmarks/kubernetes_scale_benchmark.py
https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/kubernetes_scale_benchmark.py
Apache-2.0
def ParseStatusChanges( cluster: container_service.KubernetesCluster, resource_type: str, start_time: float, resources_to_ignore: abc.Set[str] = frozenset(), ) -> list[sample.Sample]: """Parses status transitions into samples. Status transitions are pulled from the cluster, and include e.g. when a ...
Parses status transitions into samples. Status transitions are pulled from the cluster, and include e.g. when a pod transitions to PodScheduled or Ready. See tests for more example input/output. Args: cluster: The cluster to parse the status changes for. resource_type: The type of the resource to parse ...
ParseStatusChanges
python
GoogleCloudPlatform/PerfKitBenchmarker
perfkitbenchmarker/linux_benchmarks/kubernetes_scale_benchmark.py
https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/kubernetes_scale_benchmark.py
Apache-2.0
def _SummarizeTimestamps(timestamps: list[float]) -> dict[str, float]: """Returns a few metrics about a list of timestamps.""" percentiles = [0, 10, 50, 90, 95, 99.9, 100] summary = { 'mean': np.mean(timestamps), } for percentile in percentiles: summary[f'p{percentile}'] = np.percentile(timestamps, ...
Returns a few metrics about a list of timestamps.
_SummarizeTimestamps
python
GoogleCloudPlatform/PerfKitBenchmarker
perfkitbenchmarker/linux_benchmarks/kubernetes_scale_benchmark.py
https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/kubernetes_scale_benchmark.py
Apache-2.0
def Cleanup(_): """Cleanups scale benchmark. Runs before teardown.""" container_service.RunRetryableKubectlCommand( ['delete', '--all', 'pods', '-n', 'default'], timeout=_GetScaleTimeout() )
Cleanups scale benchmark. Runs before teardown.
Cleanup
python
GoogleCloudPlatform/PerfKitBenchmarker
perfkitbenchmarker/linux_benchmarks/kubernetes_scale_benchmark.py
https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/kubernetes_scale_benchmark.py
Apache-2.0
def GetAzBootVMStartIdByLauncher(launcher_name): """Returns the Azure boot VM id by launcher name. We want to keep the VM id unique across all the vms in this resource group. Since the ids are used later to calculate the private ip address. We have to skip the first few ids that will match up to reserved reser...
Returns the Azure boot VM id by launcher name. We want to keep the VM id unique across all the vms in this resource group. Since the ids are used later to calculate the private ip address. We have to skip the first few ids that will match up to reserved reserved ips. E.g. Azure reserved ip: 10.0.0.0, 10.0....
GetAzBootVMStartIdByLauncher
python
GoogleCloudPlatform/PerfKitBenchmarker
perfkitbenchmarker/linux_benchmarks/large_scale_boot_benchmark.py
https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/large_scale_boot_benchmark.py
Apache-2.0
def _GetServerStartCommand(client_port, launcher_vm): """Returns the command to start the listener server.""" cloud = FLAGS.cloud if cloud == 'GCP' and FLAGS.use_public_ip: vms_name_pattern = UNDEFINED_HOSTNAME elif cloud == 'GCP': vms_name_pattern = ( '{name_pattern}-VM_ID.{zone}.c.{project}.in...
Returns the command to start the listener server.
_GetServerStartCommand
python
GoogleCloudPlatform/PerfKitBenchmarker
perfkitbenchmarker/linux_benchmarks/large_scale_boot_benchmark.py
https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/large_scale_boot_benchmark.py
Apache-2.0
def GetConfig(user_config): """Load and updates the benchmark config with user flags. Args: user_config: user supplied configuration (flags and config file) Returns: loaded benchmark configuration """ config = configs.LoadConfig(BENCHMARK_CONFIG, user_config, BENCHMARK_NAME) launcher_config = conf...
Load and updates the benchmark config with user flags. Args: user_config: user supplied configuration (flags and config file) Returns: loaded benchmark configuration
GetConfig
python
GoogleCloudPlatform/PerfKitBenchmarker
perfkitbenchmarker/linux_benchmarks/large_scale_boot_benchmark.py
https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/large_scale_boot_benchmark.py
Apache-2.0
def _BuildContext(launcher_vm, booter_template_vm): """Returns the context variables for Jinja2 template during rendering.""" context = { 'boot_machine_type': booter_template_vm.machine_type, 'cloud': FLAGS.cloud, 'contact_launcher': FLAGS.vms_contact_launcher, 'launcher_vm_name': launcher_v...
Returns the context variables for Jinja2 template during rendering.
_BuildContext
python
GoogleCloudPlatform/PerfKitBenchmarker
perfkitbenchmarker/linux_benchmarks/large_scale_boot_benchmark.py
https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/large_scale_boot_benchmark.py
Apache-2.0
def _Install(launcher_vm, booter_template_vm): """Installs benchmark scripts and packages on the launcher vm.""" launcher_vm.InstallCli() # Render boot script on launcher server VM(s) context = _BuildContext(launcher_vm, booter_template_vm) launcher_vm.RenderTemplate( data.ResourcePath(_BOOT_TEMPLATE), ...
Installs benchmark scripts and packages on the launcher vm.
_Install
python
GoogleCloudPlatform/PerfKitBenchmarker
perfkitbenchmarker/linux_benchmarks/large_scale_boot_benchmark.py
https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/large_scale_boot_benchmark.py
Apache-2.0
def Prepare(benchmark_spec): """Prepare the launcher server vm(s). Prepare the launcher server vm(s) by: 1) Build the script that each launcher server will use to kick off boot. 2) Start a listening server to wait for booting vms. Args: benchmark_spec: The benchmark specification. Contains all data that...
Prepare the launcher server vm(s). Prepare the launcher server vm(s) by: 1) Build the script that each launcher server will use to kick off boot. 2) Start a listening server to wait for booting vms. Args: benchmark_spec: The benchmark specification. Contains all data that is required to run the benc...
Prepare
python
GoogleCloudPlatform/PerfKitBenchmarker
perfkitbenchmarker/linux_benchmarks/large_scale_boot_benchmark.py
https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/large_scale_boot_benchmark.py
Apache-2.0
def _WaitForResponses(launcher_vms): """Wait for all results or server shutdown or TIMEOUT_SECONDS.""" # if any listener server exited, stop waiting. def _LauncherError(vm): error, _ = vm.RemoteCommand( 'grep ERROR ' + _LISTENER_SERVER_LOG, ignore_failure=True ) return error error_str = ba...
Wait for all results or server shutdown or TIMEOUT_SECONDS.
_WaitForResponses
python
GoogleCloudPlatform/PerfKitBenchmarker
perfkitbenchmarker/linux_benchmarks/large_scale_boot_benchmark.py
https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/large_scale_boot_benchmark.py
Apache-2.0
def _ParseResult(launcher_vms): """Parse the results on the launcher VMs and send it back. Boot time is the boot duration of the slowest machine. Args: launcher_vms: Launcher server VMs. Returns: A list of benchmark samples. """ vm_count = 0 slowest_time = -1 get_starttime_cmd = 'cat {startim...
Parse the results on the launcher VMs and send it back. Boot time is the boot duration of the slowest machine. Args: launcher_vms: Launcher server VMs. Returns: A list of benchmark samples.
_ParseResult
python
GoogleCloudPlatform/PerfKitBenchmarker
perfkitbenchmarker/linux_benchmarks/large_scale_boot_benchmark.py
https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/large_scale_boot_benchmark.py
Apache-2.0