Commit Graph

50 Commits

Author SHA1 Message Date
Sergiy Markin eb96649b61 Airflow stable 2.6.2
This PS updates python modules and code to match Airflow 2.6.2

- bionic py36 gates  were removed
- python code corrected to match new modules versions
- selection of python modules versions was performed based on
  airflow-2.6.2 constraints
- a new pegleg validation gate was created based on airskiff deploy
  pipeline from treasuremap v1.9

Change-Id: Icc96deb0b745eaab7a19d83b00aad909dcd28c25
2023-08-30 16:07:28 +00:00
Sergiy Markin 0f2ab241f9 Restored ubuntu_bionic image build
This PS restores image build for ubuntu_bionic and adds appropriate
gates to keep it tested by appropriate functional and integrational
tests.

Change-Id: Id31d97ced8732d823937fb1f218e7ad8760d735c
2023-06-07 21:02:28 +00:00
Sergiy Markin c052d40277 Pegleg focal upgrade
This PS delivers focal version of Pegleg image and has the following updates:
- removed release-notes-jobs-python3 gate job because of incompartibility with Sphinx from current requirements
- added focal gate node and switched gates to use it
- added bindep.txt file into project root
- added bindep role into gate jobs
- added ubuntu_focal dockerfile for building focal pegleg image
- switched tox profiles to py38
- uplifted references to shipyard_client, promenade and deckhand projects
- resolved required dependencies conflicts by weakening constraints in Pipfile
- updated tox profile update-requirements for generate requirements.txt and test-requirements.txt
- generated new Pipfile.lock, requirements.txt and test-requirements.txt from Pipfile
- switched tox profiles to use requirements.txt and test-requirements.txt instead of pipenv because of upstream zuul nodes Pypi mirrorring issue
- updated reference to seaworthy site certificates in treasuremap repo
- fixed unit tests issues caused by pytest/mock updates and new openssl version
- fixed focal docker image publishing issue
- added multiprocessing into coverage tests running process
- made unit and coveraget tests more verbosive

Change-Id: I5c4c519dc725cfb8c7b4e14756347c9336028aff
2023-05-02 15:05:45 +00:00
Ruslan Aliev 6833800ecc Uplift k8s, promenade and shipyard dependencies
* disable python 35, leave only 36
* switch to bionic nodeset only
* update requirements.txt, Pipfile and lock

Signed-off-by: Ruslan Aliev <raliev@mirantis.com>
Change-Id: Ia3c4df9d1f39f0f2cebf8ba0d89aebc5eec6f674
2022-07-20 18:40:42 -05:00
anthony.bellino 86c52e4c8c Gate fix for pegleg
Remove default pip.conf as some packages are
not availablei from the mirror and cause
the image build jobs to fail.

Change-Id: I125360952190a4dc5cfb98647cd94dcf506f9b71
2021-08-03 17:21:53 -07:00
Phil Sphicas 4ed7005329 Ignore binary files when whitespace linting
Update the whitespace linter script to avoid tripping on png files,
using git-grep option:
    -I
        Don’t match the pattern in binary files.

Change-Id: Ifcd60354086cc606dbd3e71981484201b00c619c
2020-09-22 04:52:18 +00:00
Svetlana Shturm c40ffbdd8b Make zuul jobs reusable for internal zuul setup
This change makes zuul jobs configurable on project level using variables.
That allows to reuse same jobs in other zuul setup with different base images,
docker registry and proxy settings.

Change-Id: I301ea09f42bc1498d3cba45eede075e0d5a6f8fa
2020-06-24 16:51:45 -05:00
Alexander Hughes aa3fca532a Fix image build checks missing setuptools
Use apt to install python3-pip, and use pip3 in event system has
both pip2 and pip3 installed. Use apt to install setuptools for
Ansible's consumption.

Change-Id: Icd66c91e1c26627f756373800b3913d8c347e412
Signed-off-by: Alexander Hughes <Alexander.Hughes@pm.me>
Co-Authored-By: Alexey Odinokov <aodinokov@mirantis.com>
2020-06-17 12:07:58 +00:00
Ahmad Mahmoudi def3afff05 Bionic pegleg airship clients
This patchset updates pegleg airship clients for shipyard and
deckhand to use the new clients, which support bionic base image.

Change-Id: I266747b84c39984b941afd6454647fe0d5510ca3
2020-03-13 15:12:52 +00:00
Raven Daugherty 158768278e Added YAML file linting
Change-Id: I17208c96610ee13772c44b7d765d3014f0023134
2019-12-09 16:43:45 +00:00
Alexander Hughes 8946663381 Update Pegleg docs jobs
This patch brings Pegleg in line with other Airship projects in their
method of updating documentation.  This is achieved by:
1. Adding docs-on-readthedocs job
2. Adding readthedocs webhook and project name vars used for Pegleg
3. Removing airship-pegleg-doc-build
4. Removing doc-build playbook

Change-Id: Iaa4139ccb1cd9d7ca20a6b502ef2a152908147d0
2019-05-20 08:16:16 -05:00
Rajeshwari Dharwadkar 6ee2aaf845 Support pegleg to run on opensuse leap15 image
Add DISTRO parameter to support multiple distros
Add Dockerfile for opensuse to build leap 15 image.

Change-Id: I7a529476937494e042a4801117489325aa6621c7
2019-05-14 09:41:21 -07:00
Zuul 05ae434952 Merge "tests: Improve unit tests runtime performance" 2019-05-08 19:20:48 +00:00
Zuul 177486d8e6 Merge "zuul: Remove redundant airship-pegleg-tox-py36 job." 2019-05-08 18:58:35 +00:00
Ian H. Pittwood 33286a1173 Simplify whitespace-linter script
Pegleg currently uses `find` to search files in the whitespace-linter
script. A more simplified approach could be taken by using `git grep`
instead. This method levarages .gitignore so a separate list of files
in the script no longer needs to be maintained. This is the method used
by Airship Armada.

Change-Id: I26a2a95f533b9ff62de784d004f25ade552a5b31
2019-04-10 15:37:08 -05:00
Felipe Monteiro b28788325f tests: Improve unit tests runtime performance
This patch set does 2 things:

1) Improves unit test runtime peformance via pytest-xdist [0]
2) Reduces finnicky nature of `is_connected` helpers which
   sometimes skip even when there is access to the internet;
   logic has been added to make these checks more accurate
   to avoid skipping tests

Note that while there are newer alternatives to pytest-xdist they
are only compatible with much newer versions of Python.

[0] https://pypi.org/project/pytest-xdist/

Change-Id: Ib04b48ebabca0551058e5e1065056f4e559fbfe6
2019-04-04 14:21:43 +00:00
Scott Hussey a640ebf85a (zuul) Fix image publish job
- Fix issue in post pipeline image publish job introduced
  by Ansible update

Change-Id: I39fa51ea11804db065203761c475b48d269796f4
2019-04-03 14:51:51 -05:00
Felipe Monteiro 6c1b6e65b8 zuul: Remove redundant airship-pegleg-tox-py36 job.
The openstack-python36-jobs template already exists; thus there
is no need for airship-pegleg-tox-py36. Since airship-pegleg-tox-py36
installs cfssl as a prerequisite for unit tests, move the install-cfssl.sh
command to tox.ini prior to unit test execution, allowing for the
airship-pegleg-tox-py36 Zuul job and its associated playbook to be
removed.

Change-Id: I66de957a1a57ef246476c1a81954cd0f822cb8be
2019-03-26 20:38:14 +00:00
Aaron Sheffield 39119d5895 Updating Docker Gate use of zuul.newrev
- Zuul updated ansible to 2.7, no longer uses missing variables.
- Using an if to try and address.

Change-Id: I547097efc9ed2b2ca308cf394fe14dab16abacc4
2019-03-22 11:47:12 -05:00
Felipe Monteiro 2a8d2638b3 pki: Port Promenade's PKI catalog into Pegleg
This patch set implements the PKICatalog [0] requirements
as well as PeglegManagedDocument [1] generation requirements
outlined in the spec [2].

Included in this patch set:

* New CLI entry point called "pegleg site secrets generate-pki"
* PeglegManagedDocument generation logic in
  engine.cache.managed_document
* Refactored PKICatalog logic in engine.cache.pki_catalog derived
  from the Promenade PKI implementation [3], responsible for
  generating certificates, CAs, and keypairs
* Refactored PKIGenerator logic in engine.cache.pki_generator
  derived from Promenade Generator implementation [4],
  responsible for reading in pegleg/PKICatalog/v1 documents (as
  well as promenade/PKICatalog/v1 documents for backwards
  compatibility) and generating required secrets and storing
  them into the paths specified under [0]
* Unit tests for all of the above [5]
* Example pki-catalog.yaml document under pegleg/site_yamls
* Validation schema for pki-catalog.yaml (TODO: implement
  validation logic here: [6])
* Updates to CLI documentation and inclusion of PKICatalog
  and PeglegManagedDocument documentation
* Documentation updates with PKI information [7]

TODO (in follow-up patch sets):

* Expand on overview documentation to include new Pegleg
  responsibilities
* Allow the original repository (not the copied one) to
  be the destination where the secrets are written to
* Finish up cert expiry/revocation logic

[0] https://airship-specs.readthedocs.io/en/latest/specs/approved/pegleg-secrets.html#document-generation
[1] https://airship-specs.readthedocs.io/en/latest/specs/approved/pegleg-secrets.html#peglegmanageddocument
[2] https://airship-specs.readthedocs.io/en/latest/specs/approved/pegleg-secrets.html
[3] https://github.com/openstack/airship-promenade/blob/master/promenade/pki.py
[4] https://github.com/openstack/airship-promenade/blob/master/promenade/generator.py
[5] https://review.openstack.org/#/c/611739/
[6] https://review.openstack.org/#/c/608159/
[7] https://review.openstack.org/#/c/611738/

Change-Id: I3010d04cac6d22c656d144f0dafeaa5e19a13068
2019-01-15 13:29:21 -06:00
Felipe Monteiro e3f6efbb1f trivial: fix whitespace-linter catching false positives
Ignores .pyc files and files contained in htmlcov as a coverage
job was recently added.

Change-Id: I33b1b88e90060f3b26f41b6acbbc0c7091caeb57
2018-11-25 12:30:56 -05:00
Tin Lam 152b42bc3b Consolidate linter jobs
Consolidating all the linting to a single job rather than having a one-off
just to lint for trailing whitespaces. As most of this projects are python,
this should already be covered by PEP8, but will be scanning for yamls with
trailing whitespaces.

Change-Id: Iee33a69ff234d21c08217faa33a19e11dfef0ad9
Signed-off-by: Tin Lam <tin@irrational.io>
2018-11-12 02:30:20 -06:00
Ahmad Mahmoudi eb0deeb9e5 Pegleg encryption of site secrets
Added secret encryption/decryption to pegleg cli.

Change-Id: I95b993748d99fc4398eee1d1c59e74f382497f74
2018-10-30 16:53:51 +00:00
Felipe Monteiro ec34ed056f Allow tox to support regexes for unit tests
This patch set adds a shell wrapper script to allow
tox to be used to run a subset of unit tests via regexes:

To run all unit tests, execute::

  $ tox -epy35

To run unit tests using a regex, execute::

  $ tox -epy35 -- <regex>

Change-Id: I2ba1e18226d686cb549a075e020ba02e24204829
2018-10-22 10:18:05 -04:00
Zuul 2ea774a744 Merge "Switch to openstack-python35-jobs template for py35 CI gate" 2018-10-15 19:25:30 +00:00
Felipe Monteiro 17b4d6e563 Switch to openstack-python35-jobs template for py35 CI gate
This patch set switches to openstack-python35-jobs for the py35
CI gate.

Change-Id: I12239086984a387dde33e5fdc451a9c51deec953
2018-10-02 22:32:47 +00:00
Felipe Monteiro 57a6c6a84e Implement global lint and lint by site logic
With the implementation of revisioned repository to the CLI in
https://review.openstack.org/#/c/577886 there was a change to
the lint command [0], which changed it from being a global lint
to a site-level (targetted lint)... kind of: Only the CLI logic
was modified to support targetted single-site linting. Thus,
the first issue this patch set addresses is implementing the
back-end logic to realize targetted, single-site linting.

The second issue this patch set addresses is re-supporting global
linting (linting all sites within a repository) which means that
this partially reverts [0] which had (kind of) replaced global
linting with per-site linting.

So, this patch set:

1) Implements targetted, single-site linting back-end logic
2) Re-implements global linting for all sites in a repo
3) Adds unit tests for both
4) Adds some helper functions to util.engine.definition to
   help with 1) and 2)

[0] https://review.openstack.org/#/c/577886/4/src/bin/pegleg/pegleg/cli.py@191

Change-Id: I5147282556763d93dfaf06912d2c4c876e1bd69f
2018-10-02 21:41:56 +01:00
Zuul 6c6bea992d Merge "Fix: git commit id labels on images" 2018-10-01 12:07:52 +00:00
Kaspars Skels 87b385be60 Enable override of terminal options for pegleg.sh
This takes care of removing -t option when running the script
with automated system (e.g. Jenkins)

Change-Id: I087b32d2635251f967a8f78c4d1f945827573be6
2018-09-22 11:16:06 -05:00
Roman Gorshunov de6486c380 Fix: git commit id labels on images
1) Use OCI Image Specs for labels instead of custom 'commit-id=xxxxx'
   or legacy "Label Schema"
2) Fix missing git commit id labels on images (.revision)
3) Add human-readable title (.title) of the image, URL (.url), and
   a few other properties (annotations) according to the latest Specs

Change-Id: I57318d4662d90b439d4b7766f7c67571e0f69f15
2018-09-21 03:31:12 +02:00
Zuul 7cb4d1b261 Merge "docs: Add developer overview guide" 2018-09-14 23:24:05 +00:00
Felipe Monteiro adb23bc2a6 docs: Add developer overview guide
This patch set introduces a developer overview documentation
page to Pegleg to help developers onboard.

Change-Id: Ia453d76f024db39c6bdd97a44bfe1db1c25193f9
2018-09-13 18:28:58 -06:00
Kaspars Skels ac6297eae6 Add ~/.ssh mount to pegleg.sh
New Pegleg supports feature of pulling git repos.
This mount passes SSH keys to the container.

Change-Id: I6606ac44469099d8560e89482bba98d7bb9c8dbf
2018-09-07 10:31:35 -05:00
Kaspars Skels 4245926e68 Fixes for pegleg.sh
Update image reference to quay.io/airshipit vs quay.io/attcomdev.

Set host networking for running pegleg container.
Recent Ubuntu releases are using 127.0.0.53 in /etc/resolv.conf,
and host networking mode is a way to work around local DNS.

Change-Id: Ib3e39e6f83e0bb7a50f92f85b791c8d0b59664d1
2018-08-23 16:36:42 -05:00
Gage Hugo ad7e855cf8 Consolidate pep8/bandit zuul gating
This change adds the global zuul pep8 tox job, which runs both
bandit and pep8 using tox. This also removes the two other airship
specific lint-pep8 and bandit zuul jobs since they are both covered
by the default openstack global one.

Also cleaned up the tox.ini by moving the requirements into the
test-requirements.txt file.

Change-Id: Iab37a8090515936732e390b1f7c6d281e014e31c
2018-08-21 20:55:39 +00:00
Felipe Monteiro 22584dfdb8 trivial: Update default image reference in pegleg.sh
This patch set updates the default image reference used by
pegleg.sh from a downstream reference to the appropriate
upstream reference.

Change-Id: Id0198c6b69ee145901dae208ab9584e102f39827
2018-08-16 03:17:49 +00:00
Jerome Brette 4727df6b80 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: I6703589f32487f5668d709f485dae5782b13c002
2018-07-17 14:37:08 -05:00
Anderson, Craig (ca846m) 83300a3da3 Simplify pegleg.sh usage
Remove unused code. Set WORKSPACE default to $PWD and set workdir in the
container, so that users of pegleg.sh do not need to have any knowledge of
the internal "/worksapce" mountpath inside the container, and in general
simplify the execution of container command line tools.

Change-Id: I56dea7d116f88df303aaeca8dc25a7b24cb291a6
2018-06-22 16:00:09 -07:00
Zuul c7dc0e71dc Merge "Rename docs to doc to align with OpenStack standard" 2018-06-10 01:24:15 +00:00
Scott Hussey f7b7946e4b (zuul) Docker image jobs
- Add check/gate jobs for image building
- Add post job for image building and publish to quay.io

Change-Id: Ia7c1f67ec4a5ae11e1fad489259f8418bac0a644
2018-06-08 08:54:34 -05:00
Felipe Monteiro f5fc46c7af Rename docs to doc to align with OpenStack standard
This patchset updates docs to doc to align with OpenStack
standard. Follow-up patchset will be needed to publish
documentation to OpenStack [0].

[0] https://docs.openstack.org/doc-contrib-guide/project-guides.html

Change-Id: I90e5f9129207901402e26ed9488ec6e065568fe1
2018-06-06 09:25:14 -04:00
Scott Hussey 4ad86e0728 Basic zuul gates
- Pep8, bandit and unit tests
- Document build (no publish)

Change-Id: I2ca67e69f80aff63576bebd14da412e2f138f54a
2018-05-31 13:10:41 -05:00
Felipe Monteiro bfac6ada6c Zuul: Initial Airship-Pegleg checks
This PS adds the skeleton for a set of zuul checks and gates for
Airship, using the framework from OpenStack-Helm.

Change-Id: I4cc071d0076e265e5c34f15616ccf40c0b3a83a8
2018-05-17 22:09:35 +00:00
Bryan Strassner cc64765075 Pegleg use artifactory image
The referenced quay.io image was no longer valid. Changed to
use artifactory iamge in atlantafoundry.

Change-Id: I29b384271e5f65e7609ffae52a553bf82f7a0d32
2018-04-11 09:38:46 -04:00
Scott Hussey 8224e6fc21 Support multiple repo for document source
- A single primary repo must be specified which
  holds the site_definition.yaml file.
- Zero or more auxiliary repos can be specified which
  have additional documents used in the site definition.
- Collected documents are written to a file named after their
  source repo. Collection must always be given a output directory
  rather than a single file now.

Change-Id: Iceda4da18c4df45d917d88a49144e39e3f1743ed
2018-03-12 15:30:02 -05:00
Scott Hussey b3ea5de2b8 Update to UCP layout standard
- Create Makefile for image build
- Move Dockerfile into images/pegleg
- Move pegleg module src to src/bin/pegleg

Change-Id: I8fd728888ecfd75fe857da253d6c8cd4fd83f89c
2018-03-05 07:42:00 -06:00
Pete Birley 168c4aa3c8 Docker: use host network for build and none for running pegleg
This PS updates the pegleg script to build and run the docker
image/container with host networking/no networking - enabling it
to be used seamlessly on k8s hosts that do not make use of dockers
iptables rules.

Change-Id: Ia08b805f79ec8f82f3555856f316921f7eddb064
2018-03-02 20:46:51 -05:00
Alan Meadows bf9e121f6f Add site render using deckhand and use deckhand for linting
Change-Id: I8ba6abe6d93db12ded63817a1f5a79fe55d73786
2018-02-28 14:47:29 +00:00
Craig Anderson bc968e2746 Add docs and remove AIC references
Change-Id: I283954d87ef02408859f75cbc21250a1621ad001
2018-02-16 14:48:48 -05:00
Craig Anderson e59c4fbf2a Twigleg to Pegleg transition
Change-Id: Ice500c7e7e30609827d69dc0ae178b627ea046d9
Author: mb874d@att.com
2018-02-01 15:26:59 -08:00