471 Commits

Author SHA1 Message Date
Zuul
0341954f00 Merge "Change logging of sql to single line" 2018-08-07 18:01:26 +00:00
Bryan Strassner
1a1cad60ed Change logging of sql to single line
Cleans up Shipyard logs a bit, where queries were nice and easy to read,
but multi-line and needlessly on a separate line from the logging
headers.

Change-Id: I2fdff634dad097ef30207edae5205cb6c7226602
2018-08-06 13:57:24 -05:00
Sreejith Punnapuzha
f19df69059 Fix security vulnerability using os.system()
Updates the rest api plugin used from [0] to remove background
processing logic that triggers an observed security vulnerability due to
use of os.system(). The background process support was used only for log
retrieval, which Shipyard does in a different way (not this plugin).

[0] https://github.com/teamclairvoyant/airflow-rest-api-plugin

Change-Id: I6967938c1f29678137ea27d01b4a639bc3acc6d5
2018-08-03 13:21:32 -05:00
Crank, Daniel (dc6350)
205e1b1b37 Add no_proxy to docker base command
Add no_proxy environment variable for proper operation
behind a proxy.

Change-Id: Ida4419cf7c64c8e950acf284d75986f02a82470d
2018-08-01 11:21:44 -05:00
Smruti Soumitra Khuntia
839e3eb8d2 Unit tests added for `get site-statuses` cli
Change-Id: Ie000d05a34adeb98d7a52adc0839fb1eecf7e218
2018-08-01 17:04:14 +05:30
Bryan Strassner
553acf139f Remove pip of docker during image publishing
During the publish of an image post-merge, an error was being rasied due
to a conflict between the ansible-supplied docker-py and the pip
installed docker. This removes the pip installed docker to allow
publishing to proceed.

Change-Id: I6a1ff54ed2d2af85cbe44ed50b1c637dee9adf54
2018-07-31 15:57:15 -05:00
Smruti Soumitra Khuntia
f4c724fbf1 A new Shipyard site statuses API and CLI
A new Shipyard site statuses API and CLI supporting nodes
provisoning status and node power state. This API
can be further developed to support new status
requirements by expanding the filters option.

Change-Id: I620aefd82d4a17b616f3f253265605e519506257
2018-07-31 09:16:36 +00:00
Zuul
4d0a2759f9 Merge "Mask password in logs for database connection" 2018-07-30 20:53:58 +00:00
Zuul
67ac005b13 Merge "Add cryptography to shipyard" 2018-07-27 22:58:11 +00:00
Matt McEuen
e75f1e277a Add cryptography to shipyard
Use of memcached, which is enabled by default in the Shipyard Helm
chart, requires the cryptography package. Word is that cryptography
had a compatibility issue with python3 in the past, but v2.3 seems
to be working fine and getting memcached integration to work.

Change-Id: I6b5c9983f41aec874e45fd81bd8a30faa88fc316
2018-07-27 15:00:11 -05:00
Van Hung Pham
29a386df3c fix tox python3 overrides
We want to default to running all tox environments under python 3, so
set the basepython value in each environment.

We do not want to specify a minor version number, because we do not
want to have to update the file every time we upgrade python.

We do not want to set the override once in testenv, because that
breaks the more specific versions used in default environments like
py35 and py36.

Change-Id: If0f86ecb4c18216daf158101dbd3663bda06956f
2018-07-27 13:13:02 +07:00
Zuul
401ebe627c Merge "Update Dockerfile to allow override of FROM variable" 2018-07-26 17:54:09 +00:00
Bryan Strassner
852159edd9 Mask password in logs for database connection
Masks the database password during logging of connection strings.

Change-Id: I5e19da97ba0a16a61f7c851ffab404caa8a2e6ad
2018-07-26 12:37:00 -05:00
Zuul
7e5eac94e3 Merge "Add py36 testenv" 2018-07-26 17:36:37 +00:00
Bryan Strassner
cf9684377a Refactor to use unittest.mock instead of mock
Simple refactor to eliminate use of mock library and instead use the
built-in library.

Change-Id: Id2c176c9c67a9043ea5f54d62044423518a3446b
2018-07-25 10:41:16 -05:00
Bryan Strassner
038f958501 Refactor imports to support loading dags for tests
Updates the imports for the dags and operators to support both "as
deployed" and "as tested" package configurations. This allows for a
simple test to be added that at least imorts and checks the dags to
ensure they contain steps.

A future refactor may eliminate the need for some/much of this by moving the
operators away from the plugin appraoch such that they can be statically
built into the airflow pod and used like a third party library instead
of being appended to the airflow plugins. For now though, this maintains
the status quo for the way these are used in a deployed way.

Change-Id: I437ff9c583358188e27de0e2f6987c38ca85ab2f
2018-07-25 09:19:18 -05:00
Vu Cong Tuan
2c841b9c6b Add py36 testenv
Python 3.6 is installed by default in Ubuntu 18.04 LTS.
Therefore, according to Transition Plan [1],
it'll be handy to have py36 testenv.

For more details, please check Python2 Deprecation Timeline [2]
and Python3-first Goal - Completion Criteria [3].

[1] https://wiki.ubuntu.com/Python/Python36Transition
[2] https://governance.openstack.org/tc/resolutions/20180529-python2-deprecation-timeline.html
[3] https://review.openstack.org/#/c/575933/8/goals/stein/python3-first.rst@42

Change-Id: Ife9ad9648ded0d96523957381f87c059c217b28b
2018-07-25 09:18:19 +07:00
Jerome Brette
4b8e0220b0 Update Dockerfile to allow override of FROM variable
l is to let user customize the base image of the component
by passing FROM=myimage during the build process. This would let any
project leveraging Airship ensure that the base image is matching the
security requirements for that project and still use the same Dockerfile.
This will also ease the control of the /etc/apt/source.list
and thereby the result of apt-get update/upgrade procedure.
2. The above goal is achievable by using docker-ce feature such as:
ARG FROM="defaultbaseimage:xx"
FROM ${FROM}
For this reason, the installation of docker.io in the Zuul gating is beeing
replaced by docker-ce.
3. Third Goal is to bring consistency with the other compoenents leveraging
Helm such as the openstack-helm and potentially use bindep the same way
the LOCI images are to ensure
4. The new syntax in the Dockerfile is still commented out until the associated
image builder have been updated to use docker-ce as they have been for the LOCI
images.

Change-Id: Ife7e1be53c7c139bdc42dee42f0798e83f4fd271
2018-07-17 16:35:42 -05:00
Bryan Strassner
bd2a686dbf Make validation process failures more obvious
Adds better info to the error returne when retreiving the validations
from another Airship component. Adds tests to cover the success and
failure flows of this same logic

Change-Id: Id7fb389a3905f3e0659d4a7eec0e0658e00f3f28
2018-07-16 16:59:39 -05:00
Aaron Sheffield
16cc15f856 Add test pods labels.
- Uses helm toolkit to add labels to test pods.

Change-Id: I8796379b0370fb41c1a519023b49139b5401810e
2018-07-11 08:49:49 -05:00
Zuul
a4474f7bc2 Merge "Add step info and timestamp to get actions command" 2018-07-09 20:10:19 +00:00
Bryan Strassner
70e451dce3 Add step info and timestamp to get actions command
Adds an execution start time and a summary of steps that have succeeded,
failed, or otherwise.

Change-Id: I8aaaa45b9c3e00aaf3ae428911dc522509dec694
2018-07-09 14:16:48 -05:00
Zuul
2e109bb22a Merge "Separate source of node_selector_key and values" 2018-07-07 18:11:00 +00:00
Zuul
1c21ffa851 Merge "Add udpate_software action to Shipyard" 2018-07-07 18:08:04 +00:00
Zuul
d64bcae2c4 Merge "fix(gate): fix airship-shipyard-ubuntu job" 2018-07-07 18:08:03 +00:00
Bryan Strassner
70eb1cef10 Add udpate_software action to Shipyard
Provides an action that can be invoked by a user to deploy only the
software portion of a design.

Change-Id: I880bdc245064364dfdd6a482a3cf2d2a293f6c0d
2018-07-06 16:57:42 -05:00
Zuul
29d8810465 Merge "DAG Maintenance - parallelization" 2018-07-06 13:51:15 +00:00
Bryan Strassner
2651f6e831 Separate source of node_selector_key and values
Provides different fields in the values.yaml to use for the node
selector keys/values used in deployments vs jobs.

Change-Id: I12d7c6257aea0ac00cd77cd3f6331a2b7380b589
2018-07-06 04:22:38 +00:00
Tin Lam
87ae709fb2 fix(gate): fix airship-shipyard-ubuntu job
Change-Id: I146c57bf39c7588eca3df486b4505584c333bf74
Signed-off-by: Tin Lam <tin@irrational.io>
2018-07-06 04:17:13 +00:00
Bryan Strassner
9f99431fad DAG Maintenance - parallelization
Updates the workflows to have considerably more parallelization of the
early steps, and unwraps some of the operators from their sub-dags, in
an attempt to simplify the representation of the workflow and
potentially increase performance.

Change-Id: I6ce987b32399e261a2383233bd192b0e49514791
2018-07-03 13:18:04 -05:00
Felipe Monteiro
15c829da7c Job fix: update osh-infra-deploy-docker.yaml to align with osh
This patchset updates osh-infra-deploy-docker.yaml playbook
to align with role rename change in osh-infra causing pre-run
to fail: https://review.openstack.org/#/c/578703/6

Change-Id: Ie119f953e77fc748cc784b8cd9f509892e55927d
2018-07-02 22:18:16 -04:00
Bryan Strassner
1aa814491b Change k8s node status to be a positive check
When checking for deployed nodes, the kubernetes join check was
only performing a negative check - and would wait for up to the timeout
even in the event that nodes that were not part of the current
processing before proceeding. This had the drawback of being overall
likely to add wait time in any complex deployment scenario, as well as
(and more importantly) miss the case where a node never started to try
to join, and assume that was a success.

This patchset flips the logic to positively look for an expected set of
nodes instead, and will not wait upon nodes that are not currently being
checked. The end result should remedy both of the drawbacks listed
above.

Change-Id: Ib07e4e2677ec4f773d695d57893fdfa5e4b7ff76
2018-06-30 00:14:54 -05:00
Bryan Strassner
4c6cce57ad [Fix] Shipyard handle set Key Error
A KeyError was not being caught by the ValueError exception handler when
removing a node from a list of successes. This provides a safer
exception handler.

Change-Id: I3f7b5146009f4f05ee893919a73e41e182dea9f9
2018-06-29 18:12:21 -05:00
Zuul
bb697212a9 Merge "Externalize database connection pool parameters" 2018-06-29 20:18:11 +00:00
Bryan Strassner
e72a83f03b Externalize database connection pool parameters
Updating to include the pre-flight check required an update to
sqlalchemy version.

Change-Id: I3da7c4e88f31ea5c2b9f4afa433bda54b16ba8eb
2018-06-29 09:54:44 -05:00
Zuul
c604dfae97 Merge "Fix API response code mismatch" 2018-06-28 20:21:28 +00:00
Zuul
66da23cb20 Merge "Update chart to support TLS for Shipyard" 2018-06-28 00:22:49 +00:00
Pete Birley
a7b6d184a5 Update chart to support TLS for Shipyard
Adds the secret to support TLS for the Shipyard API

Change-Id: I34d753bc0c65b00df54aeb32ff66eef5bf2c4c6e
Co-Authored-By: Pete Birley <pete@port.direct>
Signed-off-by: Pete Birley <pete@port.direct>
2018-06-27 18:21:54 -05:00
Bryan Strassner
90944fc768 Add robustness to capturing task info from Drydock
In the case of being able to gather informational task info, if there is
any exception, report the exception and move on, rather than failing
hard.

Change-Id: I677f9c375549f0ff421aa322c561a8bc7cb848d0
2018-06-27 13:14:46 -05:00
hs571j
8b43d75ecf Fix API response code mismatch
Response mismatch between http reponse and json payload for configdocs replace

Change-Id: I979cd31e26660149d0121d65298d106afbb24008
2018-06-27 13:12:25 -05:00
anthony.lin
c7a9c65c88 Update Shipyard Chart - HTK OSH Infra
Updated configurations to point to openstack-helm-infra
for reference to helm-toolkit as helm-toolkit has been
removed from the openstack-helm repo [0]

Also aligned with changes to the keystone user set up in
OSH using Helm ToolKit so as to get pass Helm Lint.

Updated Makefile targets to install helm dynamically

[0] https://review.openstack.org/#/c/558065/

Change-Id: I0a0813516f9ad176ff005b4693e6b933013a99fd
2018-06-25 17:14:28 -05:00
Zuul
58e2949cdc Merge "[trivial] fix several minor issues" 2018-06-22 21:39:59 +00:00
Bryan Strassner
e5a0bf4a32 [trivial] fix several minor issues
This cleanup fixes a handful of items identified as not
blocking a larger patchset.

Change-Id: I4642112c444c546c0bb271ed58a2d9b76155cad7
2018-06-22 13:05:32 -05:00
Roman Gorshunov
1e9a21897a Unifying proxy variables for tox and docker build
This patch adds proxy-related variables to tox and 'docker build'
commands.

Change-Id: I019bb0ff5a5eb48b0a9bec6f202a5d3022b8095c
2018-06-22 19:37:20 +02:00
Bryan Strassner
04906cce68 Workflow to support deployment groups
Updates the Shipyard/Airflow workflow for deploy_site and
update_site to use the deployment group/deployment strategy
information from the design.

This allows for baremetal nodes to be deployed in a design-
specified order, with criticality and success criteria driving
the success and failure of deployment.

Includes refactoring of service endpoints to reduce the need
for so much data passing.

Change-Id: Ib5e9fca535ca74d1819fe46959695acfed5b65c2
2018-06-20 09:55:15 -05:00
Zuul
ea47f2c77b Merge "Updates to shipyard cli wrapper" 2018-06-13 21:48:13 +00:00
Zuul
16942212fa Merge "Docs supporting deployment groups" 2018-06-13 19:58:37 +00:00
Scott Hussey
bf22828f52 Updates to shipyard cli wrapper
- Don't change directory so that the volume mounted in the
  container at /home/shipayard/host is predictable
- Update image default to point at airshipit repo

Change-Id: If8b0988925921d7b54ec74ac73e12289d89d392e
2018-06-12 16:06:02 -05:00
Zuul
748d0fcd53 Merge "Add proxy options to docker run portions of image build" 2018-06-09 18:09:30 +00:00
Bryan Strassner
6a6e3ec46e Add proxy options to docker run portions of image build
Updates the Makefile and associated shell scripts that perform docker
run to utilize proxy info.

Change-Id: Ic37ae9bc25500357f980ed327148eacac7555915
2018-06-08 15:26:42 -05:00