From 227ad82b5a979db960d274228bade3f8308b5f89 Mon Sep 17 00:00:00 2001 From: Valentin Kaas Date: Sun, 25 Oct 2026 16:35:42 +0100 Subject: [PATCH 1/2] [system] Find cached functions with a user-provided name on AWS AWS replaces '-' and '.' in function names with '_', and the cache stores the function under the converted name. get_function looked up the name as passed with --function-name, e.g., sebs-ffmpeg-9-0-2-x64-512, so it never found the cached function, and every 'sebs benchmark invoke' uploaded the code package again. Default names are already converted. The name is now converted before the lookup. GCP needs no conversion, as it deploys user-provided names unchanged. --- sebs/aws/aws.py | 11 +++++++++++ sebs/faas/system.py | 17 +++++++++++++++++ 2 files changed, 28 insertions(+) diff --git a/sebs/aws/aws.py b/sebs/aws/aws.py index dd7077d18..34ab2e66f 100644 --- a/sebs/aws/aws.py +++ b/sebs/aws/aws.py @@ -617,6 +617,17 @@ def default_function_name( func_name = f"{func_name}-docker" return AWS.format_function_name(func_name) + def normalize_function_name(self, func_name: str) -> str: + """Apply the AWS name conversion done in create_function to user-provided names. + + Args: + func_name: Function name, possibly provided by the user + + Returns: + str: Function name as deployed and cached + """ + return AWS.format_function_name(func_name) + @staticmethod def format_function_name(func_name: str) -> str: """Format function name for AWS Lambda compatibility. diff --git a/sebs/faas/system.py b/sebs/faas/system.py index 291e9ce75..da62893b3 100644 --- a/sebs/faas/system.py +++ b/sebs/faas/system.py @@ -418,6 +418,7 @@ def build_function(self, code_package: Benchmark, func_name: Optional[str] = Non if not func_name: func_name = self.default_function_name(code_package) + func_name = self.normalize_function_name(func_name) _, code_package_loc, system_variant, container_uri = code_package.build( self.package_code, self.container_client, self.finalize_container_build() ) @@ -471,6 +472,7 @@ def get_function(self, code_package: Benchmark, func_name: Optional[str] = None) # Generate function name if not provided if not func_name: func_name = self.default_function_name(code_package) + func_name = self.normalize_function_name(func_name) # Build the code package rebuilt, _, system_variant, container_uri = code_package.build( @@ -655,6 +657,21 @@ def default_function_name( """ pass + def normalize_function_name(self, func_name: str) -> str: + """ + Convert a function name to the form used by the platform. + + Platforms that rewrite function names on creation must override this, + so that cache lookups use the same name as the deployed function. + + Args: + func_name: Function name, possibly provided by the user + + Returns: + str: Function name as deployed and cached + """ + return func_name + @abstractmethod def enforce_cold_start(self, functions: List[Function], code_package: Benchmark): """ From b1b830b436de467b466cd7ab3b1724c8421e8449 Mon Sep 17 00:00:00 2001 From: Valentin Kaas Date: Sun, 25 Oct 2026 16:38:54 +0100 Subject: [PATCH 2/2] [storage] Look up existing buckets with the corrected name get_bucket checked for an existing bucket under its original name, but created it under correct_name(name). On Azure, which replaces dots with hyphens, a resource prefix with a dot made SeBS miss an existing container that was not in the cache, and try to create it again. The corrected name is now used for the check, the creation, and the cache. --- sebs/faas/storage.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sebs/faas/storage.py b/sebs/faas/storage.py index 6db96f3af..ca1ee3cf8 100644 --- a/sebs/faas/storage.py +++ b/sebs/faas/storage.py @@ -431,12 +431,12 @@ def get_bucket(self, bucket_type: Resources.StorageBucketType) -> str: Resources.StorageBucketType.DEPLOYMENT: "code deployment", } - name = self._cloud_resources.get_storage_bucket_name(bucket_type) + name = self.correct_name(self._cloud_resources.get_storage_bucket_name(bucket_type)) if not self.exists_bucket(name): self.logging.info(f"Initialize a new bucket for {description[bucket_type]}") bucket = self._create_bucket( - self.correct_name(name), + name, randomize_name=False, ) else: