From: Cleber Rosa <crosa@redhat.com>
To: Andrea Bolognani <abologna@redhat.com>
Cc: "Fam Zheng" <fam@euphon.net>,
"Peter Maydell" <peter.maydell@linaro.org>,
"Thomas Huth" <thuth@redhat.com>,
"Daniel P . Berrangé" <berrange@redhat.com>,
"Beraldo Leal" <bleal@redhat.com>,
"Erik Skultety" <eskultet@redhat.com>,
"Stefan Hajnoczi" <stefanha@gmail.com>,
qemu-devel@nongnu.org,
"Wainer dos Santos Moschetta" <wainersm@redhat.com>,
"Philippe Mathieu-Daudé" <philmd@redhat.com>,
"Willian Rampazzo" <wrampazz@redhat.com>,
"Alex Bennée" <alex.bennee@linaro.org>,
"Eduardo Habkost" <ehabkost@redhat.com>
Subject: Re: [PATCH v4 2/4] Jobs based on custom runners: build environment docs and playbook
Date: Mon, 9 Nov 2020 11:37:26 -0500 [thread overview]
Message-ID: <20201109163726.GC3874327@localhost.localdomain> (raw)
In-Reply-To: <c0e7bd88bf64c0b22023810192fdb6e38d96fd97.camel@redhat.com>
[-- Attachment #1: Type: text/plain, Size: 4317 bytes --]
On Tue, Oct 20, 2020 at 07:52:43PM +0200, Andrea Bolognani wrote:
> On Sun, 2020-10-18 at 21:50 -0400, Cleber Rosa wrote:
> > +++ b/scripts/ci/setup/build-environment.yml
> > @@ -0,0 +1,233 @@
> > +---
> > +- name: Installation of basic packages to build QEMU
> > + hosts: all
> > + tasks:
>
> My Ansible-fu is a bit rusty at the moment, so please double-check my
> claims and apologies in advance for the ones that I will get wrong O:-)
>
> > + - name: Install basic packages to build QEMU on Ubuntu 18.04/20.04
> > + apt:
> > + update_cache: yes
> > + # Originally from tests/docker/dockerfiles/ubuntu1804.docker
> > + pkg:
> > + - ccache
> > + - clang
>
> Instead of using the 'apt' module here, and the equivalent module
> further down, you could just do
>
> package:
> name:
> - pkg1
> - pkg2
> ...
> state: present
>
> every single time and let Ansible take care of the differences for
> you.
>
I'm almost sure that this was a conscious decision. I remeber it had
to do with not being able to set `update_cache`, and failures on
recently installed systems and containers that did not update the APT
cache. There may be something else, but I'll have to give it another
round of testing.
FIY, under the hood, package is not really a module, but an action
plugin that forwards these very limited options to the set or detected
package manager, so it brings uniformity in the playbook, but limits
the control too. IMO, it's very low impact to leave it AS IS.
> > + when: "ansible_facts['distribution'] == 'Ubuntu'"
>
> Quoting the entire condition is not necessary, you can just have
>
> when: ansible_facts['distribution'] == 'Ubuntu'
>
> or, my preference,
>
> when:
> - ansible_facts['distribution'] == 'Ubuntu'
>
Yep, I've used the explicit lists when there was more than one
condition, but having a standard style is better indeed.
> which results in a nicer diff when you add/remove conditions.
>
> > + - name: Install packages to build QEMU on Ubuntu 18.04/20.04 on non-s390x
> > + apt:
> > + update_cache: yes
> > + pkg:
> > + - libspice-server-dev
> > + - libxen-dev
>
> Indentation of list items is inconsistent here.
>
True. Fixed, thanks!
> > + - name: Install basic packages to build QEMU on FreeBSD 12.x
> > + pkgng:
> > + # Originally from packages on .cirrus.yml under the freebsd_12_task
> > + name: bash,curl,cyrus-sasl,git,glib,gmake,gnutls,gsed,nettle,ninja,perl5,pixman,pkgconf,png,usbredir
>
> See above for 'pkgng' vs 'package', but at the very least this should
> be
>
> pkgng:
> name:
> - bash
> - curl
> ...
>
> or each time the list is touched the resulting diff is going to be
> unmanageable.
>
The documentation suggests a comma separated list of package names:
https://docs.ansible.com/ansible/2.8/modules/pkgng_module.html#pkgng-module
And the reason is that this module is not as smart as others, and will
run one separate command for each individual package name value:
https://github.com/ansible/ansible/blob/v2.10.3/test/support/integration/plugins/modules/pkgng.py#L214
It's a tradeoff indeed, but I think we're aligned with the docs.
> > + - name: Enable PowerTools repo on CentOS 8
> > + ini_file:
> > + path: /etc/yum.repos.d/CentOS-PowerTools.repo
> > + section: PowerTools
> > + option: enabled
> > + value: "1"
> > + when:
> > + - "ansible_facts['distribution'] == 'CentOS'"
> > + - "ansible_facts['distribution_major_version'] == '8'"
>
> Another option would be to use
>
> command: 'dnf config-manager --set-enabled Stream-PowerTools -y'
> args:
> warn: no
>
> but I have to admit the way you're doing it is very clever ;)
>
Yeah, that would require another package to be installed, and then the
command executed... So I think this is cheaper and eaiser indeed.
> --
> Andrea Bolognani / Red Hat / Virtualization
>
Thanks for the review, I'll report on the additional points as soon as
I test them. If appropriate, I'll put notes on the v5.
- Cleber.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
next prev parent reply other threads:[~2020-11-09 16:38 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-19 1:49 [PATCH v4 0/4] GitLab Custom Runners and Jobs (was: QEMU Gating CI) Cleber Rosa
2020-10-19 1:50 ` [PATCH v4 1/4] Jobs based on custom runners: documentation and configuration placeholder Cleber Rosa
2020-10-21 6:45 ` Thomas Huth
2020-11-09 15:17 ` Cleber Rosa
2020-10-19 1:50 ` [PATCH v4 2/4] Jobs based on custom runners: build environment docs and playbook Cleber Rosa
2020-10-19 10:27 ` Erik Skultety
2020-10-19 20:25 ` Cleber Rosa
2020-10-20 6:18 ` Erik Skultety
2020-11-09 15:20 ` Cleber Rosa
2020-10-20 17:52 ` Andrea Bolognani
2020-11-09 16:37 ` Cleber Rosa [this message]
2020-11-10 17:27 ` Andrea Bolognani
2020-10-21 7:00 ` Thomas Huth
2020-11-09 16:39 ` Cleber Rosa
2020-10-19 1:50 ` [PATCH v4 3/4] Jobs based on custom runners: docs and gitlab-runner setup playbook Cleber Rosa
2020-10-19 10:26 ` Erik Skultety
2020-10-19 20:41 ` Cleber Rosa
2020-10-20 6:58 ` Erik Skultety
2020-10-20 8:29 ` Daniel P. Berrangé
2020-10-20 18:13 ` Andrea Bolognani
2020-10-19 20:54 ` Cleber Rosa
2020-10-20 7:00 ` Erik Skultety
2020-10-19 1:50 ` [PATCH v4 4/4] Jobs based on custom runners: add job definitions for QEMU's machines Cleber Rosa
2020-10-19 10:29 ` Daniel P. Berrangé
2020-10-19 10:42 ` Philippe Mathieu-Daudé
2020-10-19 20:17 ` Cleber Rosa
2021-01-28 11:51 ` [PATCH v4 0/4] GitLab Custom Runners and Jobs (was: QEMU Gating CI) Thomas Huth
2021-02-03 21:06 ` Cleber Rosa
2021-02-04 11:27 ` Thomas Huth
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=20201109163726.GC3874327@localhost.localdomain \
--to=crosa@redhat.com \
--cc=abologna@redhat.com \
--cc=alex.bennee@linaro.org \
--cc=berrange@redhat.com \
--cc=bleal@redhat.com \
--cc=ehabkost@redhat.com \
--cc=eskultet@redhat.com \
--cc=fam@euphon.net \
--cc=peter.maydell@linaro.org \
--cc=philmd@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@gmail.com \
--cc=thuth@redhat.com \
--cc=wainersm@redhat.com \
--cc=wrampazz@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).