pulumi: [Python SDK] slow performance with large CRD in helm chart.

Expected Behavior

pulumi up is fast just like in typescript ~5 seconds Typescript SDK TRACE out.txt

Current Behavior

pulumi up with python is very very slow ~1 hour ! Python SDK TRACE out.txt.zip (I didn’t wait and canceled the command pulumi up, very long wait)

Steps to Reproduce

  1. Chart with a large CRD yaml size ~10k lines Example: https://github.com/VictoriaMetrics/helm-charts/blob/master/charts/victoria-metrics-operator/templates/crd.yaml https://github.com/VictoriaMetrics/helm-charts/tree/master/charts/victoria-metrics-operator

  2. use python sdk to install chart:

from pulumi_kubernetes.helm import v3
from pulumi_kubernetes.helm.v3.helm import ChartOpts


vm_chart = v3.Chart("vm", ChartOpts(chart="victoria-metrics-operator", repo="vm"))

Context (Environment)

macOS Big Sur 11.1
Python 3.9.1
pulumi v2.17.0
pulumi-kubernetes==2.7.4

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 2
  • Comments: 27 (17 by maintainers)

Most upvoted comments

@Zaid-Ajaj As you are the only person with an M1 on our team, I’m assigning this to you to take a look. Thank you!

Another non-M1 data point:

> pulumi about
CLI          
Version      3.22.1
Go Version   go1.17.5
Go Compiler  gc

Plugins
NAME          VERSION
azure-native  1.54.0
azuread       4.3.0
kubernetes    3.15.0
python        unknown
random        4.3.1
tls           4.1.0

Host     
OS       darwin
Version  12.1
Arch     x86_64

> time pulumi preview
...
pulumi preview  22.04s user 2.64s system 62% cpu 39.210 total

So the problem does seem to be M1-specific.

For another data point, I ran on my first-gen M1 and got just about the same results as @rawkode:

pulumi preview  225.07s user 1.05s system 98% cpu 3:48.43 total

Looking at a trace, it appears that most of the time is spent in the /pulumirpc.LanguageRuntime/Run function, so it seems like this is an issue with the core Python SDK rather than the k8s provider. Moving the issue to pulumi/pulumi for further investigation. Screen Shot 2022-01-10 at 1 35 17 PM