Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion sebs.py
Original file line number Diff line number Diff line change
Expand Up @@ -447,6 +447,12 @@ def local():
default=True,
help="Remove containers after stopping.",
)
@click.option(
"--architecture",
default="x64",
type=click.Choice(["x64", "arm64"]),
help="Target architecture",
)
@simplified_common_params
def start(
benchmark,
Expand All @@ -456,6 +462,7 @@ def start(
storage_configuration,
measure_interval,
remove_containers,
architecture,
**kwargs,
):
"""
Expand All @@ -464,7 +471,8 @@ def start(

(config, output_dir, logging_filename, sebs_client, deployment_client) = parse_common_params(
update_code=False, update_storage=False,
deployment="local", storage_configuration=storage_configuration, **kwargs
deployment="local", storage_configuration=storage_configuration,
architecture=architecture, container_deployment=False, ignore_cache=False, **kwargs
)
deployment_client = cast(sebs.local.Local, deployment_client)
deployment_client.remove_containers = remove_containers
Expand Down
13 changes: 9 additions & 4 deletions sebs/cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,14 +169,19 @@ def get_storage_config(self, deployment: str, benchmark: str):
return cfg["storage"] if cfg and "storage" in cfg and not self.ignore_storage else None

def update_storage(self, deployment: str, benchmark: str, config: dict):
if self.ignore_storage:
return
benchmark_dir = os.path.join(self.cache_dir, benchmark)
config_path = os.path.join(benchmark_dir, "config.json")

if self.ignore_storage or not os.path.exists(config_path):
self.logging.debug(
f"Skipping storage update: ignore_storage={self.ignore_storage}, config exists={os.path.exists(config_path)} at {config_path}"
)
return
with self._lock:
with open(os.path.join(benchmark_dir, "config.json"), "r") as fp:
with open(config_path, "r") as fp:
cached_config = json.load(fp)
cached_config[deployment]["storage"] = config
with open(os.path.join(benchmark_dir, "config.json"), "w") as fp:
with open(config_path, "w") as fp:
json.dump(cached_config, fp, indent=2)

def add_code_package(
Expand Down
9 changes: 6 additions & 3 deletions sebs/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,12 @@ def docker_image_types(self, deployment_name: str, language_name: str) -> List[s
def supported_language_versions(
self, deployment_name: str, language_name: str, architecture: str
) -> List[str]:
return self._system_config[deployment_name]["languages"][language_name]["base_images"][
architecture
].keys()
languages = self._system_config.get(deployment_name, {}).get("languages", {})
base_images = languages.get(language_name, {}).get("base_images", {})

if deployment_name == "local":
return list(base_images.keys())
return list(base_images.get(architecture, {}).keys())

def supported_architecture(self, deployment_name: str) -> List[str]:
return self._system_config[deployment_name]["architecture"]
Expand Down