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