-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Cache Go builds with rebuild: true runtime option #10473
Labels
impact/performance
Something is slower than expected
kind/enhancement
Improvements or new features
language/go
resolution/fixed
This issue was fixed
size/S
Estimated effort to complete (1-2 days).
Milestone
Comments
t0yv0
added
kind/enhancement
Improvements or new features
needs-triage
Needs attention from the triage team
and removed
needs-triage
Needs attention from the triage team
labels
Aug 23, 2022
This was referenced Aug 23, 2022
Noting idea from @AaronFriel to add an option with the path to the binary so users can opt-in to a workspace-local binary path. This seems reasonable. |
t0yv0
changed the title
Go build cache
Cache Go builds with rebuild: true runtime option
Aug 24, 2022
Merged
3 tasks
bors bot
added a commit
that referenced
this issue
Sep 21, 2022
10727: Fix incorrect import for non-pulumi owned package on convert r=aq17 a=aq17 <!--- Thanks so much for your contribution! If this is your first time contributing, please ensure that you have read the [CONTRIBUTING](https://github.com/pulumi/pulumi/blob/master/CONTRIBUTING.md) documentation. --> # Description <!--- Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. --> Fixes `pulumi/yaml` [335](pulumi/pulumi-yaml#335) ## Checklist <!--- Please provide details if the checkbox below is to be left unchecked. --> - [x] I have added tests that prove my fix is effective or that my feature works <!--- User-facing changes require a CHANGELOG entry. --> - [x] I have updated the [CHANGELOG-PENDING](https://github.com/pulumi/pulumi/blob/master/CHANGELOG_PENDING.md) file with my change <!-- If the change(s) in this PR is a modification of an existing call to the Pulumi Service, then the service should honor older versions of the CLI where this change would not exist. You must then bump the API version in /pkg/backend/httpstate/client/api.go, as well as add it to the service. --> - [ ] Yes, there are changes in this PR that warrants bumping the Pulumi Service API version <!-- `@Pulumi` employees: If yes, you must submit corresponding changes in the service repo. --> 10731: add `buildTarget` option for pulumi go programs to compile/recompile to the specified path r=dixler a=dixler <!--- Thanks so much for your contribution! If this is your first time contributing, please ensure that you have read the [CONTRIBUTING](https://github.com/pulumi/pulumi/blob/master/CONTRIBUTING.md) documentation. --> # Description <!--- Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. --> Part of #10473 This implements the `buildTarget` option(Pulumi.yaml) for Pulumi Go programs to write the pulumi program out to a file. It has some performance benefits as Go can build a program faster when an existing program is provided. ## Checklist <!--- Please provide details if the checkbox below is to be left unchecked. --> - [x] I have added tests that prove my fix is effective or that my feature works <!--- User-facing changes require a CHANGELOG entry. --> - [x] I have updated the [CHANGELOG-PENDING](https://github.com/pulumi/pulumi/blob/master/CHANGELOG_PENDING.md) file with my change <!-- If the change(s) in this PR is a modification of an existing call to the Pulumi Service, then the service should honor older versions of the CLI where this change would not exist. You must then bump the API version in /pkg/backend/httpstate/client/api.go, as well as add it to the service. --> - [ ] Yes, there are changes in this PR that warrants bumping the Pulumi Service API version <!-- `@Pulumi` employees: If yes, you must submit corresponding changes in the service repo. --> 10817: Add pulumi-analyzer-policy and pulumi-analyzer-policy-python to the list of bundled plugins r=Frassle a=Frassle <!--- Thanks so much for your contribution! If this is your first time contributing, please ensure that you have read the [CONTRIBUTING](https://github.com/pulumi/pulumi/blob/master/CONTRIBUTING.md) documentation. --> # Description <!--- Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. --> Fixes discovering these plugins if the directory "pulumi[.exe]" is in is not on PATH. ## Checklist <!--- Please provide details if the checkbox below is to be left unchecked. --> - [ ] I have added tests that prove my fix is effective or that my feature works <!--- User-facing changes require a CHANGELOG entry. --> - [x] I have run `make changelog` and committed the `changelog/pending/<file>` documenting my change <!-- If the change(s) in this PR is a modification of an existing call to the Pulumi Service, then the service should honor older versions of the CLI where this change would not exist. You must then bump the API version in /pkg/backend/httpstate/client/api.go, as well as add it to the service. --> - [ ] Yes, there are changes in this PR that warrants bumping the Pulumi Service API version <!-- `@Pulumi` employees: If yes, you must submit corresponding changes in the service repo. --> Co-authored-by: aq17 <aqiu@pulumi.com> Co-authored-by: Kyle Dixler <kyle@pulumi.com> Co-authored-by: Fraser Waters <fraser@pulumi.com>
bors bot
added a commit
that referenced
this issue
Sep 22, 2022
10731: add `buildTarget` option for pulumi go programs to compile/recompile to the specified path r=dixler a=dixler <!--- Thanks so much for your contribution! If this is your first time contributing, please ensure that you have read the [CONTRIBUTING](https://github.com/pulumi/pulumi/blob/master/CONTRIBUTING.md) documentation. --> # Description <!--- Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. --> Part of #10473 This implements the `buildTarget` option(Pulumi.yaml) for Pulumi Go programs to write the pulumi program out to a file. It has some performance benefits as Go can build a program faster when an existing program is provided. ## Checklist <!--- Please provide details if the checkbox below is to be left unchecked. --> - [x] I have added tests that prove my fix is effective or that my feature works <!--- User-facing changes require a CHANGELOG entry. --> - [x] I have updated the [CHANGELOG-PENDING](https://github.com/pulumi/pulumi/blob/master/CHANGELOG_PENDING.md) file with my change <!-- If the change(s) in this PR is a modification of an existing call to the Pulumi Service, then the service should honor older versions of the CLI where this change would not exist. You must then bump the API version in /pkg/backend/httpstate/client/api.go, as well as add it to the service. --> - [ ] Yes, there are changes in this PR that warrants bumping the Pulumi Service API version <!-- `@Pulumi` employees: If yes, you must submit corresponding changes in the service repo. --> 10817: Add pulumi-analyzer-policy and pulumi-analyzer-policy-python to the list of bundled plugins r=Frassle a=Frassle <!--- Thanks so much for your contribution! If this is your first time contributing, please ensure that you have read the [CONTRIBUTING](https://github.com/pulumi/pulumi/blob/master/CONTRIBUTING.md) documentation. --> # Description <!--- Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. --> Fixes discovering these plugins if the directory "pulumi[.exe]" is in is not on PATH. ## Checklist <!--- Please provide details if the checkbox below is to be left unchecked. --> - [ ] I have added tests that prove my fix is effective or that my feature works <!--- User-facing changes require a CHANGELOG entry. --> - [x] I have run `make changelog` and committed the `changelog/pending/<file>` documenting my change <!-- If the change(s) in this PR is a modification of an existing call to the Pulumi Service, then the service should honor older versions of the CLI where this change would not exist. You must then bump the API version in /pkg/backend/httpstate/client/api.go, as well as add it to the service. --> - [ ] Yes, there are changes in this PR that warrants bumping the Pulumi Service API version <!-- `@Pulumi` employees: If yes, you must submit corresponding changes in the service repo. --> 10821: ci: Updated test repo, check if Windows tests pass r=AaronFriel a=AaronFriel The remote repo has been updated to use the latest Go & Pulumi SDK, so this ought to unblock these tests. Resolves #8646. Co-authored-by: Kyle Dixler <kyle@pulumi.com> Co-authored-by: Fraser Waters <fraser@pulumi.com> Co-authored-by: Aaron Friel <mayreply@aaronfriel.com>
bors bot
added a commit
that referenced
this issue
Sep 22, 2022
10731: add `buildTarget` option for pulumi go programs to compile/recompile to the specified path r=dixler a=dixler <!--- Thanks so much for your contribution! If this is your first time contributing, please ensure that you have read the [CONTRIBUTING](https://github.com/pulumi/pulumi/blob/master/CONTRIBUTING.md) documentation. --> # Description <!--- Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. --> Part of #10473 This implements the `buildTarget` option(Pulumi.yaml) for Pulumi Go programs to write the pulumi program out to a file. It has some performance benefits as Go can build a program faster when an existing program is provided. ## Checklist <!--- Please provide details if the checkbox below is to be left unchecked. --> - [x] I have added tests that prove my fix is effective or that my feature works <!--- User-facing changes require a CHANGELOG entry. --> - [x] I have updated the [CHANGELOG-PENDING](https://github.com/pulumi/pulumi/blob/master/CHANGELOG_PENDING.md) file with my change <!-- If the change(s) in this PR is a modification of an existing call to the Pulumi Service, then the service should honor older versions of the CLI where this change would not exist. You must then bump the API version in /pkg/backend/httpstate/client/api.go, as well as add it to the service. --> - [ ] Yes, there are changes in this PR that warrants bumping the Pulumi Service API version <!-- `@Pulumi` employees: If yes, you must submit corresponding changes in the service repo. --> Co-authored-by: Kyle Dixler <kyle@pulumi.com>
65 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
impact/performance
Something is slower than expected
kind/enhancement
Improvements or new features
language/go
resolution/fixed
This issue was fixed
size/S
Estimated effort to complete (1-2 days).
Hello!
Issue details
Consider introducing a
rebuild: true
runtime option for Go programs.The option is to be used in conjunction with
binary: $dest
option andwill instruct Pulumi to rebuild the binary with
go build -o $dest
prior to executing:
In version v3.38.0 Pulumi commands such as
pulumi up
usedgo run
to execute Go code, but is going to usego build -o $tempfile
with a temp file after #10375Pulumi also supports
binary
option. If set, Pulumi does not build code at all but executes a prebuilt code at the location given bybinary
.As it turns out,
go build -o $dest
can be much more efficient thango build -o $tempfile
on repeat invocations. Therebuild: true
opens a way to rebuild thebinary
efficiently as part of normalpulumi up
.It should be an error to specify
rebuild: true
without also specifyingbinary
.Alternatives
This feature requires explicit user opt-in to result in speedups. We
considered an alternative design that would speed up all user programs
transparently upon upgrade: a go compilation cache. Pulumi would
manage a LRU binary cache under
~/.pulumi
. We decided against thisgiven some complexity in dealing with locking and managing disk space.
Rollout
Potential speedup
So the new method would result in a warm start (after initial build)
of 250ms for a Pulumi project using azure-native compared to the 1.2s
baseline with
go run
. It's common for users to run severaloperations that don't result in relinking the binary so these savings
can be meaningful.
Affected area/feature
Go provider.
The text was updated successfully, but these errors were encountered: