[CPINF-1432] Add drydock-focal image build job

Change-Id: Iaa39ffa9ee6af202ce8a23e01ea9cac39dd4df16
This commit is contained in:
Wahlstedt, Walter (ww229g) 2023-03-02 15:24:29 -05:00
parent 389db640e4
commit b5e7e5b4c1
25 changed files with 217 additions and 194 deletions

View File

@ -22,5 +22,5 @@ python:
version: 3.7
install:
- requirements: doc/requirements-doc.txt
- requirements: python/requirements-lock.txt
- requirements: python/requirements-frozen.txt
- requirements: python/requirements-test.txt

View File

@ -21,17 +21,17 @@
- airship-drydock-omni-test
- airship-drydock-chart-build-gate
- airship-drydock-chart-build-latest-htk
- airship-drydock-docker-build-gate-ubuntu_xenial
- airship-drydock-docker-build-gate-ubuntu_focal
- airship-drydock-docker-build-gate-ubuntu_bionic
gate:
jobs:
- airship-drydock-omni-test
- airship-drydock-chart-build-gate
- airship-drydock-docker-build-gate-ubuntu_xenial
- airship-drydock-docker-build-gate-ubuntu_focal
- airship-drydock-docker-build-gate-ubuntu_bionic
post:
jobs:
- airship-drydock-docker-publish-ubuntu_xenial
- airship-drydock-docker-publish-ubuntu_focal
- airship-drydock-docker-publish-ubuntu_bionic
- drydock-upload-git-mirror
@ -41,6 +41,12 @@
- name: primary
label: ubuntu-bionic
- nodeset:
name: airship-drydock-single-node-focal
nodes:
- name: primary
label: ubuntu-focal
- job:
name: airship-drydock-omni-test
description: |
@ -50,7 +56,7 @@
required-projects:
- openstack/openstack-helm-infra
timeout: 3600
nodeset: airship-drydock-single-node
nodeset: airship-drydock-single-node-focal
- job:
name: airship-drydock-chart-build-gate
@ -58,7 +64,7 @@
Builds charts using pinned Helm toolkit.
timeout: 900
run: tools/gate/playbooks/build-charts.yaml
nodeset: airship-drydock-single-node
nodeset: airship-drydock-single-node-focal
- job:
name: airship-drydock-chart-build-latest-htk
@ -67,21 +73,21 @@
timeout: 900
voting: false
run: tools/gate/playbooks/build-charts.yaml
nodeset: airship-drydock-single-node
nodeset: airship-drydock-single-node-focal
vars:
HTK_COMMIT: master
- job:
name: airship-drydock-docker-build-gate-ubuntu_xenial
name: airship-drydock-docker-build-gate-ubuntu_focal
timeout: 1800
run: tools/gate/playbooks/docker-image-build.yaml
nodeset: airship-drydock-single-node
nodeset: airship-drydock-single-node-focal
irrelevant-files:
- '^doc/.*'
- '^charts/.*'
vars:
publish: false
distro: ubuntu_xenial
distro: ubuntu_focal
tags:
dynamic:
patch_set: true
@ -90,7 +96,7 @@
name: airship-drydock-docker-build-gate-ubuntu_bionic
timeout: 1800
run: tools/gate/playbooks/docker-image-build.yaml
nodeset: airship-drydock-single-node
nodeset: airship-drydock-single-node-focal
irrelevant-files:
- '^doc/.*'
- '^charts/.*'
@ -103,10 +109,10 @@
- job:
name: airship-drydock-docker-publish-ubuntu_xenial
name: airship-drydock-docker-publish-ubuntu_focal
timeout: 1800
run: tools/gate/playbooks/docker-image-build.yaml
nodeset: airship-drydock-single-node
nodeset: airship-drydock-single-node-focal
secrets:
- airship_drydock_quay_creds
irrelevant-files:
@ -114,7 +120,7 @@
- '^charts/.*'
vars:
publish: true
distro: ubuntu_xenial
distro: ubuntu_focal
tags:
dynamic:
branch: true
@ -126,7 +132,7 @@
name: airship-drydock-docker-publish-ubuntu_bionic
timeout: 1800
run: tools/gate/playbooks/docker-image-build.yaml
nodeset: airship-drydock-single-node
nodeset: airship-drydock-single-node-focal
secrets:
- airship_drydock_quay_creds
irrelevant-files:

View File

@ -19,7 +19,7 @@ IMAGE_PREFIX ?= airshipit
IMAGE_TAG ?= dev
HELM := $(shell realpath $(BUILD_DIR))/helm
UBUNTU_BASE_IMAGE ?=
DISTRO ?= ubuntu_bionic
DISTRO ?= ubuntu_focal
PROXY ?= http://proxy.foo.com:8000
NO_PROXY ?= localhost,127.0.0.1,.svc.cluster.local
USE_PROXY ?= false
@ -51,14 +51,14 @@ coverage_test: build_drydock
# Run just unit tests
unit_tests: external_dep
tox -re py36 $(TESTS)
tox -re py38 $(TESTS)
# Run just DB integration tests
db_integration_tests: external_dep
tox -re integration $(TESTS)
# Freeze full set of Python requirements
req_freeze:
freeze:
tox -re freeze
# Run the drydock container and exercise simple tests
@ -138,5 +138,5 @@ helm_lint: helm-init
.PHONY: build_baclient build_drydock charts clean coverage_test \
db_integration_tests docs drydock drydock_docs dry-run genconfig \
genpolicy helm-init helm-install helm_lint images lint pep8 \
render_diagrams req_freeze run_drydock run_images security \
render_diagrams freeze run_drydock run_images security \
test_baclient tests unit_tests

View File

@ -32,7 +32,7 @@ and policy file templates to be customized
$ tox -e genpolicy
$ virtualenv -p python3.5 /var/tmp/drydock
$ . /var/tmp/drydock/bin/activate
$ pip install -r requirements-lock.txt
$ pip install -r requirements-frozen.txt
$ pip install .
$ cp -r etc/drydock /etc/drydock

View File

@ -92,10 +92,10 @@ ENV LD_LIBRARY_PATH=/usr/local/lib
COPY --from=baclient_builder /usr/local/lib /usr/local/lib
COPY --from=baclient_builder /usr/local/include/yaml.h /usr/local/include/yaml.h
COPY ./python/requirements-lock.txt /tmp/drydock/
COPY ./python/requirements-frozen.txt /tmp/drydock/
RUN pip3 install \
--no-cache-dir \
-r /tmp/drydock/requirements-lock.txt
-r /tmp/drydock/requirements-frozen.txt
COPY ./python /tmp/drydock/python
WORKDIR /tmp/drydock/python

View File

@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
ARG FROM=ubuntu:16.04
ARG FROM=ubuntu:20.04
FROM ${FROM} AS baclient_builder
ARG UBUNTU_REPO=http://archive.ubuntu.com/ubuntu
@ -24,9 +24,9 @@ ENV LC_ALL C.UTF-8
ENV LANG C.UTF-8
# Copy direct dependency requirements only to build a dependency layer
RUN echo "deb ${UBUNTU_REPO} xenial main restricted universe multiverse" > /etc/apt/sources.list; \
echo "deb ${UBUNTU_REPO} xenial-security main restricted universe multiverse" >> /etc/apt/sources.list; \
echo "deb ${UBUNTU_REPO} xenial-updates main restricted universe multiverse" >> /etc/apt/sources.list; \
RUN echo "deb ${UBUNTU_REPO} focal main restricted universe multiverse" > /etc/apt/sources.list; \
echo "deb ${UBUNTU_REPO} focal-security main restricted universe multiverse" >> /etc/apt/sources.list; \
echo "deb ${UBUNTU_REPO} focal-updates main restricted universe multiverse" >> /etc/apt/sources.list; \
cat /etc/apt/sources.list; \
echo "APT::Get::AllowUnauthenticated ${ALLOW_UNAUTHENTICATED};" >> /etc/apt/apt.conf.d/00-local-mirrors;
@ -74,9 +74,9 @@ ENV LC_ALL C.UTF-8
ENV LANG C.UTF-8
# Copy direct dependency requirements only to build a dependency layer
RUN echo "deb ${UBUNTU_REPO} xenial main restricted universe multiverse" > /etc/apt/sources.list; \
echo "deb ${UBUNTU_REPO} xenial-security main restricted universe multiverse" >> /etc/apt/sources.list; \
echo "deb ${UBUNTU_REPO} xenial-updates main restricted universe multiverse" >> /etc/apt/sources.list; \
RUN echo "deb ${UBUNTU_REPO} focal main restricted universe multiverse" > /etc/apt/sources.list; \
echo "deb ${UBUNTU_REPO} focal-security main restricted universe multiverse" >> /etc/apt/sources.list; \
echo "deb ${UBUNTU_REPO} focal-updates main restricted universe multiverse" >> /etc/apt/sources.list; \
cat /etc/apt/sources.list; \
echo "APT::Get::AllowUnauthenticated ${ALLOW_UNAUTHENTICATED};" >> /etc/apt/apt.conf.d/00-local-mirrors;
@ -92,10 +92,10 @@ ENV LD_LIBRARY_PATH=/usr/local/lib
COPY --from=baclient_builder /usr/local/lib /usr/local/lib
COPY --from=baclient_builder /usr/local/include/yaml.h /usr/local/include/yaml.h
RUN python3 -m pip install -U 'pip<21.0'
COPY ./python/requirements-lock.txt /tmp/drydock/
RUN cat /tmp/drydock/requirements-lock.txt | xargs -d '\n' \
-l1 pip3 -vv install --no-cache-dir
COPY ./python/requirements-frozen.txt /tmp/drydock/
RUN pip3 install \
--no-cache-dir \
-r /tmp/drydock/requirements-frozen.txt
COPY ./python /tmp/drydock/python
WORKDIR /tmp/drydock/python

View File

@ -45,7 +45,7 @@ def start_api(state_manager=None, ingester=None, orchestrator=None):
part input
:param orchestrator: Instance of drydock_provisioner.orchestrator.Orchestrator for managing tasks
"""
control_api = falcon.API(
control_api = falcon.App(
request_type=DrydockRequest,
middleware=[
AuthMiddleware(),

View File

@ -239,7 +239,7 @@ class BootactionUtils(object):
challenges=['Bootaction-Key'])
if ba_ctx['identity_key'] != bytes.fromhex(identity_key):
logger.warn(
logger.warning(
"Forbidding boot action access - node: %s, identity_key: %s, req header: %s"
% (ba_ctx['node_name'], str(ba_ctx['identity_key']),
str(bytes.fromhex(identity_key))))

View File

@ -206,7 +206,7 @@ class PromenadeSession(object):
elif timeout is not None:
raise ValueError("Non integer timeout value")
except ValueError:
self.logger.warn(
self.logger.warning(
"Timeout value must be a tuple of integers or a "
"single integer. Proceeding with values of "
"(%s, %s)", connect_timeout, read_timeout)

View File

@ -633,7 +633,7 @@ class Machines(model_base.ResourceCollectionBase):
node_oob_ip = node_model.get_network_address(node_oob_network)
if node_oob_ip is None:
self.logger.warn("Node model missing OOB IP address")
self.logger.warning("Node model missing OOB IP address")
raise ValueError('Node model missing OOB IP address')
maas_node = self.find_node_with_power_address(node_oob_ip)

View File

@ -204,7 +204,7 @@ class DrydockSession(object):
elif timeout is not None:
raise ValueError("Non integer timeout value")
except ValueError:
self.logger.warn(
self.logger.warning(
"Timeout value must be a tuple of integers or a "
"single integer. Proceeding with values of "
"(%s, %s)", connect_timeout, read_timeout)

View File

@ -96,7 +96,7 @@ class Ingester(object):
status, design_items = self.registered_plugin.ingest_data(
content=design_blob, **kwargs)
except errors.IngesterError as vex:
self.logger.warn(
self.logger.warning(
"Ingester:ingest_data - Unexpected error processing data - %s"
% (str(vex)))
return None, None

View File

@ -409,7 +409,7 @@ class Orchestrator(object):
if not isinstance(node_filter, dict) and not isinstance(
node_filter, objects.NodeFilterSet):
msg = "Invalid node_filter, must be a dictionary with keys 'filter_set_type' and 'filter_set'."
self.logger.error(msg)
self.logger.error(msg, node_filter)
raise errors.OrchestratorError(msg)
result_sets = []

View File

@ -28,7 +28,7 @@ class PlatformSelection(Validators):
try:
node_driver = orchestrator.enabled_drivers['node']
except KeyError:
msg = ("Platform Validation: No enabled node driver, image"
msg = ("Platform Validation: No enabled node driver. Image "
"and kernel selections not validated.")
self.report_warn(
msg, [],
@ -39,7 +39,7 @@ class PlatformSelection(Validators):
try:
valid_images = node_driver.get_available_images()
except Exception:
msg = ("Platform validation: Could not load images from driver, skipping"
msg = ("Platform validation: Could not load images from driver. Skipping "
"image and kernel selection validation.")
self.report_warn(
msg, [],
@ -53,7 +53,7 @@ class PlatformSelection(Validators):
try:
valid_kernels[i] = node_driver.get_available_kernels(i)
except Exception:
msg = ("Platform validation: Could not load kernels from driver, skipping"
msg = ("Platform validation: Could not load kernels from driver. Skipping "
"image and kernel selection validation.")
self.report_warn(
msg, [],

View File

@ -1,29 +1,28 @@
pylibyaml~=0.1
PyYAML~=5.3.1
pyghmi==1.0.18
pylibyaml==0.1.0
PyYAML==5.4.1
pyghmi>=1.0.18
netaddr
falcon
oslo.versionedobjects==1.23.0
oslo.versionedobjects==2.5.0
requests
oauthlib
uwsgi==2.0.17.1
uWSGI==2.0.21
pymongo==3.6.1
oslo.config==7.0.0
click==6.7
PasteDeploy==1.5.2
oslo.config==8.7.1
click==8.1.3
PasteDeploy==3.0.1
PTable==0.9.2
keystonemiddleware==4.9.1
oslo.policy==1.22.1
keystonemiddleware==10.2.0
oslo.policy==4.0.0
iso8601==0.1.11
keystoneauth1==3.18.0
alembic==0.8.2
sqlalchemy==1.2.8
psycopg2-binary==2.8.4
jsonschema==2.6.0
jsonschema>=3.0.1<4
jinja2==2.10
keystoneauth1==5.1.1
alembic==1.7.1
SQLAlchemy==1.4.23
psycopg2-binary==2.9.5
jsonschema==3.2.0
Jinja2==3.1.2
ulid2==0.1.1
defusedxml===0.5.0
libvirt-python==3.10.0
beaker==1.9.1
defusedxml===0.7.1
libvirt-python===7.6.0
Beaker==1.12.0
redfish==2.0.1

View File

@ -0,0 +1,96 @@
alembic==1.7.1
amqp==5.1.1
attrs==22.2.0
bcrypt==4.0.1
Beaker==1.12.0
cachetools==5.3.0
certifi==2022.12.7
cffi==1.15.1
charset-normalizer==3.0.1
click==8.1.3
cryptography==39.0.1
debtcollector==2.5.0
decorator==5.1.1
defusedxml==0.7.1
dnspython==2.3.0
dogpile.cache==1.1.8
eventlet==0.33.3
falcon==3.1.1
fasteners==0.18
fixtures==4.0.1
futurist==2.4.1
greenlet==2.0.2
idna==3.4
importlib-resources==5.12.0
iso8601==0.1.11
Jinja2==3.1.2
jsonpatch==1.32
jsonpath-rw==1.4.0
jsonpointer==2.3
jsonschema==3.2.0
keystoneauth1==5.1.1
keystonemiddleware==10.2.0
kombu==5.2.4
libvirt-python===7.6.0
Mako==1.2.4
MarkupSafe==2.1.2
msgpack==1.0.4
netaddr==0.8.0
netifaces==0.11.0
oauthlib==3.2.2
os-service-types==1.7.0
oslo.cache==3.3.1
oslo.concurrency==5.1.1
oslo.config==8.7.1
oslo.context==5.1.1
oslo.i18n==6.0.0
oslo.log==5.1.0
oslo.messaging==14.2.0
oslo.metrics==0.6.0
oslo.middleware==5.1.1
oslo.policy==4.0.0
oslo.serialization==5.1.1
oslo.service==3.1.1
oslo.utils==6.1.0
oslo.versionedobjects==2.5.0
packaging==23.0
Paste==3.5.2
PasteDeploy==3.0.1
pbr==5.11.1
pip==23.0.1
ply==3.11
prometheus-client==0.16.0
psycopg2-binary==2.9.5
PTable==0.9.2
pycadf==3.1.1
pycparser==2.21
pyghmi==1.5.58
pylibyaml==0.1.0
pymongo==3.6.1
pyparsing==3.0.9
pyrsistent==0.19.3
python-dateutil==2.8.2
python-keystoneclient==5.1.0
pytz==2022.7.1
PyYAML==5.4.1
recordtype==1.4
redfish==2.0.1
repoze.lru==0.7
requests==2.28.2
rfc3986==2.0.0
Routes==2.5.1
setuptools==67.4.0
six==1.16.0
SQLAlchemy==1.4.23
statsd==4.0.1
stevedore==5.0.0
ulid2==0.1.1
urllib3==1.26.14
urlparse2==1.1.1
uWSGI==2.0.21
vine==5.0.0
WebOb==1.8.7
wheel==0.38.4
wrapt==1.15.0
yappi==1.4.0
zipp==3.15.0

View File

@ -1,82 +0,0 @@
alembic==0.8.2
amqp==2.6.0
Babel==2.6.0
Beaker==1.9.1
cachetools==2.1.0
certifi==2018.8.24
chardet==3.0.4
click==6.7
contextlib2==0.5.5
debtcollector==1.20.0
defusedxml==0.5.0
dnspython==1.15.0
eventlet==0.24.1
falcon==1.4.1
fasteners==0.14.1
futurist==1.7.0
greenlet==0.4.15
idna==2.7
iso8601==0.1.11
Jinja2==2.10
jsonschema>=3.0.1<4
keystoneauth1==3.18.0
keystonemiddleware==4.9.1
kombu==4.6.11
libvirt-python==3.10.0
Mako==1.0.7
MarkupSafe~=1.1.1
monotonic==1.5
msgpack==0.5.6
netaddr==0.7.19
netifaces==0.10.7
oauthlib==2.1.0
oslo.concurrency==3.28.0
oslo.config==7.0.0
oslo.context==2.21.0
oslo.i18n==3.22.0
oslo.log==3.45.2
oslo.messaging==8.1.1
oslo.middleware==3.36.0
oslo.policy==1.22.1
oslo.serialization==2.29.2
oslo.service==1.32.0
oslo.utils==3.42.1
oslo.versionedobjects==1.23.0
Paste==2.0.3
PasteDeploy==1.5.2
pbr==5.4.5
pip==18.0
positional==1.2.1
prettytable==0.7.2
psycopg2-binary==2.8.4
PTable==0.9.2
pycadf==2.8.0
pycrypto==2.6.1
pyghmi==1.0.18
pylibyaml==0.1.0
pymongo==3.6.1
pyparsing==2.2.1
python-dateutil==2.8.1
python-editor==1.0.3
python-keystoneclient==3.22.0
python-mimeparse==1.6.0
pytz==2018.5
PyYAML==5.3.1
redfish==2.0.1
repoze.lru==0.7
requests==2.22.0
rfc3986==1.2.0
Routes==2.4.1
setuptools==40.4.3
six==1.15.0
SQLAlchemy==1.2.8
statsd==3.3.0
stevedore==1.29.0
tenacity==5.0.2
ulid2==0.1.1
urllib3==1.25.9
uWSGI==2.0.15
vine==1.1.4
WebOb==1.8.2
wheel==0.31.1
wrapt==1.10.11

View File

@ -1,4 +1,4 @@
pytest-mock==3.1.0
pytest-mock==3.10.0
pytest
pytest-cov
responses
@ -8,6 +8,6 @@ oslo.versionedobjects[fixtures]>=1.23.0
oslo.config[fixtures]
yapf
flake8
bandit>=1.1.0
bandit==1.7.4
sphinx>=1.6.2
sphinx_rtd_theme==0.2.4
sphinx-rtd-theme==1.1.1

View File

@ -18,6 +18,7 @@ import pytest
import json
import logging
import drydock_provisioner
from drydock_provisioner import policy
from drydock_provisioner.control.api import start_api
import drydock_provisioner.objects as objects
@ -37,14 +38,15 @@ class TestNodesApiUnit(object):
url = '/api/v1.0/nodefilter'
hdr = self.get_standard_header()
body = {
'node_filter': 'filters',
'node_filter': None,
'design_ref': design_ref,
}
result = falcontest.simulate_post(
url, headers=hdr, body=json.dumps(body))
LOG.debug(result.text)
# LOG.debug('falcontest result text: %s', result.text)
print('falcontest result text: %s', result.text)
assert result.status == falcon.HTTP_200
assert result.text.count('n1') == 1
assert result.text.count('n2') == 1
@ -93,6 +95,7 @@ def mock_process_node_filter(mocker, deckhand_orchestrator):
n2.site = 'test2'
mock_results = [n1, n2]
with mocker.patch('drydock_provisioner.orchestrator.orchestrator.Orchestrator.process_node_filter',
mocker.MagicMock(return_value=mock_results)):
with mocker.patch.context_manager(drydock_provisioner.orchestrator.orchestrator.Orchestrator,
"process_node_filter",
mocker.MagicMock(return_value=mock_results)):
yield

View File

@ -52,7 +52,6 @@ class TestClientSession(object):
sess = DrydockSession("testdrydock")
result = sess.get('bogus')
assert result.status_code == 200
return True
@responses.activate
def test_get_with_timeout(self):
@ -61,7 +60,6 @@ class TestClientSession(object):
sess = DrydockSession("testdrydock")
result = sess.get('bogus', timeout=(60, 60))
assert result.status_code == 200
return True
post_responses_inp = {
'method': 'POST',
@ -78,7 +76,6 @@ class TestClientSession(object):
sess = DrydockSession("testdrydock")
result = sess.post('bogus')
assert result.status_code == 200
return True
@responses.activate
def test_post_with_timeout(self):
@ -87,7 +84,6 @@ class TestClientSession(object):
sess = DrydockSession("testdrydock")
result = sess.post('bogus', timeout=(60, 60))
assert result.status_code == 200
return True
def test_timeout(self):
"""Tests the _timeout method"""

View File

@ -1,5 +1,5 @@
# These are host packages needed for Drydock
# that don't come on a minimal Ubuntu install
python-tox
tox
docker.io|docker-ce
plantuml

View File

@ -14,6 +14,7 @@ function start_db {
docker run --rm --net host postgres:9.5 psql -h localhost -c "create user drydock with password 'drydock';" postgres postgres
docker run --rm --net host postgres:9.5 psql -h localhost -c "create database drydock;" postgres postgres
docker ps | grep 'psql_integration'
}
function customize_conf {

View File

@ -15,6 +15,7 @@
- hosts: primary
tasks:
- name: Execute the make target for PEP8 linting
make:
chdir: "{{ zuul.project.src_dir }}"

77
tox.ini
View File

@ -1,43 +1,45 @@
[tox]
envlist = py36,pep8,bandit
envlist = py38,pep8,bandit
setupdir=python/
[testenv]
setenv = YAMLDIR = {toxinidir}/python/tests/yaml_samples/
passenv = http_proxy,HTTP_PROXY,https_proxy,HTTPS_PROXY,no_proxy,NO_PROXY
deps=
-r{toxinidir}/python/requirements-lock.txt
-r{toxinidir}/python/requirements-test.txt
passenv =
http_proxy
HTTP_PROXY
https_proxy
HTTPS_PROXY
no_proxy
NO_PROXY
deps = -r{toxinidir}/python/requirements-frozen.txt
-r{toxinidir}/python/requirements-test.txt
[testenv:venv]
basepython=python3
commands = {posargs}
commands =
{posargs}
[testenv:freeze]
basepython=python3
deps = -r{toxinidir}/python/requirements-direct.txt
recreate = True
allowlist_externals=
rm
sh
deps=
-rpython/requirements-direct.txt
allowlist_externals =
sh
grep
commands=
rm python/requirements-lock.txt
sh -c "pip freeze --all | grep -vE 'drydock-provisioner|pyinotify|pkg-resources==0.0.0' > python/requirements-lock.txt"
; rm {toxinidir}/python/requirements-frozen.txt
sh -c "pip freeze --all | grep -vE 'drydock-provisioner|pyinotify|pkg-resources==0.0.0' > python/requirements-frozen.txt"
[testenv:yapf]
basepython=python3
allowlist_externals=find
commands=
allowlist_externals = find
commands =
yapf -i -r --style=pep8 {toxinidir}/python/setup.py
yapf -i -r --style=pep8 {toxinidir}/alembic
yapf -i -r --style=pep8 {toxinidir}/python/drydock_provisioner
yapf -i -r --style=pep8 {toxinidir}/python/tests
find {toxinidir}/python/drydock_provisioner -name '__init__.py' -exec yapf -i --style=pep8 \{\} ;
[testenv:py36]
usedevelop=True
setenv=
[testenv:py38]
usedevelop = True
setenv =
PYTHONWARNING=all
YAMLDIR={toxinidir}/python/tests/yaml_samples/
commands=
@ -46,8 +48,11 @@ commands=
{toxinidir}/python/tests/unit/{posargs}
[testenv:integration]
basepython=python3
passenv=DOCKER_REGISTRY,IMAGE_NAME,IMAGE_PREFIX,IMAGE_TAG
passenv =
DOCKER_REGISTRY
IMAGE_NAME
IMAGE_PREFIX
IMAGE_TAG
setenv=
PYTHONWARNING=all
YAMLDIR={toxinidir}/python/tests/yaml_samples/
@ -57,9 +62,12 @@ commands=
{toxinidir}/python/tests/integration/postgres/{posargs}
[testenv:cover]
basepython=python3
usedevelop=True
passenv=DOCKER_REGISTRY,IMAGE_NAME,IMAGE_PREFIX,IMAGE_TAG
usedevelop = True
passenv =
DOCKER_REGISTRY
IMAGE_NAME
IMAGE_PREFIX
IMAGE_TAG
setenv=
YAMLDIR={toxinidir}/python/tests/yaml_samples/
commands=
@ -68,24 +76,20 @@ commands=
{toxinidir}/python/tests/unit/ {toxinidir}/python/tests/integration/postgres
[testenv:genconfig]
basepython=python3
allowlist_externals=tee
sh
allowlist_externals = tee
sh
commands = sh -c 'oslo-config-generator --config-file=etc/drydock/drydock-config-generator.conf | tee etc/drydock/drydock.conf.sample doc/source/_static/drydock.conf.sample'
[testenv:genpolicy]
basepython=python3
allowlist_externals=tee
sh
allowlist_externals = tee
sh
commands = sh -c 'oslopolicy-sample-generator --config-file etc/drydock/drydock-policy-generator.conf | tee etc/drydock/policy.yaml.sample doc/source/_static/policy.yaml.sample'
[testenv:pep8]
basepython=python3
commands = flake8 \
{posargs}
[testenv:bandit]
basepython=python3
commands = bandit -r drydock_provisioner -n 5
[flake8]
@ -94,10 +98,9 @@ exclude= venv,.venv,.git,.idea,.tox,*.egg-info,*.eggs,bin,dist,./build/,alembic/
max-line-length=119
[testenv:docs]
basepython=python3
deps=
-rdoc/requirements-doc.txt
allowlist_externals=rm
-r{toxinidir}/doc/requirements.txt
allowlist_externals = rm
recreate=true
commands =
rm -rf doc/build