Commit Graph

34 Commits

Author SHA1 Message Date
Sergiy Markin f0b1376330 Fix exception handling
ConnectTimeout exception does not hae title attribute.

Change-Id: I7a9ea94b257dcc458d2fb2cd7464470f9377e136
2024-04-03 16:46:09 +00:00
Sergiy Markin a3fdc9e52c [focal] Fix requests.body attribute deprecation
This PS updates calls to body attribute of requests module with new text
attribute.

Change-Id: I8f69d18a0ac5a0065072642a58364584392bde37
2023-05-10 21:39:02 +00:00
Sergiy Markin 32ad8a96b0 [focal] Python modules sync with Airship project
- uplifted/downgraded some python modules
- fixed falcon.API deprecation - -> falcon.App
- uplifted deckhand reference for python deps
- fixed formatting style  using yapf linter
- added bindep role and bindep.txt file with required deps
- fixed quai docker image publishing
- re-enabled openstack-tox-py38 gate job

Change-Id: I0e248182efad75630721a1291bc86a5edc79c22a
2023-04-21 06:09:14 +00:00
Phil Sphicas c7e72942a9 Remove hyperkube extraction functionality
The extraction of the monolithic hyperkube binary from its container
image to be used as kubelet was last relevant in Kubernetes 1.16. Since
then, the hyperkube image has been deprecated, the structure of the
image has been changed, and it has ultimately been eliminated in
Kubernetes 1.19.

This change cleans up promenade accordingly.

Reverts the following commits:
* 886007b New CLI option to extract hyperkube
* 32a6c15 hyperkube image in promenade init
* 955deed New source for hyperkube binary definition

Change-Id: Ib62ecdf1af13abe8202a4ba4f86c39b9042ed13f
2021-02-11 17:23:32 +00:00
Egorov, Stanislav (se6518) 886007b36e New CLI option to extract hyperkube
New option --extract-hyperkube to declare the way how hyperkube
will be delivered.

By default this option is disabled which means hyperkube should be
extracted before running promenade container for the first time.

When it's enabled the appropriate env vars should be set for
promenade container to be able to extract hyperkube binary from image.

Change-Id: I2c45100e1e953d859d768ec80f268bd490ce3a81
2019-07-15 20:21:34 +00:00
Matt McEuen c18e3a8d9d Add optional external_ip to promjoin
Adds an optional external_ip parameter to the prom join script API,
and to the Genesis and KubernetesNode schema.
This is used to populate the host's IP address in its /etc/hosts
file if present, according to normal hosts conventions.
If the value is not passed to prom-join or is absent from a
Genesis or KubernetesNode document, then the hosts file defaults
to the current loopback IP for the hostname (business as usual).

Change-Id: I58dc219923b18aaf9c83453b896ce509664d8766
2019-04-23 08:45:34 -05:00
Crank, Daniel (dc6350) d8c87f3f7b Log client-id in UCP API endpoints
Adds functionality to read context marker and end-user
from request headers and log that information where
available, to aid in tracing transactions that span
multiple Airship components.

Change-Id: I31c26b269ef6db9ebf44eb381eb6745ce40fc4ea
2019-04-05 09:55:15 +00:00
Zuul 24e4ebf37a Merge "Fix: re-add incorrectly removed format test" 2018-09-14 10:58:19 +00:00
Mark Burnett 3ac95edc60 Fix: re-add incorrectly removed format test
This was removed in Iccf6228ab9e6d621d3047994b3adc192d67273c9 but should
not have been as it has allowed for code format drift.

This also

* Pins the version of yapf to 0.24.0
* Fixes some drift
* Updates formatting to the version of yapf being used

Change-Id: Ie3d9fd6344a29d8ddb76a36d4a31d001a4c8b7c6
2018-09-12 10:40:45 -05:00
Scott Hussey 9f875767cb [458884] Refactor validation
- This addresses a bug where Promenade doesn't detect some invalid
  configurations during genesis script generation.
- Refactor some validation checks for performance

Change-Id: I8b39caaab04819a935b83eb544979eac333fe409
2018-08-31 10:41:01 -05:00
Zuul be5689cf61 Merge "Supporting setting domain on nodes" 2018-08-27 16:14:40 +00:00
Scott Hussey 0011414107 Supporting setting domain on nodes
- During the genesis or join operation when /etc/hosts and
  /etc/resolv.conf are controlled by Promeande, we need to
  support including a domain name. This can be configured
  by YAML definition or by the join-script API. To support
  backward compatability use a default of 'local' when no
  domain is specified.

Testing: `./tools/gate.sh resiliency` has passed locally

Change-Id: Ia0d300912d3ec25eb7f1cb9c580eaa40b5b4addb
2018-08-27 10:33:02 -05:00
Zuul 9917eb5bfb Merge "Allow multiple join IPs" 2018-08-13 21:17:31 +00:00
pallav ea5de25b1a Adding node-labels api
Blueprint: https://review.openstack.org/#/c/583343

1. Added node-labels api for managing node labels in
   kubernetes cluster
2. Added unit test cases
3. Updated documents
4. Resiliency gate script update

Change-Id: Iebd49706b3fdbb3650f2e46c5a7fbd21d236b906
2018-08-09 23:58:59 +05:30
Mark Burnett 8d3e44c7d6 Allow multiple join IPs
This provides more robustness in testing and removes a nosec.

Additionally, commit 5a8b1d8 introduced a random failure in the
resiliency gate, due to there being a chance to choose the intentionally
downed node for the join ip.

Change-Id: I77b410b8e51f9d41eca2be4f5f770694140733b4
2018-08-02 15:46:49 -05:00
Mark Burnett 0e5009277a Fix broken validatedesign endpoint
This endpoint did not correctly return a response body.

Change-Id: Iec23083402d92069ab34698f31aeee4dce035aa6
2018-07-19 13:29:18 -05:00
Samantha Blanco 2cd353da21 Update validatedesign message
Update validatedesign failure message to return more detailed error
message.

Change-Id: I56f11ecd3030532d90b421dce5d8959b28d40cbb
2018-06-25 10:22:10 -04:00
Anthony Lin 16f23daee9 [Fix] Fix Incorrect Method Name
We are seeing the following error [0] while using Shipyard to run
a commit configdocs. The relevant exceptions are [1] and it is a
result of incorrect reference to method name.

The bug will be triggered when we use ext_marker. This patch set is
meant to correct that.

[0] shipyard commit configdocs

Error: Validations failed
Reason: Validation
- Error: None
        Message: Promenade unable to validate configdocs
        Source: Promenade
- Error: None
        Message: 500 Server Error: Internal Server Error for url: http://promenade-api.ucp.svc.cluster.local:80/api/v1.0/validatedesign
        Source: Promenade

[1] Exceptions messages in Promenade API pod

2018-05-14 14:56:20,147 ERROR    - - - promenade.exceptions:default_exception_handler [142] Unhanded Exception being handled:
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/falcon/api.py", line 201, in __call__
    process_request(req, resp)
  File "./promenade/control/middleware.py", line 103, in process_request
    if ext_marker is not None and self.is_uuid_like(ext_marker):
AttributeError: 'ContextMiddleware' object has no attribute 'is_uuid_like'

Change-Id: I89713fbb953a46e61093c4dadaa5a752b1a81c6c
2018-05-15 17:21:23 +00:00
Anthony Lin e413971a57 Update Promenade Validate Design Status
Based on the API conventions [0], we will expect the status
to be 'Success' or 'Failure' instead of 'Valid' or 'Invalid'.

This patch set is meant to align with the UCP API conventions

[0] https://github.com/att-comdev/ucp-integration/blob/master/docs/source/api-conventions.rst

Change-Id: Iae45588ea0bceb4b9a4f7ecc9d15e66f7251a1ea
2018-05-10 13:43:18 +00:00
Mark Burnett 26e6792690 Allow adding new definitions to PKICatalog
* Detect and re-use existing Certs/Keys
* Negative functional test for join with missing cert
* Positive functional test to generate cert after initial construction
* Extract some promenade test code into tools/g2/lib/promenade.sh
* Add timestamps to tar'd up files

Change-Id: Ib717785fc2c8f6cd1db1970ecdf1f5184ed40e92
2018-05-01 14:01:03 +00:00
Mark Burnett 702f5dcb11 Remove kubectl & credentials on join
This behavior can be disabled with the `leave_kubectl` query parameter
to the `join-scripts` endpoint.

Change-Id: Ia2d9d11f2e900aed0b69394de6ba30442921d5a0
2018-04-25 15:12:09 +00:00
One-Fine-Day 01d0b17d8e Promenade Test Fix
Required for Promenade validateDesign for Shipyard

Change-Id: I37eaceb1d57123d4d38737e1d3e6e0ae822f50f1
2018-04-24 16:33:05 +00:00
Samantha Blanco 0604b0404f Improve Promenade validatedesign message
Improves validatedesign return message by including count and list
of validation errors.

Change-Id: I7771eafedaa56c748f43fe1212926154933f247f
2018-04-03 10:53:25 -04:00
One-Fine-Day 9d20704fa5 Promenade Endpoint Fix
Required for Promenade validateDesign for Shipyard

Change-Id: Ie7eadf50b64eaae323c4997be86087ccdbb47f37
PS: https://review.gerrithub.io/#/c/400327/
2018-03-28 10:59:57 -05:00
Samantha Blanco a3b79eabc0 Add policy to validatedesign
Adds policy enforcement to validatedesign and adds testing for
validatedesign endpoint. Also fixes error when raising
ValidationException.

Change-Id: Ie48fc49a05f7890866d2dd3480c4d6333ef3a087
2018-03-19 19:58:34 -04:00
Mark Burnett ed32542da7 Avoid possible conflicting KubernetesNode document
This avoids a tricky-to-debug situation where it can appear that
different labels (or even a different ip address) is applied to a host
than expected.

Change-Id: I29fc99581a85f9cd1275f5cc07dfcb1be0e98339
2018-03-08 12:15:03 -05:00
Mark Burnett cfa3dffc5c Be stricter about allowed missing substitutions
Change-Id: Idb36c3521d878e72c5afd158e91841bea6e58ec9
2018-03-05 16:13:11 -06:00
Felipe Monteiro d0b23f3eeb Fix Deckhand render throwing exception on missing sub source
This PS resolves a recent issue with Deckhand in which missing
substitution sources cause Promenade to fail during genesis,
while using Deckhand to render documents. The fix involves
introducing a new flag called fail_on_missing_sub_src which
if False logs a warning rather than raises an exception
in the event that a substitution source document is missing.

Also adds better exception handling and logging around
Deckhand.

Example error:

Traceback (most recent call last):
  File "/usr/local/bin/promenade", line 10, in <module>
    sys.exit(promenade())
  File "/usr/local/lib/python3.6/site-packages/click/core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python3.6/site-packages/click/core.py", line 1066, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python3.6/site-packages/click/core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python3.6/site-packages/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/opt/promenade/promenade/cli.py", line 55, in genereate_certs
    debug=debug, streams=config_files, substitute=True, validate=False)
  File "/opt/promenade/promenade/config.py", line 49, in from_streams
    return cls(documents=documents, **kwargs)
  File "/opt/promenade/promenade/config.py", line 29, in __init__
    documents = [dict(d) for d in deckhand_eng.render()]
  File "/usr/local/lib/python3.6/site-packages/deckhand/engine/layering.py", line 485, in render
    self.secrets_substitution.substitute_all(doc))
  File "/usr/local/lib/python3.6/site-packages/deckhand/engine/secrets_manager.py", line 182, in substitute_all
    document_name=document.name)

Depends-On: https://review.gerrithub.io/#/c/400880/
Change-Id: I4486535d4555ece54eb4d47bfb56472250f97ab4
2018-02-22 19:19:34 +00:00
Scott Hussey 873e069549 Merge "Add keystone integration test" 2017-12-21 10:53:08 -05:00
Mark Burnett 527b2ad096 Add keystone integration test
* Adds "g2" gate for testing keystone integration
* Adds policy enforcement for join-scripts endpoint
* Updates ceph to luminous

Change-Id: Id52c1e51b567afc5a16d46c72145e21316c00a49
2017-12-19 16:00:20 -06:00
Samantha Blanco fd31aae8e8 Add API unit tests
Add unit tests for Promenade API endpoints. Also adds validatedesign
API endpoint.

Change-Id: I4c6a5da1f521f913c94ae8a07c8bc43cf4114f75
2017-12-19 16:45:37 -05:00
Samantha Blanco 5b4eee16b8 Add noauth
Adds noauth option for testing.

Change-Id: Idd0ee60ffdc824c9693e998595577b5eca3a24b6
2017-12-13 16:19:11 -05:00
Mark Burnett b4d9596468 Add join-scripts endpoint
* Adds initial join-scripts API
* Updates resiliency test to leverage API for joining

Change-Id: Ibe0d42b8f4f4a3e1f6f102dee85a22cb8f78f8ec
2017-11-15 15:03:53 -06:00
Samantha Blanco 9eb6f9c686 Inital API Commit
Creates necessary API files and implements health API route.

Change-Id: Id545d65949fcc48a05565f39b08180d4aa86006f
2017-11-03 14:48:47 -04:00