-
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
Python: Use async invokes to avoid hangs and stalls #2863
Conversation
pulumi 3.109.0 introduces a new `invoke_async` function that allows calling invokes asynchronously. This change updates the Kubernetes Python SDK's `yaml`, `helm`, and `kustomize` components to use `invoke_async` to avoid hangs and stalls in resource registrations which severely limits parallelism.
@@ -518,7 +518,7 @@ Use the navigation below to see detailed documentation for each of the supported | |||
}) | |||
pkg.Language["python"] = rawMessage(map[string]any{ | |||
"requires": map[string]string{ | |||
"pulumi": ">=3.25.0,<4.0.0", | |||
"pulumi": ">=3.109.0,<4.0.0", |
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.
Alternatively, instead of bumping the min required version, we could dynamically check whether invoke_async
exists in pulumi.runtime
, and fallback to the old implementations if it's unavailable. That does add some complexity, though.
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.
I was thinking about that as well. I think that bumping the min version is probably a better idea, as it will ensure that the actual fix gets out into the world sooner. Otherwise we'd need to tell people to update p/p explicitly.
Does the PR have any schema changes?Looking good! No breaking changes found. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #2863 +/- ##
=======================================
Coverage 25.46% 25.46%
=======================================
Files 48 48
Lines 7532 7532
=======================================
Hits 1918 1918
Misses 5456 5456
Partials 158 158 ☔ View full report in Codecov by Sentry. |
I think both of these are relatively simple to do with mocks. we can definitely do these as a follow-up. |
@@ -518,7 +518,7 @@ Use the navigation below to see detailed documentation for each of the supported | |||
}) | |||
pkg.Language["python"] = rawMessage(map[string]any{ | |||
"requires": map[string]string{ | |||
"pulumi": ">=3.25.0,<4.0.0", | |||
"pulumi": ">=3.109.0,<4.0.0", |
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.
I was thinking about that as well. I think that bumping the min version is probably a better idea, as it will ensure that the actual fix gets out into the world sooner. Otherwise we'd need to tell people to update p/p explicitly.
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.
LGTM. I assume we should update the pu/pu dependency to v3.109.0 (once available), as part of this PR or as a prerequisite.
Update: I'll handle the broader pu/pu update in a follow-up PR: #2866
<!--Thanks for your contribution. See [CONTRIBUTING](CONTRIBUTING.md) for Pulumi's contribution guidelines. Help us merge your changes more quickly by adding more details such as labels, milestones, and reviewers.--> ### Proposed changes <!--Give us a brief description of what you've done and what it solves. --> A follow-up to #2863 to upgrade to pu/pu v3.109.0 across the board. ### Related issues (optional) <!--Refer to related PRs or issues: #1234, or 'Fixes #1234' or 'Closes #1234'. Or link to full URLs to issues or pull requests in other GitHub repositories. -->
pulumi 3.109.0 introduces a new `invoke_async` function (pulumi/pulumi#15602) that allows calling invokes asynchronously. This change updates the Kubernetes Python SDK's `yaml`, `helm`, and `kustomize` components to use `invoke_async` to avoid hangs and stalls in resource registrations which severely limits parallelism. It'd also be great to add some new tests (to complement existing tests), but I don't want to block on getting a fix out to customers: 1. A test similar to the repro of the hang in pulumi/pulumi#15462. It's difficult to repro this without mocking, though. 2. Some kind of benchmark that demonstrates this improves performance. Fixes pulumi/pulumi#15462 Fixes pulumi/pulumi#15591 (cherry picked from commit e174e29)
<!--Thanks for your contribution. See [CONTRIBUTING](CONTRIBUTING.md) for Pulumi's contribution guidelines. Help us merge your changes more quickly by adding more details such as labels, milestones, and reviewers.--> <!--Give us a brief description of what you've done and what it solves. --> A follow-up to #2863 to upgrade to pu/pu v3.109.0 across the board. <!--Refer to related PRs or issues: #1234, or 'Fixes #1234' or 'Closes Or link to full URLs to issues or pull requests in other GitHub repositories. --> (cherry picked from commit 7246ed3)
This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [@pulumi/kubernetes](https://pulumi.com) ([source](https://github.com/pulumi/pulumi-kubernetes)) | dependencies | patch | [`4.9.0` -> `4.9.1`](https://renovatebot.com/diffs/npm/@pulumi%2fkubernetes/4.9.0/4.9.1) | --- > [!WARNING] > Some dependencies could not be looked up. Check the Dependency Dashboard for more information. --- ### Release Notes <details> <summary>pulumi/pulumi-kubernetes (@​pulumi/kubernetes)</summary> ### [`v4.9.1`](https://github.com/pulumi/pulumi-kubernetes/blob/HEAD/CHANGELOG.md#491-March-13-2024) [Compare Source](https://github.com/pulumi/pulumi-kubernetes/compare/v4.9.0...v4.9.1) - Use async invokes to avoid hangs/stalls in Python `helm`, `kustomize`, and `yaml` components ([https://github.com/pulumi/pulumi-kubernetes/pull/2863](https://github.com/pulumi/pulumi-kubernetes/pull/2863)) </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4yNDQuMCIsInVwZGF0ZWRJblZlciI6IjM3LjI1Ny4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiJ9--> Co-authored-by: lumiere-bot[bot] <98047013+lumiere-bot[bot]@users.noreply.github.com>
pulumi 3.109.0 introduces a new
invoke_async
function (pulumi/pulumi#15602) that allows calling invokes asynchronously. This change updates the Kubernetes Python SDK'syaml
,helm
, andkustomize
components to useinvoke_async
to avoid hangs and stalls in resource registrations which severely limits parallelism.It'd also be great to add some new tests (to complement existing tests), but I don't want to block on getting a fix out to customers:
Chart
component with explicit provider pulumi#15462. It's difficult to repro this without mocking, though.Fixes pulumi/pulumi#15462
Fixes pulumi/pulumi#15591