Here is an example of one such code:
|
def setup_infrastructure(config: Dict[str, Any]) -> None: |
|
"""Set up the infrastructure based on the configuration.""" |
|
if 'Infrastructure' not in config: |
|
raise ValueError("Infrastructure configuration is missing in bench-spec.yaml") |
|
|
|
location = config['Infrastructure'].get('Location') |
|
if not location: |
|
raise ValueError("Infrastructure Location is not specified in bench-spec.yaml") |
|
if location == 'NoBench': |
|
print("Not running any benchmarks!") |
|
sys.exit(0) |
|
elif location == 'LocalMinikube': |
|
minikube_installation(config) |
|
elif location == 'LMCacheGKE': |
|
start_gke_cluster(config) |
|
else: |
|
raise ValueError(f"Unsupported infrastructure location: {location}") |
and
|
def setup_infrastructure_from_run_bench_config(infrastructure_config: Dict[str, Any]) -> None: |
|
"""Set up the infrastructure based on the run-bench.yaml configuration.""" |
|
location = infrastructure_config.get('Location') |
|
if not location: |
|
raise ValueError("Infrastructure Location is not specified in run-bench.yaml") |
|
|
|
if location == 'NoBench': |
|
print("Not running any benchmarks!") |
|
sys.exit(0) |
|
elif location == 'LocalMinikube': |
|
minikube_installation_from_infrastructure_config(infrastructure_config) |
|
elif location == 'LMCacheGKE': |
|
start_gke_cluster_from_infrastructure_config(infrastructure_config) |
|
elif location == 'Local-Flat': |
|
print("Using Local-Flat infrastructure - no setup required") |
|
else: |
|
raise ValueError(f"Unsupported infrastructure location: {location}") |
Here is an example of one such code:
LMBench/run-bench.py
Lines 222 to 238 in 9318e41
and
LMBench/run-bench.py
Lines 279 to 295 in 9318e41