The Python 2.7 Support has been support
So remove hacking rules for compatibility between python 2 and 3
Change-Id: Ia0fe869b80d330551cc9dac06c23001faf229542
As per victoria cycle testing runtime and community goal[1]
we need to migrate upstream CI/CD to Ubuntu Focal(20.04).
Fixing:
- bug#1886298
Bump the lower constraints for required deps which added python3.8 support
in their later version.
Also skip salt tests before we fix salt failing issues.
Sync salt requirelemt with global requirement to support py3.8.
Story: #2007865
Task: #40186
[1] https://governance.openstack.org/tc/goals/selected/victoria/migrate-ci-cd-jobs-to-ubuntu-focal>
Change-Id: I482ac98bc56f0e3cfb8b767f47649da11ed1afab
This reverts commit 33241a84c1
The requirements check fails since
Ia4e086162e65a51af417a8b381ae898c95966a09 removed paunch as valid
dependency.
Since Paunch is retired, this patch propose to switch to use docker cli
for docker cmd hook and remove any dependency to Paunch.
Change-Id: I9c3839e551259fb85b191a27fa054c605964f30e
The repo is Python 3 now, so update hacking to version 3.0 which
supports Python 3.
Fix problems found.
Remove hacking and friends from lower-constraints, they are not needed
for installation.
Change-Id: I035eb2f83c289ff994c77b02d5f3c2f9a0d583d8
This test breaks frequently as it is asserting the docker calls which
paunch is making internally. These calls are changing often, as paunch
is in active development.
This change rewrites the test to be a unit test of hook-docker-cmd.py
specifically, with calls to paunch.apply mocked out.
Change-Id: Ieeef3e5916e46d006a358f132bbd64f3960e1fcd
Task: 36342
Test that everything works when region_name is not supplied or is None.
Change-Id: Ia880447e27289fdb488a90d77a5a1f5f3d8b8c61
Task: 33529
Related-Bug: #1830967
paunch was changed to support podman, it breaks some arguments, and
expectations in our tests. Let's fix that.
Change-Id: I7127cc2edb9af785e0533e0a1e5f2608417390e7
Now there is no region name when heat-config-notify try to get the
heat endpoint or zaqar endpoint. As a result, it could be a wrong
one returned from Keystone because there is no region name specified.
This patch fixes it.
Please refer Iec6f3606c9fdf8474f393b0990356f34d38bcf75 for the change
in Heat.
Please refer I88182a9a9af74e9760b2ec9b500971f06293f0b8 for the change
in occ.
Task: 22720
Story: 2002781
Change-Id: I8e0518fa61e237ec055834dd4bebe0fc87cd6627
Currently this can result in errors being ignored so it's not clear
to the user that something failed.
Change-Id: Idf6badecbfa72150f3506a485eed9ae2cb5858f7
Story: 2002084
Task: 19753
On python3, sys.stdin/stdout are Text-mode streams, which can be
approximated with io.StringIO. On python2, there's no real
distinction between Text-mode and Binary-mode (except for line
endings, which sys.stdin/stdout also treat as Text-mode). Hence,
there's no need to explicitly use io.BytesIO on python2.
StringIO.StringIO is equally or more representative of how the
mocked streams behave.
Therefore, just use six.StringIO instead of different types for
python2 vs. python3.
Change-Id: Ib80e10a40e68ece946b344ce7bcfba5e182ce848
Allow the Chef hook to run under Python 3, and gracefully handle invalid
UTF-8 sequences in the output from the command in the same manner we
have in other hooks since 25cd394bbe.
Change-Id: I087cd93a78c48f01bdebbd1e630cb8701dc9477a
Closes-Bug: #1709026
They fail sometimes on py35 because we rely on dict order in asserts.
Let's remove that and load json instead.
Change-Id: I7bff32028cc130128ce05c151534c85ef99607d5
Adds retry logic for software deployments using the url signals
to ensure that requests are retried if network connection issues
occur or a 500, 502, 503, or 504 is returned by the http or https
endpoint.
Note: this does not add retry logic to heatclient or zaqarclient
if they are used for signaling.
Change-Id: I82dff4a4b9fac05c5ec649db3eb379bdec71e208
Related-Bug: #1731540
paunch is a library and utility which is now in OpenStack
under the TripleO umbrella. It contains the logic currently in the
docker-cmd hook exposed as a python library and command utility.
This change switches the docker-cmd hook to paunch.
Asserting --label arguments has been split out from the other docker
run arguments so that paunch can add new --label arguments in future
releases without breaking these tests.
paunch-1.1.0 has just been release which contains new idempotency
behaviour, so the tests have been modified to work with the new docker
command behaviour that idempotency requires.
Change-Id: I884c38ade06ab0e01432837c43f29b123e65fa3c
This passes --color false to the puppet apply call, removing color from
puppet output. As it's meant to be passed to software deployment, it
will make it more readable.
Change-Id: I12074f06f6bdbddc8706426b1515b3db4affb2f7
This change sets the ansible variable called heat_config_id to the
'id' value of the heat config data.
This will be useful in some playbooks to make idempotency decisions.
Change-Id: I5f03e012b2fb97cc0076c886ca7bd3f284d19032
Add docker hook for environment files.
Some containerized services need to accept environment
files and cannot be configured otherwise, for example
Etcd key-value storage.
Partial-bug: #1668938
Change-Id: I228b5f9ee67215ae742760d449b9cd8a4b9543d0
Signed-off-by: Bogdan Dobrelya <bdobreli@redhat.com>
This change supports specifying commands as strings by spliting the
string into a list using python's default whitespace string split().
This will handle simple string commands but not cases like
quoted/escaped spaces. Other cases can be handled by specifying the
command as a list instead.
Change-Id: Icc4eebe324a4e6a7dd06f697ef16d38777f90861
Once 50-heat-config-docker-cmd (or any other container managing tool)
deletes existing containers, 50-heat-config-docker-cmd can check if
any containers do not have their desired name, and rename them where
possible.
Change-Id: I1bc9fa4880b2487b15e28da67c4fad79312d54ad
When a container already exists with the desired name, the container
name has a random suffix attached to it so that it can still be run.
This ensures containers are always created regardless of other running
containers.
Since the name may not be as expected, the exec action needs an extra
lookup to attempt to discover the actual name, falling back to the
requested name if the lookup fails.
Since there is a container_name label set with the desired
name, the next patch in this series modifies 50-heat-config-docker-cmd
to rename containers to their desired name when possible.
Change-Id: Ibd97f52811f653295559d000487d2c50a7c67ece
This rewrites 50-heat-docker-cmd to not require any state directory to
make decisions on what containers to delete. Instead the labels on the
running containers are used to make decisions on when containers
should be deleted.
This also changes the behaviour to ignore the config name and strictly
use the config id, so all containers for a given config id are deleted
when that config no longer appears in the list of configs. This maps
correctly to heat's software deployment model and allows a future
change to properly implement replace_on_change[1] behaviour.
Containers created with an older docker-cmd (or create any other way)
will never be deleted by 50-heat-config-docker-cmd. This will result
in docker run failures when unique container names are re-used and
will require manual intervention to delete the old containers before
continuing.
[1] http://docs.openstack.org/developer/heat/template_guide/openstack.html#OS::Heat::SoftwareConfig-prop-inputs-*-replace_on_change
Change-Id: Iaf56c2b5fcb4969ce09480742f13a04d35bd2bae
Docker labels are metadata associated with running containers. This
change sets labels which will allow the correct lifecycle decisions
to be made by the docker-cmd hook about which containers are managed
by heat and when specific containers should be deleted.
Associating these labels now will also allow the os-refresh-config
50-heat-config-docker-cmd to be rewritten to not require a directory
to store state, and instead get all of the current state information
from 'docker ps' and 'docker inspect' calls.
Change-Id: I967df26c8b0661413dc504c45d1764d23f895530
Allow for ordering containers execution within the same step. This hook
uses `start_order` and it defaults to 0.
Co-Authored-by: Ian Main <imain@redhat.com>
Change-Id: Ib0804ee622e2889e6c18a76f07a194490f4721d4
We recently added --tags, but exposing --skip-tags can also
be useful (we want to use it in tripleo to optionally skip
validation tasks when resuming upgrades from a failed state).
Change-Id: I18214f80be9f3ad6c2d385fc00f3b786d3e7dda3
Some command we need to run with 'exec' or 'run' have custom
exit codes that are valid if the command completes sucessfully.
This patch adds an 'exit_codes' option which takes an array
of integers that are meant to represent the valid exit codes
for this hook. If for example 0 or 1 is meant to be considered
success you can specify:
exit_codes: [0,1]
Previously an non-zero exit code would always fail this hook.
Change-Id: Ia6ca4b01982a0b33b26eca2a907d9d9f87c19922
This patch simplies the check for privileged so that we treat
it as a pass through string. Previously we were converting
to a string before doing the boolean check which was causing
all containers to get set to --privileged true.
Change-Id: Ibe2221abf9616c1c54acecf7c18ae36e2c07576c