All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wei Liu <wl@xen.org>
To: Anthony PERARD <anthony.perard@citrix.com>
Cc: xen-devel@lists.xenproject.org,
	Doug Goldstein <cardoe@cardoe.com>,
	Ian Jackson <ian.jackson@eu.citrix.com>, Wei Liu <wl@xen.org>
Subject: Re: [Xen-devel] [XEN PATCH 2/2] automation: Cache sub-project git tree in build jobs
Date: Fri, 3 Jan 2020 14:29:07 +0000	[thread overview]
Message-ID: <20200103142907.ylckq7fh2h536w72@debian> (raw)
In-Reply-To: <20191219144217.305851-3-anthony.perard@citrix.com>

On Thu, Dec 19, 2019 at 02:42:17PM +0000, Anthony PERARD wrote:
> GitLab have a caching capability, see [1]. Let's use it to avoid using
> Internet too often.
> 
> The cache is setup so that when xen.git/Config.mk is changed, the
> cache will need to be recreated. This has been chosen because that is
> where the information about how to clone sub-project trees is encoded
> (revisions). That may not work for qemu-xen tree which usually is
> `master', but that should be fine for now.
> 
> The cache is populated of "git bundle" which will contain a mirror of
> the original repo, and can be cloned from. If the bundle exist, the
> script have the Xen makefiles clone from it, otherwise it will clone
> from the original URL and the bundles will be created just after.
> 
> We have more than one runner in GitLab, and no shared cache between
> them, so every build jobs will be responsible to create the cache.
> 
> [1] https://docs.gitlab.com/ee/ci/yaml/README.html#cache
> 
> Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>

This is a good improvement.

Have you run this in Gitlab CI? Can you point me to a run?

> ---
>  automation/gitlab-ci/build.yaml     |  8 +++++
>  automation/scripts/prepare-cache.sh | 52 +++++++++++++++++++++++++++++
>  2 files changed, 60 insertions(+)
>  create mode 100755 automation/scripts/prepare-cache.sh
> 
> diff --git a/automation/gitlab-ci/build.yaml b/automation/gitlab-ci/build.yaml
> index 1e61d30c8545..8f9f53a4222f 100644
> --- a/automation/gitlab-ci/build.yaml
> +++ b/automation/gitlab-ci/build.yaml
> @@ -1,6 +1,14 @@
>  .build-tmpl: &build
>    stage: build
>    image: registry.gitlab.com/xen-project/xen/${CONTAINER}
> +  cache:
> +    key:
> +      files:
> +        - Config.mk
> +    paths:
> +      - ci_cache
> +  before_script:
> +    - ./automation/scripts/prepare-cache.sh
>    script:
>      - ./automation/scripts/build 2>&1 | tee build.log
>    artifacts:
> diff --git a/automation/scripts/prepare-cache.sh b/automation/scripts/prepare-cache.sh
> new file mode 100755
> index 000000000000..017f1b8f0672
> --- /dev/null
> +++ b/automation/scripts/prepare-cache.sh
> @@ -0,0 +1,52 @@
> +#!/bin/bash
> +
> +set -ex
> +
> +cachedir="${CI_PROJECT_DIR:=`pwd`}/ci_cache"
> +mkdir -p "$cachedir"
> +
> +declare -A r
> +r[extras/mini-os]=MINIOS_UPSTREAM_URL
> +r[tools/qemu-xen-dir]=QEMU_UPSTREAM_URL
> +r[tools/qemu-xen-traditional-dir]=QEMU_TRADITIONAL_URL
> +r[tools/firmware/ovmf-dir]=OVMF_UPSTREAM_URL
> +r[tools/firmware/seabios-dir]=SEABIOS_UPSTREAM_URL

Does this mean if in the future we add or remove trees we will need to
modify this part in the same commit?

Wei.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

  reply	other threads:[~2020-01-03 14:29 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-19 14:42 [Xen-devel] [XEN PATCH 0/2] Start using GitLab caching capability Anthony PERARD
2019-12-19 14:42 ` [Xen-devel] [XEN PATCH 1/2] tools: Allow to make *-dir-force-update without ./configure Anthony PERARD
2020-01-03 14:24   ` Wei Liu
2019-12-19 14:42 ` [Xen-devel] [XEN PATCH 2/2] automation: Cache sub-project git tree in build jobs Anthony PERARD
2020-01-03 14:29   ` Wei Liu [this message]
2020-01-06 14:34     ` Anthony PERARD
2020-01-08 16:07       ` Wei Liu

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=20200103142907.ylckq7fh2h536w72@debian \
    --to=wl@xen.org \
    --cc=anthony.perard@citrix.com \
    --cc=cardoe@cardoe.com \
    --cc=ian.jackson@eu.citrix.com \
    --cc=xen-devel@lists.xenproject.org \
    /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.