-
Notifications
You must be signed in to change notification settings - Fork 115
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
Seeing slow helm chart deployment #1597
Comments
This is hanging (or just taking a really long time) in The call that hangs is pulumi-kubernetes/sdk/python/pulumi_kubernetes/helm/v3/helm.py Lines 428 to 430 in 8d00716
The value of
It is not at all clear why |
Here's a reduced program that doesn't use Kubernetes at all - but still hangs for at least several minutes (might well be much longer): import yaml
import pulumi
loaded_values = yaml.load(open('./values.yaml'), Loader=yaml.FullLoader)
pulumi.Output.from_input(loaded_values) With the gatewayProxies:
gatewayProxy:
gatewaySettings:
options:
accessLoggingService:
accessLog:
- fileSink:
path: /dev/stdout
jsonFormat:
startTime: "%START_TIME(%Y/%m/%dT%H:%M:%S%z %s)%" The leaf node value |
Wow, that's wild! I couldn't help but look. It appears I'm sure there's some subtlety with unwrapping nested outputs or somesuch, however simplifying diff --git a/sdk/python/lib/pulumi/output.py b/sdk/python/lib/pulumi/output.py
index e7cf52faa..658320bf2 100644
--- a/sdk/python/lib/pulumi/output.py
+++ b/sdk/python/lib/pulumi/output.py
@@ -255,7 +255,7 @@ class Output(Generic[T]):
if _types.is_input_type(typ):
# Since Output.all works on lists early, serialize the class's __dict__ into a list of lists first.
# Once we have a output of the list of properties, we can use an apply to re-hydrate it back as an instance.
- items = [[k, Output.from_input(v)] for k, v in val.__dict__.items()]
+ items = val.__dict__.items()
# pylint: disable=unnecessary-comprehension
fn = cast(Callable[[List[Any]], T], lambda props: typ(**{k: v for k, v in props})) # type: ignore
@@ -265,15 +265,14 @@ class Output(Generic[T]):
if isinstance(val, dict):
# Since Output.all works on lists early, serialize this dictionary into a list of lists first.
# Once we have a output of the list of properties, we can use an apply to re-hydrate it back into a dict.
- dict_items = [[k, Output.from_input(v)] for k, v in val.items()]
+ dict_items = val.items()
# type checker doesn't like returning a Dict in the apply callback
fn = cast(Callable[[List[Any]], T], lambda props: {k: v for k, v in props}) # pylint: disable=unnecessary-comprehension
return Output.all(*dict_items).apply(fn, True)
if isinstance(val, list):
- list_items: List[Union[Any, Awaitable[Any], Output[Any]]] = [Output.from_input(v) for v in val]
# invariant: http://mypy.readthedocs.io/en/latest/common_issues.html#variance
- output: Output[T] = cast(Output[T], Output.all(*list(list_items))) # type: ignore
+ output: Output[T] = cast(Output[T], Output.all(*list(val))) # type: ignore
return output
# If it's not an output, list, or dict, it must be known and not secret |
These mutually recursive functions unintentionally had exponential complexity in nesting depth of objects, arg types and most likely arrays. Remove the exponential complexity by avoiding direct recursion of `from_input` on itself, and relying on mutual recursion with `all` alone to reduce nested substrcture. Also simplify the implementation to aid readability. Fixes pulumi/pulumi-kubernetes#1597
These mutually recursive functions unintentionally had exponential complexity in nesting depth of objects, arg types and most likely arrays. Remove the exponential complexity by avoiding direct recursion of from_input on itself, and relying on mutual recursion with all alone to reduce nested substrcture. Also simplify the implementation to aid readability. Fixes pulumi/pulumi-kubernetes#1597.
These mutually recursive functions unintentionally had exponential complexity in nesting depth of objects, arg types and most likely arrays. Remove the exponential complexity by avoiding direct recursion of from_input on itself, and relying on mutual recursion with all alone to reduce nested substructure. Also simplify the implementation to aid readability. Fixes pulumi/pulumi-kubernetes#1597. Fixes pulumi/pulumi-kubernetes#1425. Fixes pulumi/pulumi-kubernetes#1372. Fixes #3987.
Deploying gloo-ee helm chart on EKS cluster with a set of gloo values specified takes hours to complete.
The delay occurs in both preview and pulumi up use cases and the delay occurs before any resource updates are displayed.
If the gloo values are commented out of the values file, the deployment is speedy (under 2 minutes).
Expected behavior
Be able to handle custom values for the chart in a timely fashion.
Current behavior
Takes hours to process the gloo custom values before deploying the chart components.
Steps to reproduce
Launch an EKS cluster. Using the defaults for an eks cluster launched via the eks package is sufficient. Make sure it returns a stack output named kubeconfig.
Use the attached files (remove the .txt) to launch the gloo-ee chart on the eks cluster from step 1.
main.py.txt
values.yaml.txt
Test with the values file where the gloo: section is commented out and notice it deploys quickly.
Uncomment the gloo: section and notice that it takes a long time to process before deploying the components.
Context (Environment)
Affected feature
The text was updated successfully, but these errors were encountered: