Commit Graph

25 Commits

Author SHA1 Message Date
Ghanshyam Mann cbf9d36df6 Retire Tripleo: remove repo content
TripleO project is retiring
- https://review.opendev.org/c/openstack/governance/+/905145

this commit remove the content of this project repo

Change-Id: Ib5a8155d76652044701ae05e5dbcc7078f41d863
2024-02-24 11:41:18 -08:00
Sagi Shnaidman 81ca6b4dc0 Remove docker modules from the role
Remove docker modules usage from the role since we
use buildah/podman everywhere.
Change-Id: Ic2a46c0a55781041016f42bdc1af686055af9fa2
2021-08-09 20:55:41 +03:00
Julie Pichon bb6f78deca Add double quotes around the printf statements in yum_update.sh
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
2020-01-30 09:28:23 +00:00
David Hill 58d7a5bc9d Dockerfile-yum.j2 doesn't copy the RPMs so yum_update.sh fails
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
2020-01-17 17:47:17 -05:00
Zuul 3c3aa68778 Merge "Add the possibility to update packages from local rpms using yum." 2020-01-14 15:33:57 +00:00
David Hill 22374eb422 Add the possibility to update packages from local rpms using yum.
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
2020-01-13 20:38:19 -05:00
Julie Pichon 8820e9493d When updating, set PKG variable to dnf or yum at runtime
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
2019-12-20 15:42:42 +00:00
Alex Schultz 2261d850a7 Enable saving of rpms
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
2019-09-30 15:54:57 -06:00
Bogdan Dobrelya 908875eeab Add support for yum caching when buildah updates
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>
2019-09-25 14:01:15 +02:00
Alex Schultz 3a4caf4587 Implement a yum install command
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
2019-07-03 17:45:21 -06:00
Dan Prince 8f0c6bf141 Fix dev install (yum -y...)
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
2019-02-20 14:41:15 +00:00
Chandan Kumar 410408ef1b Ported tripleo-modify-image to py3
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
2019-02-18 18:22:40 +05:30
Zuul 24cd2e3fb4 Merge "Set WORKDIR / in the dockerfiles" 2018-11-21 09:20:17 +00:00
Steve Baker 97b54c3f7e Set WORKDIR / in the dockerfiles
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
2018-11-13 17:18:24 +13:00
Dan Prince 618d3ab83c Add dev mode install playbook for source installs
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
2018-11-05 09:33:43 -05:00
Steve Baker c9d085729f Remove compare_host_packages strategy
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
2018-09-17 12:17:46 +00:00
Steve Baker 821fcbf6c9 Don't use copy module for /etc/yum.repos.d
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
2018-09-10 10:22:31 -06:00
Dan Prince 7178d84867 Add rpm_install tasks
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
2018-07-17 12:17:08 -04:00
Quique Llorente a9055e351b Remove previous yum.repos.d to only used the custom ones
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
2018-07-03 10:15:23 +02:00
Steve Baker 262e5497e0 update_repo to limit to packages in repo
Rather than updating every package, allow to limit to a single repo
2018-05-14 10:43:34 +12:00
Steve Baker 91e4555bde Detect local file repos and copy them into the image 2018-05-11 13:08:58 +12:00
Steve Baker beaa391374 quote USER just in case it is empty 2018-05-10 14:14:32 +12:00
Sam Doran 5963894199 Streamline role
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.
2018-05-02 22:31:08 -04:00
Steve Baker cf858399d5 task to yum update in the image 2018-05-02 17:05:59 +12:00
Steve Baker e865f69b4e Basic template based Dockerfile approach 2018-04-30 17:26:58 +12:00