pulumi/sdk/go
Evan Boyle e1576d13b3
make plugin metadata (size, install time) opt in for list operations (#7163)
This change is a simple perf optimization to speed up the process of listing plugins by excluding some metadata like size by default.

Our strategy for finding a plugin is to first look on the path, and then to iterate through all plugins in the plugin cache (a directory). We do this for each plugin that is loaded when NewProvider is called. Unfortunately, the codepath that gets all plugins is shared by pulumi plugin ls that needs to do things like display the total size of all plugins, the size of each plugin, and when the plugin was last installed/last used.

This means that any time a plugin is loaded, we are computing the size of all plugins by recursively enumerating all folder (including all of the node_modules directories of any installed node multi-lang plugins!). For my 5 gb of node plugins this translated to 10s of overhead each time a plugin was loaded.

This change is a very simple fix. pulumi plugin ls is the only code path that uses size, so we create a dedicated code path GetPluginsWithMetadata that populates that info, excluding from the result of GetPlugins by default.
2021-05-28 07:26:08 -07:00
..
auto Temporarily disable config secrets warning (#7129) 2021-05-24 16:06:27 -07:00
common make plugin metadata (size, install time) opt in for list operations (#7163) 2021-05-28 07:26:08 -07:00
pulumi Temporarily disable config secrets warning (#7129) 2021-05-24 16:06:27 -07:00
pulumi-language-go [sdk/go] Warn when a secret config is read as a non-secret (#7080) 2021-05-18 15:02:43 -07:00
Makefile [breaking] Changing the version of go.mod in sdk / pkg to be v3 2021-04-14 19:32:18 +01:00
README.md pulumi update => pulumi up (#2702) 2019-05-06 14:00:18 -07:00

Pulumi Golang SDK

This directory contains support for writing Pulumi programs in the Go language. There are two aspects to this:

  • pulumi/ contains the client language bindings Pulumi program's code directly against;
  • pulumi-language-go/ contains the language host plugin that the Pulumi engine uses to orchestrate updates.

To author a Pulumi program in Go, simply say so in your Pulumi.yaml

name: <my-project>
runtime: go

and ensure you have pulumi-language-go on your path (it is distributed in the Pulumi download automatically).

By default, the language plugin will use your project's name, <my-project>, as the executable that it loads. This too must be on your path for the language provider to load it when you run pulumi preview or pulumi up.