We have some lingering todo's that seem to have
passed their expiry dates based on features to be
implemented in tripleo-common. Removing those
no longer necessary.
Change-Id: I1027e806cea894ebbdb7f941a582302639da4a71
When we pass the paths to the ansible playbook, they need to be absolute
paths as the relative cwd changes when it runs.
Change-Id: I8a434e38eb1a69530190df96d3b555ea14e4488a
Closes-Bug: #1895194
If a registry requires authentication and --local-push-destination is
not used, a user may need to enable the login functionality. This change
adds a --enable-registry-login flag to `openstack container image
prepare default` that can be used to ensure the
ContainerImageRegistryLogin flag is defined as true. Previously this
would have needed to be added in elsewhere.
Change-Id: I809023604fe119ba162638d921ffec56d4eb72f2
Add --work-dir to openstack overcloud container image build command and
every run will create a unique workspace which where will be stored Kolla
configs and build logs. Default directory will be in
/tmp/container-builds. UUIDs are used to identify each time we run the
command and will be the directory name in the work dir.
Depends-On: https://review.opendev.org/#/c/709389/
Related-Bug: #1864108
Change-Id: Id3e52ba920c54c98529ecb5f723ba452362a0b32
By using a function as the default for the registry url variables, the
function is actually executed on every invocation of openstack client
which is less than ideal. This change moves the default registry lookup
to only occur if the option is not passed in by the user. This limits
the lookup of the local registry to only occur when the correct
openstack tripleo container iamge commands are run.
Change-Id: Iace7be9dbdcf681c5f2f25f5810aa11e9da1853c
Closes-Bug: #1863679
This change replaces all of the ansible shell commands with the
python library, ansible-runner. This library is supported by
upstream ansible, is approved by the openstack foundation, is
supported in global requirements, and provides a better, more
programatic interface into running ansible playbooks.
All tests that interacted with the old shell commands have been
updated to now test using the library.
Change-Id: I8db50da826e2fbc074f4e7986d6fd00f6d488648
Signed-off-by: Kevin Carter <kecarter@redhat.com>
Ie5ef4045b7e22c06551e886f9f9b6f22c8d4bd21 added some additional
processing when uploading images. This unfortunately broke the
'openstack tripleo container image push' command because it assumes a
lock is always available. This change adds a process lock to the
ImageManagers used by the cli to ensure we are locking correctly when
doing any multiprocessing
Change-Id: I2d661682b3ee4d82d9f445a04e930c2fb328ef80
Closes-Bug: #1855184
We switched the tripleo-container-image-prepare script in
tripleo-common, but a user will likely run the 'openstack tripleo
container image prepare' command. Currently it uses the default which is
the threading executor.
Poke tripleo common lower/requirements as well.
Change-Id: Ifc5b46633a1f9fc9378eaa17170f6664d566c3c4
Related-Bug: #1844446
Change: https://review.opendev.org/687305 broke
the unit tests. We need to mock the method:
get_undercloud_registry()
Change-Id: I2488a8bdda1eab8f46d5dfda027633174f52e342
Closes-Bug: #1848275
The --local option for container image push requires a change in
tripleo-common to support pushing local images. This change implements
the required logic to tell the uploader that the source is local instead
of a remote source.
Depends-On: https://review.opendev.org/#/c/678890/
Change-Id: If279770212d5edb871e5f69a56c6c01681b1574f
This patch implements the tripleo container image push command.
Change-Id: Ifc2588e9e62582530f19c852715dea3ff68d9fa4
Co-Authored-By: Alex Schultz <aschultz@redhat.com>
This patch implements the tripleo container image list command, reading
for a remote registry URL, e.g. localhost:8787.
Returns a single column ascii table with full names of each image
discovered.
Change-Id: I44d19692fb7ab16797460215a98baf75e6b82034
This option was deprecated in the previous version and can be now
removed. Use namespace option now.
Change-Id: Icdbfa5ecdbe9a0bf510c0f3713b0eaa318c69732
The push=False flag with use with kolla-build.conf is not working if we
use buildah, clear example is the
tripleo-build-containers-centos-7-buildah job, it's suppose to work like
docker one but it's pushing too.
Closes-Bug: #1822752
Change-Id: I01788b3c11ac701b2cf8c151f95ccad7046532de
We change behaviour of what is returned by
set_neutron_driver for default network.
So we also need to change this test in tripleoclient
Depends-On: https://review.openstack.org/#/c/643365/
Change-Id: Iea3d6c7591b29f7474be97c939be60f368a04133
Closes-Bug: #1820065
With "sudo", the $PATH is overriden an really basic:
PATH=/sbin:/bin:/usr/sbin:/usr/bin
It doesn't list the /usr/local/(s)bin, hence the created
symlink wasn't seen by the script.
It also push that symlink creation in the __new__ special
method in order to make it cleaner.
Finaly, it takes care of lint/pep8 failures, not related to
this change (how is that even possible?!)
Co-Authored-By: Natal Ngétal <hobbestigrou@erakis.eu>
Closes-Bug: 1817365
Partial-Bug: 1816446
Change-Id: If09eb32f43b2c26c8cd8a89f2e862db1dd91dfed
Support Buildah instead of Docker by calling:
$ openstack container image build --use-buildah
And it will build TripleO containers with Buildah and not Docker.
Co-Authored-By: Alex Schultz <aschultz@redhat.com>
Change-Id: I7608136cb213bdca81348a0c3c751b488f48d712
This updates the 'overcloud container image prepare' command
so that it sets the neutron_driver variable correctly. This
allows tripleo-common to detect if OVN or ODL drivers are in
used and prepares the resulting output files for container
images and parameters accordingly.
Previously you could only access this functionality if you
used the new ContainerImagePrepare workflow (requires Mistral).
Change-Id: Icb5b20bfd98a704f3f33f739bc92f77550b52c26
Closes-bug: #1816663
Sometimes it would be beneficial to not build a specific container that
we might normally build. This change adds an --exclude option that can
be used to skip a container when passing it to kolla-build.
Change-Id: Ia871e0a46078a33270516f98ec0e08c1c3a0b43f
Depends-On: https://review.openstack.org/#/c/624530/
The docker.yaml env file is being deprecated in change
I6106e223d9c1e399d396d745ad28274107074b06 so we can stop using it. All
deployments are now containerized and the docker.yaml entries should
be part of the default resource registry.
Change-Id: I683cb03ae10f047946a0c1bc7f34344ee944a8f7
This patch ensures that the file path passed into the openstack
overcloud container prepare command using --template-file is correctly
passed through to the kolla_builder container image prepare function.
Change-Id: I5df6926e0b9417f746e47cce3ccb9218dfa13a80
Closes-Bug: #1791039
Extend the tripleo client Command class to fetch heat roles data
from a role file. That new class method is shared by many derived
classes afterwards and used for containers images preparations,
containerized overcloud, undercloud and standalone deployments.
Apply normalization to the roles_file in plan management and
preflight checks as well.
Change-Id: I7b35e117b9d12f1e5a51e2ee0465244692d33e33
Signed-off-by: Bogdan Dobrelya <bdobreli@redhat.com>
Now that the undercloud is containerized, the following command will
sometimes need to be run before the undercloud is installed:
openstack tripleo container image prepare default --local-push-destination
Doing this currently results in push_destination:localhost:8787
because the required network interface doesn't yet exist for the
registry detection logic.
This change will make push_destination be set to True, so that the
registry address is detected at upload time, which is late enough in
the undercloud install to actually work.
Change-Id: I69a30be9372dc2349b3339019be9d45b632f4a74
Closes-Bug: #1783204
Depends-On: I8a35755ac28c419490159f3cb0f60b7d54f3958d
This exposes the new cleanup behavior from change
Id844aa2fa5ee20ad264b2fada75fa6cffdc1e307. When this lands it can be
used in CI to make undercloud deploys faster with --cleanup partial.
Change-Id: Id75d5288c308e58143662703da3dddbdbcb0cdd9
Blueprint: container-prepare-workflow
This change uses the new dry_run ability in 2 places:
- "openstack tripleo container image prepare" now has a --dry-run flag
- tripleo deploy will now do a dry run so that the heat environment
parameters for all images are set, and then it is up to
tripleo-heat-templates to call "openstack tripleo container image
prepare" after the registry has actually been installed so that it
gets populated with the necessary images.
Blueprint: container-prepare-workflow
Change-Id: I7b96f8dadd9d605c114b28fce900e4573f17ba59
Depends-On: I9708b151a556f0517df8cbf8492e68ef1064745d
So the old prepare command retains feature parity with the new one,
add an --include argument for the new include filtering.
Change-Id: I472202243fc9b95034e481761845755eb87dff34
Depends-On: I751670f3788898d78f261000c0f51049948e8544
Running:
$ openstack tripleo container image prepare default \
--output-env-file prepare-default.yaml \
--local-push-destination
$ openstack tripleo container image prepare -e prepare-default.yaml
Will read a Heat template with ContainerImagePrepare, prepare containers
and upload to a registry if needed.
The idea is to replace the other commands used by the overcloud for any
use case: undercloud, overcloud or any cloud.
One of the goals here is to execute this process before starting the
containers while deploying OpenStack on any cloud.
Change-Id: Ie4b7951147f5a1aec654982e21296a749fdd865c
Blueprint: container-prepare-workflow
This allows the prepare command to set modify_role and modify_vars in
the call to container_images_prepare. The result will be an images
file that has extra options set in every entry.
The actual modification on the images is done during the upload
command, driven by these extra options.
Change-Id: Ia1dc7a1b7f777ac3e000f0c2e155be6330c05a2c
Blueprint: container-prepare-workflow
Depends-On: I2c877a96264b351b4fc8527a3e40b87ddcb4f9a5
We would like to make container image code re-usable for any cloud:
undercloud, overcloud, or any cloud so this patch just move
test_container_image.py file from tests/v1/overcloud_image directory to
tripleoclient/tests/v1.
Depends-On: I0cf206e8ceeecfca17dd99a83b8c2eaa50e66712
Change-Id: I412357bdc102cfe28cb1d4fe514a719bd8db5a15
This updates the relevant environment/services-docker code
to default to dockerish environment/services.
Depends-On: I923731f46ea26582160a11d2dfe85792ab74110b
Change-Id: Ie95b935964fdbf9e75ca04c93df9f824ec9fef51
Signed-off-by: Bogdan Dobrelya <bdobreli@redhat.com>
This will cause tag discovery to be performed on every image entry
during a prepare run.
Change-Id: Ibf6a63f9e145989b5caa8365833980b29a193251
Closes-Bug: #1738669
The tripleoupstream registry is deprecated in favor of tripleomaster,
where images are pushed automatically on rdo promotion.
Change-Id: I872a04f6c7d1c256d126b32303d73bafc6e8fd89
This sources the defaults for the image prepare command from the
common defaults in KollaImageBuilder.
This makes the defaults self-documenting via the --help argument, and
means that only one location needs to be patched downstream if any
defaults change.
Change-Id: Ibc18e6fe84700a6d630b3b03cc1d8de4f75713f2
Closes-Bug: #1727519
Since we use j2 templates for some of the heat environments, and at the
moment they are rendered when uploading them to swift at the beginning
of the deployment workflow, it is possible that one of the heat
environment file passed to the prepare command is, or references a file
that is, not yet rendered.
This commit implements a custom object_request() function that makes
process_multiple_environments_and_files() ignore the missing files.
Change-Id: I6f31898ca3db9563d3d8e8e6e0a9f0cdaebf24ca
Co-Authored-By: Thomas Hervé <therve@redhat.com>
Closes-Bug: #1730650
This change automatically inserts the DockerInsecureRegistryAddress
parameter into the containers image environment file if the registry
is reachable and unencrypted.
This eliminates a documented manual step, which is also required
throughout CI. It has been done in tripleoclient so that it can be
backported. The dedicated workflow for
blueprint container-prepare-workflow will have its own insecure
detection.
Change-Id: I74586145c222921880402cec92bbaa5f10e8b972
Closes-Bug: #1722632
Changed the following options:
* '--images-file' to '--output-images-file'
* '--env-file' to '--output-env-file'
* '--service-environment-file' to '--environment-file' in order to
match the equivalent option of the deploy command.
The old options are still in place and show a Deprecation warning in
the help message.
Change-Id: I24a6021d19ffe74760f9897e9bf3453742939bc9
Closes-Bug: #1723157
A default kolla conf file is added to the tripleo-common-continers
package, which should be added for building container images by
default.
Closes-Bug: #1712732
Depends-On: I9a2d6b48eb44e294a8501ac0768ea0b97abb4b5c
Change-Id: Id7c665593d8105cadb90bcc7d10b91b17e430922
OpenDaylight/OVN is not enabled by default in overcloud. A logic needs to be
implemented to create ODL image reference when ODL needs to be deployed and
the same for OVN. This patch adds neutron driver value set depending on the
environment file specified to image prepare command.
Co-Authored-By: Numan Siddique <nusiddiq@redhat.com>
Change-Id: I3e395986ad777b1d6b057bb33fac8d5ed2d3d26a
Partial-Bug: #1713685
Partial-bug: #1699085