From: Oleksandr Andrushchenko <andr2000@gmail.com>
To: bitbake-devel@lists.openembedded.org
Cc: andr2000@gmail.com,
Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
Subject: [PATCH 4/4] fetch2/repo: Use multiple jobs to fetch and sync
Date: Tue, 24 Oct 2017 14:35:44 +0300 [thread overview]
Message-ID: <1508844944-5761-5-git-send-email-andr2000@gmail.com> (raw)
In-Reply-To: <1508844944-5761-1-git-send-email-andr2000@gmail.com>
From: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
Google repo supports "--jobs" parameter, so one can
speed up the process of fetching and syncing. According to
https://groups.google.com/a/chromium.org/forum/#!topic/chromium-os-dev/ny3nkgE9AE8
it is even more gets to speed if used separately for
network jobs and "local" ones.
Use BB_NUMBER_THREADS to run parallel repo sync.
Signed-off-by: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
---
lib/bb/fetch2/repo.py | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/lib/bb/fetch2/repo.py b/lib/bb/fetch2/repo.py
index 3c28fe04ab1e..08331acd6706 100644
--- a/lib/bb/fetch2/repo.py
+++ b/lib/bb/fetch2/repo.py
@@ -57,6 +57,13 @@ class Repo(FetchMethod):
ud.codir = os.path.join(repodir, gitsrcname, ud.manifest)
ud.repodir = os.path.join(ud.codir, "repo")
+ def sync(self, ud, d):
+ # repo can separate the "network" sync (the git fetch part, network bound)
+ # from the local sync (the git rebase part, compute & i/o bound).
+ num_jobs = d.getVar("BB_NUMBER_THREADS", True) or "1"
+ runfetchcmd("repo sync -c -n -j%s" % num_jobs, d, workdir=ud.repodir)
+ runfetchcmd("repo sync -c -l -j%s" % num_jobs, d, workdir=ud.repodir)
+
def download(self, ud, d):
"""Fetch url"""
@@ -74,7 +81,7 @@ class Repo(FetchMethod):
runfetchcmd("repo init -m %s -b %s -u %s://%s%s%s" % (ud.manifest, ud.branch, ud.proto, username, ud.host, ud.path), d, workdir=ud.repodir)
bb.fetch2.check_network_access(d, "repo sync %s" % ud.url, ud.url)
- runfetchcmd("repo sync", d, workdir=ud.repodir)
+ self.sync(ud, d)
scmdata = ud.parm.get("scmdata", "")
if scmdata == "keep":
@@ -88,7 +95,7 @@ class Repo(FetchMethod):
def unpack(self, ud, destdir, d):
FetchMethod.unpack(self, ud, destdir, d)
bb.fetch2.check_network_access(d, "repo sync %s" % ud.url, ud.url)
- runfetchcmd("repo sync", d, workdir=ud.repodir)
+ self.sync(ud, d)
def supports_srcrev(self):
return False
--
2.7.4
prev parent reply other threads:[~2017-10-24 11:35 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-24 11:35 [PATCH 0/4] fetch2/repo: Repo fetcher fixes and improvements Oleksandr Andrushchenko
2017-10-24 11:35 ` [PATCH 1/4] fetch2/repo: Fix missing logger import in repo fetcher Oleksandr Andrushchenko
2017-10-24 11:35 ` [PATCH 2/4] fetch2/repo: Always check if branch is correct Oleksandr Andrushchenko
2017-10-24 11:35 ` [PATCH 3/4] fetch2/repo: Make fetcher always sync on unpack Oleksandr Andrushchenko
2017-11-07 13:45 ` Richard Purdie
2017-11-07 19:31 ` Oleksandr Andrushchenko
2017-11-08 18:09 ` Richard Purdie
2017-10-24 11:35 ` Oleksandr Andrushchenko [this message]
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=1508844944-5761-5-git-send-email-andr2000@gmail.com \
--to=andr2000@gmail.com \
--cc=bitbake-devel@lists.openembedded.org \
--cc=oleksandr_andrushchenko@epam.com \
/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.
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.