all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Roel Janssen <roel@gnu.org>
To: Leo Famulari <leo@famulari.name>
Cc: 48178@debbugs.gnu.org
Subject: bug#48178: Out of memory error when generating a docker-image.
Date: Mon, 03 May 2021 19:47:49 +0200	[thread overview]
Message-ID: <5578dcab6d15ae85a544b92f03b6a5d89223967c.camel@gnu.org> (raw)
In-Reply-To: <YJAnKAe7HCWy/lpd@jasmine.lan>

[-- Attachment #1: Type: text/plain, Size: 1643 bytes --]

On Mon, 2021-05-03 at 12:39 -0400, Leo Famulari wrote:
> On Mon, May 03, 2021 at 12:09:36AM +0200, Roel Janssen wrote:
> > Looking at 'guix/scripts/system.scm', it seems that we always pass
> > 256M
> > of memory to the VM.  After bumping that to 4096M, I was able to
> > produce a docker image.
> 
> Can you test somes values that are in between? Like, 512M, 1024M,
> etc,
> until we know how much is actually required? If 512M is enough, I
> don't
> see a problem with increasing the hard-coded value to that.
> 

I monitored the VM's memory usage and it peaked at 1.6G. But after
testing, it seems 1024 also works.

I tested with 2048 (worked), 1024 (worked), and 512 (didn't work).

> > I'd like to see what we can do here.  Assigning too little memory
> > leads
> > to problems generating the container, but assigning too much memory
> > wil
> > l cause problems for computing machines that don't have much memory
> > to
> > spare.
> 

In that case... The attached patch would only increase the size when
generating a Docker container image.  Would that be acceptable?

> There are some use cases for this code that we'd like to work on
> low-resource machines (`guix system vm`), and other use cases (like
> building Docker images) that shouldn't be expected to work on
> machines
> with limited RAM.
> 
> > Would it be a good idea to make it configurable at run-time?
> 
> Yeah, maybe.
> 

I think it'd be better to have it somehow dynamically increase, but I
don't see how I could determine the VM size needed for a given system
configuration.  So perhaps the attached patch is an acceptable
compromise.

Kind regards,
Roel Janssen


[-- Attachment #2: 0001-guix-scripts-system-Increase-the-size-for-generating.patch --]
[-- Type: text/x-patch, Size: 884 bytes --]

From 0dcaf5cfc529f0ce31af46d4f3039f4b7dbebb9b Mon Sep 17 00:00:00 2001
From: Roel Janssen <roel@gnu.org>
Date: Mon, 3 May 2021 18:54:08 +0200
Subject: [PATCH] guix: scripts system: Increase the size for generating Docker
 container images.

* guix/scripts/system.scm: Override the default of 256.
---
 guix/scripts/system.scm | 1 +
 1 file changed, 1 insertion(+)

diff --git a/guix/scripts/system.scm b/guix/scripts/system.scm
index 0a051ee4e3..a25e0dac52 100644
--- a/guix/scripts/system.scm
+++ b/guix/scripts/system.scm
@@ -717,6 +717,7 @@ checking this by themselves in their 'check' procedure."
        (lower-object (system-image image)))
       ((docker-image)
        (system-docker-image os
+                            #:memory-size 1024
                             #:shared-network? container-shared-network?)))))
 
 (define (maybe-suggest-running-guix-pull)
-- 
2.31.1


  reply	other threads:[~2021-05-03 17:53 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-02 22:09 bug#48178: Out of memory error when generating a docker-image Roel Janssen
2021-05-03 16:39 ` Leo Famulari
2021-05-03 17:47   ` Roel Janssen [this message]
2021-05-10  7:29     ` Efraim Flashner
2021-05-10  7:46       ` Roel Janssen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5578dcab6d15ae85a544b92f03b6a5d89223967c.camel@gnu.org \
    --to=roel@gnu.org \
    --cc=48178@debbugs.gnu.org \
    --cc=leo@famulari.name \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.