-
Notifications
You must be signed in to change notification settings - Fork 100
Support GCP Functions gen2 #301
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
5b6bc1f
f61eb44
75c9936
e29485d
cb3a950
4abda81
abd97ec
e1da8e7
1ff2b79
7db15cd
bea57da
8469a53
a5e8985
2bb0dd8
534b145
bb0c306
b4f0789
8525df1
fa11328
82330de
eeb813b
a3811fd
9df3d12
31eeead
e72b864
2bc79d0
754ed43
3a8b8ac
0a908f9
fa42a0a
4557bb8
b6b6847
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -29,6 +29,7 @@ | |
| from sebs.benchmark import Benchmark | ||
| from sebs.cache import Cache | ||
| from sebs.config import SeBSConfig | ||
| from sebs.experiments.config import SystemVariant | ||
| from sebs.utils import LoggingHandlers | ||
| from sebs.faas.function import Function, ExecutionResult, Trigger, FunctionConfig | ||
| from sebs.faas.system import System | ||
|
|
@@ -191,7 +192,7 @@ def package_code( | |
| architecture: str, | ||
| benchmark: str, | ||
| is_cached: bool, | ||
| ) -> Tuple[str, int]: | ||
| ) -> Tuple[str, float]: | ||
| """ | ||
| Package code for deployment to AWS Lambda. | ||
|
|
||
|
|
@@ -321,7 +322,7 @@ def create_function( | |
| self, | ||
| code_package: Benchmark, | ||
| func_name: str, | ||
| container_deployment: bool, | ||
| system_variant: SystemVariant, | ||
| container_uri: str | None, | ||
| ) -> "LambdaFunction": | ||
| """ | ||
|
|
@@ -333,8 +334,8 @@ def create_function( | |
| Args: | ||
| code_package: Benchmark code package | ||
| func_name: Name of the function | ||
| container_deployment: Whether to use container deployment | ||
| container_uri: URI of the container image (if container_deployment=True) | ||
| system_variant: Selected deployment variant | ||
| container_uri: URI of the container image (if container deployment is selected) | ||
|
|
||
| Returns: | ||
| LambdaFunction: The created or updated Lambda function | ||
|
|
@@ -366,7 +367,7 @@ def create_function( | |
| self.config.resources.lambda_role(self.session), | ||
| function_cfg, | ||
| ) | ||
| self.update_function(lambda_function, code_package, container_deployment, container_uri) | ||
| self.update_function(lambda_function, code_package, system_variant, container_uri) | ||
| lambda_function.updated_code = True | ||
| # TODO: get configuration of REST API | ||
| except self.client.exceptions.ResourceNotFoundException: | ||
|
|
@@ -379,7 +380,7 @@ def create_function( | |
| "Code": {}, | ||
| } | ||
|
|
||
| if container_deployment: | ||
| if system_variant.is_container: | ||
| create_function_params["PackageType"] = "Image" | ||
| create_function_params["Code"] = {"ImageUri": container_uri} | ||
|
Comment on lines
+383
to
385
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Reject a missing image URI before calling the Lambda image path. Both container branches pass 💡 Minimal fix- if system_variant.is_container:
+ if system_variant.is_container:
+ if container_uri is None:
+ raise RuntimeError("Container URI is required for container deployment")
create_function_params["PackageType"] = "Image"
create_function_params["Code"] = {"ImageUri": container_uri}
self.logging.info(
"Creating function {} from container {}".format(func_name, container_uri)
)- if system_variant.is_container:
+ if system_variant.is_container:
+ if container_uri is None:
+ raise RuntimeError("Container URI is required for container deployment")
self.client.update_function_code(FunctionName=name, ImageUri=container_uri)Also applies to: 490-492 🤖 Prompt for AI Agents |
||
| self.logging.info( | ||
|
|
@@ -467,7 +468,7 @@ def update_function( | |
| self, | ||
| function: Function, | ||
| code_package: Benchmark, | ||
| container_deployment: bool, | ||
| system_variant: SystemVariant, | ||
| container_uri: str | None, | ||
| ): | ||
| """ | ||
|
|
@@ -480,13 +481,13 @@ def update_function( | |
| Args: | ||
| function: The function to update | ||
| code_package: Benchmark code package | ||
| container_deployment: Whether to use container deployment | ||
| container_uri: URI of the container image (if container_deployment=True) | ||
| system_variant: Selected deployment variant | ||
| container_uri: URI of the container image (if container deployment is selected) | ||
| """ | ||
| name = function.name | ||
| function = cast(LambdaFunction, function) | ||
|
|
||
| if container_deployment: | ||
| if system_variant.is_container: | ||
| self.client.update_function_code(FunctionName=name, ImageUri=container_uri) | ||
| else: | ||
| code_size = code_package.code_size | ||
|
|
@@ -612,7 +613,7 @@ def default_function_name( | |
| code_package.language_version, | ||
| code_package.architecture, | ||
| ) | ||
| if code_package.container_deployment: | ||
| if code_package.system_variant.is_container: | ||
| func_name = f"{func_name}-docker" | ||
| return AWS.format_function_name(func_name) | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Update the
create_function()snippet in the same section.update_function()is now documented withSystemVariant, but thecreate_function()example a few lines above still shows the old signature. Keeping both side by side will send new provider implementations to the wrong interface.🤖 Prompt for AI Agents