Increase timeout and Update deckhand_load_yaml Script

We are getting the following errors in [0] when executing
the shipyard CLI due to timeout issue.

We will be increasing the timeout from 30 seconds to 60
seconds to allow more time for site validations.

There is another problem with the deckhand_load_yaml script
as the environment variables were defined but not exported.

This p.s. is meant to address these 2 issues.

[0] Error messages

root@genesis:~# shipyard commit configdocs
Error: Validations failed
Reason: Validation
- Error: Drydock unable to validate configdocs
- Error: HTTPConnectionPool(host='drydock-api.ucp.svc.cluster.local', port=9000): Read timed out. (read timeout=30)
- Error: Armada unable to validate configdocs
- Error: HTTPConnectionPool(host='armada-api.ucp.svc.cluster.local', port=8000): Read timed out. (read timeout=30)
root@genesis:~#

Change-Id: Ia04d244077c9f809e19aca1b47ce178eb5984b0c
This commit is contained in:
Anthony Lin 2018-01-08 17:02:05 +00:00
parent 585870080a
commit a02f79a729
2 changed files with 15 additions and 1 deletions

View File

@ -437,8 +437,13 @@ class ConfigdocsHelper(object):
'content-type': 'application/json'
}
# TODO: We will need to make timeout a configurable value as it
# will differ from site to site based on the size of the rendered
# document
# Note that 30 seconds is not sufficient to complete validations.
# Hence we are increaing the default timeout to 60 seconds.
http_resp = requests.post(
url, headers=headers, data=design_reference, timeout=(5, 30))
url, headers=headers, data=design_reference, timeout=(5, 60))
# 400 response is "valid" failure to validate. > 400 is a problem.
if http_resp.status_code > 400:
http_resp.raise_for_status()

View File

@ -60,6 +60,7 @@ ingress_controller_ip=`sudo kubectl get pods -n openstack -o wide | grep ingress
# where DNS resolution of the Keystone and Shipyard URLs
# is not available. We can skip this step if DNS is in place.
cat << EOF | sudo tee -a /etc/hosts
$ingress_controller_ip keystone.${namespace}
$ingress_controller_ip shipyard-api.${namespace}.svc.cluster.local
EOF
@ -72,6 +73,14 @@ sudo pip3 install --upgrade pip
cd shipyard && sudo pip3 install -r requirements.txt
sudo python3 setup.py install
# Export Environment Variables
export OS_USER_DOMAIN_NAME=${OS_USER_DOMAIN_NAME}
export OS_PROJECT_DOMAIN_NAME=${OS_PROJECT_DOMAIN_NAME}
export OS_PROJECT_NAME=${OS_PROJECT_NAME}
export OS_USERNAME=${OS_USERNAME}
export OS_PASSWORD=${OS_PASSWORD}
export OS_AUTH_URL=${OS_AUTH_URL}
# The directory will contain all the .yaml files with Drydock, Promenade,
# Armada, and Divingbell configurations. It will also contain all the
# secrets such as certificates, CAs and passwords.