All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Daniel P. Berrangé" <berrange@redhat.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: alex.bennee@linaro.org, qemu-devel@nongnu.org, stefanha@redhat.com
Subject: Re: [RFC PATCH] ci: ensure that all jobs use a shallow clone
Date: Thu, 7 Jan 2021 18:28:12 +0000	[thread overview]
Message-ID: <20210107182812.GI1029501@redhat.com> (raw)
In-Reply-To: <20210107171719.477856-1-pbonzini@redhat.com>

On Thu, Jan 07, 2021 at 06:17:19PM +0100, Paolo Bonzini wrote:
> We are still using quite a bit of bandwidth to run CI jobs, even though
> GitLab has switched to gitlab.com to fetch the sources.  This is in
> part because we are handling submodules ourselves and therefore those
> do not use shallow clones.

I presume the impact is going to vary for GitLab vs the other
CI systems.  For gitlab, any bandwidth used should be entirely
within gitlab's own network infra since its pulling repos
from  gitlab.com/qemu-project

For Cirrus/Shippable/Travis  the bandwidth used would be more
of a potential performance problem.

> Observe GitLab's GIT_DEPTH environment variable in
> scripts/git-submodule.sh so that CI systems can use a shallow clone
> for submodules.  Set a depth of 3 for all CI systems, for both the main
> repository (using whatever native configuration mechanism is there)
> and the submodules.
> 
> Reported-by: Stefan Hajnoczi <stefanha@redhat.com>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
>         Completely untested, just to propose the idea.

The check-patch and check-dco jobs need the git history depth to be
long enough to cover the entire contents of the branch that is being
tested vs common ancestor against git master.

This could potentially be 100's of commits deep for some of the very
largest branches we see merged in qemu


Travis has issues with git cloning and concurrent pushes.

eg if you push branch A, it schedules a CI job. Then you
push branch B before jobs for A have started.

When the job for A starts, it will be unable to checkout
the commit for branch A's merge because the history will
be too shallow.


I'm not sure if the other CI systems have similar issues or
not.

> 
>  .cirrus.yml              | 1 +
>  .gitlab-ci.yml           | 3 +++
>  .shippable.yml           | 2 ++
>  .travis.yml              | 2 ++
>  scripts/git-submodule.sh | 2 +-
>  5 files changed, 9 insertions(+), 1 deletion(-)
> 
> diff --git a/.cirrus.yml b/.cirrus.yml
> index 6f2a958472..47c2467d04 100644
> --- a/.cirrus.yml
> +++ b/.cirrus.yml
> @@ -1,5 +1,6 @@
>  env:
> -  CIRRUS_CLONE_DEPTH: 1
> +  CIRRUS_CLONE_DEPTH: 3
> +  GIT_DEPTH: 3
>  
>  freebsd_12_task:
>    freebsd_instance:
> diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
> index 01c9e46410..ff19a9c313 100644
> --- a/.gitlab-ci.yml
> +++ b/.gitlab-ci.yml
> @@ -7,6 +7,9 @@ stages:
>    - build
>    - test
>  
> +variables:
> +  GIT_DEPTH: 3
> +
>  include:
>    - local: '/.gitlab-ci.d/edk2.yml'
>    - local: '/.gitlab-ci.d/opensbi.yml'
> diff --git a/.shippable.yml b/.shippable.yml
> index 14350e6de8..f2d59b478e 100644
> --- a/.shippable.yml
> +++ b/.shippable.yml
> @@ -1,9 +1,11 @@
>  language: c
> +depth: 3
>  git:
>     submodules: false
>  env:
>    global:
>      - LC_ALL=C
> +    - GIT_DEPTH=3
>    matrix:
>      - IMAGE=debian-amd64
>        TARGET_LIST=x86_64-softmmu,x86_64-linux-user
> diff --git a/.travis.yml b/.travis.yml
> index f2a101936c..f2a785a42b 100644
> --- a/.travis.yml
> +++ b/.travis.yml
> @@ -80,9 +80,11 @@ env:
>      - CCACHE_SLOPPINESS="include_file_ctime,include_file_mtime"
>      - CCACHE_MAXSIZE=1G
>      - G_MESSAGES_DEBUG=error
> +    - GIT_DEPTH=3
>  
>  
>  git:
> +  depth: 3
>    # we want to do this ourselves
>    submodules: false
>  
> diff --git a/scripts/git-submodule.sh b/scripts/git-submodule.sh
> index 65ed877aef..2886087a12 100755
> --- a/scripts/git-submodule.sh
> +++ b/scripts/git-submodule.sh
> @@ -75,7 +75,7 @@ update)
>          exit 0
>      fi
>  
> -    $GIT submodule update --init $modules 1>/dev/null
> +    $GIT submodule update ${GIT_DEPTH:+--depth "$GIT_DEPTH"} --init $modules 1>/dev/null
>      test $? -ne 0 && error "failed to update modules"
>  
>      $GIT submodule status $modules > "${substat}"
> -- 
> 2.29.2
> 
> 

Regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|



  reply	other threads:[~2021-01-07 18:29 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-07 17:17 [RFC PATCH] ci: ensure that all jobs use a shallow clone Paolo Bonzini
2021-01-07 18:28 ` Daniel P. Berrangé [this message]
2021-01-07 19:05   ` Thomas Huth
2021-01-07 19:23     ` Paolo Bonzini
2021-01-08 10:16       ` Daniel P. Berrangé
2021-01-08 11:06         ` Thomas Huth
2021-01-08 11:10           ` Daniel P. Berrangé

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=20210107182812.GI1029501@redhat.com \
    --to=berrange@redhat.com \
    --cc=alex.bennee@linaro.org \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.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.