diff mbox

[U-Boot,06/13] buildman: Tidy up the 'cloning' message

Message ID 1474238918-1797-7-git-send-email-sjg@chromium.org
State Accepted
Commit 21f0eb332faddeb88a0f3e9788f83b6f9c22071c
Delegated to: Simon Glass
Headers show

Commit Message

Simon Glass Sept. 18, 2016, 10:48 p.m. UTC
On a machine with a lot of CPUs this prints a lot of useless lines of the
form:

   Cloning repo for thread <n>

Adjust the output so that these all appear on one line, and disappear when
the cloning is complete.

Note: This cloning is actually unnecessary and very wasteful on disk space
(about 3.5GB each time). It would be better to create symlinks.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

 tools/buildman/builder.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Tom Rini Sept. 19, 2016, 7:14 p.m. UTC | #1
On Sun, Sep 18, 2016 at 04:48:31PM -0600, Simon Glass wrote:

> On a machine with a lot of CPUs this prints a lot of useless lines of the
> form:
> 
>    Cloning repo for thread <n>
> 
> Adjust the output so that these all appear on one line, and disappear when
> the cloning is complete.
> 
> Note: This cloning is actually unnecessary and very wasteful on disk space
> (about 3.5GB each time). It would be better to create symlinks.

When do we actually need to clone?  Or why, even?
Simon Glass Sept. 23, 2016, 4:14 a.m. UTC | #2
Hi Tom,

On 19 September 2016 at 13:14, Tom Rini <trini@konsulko.com> wrote:
> On Sun, Sep 18, 2016 at 04:48:31PM -0600, Simon Glass wrote:
>
>> On a machine with a lot of CPUs this prints a lot of useless lines of the
>> form:
>>
>>    Cloning repo for thread <n>
>>
>> Adjust the output so that these all appear on one line, and disappear when
>> the cloning is complete.
>>
>> Note: This cloning is actually unnecessary and very wasteful on disk space
>> (about 3.5GB each time). It would be better to create symlinks.
>
> When do we actually need to clone?  Or why, even?

Each thread can check out a different commit. I think it might be
possible to put the checkout in a separate thread so it can avoid
contention. I'm not quite sure...

Regards,
Simon
Tom Rini Sept. 23, 2016, 6:42 p.m. UTC | #3
On Thu, Sep 22, 2016 at 10:14:01PM -0600, Simon Glass wrote:
> Hi Tom,
> 
> On 19 September 2016 at 13:14, Tom Rini <trini@konsulko.com> wrote:
> > On Sun, Sep 18, 2016 at 04:48:31PM -0600, Simon Glass wrote:
> >
> >> On a machine with a lot of CPUs this prints a lot of useless lines of the
> >> form:
> >>
> >>    Cloning repo for thread <n>
> >>
> >> Adjust the output so that these all appear on one line, and disappear when
> >> the cloning is complete.
> >>
> >> Note: This cloning is actually unnecessary and very wasteful on disk space
> >> (about 3.5GB each time). It would be better to create symlinks.
> >
> > When do we actually need to clone?  Or why, even?
> 
> Each thread can check out a different commit. I think it might be
> possible to put the checkout in a separate thread so it can avoid
> contention. I'm not quite sure...

Ah, ok.  So we have a few places under tools/ that should be doing 'git
clone --local', at first glance.
Simon Glass Sept. 23, 2016, 9:09 p.m. UTC | #4
Hi Tom,

On 23 September 2016 at 12:42, Tom Rini <trini@konsulko.com> wrote:
> On Thu, Sep 22, 2016 at 10:14:01PM -0600, Simon Glass wrote:
>> Hi Tom,
>>
>> On 19 September 2016 at 13:14, Tom Rini <trini@konsulko.com> wrote:
>> > On Sun, Sep 18, 2016 at 04:48:31PM -0600, Simon Glass wrote:
>> >
>> >> On a machine with a lot of CPUs this prints a lot of useless lines of the
>> >> form:
>> >>
>> >>    Cloning repo for thread <n>
>> >>
>> >> Adjust the output so that these all appear on one line, and disappear when
>> >> the cloning is complete.
>> >>
>> >> Note: This cloning is actually unnecessary and very wasteful on disk space
>> >> (about 3.5GB each time). It would be better to create symlinks.
>> >
>> > When do we actually need to clone?  Or why, even?
>>
>> Each thread can check out a different commit. I think it might be
>> possible to put the checkout in a separate thread so it can avoid
>> contention. I'm not quite sure...
>
> Ah, ok.  So we have a few places under tools/ that should be doing 'git
> clone --local', at first glance.

Actually I think I am wrong about this. The 3.5GB is due to 32 copies
of the code, not the cloning. In fact --local is the default and that
is what buildman seems to use.

So in fact I'm not sure we can change it. Each thread can be building
a different commit.

Regards,
Simon
Tom Rini Sept. 23, 2016, 9:13 p.m. UTC | #5
On Fri, Sep 23, 2016 at 03:09:53PM -0600, Simon Glass wrote:
> Hi Tom,
> 
> On 23 September 2016 at 12:42, Tom Rini <trini@konsulko.com> wrote:
> > On Thu, Sep 22, 2016 at 10:14:01PM -0600, Simon Glass wrote:
> >> Hi Tom,
> >>
> >> On 19 September 2016 at 13:14, Tom Rini <trini@konsulko.com> wrote:
> >> > On Sun, Sep 18, 2016 at 04:48:31PM -0600, Simon Glass wrote:
> >> >
> >> >> On a machine with a lot of CPUs this prints a lot of useless lines of the
> >> >> form:
> >> >>
> >> >>    Cloning repo for thread <n>
> >> >>
> >> >> Adjust the output so that these all appear on one line, and disappear when
> >> >> the cloning is complete.
> >> >>
> >> >> Note: This cloning is actually unnecessary and very wasteful on disk space
> >> >> (about 3.5GB each time). It would be better to create symlinks.
> >> >
> >> > When do we actually need to clone?  Or why, even?
> >>
> >> Each thread can check out a different commit. I think it might be
> >> possible to put the checkout in a separate thread so it can avoid
> >> contention. I'm not quite sure...
> >
> > Ah, ok.  So we have a few places under tools/ that should be doing 'git
> > clone --local', at first glance.
> 
> Actually I think I am wrong about this. The 3.5GB is due to 32 copies
> of the code, not the cloning. In fact --local is the default and that
> is what buildman seems to use.
> 
> So in fact I'm not sure we can change it. Each thread can be building
> a different commit.

Ah, OK, oh well.
Simon Glass Oct. 2, 2016, 12:29 a.m. UTC | #6
On 18 September 2016 at 16:48, Simon Glass <sjg@chromium.org> wrote:
> On a machine with a lot of CPUs this prints a lot of useless lines of the
> form:
>
>    Cloning repo for thread <n>
>
> Adjust the output so that these all appear on one line, and disappear when
> the cloning is complete.
>
> Note: This cloning is actually unnecessary and very wasteful on disk space
> (about 3.5GB each time). It would be better to create symlinks.
>
> Signed-off-by: Simon Glass <sjg@chromium.org>
> ---
>
>  tools/buildman/builder.py | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)

Applied to u-boot-dm.
diff mbox

Patch

diff --git a/tools/buildman/builder.py b/tools/buildman/builder.py
index 2aca189..7c237a5 100644
--- a/tools/buildman/builder.py
+++ b/tools/buildman/builder.py
@@ -1379,8 +1379,10 @@  class Builder:
             if os.path.exists(git_dir):
                 gitutil.Fetch(git_dir, thread_dir)
             else:
-                Print('Cloning repo for thread %d' % thread_num)
+                Print('\rCloning repo for thread %d' % thread_num,
+                      newline=False)
                 gitutil.Clone(src_dir, thread_dir)
+                Print('\r%s\r' % (' ' * 30), newline=False)
 
     def _PrepareWorkingSpace(self, max_threads, setup_git):
         """Prepare the working directory for use.