-
Notifications
You must be signed in to change notification settings - Fork 903
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
cannot set globals_dict or globals.yml for template configloader when deploying on AWS step functions #2860
Comments
@Harsh-Maheshwari This should solve your problem. #1782 (comment) class MyTemplatedConfigLoader(TemplatedConfigLoader):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
if self.runtime_params:
self._config_mapping.update(self.runtime_params)
CONFIG_LOADER_CLASS = MyTemplatedConfigLoader # TemplatedConfigLoader
CONFIG_LOADER_ARGS = {
"globals_dict": {
"s3_bucket_name": "s3://ABC/",
"report_to_generate": os.getenv("REPORT_NAME")
}
} |
Note for team discussion: I cannot find the issue (maybe it's not created)? We should merge the |
@noklam But this would still not solve the issue for AWS Step functions. From the documentation I gather the lambda handler should be defined as :
And now if I want to add runtime parameters to the session object I need to pass them as input to the Step Function (and each lambda consecutively), but there is no such option given in thedocumentation please note this piece of code from the documentation below:
The complete
|
I suspect the Could you simply update the with KedroSession.create(env="aws",extra_params=<your_params>) as session:
session.run(node_names=[node_to_run]) If this is not an option, I suppose you can always add this into the def _convert_kedro_node_to_sfn_task(self, node: Node) -> LambdaInvoke:
"""Convert a Kedro node into an AWS Step Functions Task"""
return LambdaInvoke(
self,
_clean_name(node.name),
lambda_function=self._convert_kedro_node_to_lambda_function(node),
payload=sfn.TaskInput.from_object({"node_name": node.name}), # Insert the extra information you need and retrieve it from `handler`?
) |
For every new REPORT I want to generate I will need to deploy the step function again and again, |
@noklam
Since from kedro 0.19 we are going to shift to OmegaConfigLoader, I decided to use that in my project, |
The |
Description
Below is the configuration for my settings file :
Note: I need REPORT_NAME variable to be different every time the AWS Step function is called as this affects my catalog
My Catalog file looks like this:
I can not use this setup when deploying the project on AWS Step Functions as I am not able to set the environment variable with every new invocation of the Step Function and for all the lambdas involved in it
Expected Result
I should be able to add a new globals dict every time I call the AWS step function
Your Environment
The text was updated successfully, but these errors were encountered: