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.
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.
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.
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.
Signed-off-by: Kevin Carter <email@example.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
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.
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.
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
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.
We change behaviour of what is returned by
set_neutron_driver for default network.
So we also need to change this test in tripleoclient
With "sudo", the $PATH is overriden an really basic:
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 <firstname.lastname@example.org>
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 <email@example.com>
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).
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.
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.
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.
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.
Signed-off-by: Bogdan Dobrelya <firstname.lastname@example.org>
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.
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.
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.
So the old prepare command retains feature parity with the new one,
add an --include argument for the new include filtering.
$ openstack tripleo container image prepare default \
--output-env-file prepare-default.yaml \
$ 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.
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.
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