From a02f79a7297a6a515626c74edc40abb356c149b3 Mon Sep 17 00:00:00 2001 From: Anthony Lin Date: Mon, 8 Jan 2018 17:02:05 +0000 Subject: [PATCH] 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 --- shipyard_airflow/control/configdocs/configdocs_helper.py | 7 ++++++- tools/deckhand_load_yaml.sh | 9 +++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/shipyard_airflow/control/configdocs/configdocs_helper.py b/shipyard_airflow/control/configdocs/configdocs_helper.py index 94f29b9f..d353c418 100644 --- a/shipyard_airflow/control/configdocs/configdocs_helper.py +++ b/shipyard_airflow/control/configdocs/configdocs_helper.py @@ -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() diff --git a/tools/deckhand_load_yaml.sh b/tools/deckhand_load_yaml.sh index dff4ab4c..f88275c5 100755 --- a/tools/deckhand_load_yaml.sh +++ b/tools/deckhand_load_yaml.sh @@ -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.