No standard way of specifying memory requirements for multipass build VMs

Bug #1842376 reported by Dmitrii Shcherbakov
16
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Snapcraft
New
Undecided
Unassigned

Bug Description

I tried to build Juju via snapcraft + multipass, however, the VM ran out of memory and OOM killer killed the linker process. Considering that this bug https://bugs.launchpad.net/snapcraft/+bug/1822265 was closed with a note that SNAPCRAFT_BUILD_ENVIRONMENT_MEMORY is for development/debugging only there needs to be a standard way to do it as some software requires more that 2 GiB of memory to be built.

snapcraft --debug
Launching a VM.
Loaded local plugin for dep
Skipping pull juju (already ran)
Skipping pull wrappers (already ran)
Building juju
go install github.com/juju/juju/cmd/juju
^[[6~/snap/go/4301/pkg/tool/linux_amd64/link: signal: killed
Failed to run 'go install github.com/juju/juju/cmd/juju' for 'juju': Exited with code 1.
Verify that the part is using the correct parameters and try again.

Kernel log inside a VM:

Sep 03 03:21:32 snapcraft-juju kernel: Out of memory: Kill process 1588 (link) score 859 or sacrifice child
Sep 03 03:21:32 snapcraft-juju kernel: Killed process 1588 (link) total-vm:1947684kB, anon-rss:1813888kB, file-rss:0kB, shmem-rss:0kB
Sep 03 03:21:32 snapcraft-juju kernel: oom_reaper: reaped process 1588 (link), now anon-rss:0kB, file-rss:0kB, shmem-rss:0kB

Revision history for this message
Nobuto Murata (nobuto) wrote :

Seconded. I bumped into it by doing `git clone github.com/juju/juju && snapcraft`.

Then the build process failed with:

> Memory usage: 1.8GiB out of 1.9GiB

> go build github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork: /snap/go/10029/pkg/tool/linux_amd64/compile: signal: killed

If we don't have a way to specify required memory size somewhere in snapcraft.yaml for example, the first developer experience is not going to be great.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.