https://pulumi.com logo
Title
b

big-account-56668

09/29/2020, 4:26 PM
Hi, I'm just trying to start using Pulumi but are running into some issues. Using GCP and
<http://github.com/pulumi/pulumi-gcp/sdk/v3@v3.25.0/go/gcp/compute|github.com/pulumi/pulumi-gcp/sdk/v3@v3.25.0/go/gcp/compute>
creating a
NewInstance
and running
pulumi up
has my machine freeze up as the compilation step (snippet) hijacks all cores at 100% until finally failing with
Diagnostics:
  pulumi:pulumi:Stack (project-stage):
    go build <http://github.com/pulumi/pulumi-gcp/sdk/v3/go/gcp/compute|github.com/pulumi/pulumi-gcp/sdk/v3/go/gcp/compute>: /usr/lib/go/pkg/tool/linux_amd64/compile: signal: killed

    error: an unhandled error occurred: program exited with non-zero exit code: 1
I'm looking for any assistance in debugging this. I've successfully added two other resources and it's as I'm adding the compute instance to my stack that this happens. I'm not sure what is eventually killing off the compilation but I would assume it's some internal timeout in Pulumi. Happy to provide any additional info.
l

lemon-agent-27707

09/29/2020, 4:44 PM
Are you by any chance running pulumi inside of a VM? Due to a lack of generics in go, there are a huge number of types that get linked in and this is known to take up quite a bit of memory.
Are you able to build the binary before running
pulumi up
or does that fail as well?
b

big-account-56668

09/29/2020, 5:19 PM
I am not running inside a VM, yet. This is on my laptop which has 16gb of total memory. Do you think that is not enough?
I tried building the binary on it's own which caused the same long-running compilation. Let me see if it finishes if I leave it for a while longer.
No, building the binary also results in the same error, but I can see now that it's indeed being killed off by the OOM-killer:
[ 6559.889281] Out of memory: Killed process 15267 (compile) total-vm:10209944kB, anon-rss:9480132kB, file-rss:0kB, shmem-rss:0kB, UID:1000 pgtables:18764kB oom_score_adj:0
Any suggestions on how to proceed here?
l

lemon-agent-27707

09/29/2020, 5:32 PM
Can you try setting GOGC? Perhaps something like
GOGC=50
or
GOGC=25
https://dave.cheney.net/tag/gogc
b

big-account-56668

09/29/2020, 5:49 PM
Setting a lower
GOGC
value seems to help as the compilation now succeeds so I can get around my particular issue this way for now, thanks.
As I suspected this is only needed when recompiling, in this case, the
compute
package.