This is consistent with the other printf statements in the file. This
keeps the sorted data with the newlines as they are, and avoids
breaking down the data again. Otherwise, the sorting order can be
altered which breaks comm comparison and causes the "Run yum_update.sh"
task to fail with the following error:
"stderr_lines": [
"comm: file 2 is not in sorted order",
"error while running runtime: exit status 1"
],
This is particularly important for the $available variable which
contains the repoquery output, often very large and with unusual
characters. The error happens consistently when including RHEL 7 server
repos or RHEL 8 BaseOS repo and prevents the update from working at
all.
This patch also adds -u when sorting the $available output. Once the
versions are removed with cut, there can be a tremendous amount of
duplication in the data obtained from repoquery. That makes verbose
mode even more difficult to navigate when debugging.
Change-Id: Id64a8c2e395de28945d5d6b4370c44b80392e543
After implementing "yum localinstall", a critical part of the
process wasn't merged in the code which consists of copying
the actual RPMs through the Dockerfile-yum.j2 file.
Change-Id: Ifbcaa07bb80dd612e85f0d7cf8d99131fb739c84
Closes-bug: #1860184
This is needed if we want to only update installed packages and not
hit depenency issues encountered when updating packages with rpm_install.sh
Change-Id: I5095d7b04cb10fde1bd82afd1bc406445b7595fd
Closes-bug: #1858837
When updating RHEL7 containers from a RHEL8-based environment, the
update fails with the following messages:
"stderr": "/tmp/yum_update.sh: line 18: /bin/dnf: No such file or directory",
"stdout": "No packages were found for update...",
This patch reverts the PKG variable assignment to the way it used to be
so that the decision to use dnf or yum is made at runtime, within the
container.
Change-Id: I6a248b5277efd8707fc744292075949d94e3a05f
We currently map in the cache dir, but it only saves the metadata. The
improvements would come with the rpm saving as well. In order to have
that, we need to set keepcache=1 which is disabled by default. We can
enable this on the command line via --setopt so we don't have to touch
the container yum configuration.
Change-Id: Ia274dbbad9a220e52b2cfa554dede3bf40055f98
When yum_cache is set, that directory will be automatically
picked as either the source or destination for the containers
being updated as the following:
* when that host directory is missing (or empty), the container
under update will start populating it, while it gets updated.
That path going to become the lower overlay FS layer for future
use among other containers under concurrent yum update executions.
* when the yum_cache directory exists and is not empty, it will be
bind-mounted as an upper overlay FS layer for other containers under
update. So those can benefit from some of the already prefetched
contents in its yum cache without data races or conflicts when
concurrently accessing the cached data.
Overlaying ensures data safety as each container can only see the lower
layer of the overlay, while storing its local changes on top of it as
an ephemeral. The yum_cache directory existance & non-emptiness facts
act as a single mutex, which only grants a dedicated writing access to
the lower layer to a single "populating" container at a time. This
behavior may be forcefully reset via the force_purge_yum_cache flag.
The container update playbook invoked with it, instantly creates a
new populator and creates a fresh yum cache.
Note that the 100% saturation of the cache is only expected, when the
populating container finishes its execution.
The feature can be used only for buildah in yum update scenarios using
yum or dnf.
Change-Id: I30c6dd12454a0b1781803ab16ef79b5914178114
Related-bug: #1844446
Signed-off-by: Bogdan Dobrelya <bdobreli@redhat.com>
Yum update works if you want to update existing packages, but sometimes
you want to install a package that's available via the yum repositories
that is extra. This implements a yum install action similiar to the yum
update action except it takes package names instead of repos to install.
Change-Id: Ia47a1ea9eb51a37f6d75d39c524e97fd4ec94fba
Fixes an issue in 410408ef1b where
we removed the -y options for the pip RPM install. This functionally
broke the dev mode playbook unless you had manually installed pip
in the container (not normally the case for RDO images).
Change-Id: Ic96d9eb708bff763cbe4395cf7770b5239879309
Closes-bug: #1816775
It makes yum and pip installs work with py3 packages. The package manager
dnf/yum and pip binary are determined at run time from the OS.
Use dnf-plugins-core for dnf with respect to
yum-plugin-priorities.
Use pipefail with set -ex to fix linter errors.
Change-Id: I997509204e30abb8b21ef936ea44440fbaa5a0e4
Closes-Bug: #1813546
For some reason buildah is failing on images which already have a
WORKDIR set (such as the tempest image). This change sets the WORKDIR
to / to avoid this failure.
Change-Id: Id756000a3b24eac01292907ca8837a5f99c66678
The following playbook will produce a modified image with Python source
code installed via pip. To minimize dependencies within the container
we generate the sdist locally and then copy it into the resulting
container image as an sdist tarball to run pip install locally.
Useful for local ad-hoc testing of upstream patches without
having to build and RPM in those cases.
Change-Id: I93c0e86b2e421b0bcb777d536fcb0d30e0ee3b68
Now that the undercloud is containerized, there will be very few host
packages to compare to, so there is a high risk that required package
updates will be skipped.
This is a strategy inherited from container-update.py that was
intended to avoid unnecessary calls to yum update, however we now have
a better approach using the repoquery, so host package comparison is
no longer required, and probably causing some of the instances of bug
Change-Id: Iab7b9d6377494001d904bb84b058ea293d73110c
Partial-Bug: #1786764
Ansible copy is slow for multiple files. Using cp instead saves about
5 seconds in this case, which adds up over many images.
Change-Id: I74eedd89657bc4daddb2d45d692e1270c567705a
This patch adds a new rpm_install tasks which can be used
to build a new container layer from a set of local RPMs.
This is useful for building contains locally with no network
connectivity.
As part of the change the existing Yum update Dockerfile.j2 was
renamed to Dockerfile-yum.j2 to make it more specific.
Change-Id: I951c976ebb84c28cecefd2f5753a8232f46ad4aa
There are some repos that are deactivated in the hosts
but not deactivated in the docker images, like
CentOS-QEMU-EV.repo, this patch remove the old repos dir
to just use the the ones injected.
Change-Id: I15284189fda16514f7ba70b95ab551d58eca7ab1
Closes-Bug: 1779642
Use role defaults rather than set_fact tasks.
Remove empty placeholder files.
Add role meta info.
For variables that can't have a sane default, add precheck tasks to fail early if they are not defined.