[libvirt] [jenkins-ci PATCH v2] guests: Include "locales" by default

Fabiano Fidêncio posted 1 patch 4 years, 7 months ago
Failed in applying to current master (apply log)
guests/vars/mappings.yml      | 6 ++++++
guests/vars/projects/base.yml | 1 +
2 files changed, 7 insertions(+)
[libvirt] [jenkins-ci PATCH v2] guests: Include "locales" by default
Posted by Fabiano Fidêncio 4 years, 7 months ago
osinfo-db tests require "en_US.UTF-8" locale to be set. Unfortunately,
our containers do not contain the needed locale file.

After a discussion on libosinfo mailing list[0], it's been agreed on
having the locale as part of our libvirt-jenkins-ci's base packages.

[0]: https://www.redhat.com/archives/libosinfo/2019-September/msg00011.html

Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
---
 guests/vars/mappings.yml      | 6 ++++++
 guests/vars/projects/base.yml | 1 +
 2 files changed, 7 insertions(+)

diff --git a/guests/vars/mappings.yml b/guests/vars/mappings.yml
index c5a7824..bc6ea69 100644
--- a/guests/vars/mappings.yml
+++ b/guests/vars/mappings.yml
@@ -431,6 +431,12 @@ mappings:
     rpm: libxslt-devel
     cross-policy-deb: foreign
 
+  locales:
+    CentOS7: glibc-common
+    deb: locales
+    Fedora: glibc-langpack-en
+    FreeBSD:
+
   lsof:
     default: lsof
 
diff --git a/guests/vars/projects/base.yml b/guests/vars/projects/base.yml
index a7e572b..2a84029 100644
--- a/guests/vars/projects/base.yml
+++ b/guests/vars/projects/base.yml
@@ -16,6 +16,7 @@ packages:
   - glibc
   - libtool
   - libtoolize
+  - locales
   - lsof
   - net-tools
   - make
-- 
2.21.0

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [jenkins-ci PATCH v2] guests: Include "locales" by default
Posted by Andrea Bolognani 4 years, 7 months ago
On Fri, 2019-09-06 at 14:12 +0200, Fabiano Fidêncio wrote:
> osinfo-db tests require "en_US.UTF-8" locale to be set. Unfortunately,
> our containers do not contain the needed locale file.
> 
> After a discussion on libosinfo mailing list[0], it's been agreed on
> having the locale as part of our libvirt-jenkins-ci's base packages.
> 
> [0]: https://www.redhat.com/archives/libosinfo/2019-September/msg00011.html
> 
> Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
> ---
>  guests/vars/mappings.yml      | 6 ++++++
>  guests/vars/projects/base.yml | 1 +
>  2 files changed, 7 insertions(+)

These changes are good, so

  Reviewed-by: Andrea Bolognani <abologna@redhat.com>

and pushed.

Note however that, while applying this patch and regenerating the
corresponding container image is enough to fix the osinfo-db-check
issue on Fedora, Debian will still fail the same way as before.

This is because you've only installed the locales package but not
actually generated the en_US.UTF-8 locale: in order to do that as
well, you need something like

  sed -Ei 's,^# (en_US\.UTF-8 .*)$,\1,' /etc/locale.gen
  dpkg-reconfigure locales

Ideally we'd do this not just for containers, but for virtual
machines as well; in fact, I'm quite surprised the osinfo-db-check
job it didn't start failing there too.

-- 
Andrea Bolognani / Red Hat / Virtualization

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [jenkins-ci PATCH v2] guests: Include "locales" by default
Posted by Fabiano Fidêncio 4 years, 7 months ago
On Mon, Sep 9, 2019 at 12:00 PM Andrea Bolognani <abologna@redhat.com> wrote:
>
> On Fri, 2019-09-06 at 14:12 +0200, Fabiano Fidêncio wrote:
> > osinfo-db tests require "en_US.UTF-8" locale to be set. Unfortunately,
> > our containers do not contain the needed locale file.
> >
> > After a discussion on libosinfo mailing list[0], it's been agreed on
> > having the locale as part of our libvirt-jenkins-ci's base packages.
> >
> > [0]: https://www.redhat.com/archives/libosinfo/2019-September/msg00011.html
> >
> > Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
> > ---
> >  guests/vars/mappings.yml      | 6 ++++++
> >  guests/vars/projects/base.yml | 1 +
> >  2 files changed, 7 insertions(+)
>
> These changes are good, so
>
>   Reviewed-by: Andrea Bolognani <abologna@redhat.com>
>
> and pushed.
>
> Note however that, while applying this patch and regenerating the
> corresponding container image is enough to fix the osinfo-db-check
> issue on Fedora, Debian will still fail the same way as before.
>
> This is because you've only installed the locales package but not
> actually generated the en_US.UTF-8 locale: in order to do that as
> well, you need something like
>
>   sed -Ei 's,^# (en_US\.UTF-8 .*)$,\1,' /etc/locale.gen
>   dpkg-reconfigure locales
>
> Ideally we'd do this not just for containers, but for virtual
> machines as well; in fact, I'm quite surprised the osinfo-db-check
> job it didn't start failing there too.

The reason why we don't need this set for VMs is because you already
do that in your preseed file:
```
# Environment configuration
#
# Locale, keyboard and timezone. All these will be configured again
# later with Ansible, but they're required information so we must
# provide them
d-i debian-installer/locale string en_US.UTF-8
...
```

Thanks for reviewing and pushing the patches!

Best Regards,
-- 
Fabiano Fidêncio

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [jenkins-ci PATCH v2] guests: Include "locales" by default
Posted by Andrea Bolognani 4 years, 7 months ago
On Mon, 2019-09-09 at 13:18 +0200, Fabiano Fidêncio wrote:
> On Mon, Sep 9, 2019 at 12:00 PM Andrea Bolognani <abologna@redhat.com> wrote:
> > Ideally we'd do this not just for containers, but for virtual
> > machines as well; in fact, I'm quite surprised the osinfo-db-check
> > job it didn't start failing there too.
> 
> The reason why we don't need this set for VMs is because you already
> do that in your preseed file:
> 
> # Environment configuration
> #
> # Locale, keyboard and timezone. All these will be configured again
> # later with Ansible, but they're required information so we must
> # provide them
> d-i debian-installer/locale string en_US.UTF-8

That makes sense!

-- 
Andrea Bolognani / Red Hat / Virtualization

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list