Fix: Armada Exceptions docs rendering on RTD

Readthedocs failed to render Armada exceptions with error:

> WARNING: autodoc: failed to import exception ... from module
> 'armada'; the following exception was raised: No module named 'armada'

and others.

Trying to add Armada requirements to the installed requirements list,
so that Readthedocs has all modules, including those needed for the
Armada itself.

Cosmetic readability changes:
1. combined all Makefile .PHONY targets into one
2. merged multiple LABEL instructions in Dockerfile into one

Change-Id: I3f88fa3abf66e5d6a2f9e57f6f1514a03a0c5a30
This commit is contained in:
Roman Gorshunov 2019-08-26 18:51:03 +02:00
parent 9886cb1a5e
commit 243022d16c
18 changed files with 113 additions and 94 deletions

25
.readthedocs.yaml Normal file
View File

@ -0,0 +1,25 @@
# .readthedocs.yml
# Read the Docs configuration file
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
# Required
version: 2
# Build documentation in the doc/ directory with Sphinx
sphinx:
configuration: doc/source/conf.py
# Build documentation with MkDocs
#mkdocs:
# configuration: mkdocs.yml
# Optionally build your docs in additional formats such as PDF and ePub
formats:
- pdf
# Optionally set the version of Python and requirements required to build your docs
python:
version: 3.7
install:
- requirements: doc/requirements.txt
- requirements: requirements.txt

View File

@ -54,55 +54,43 @@ info:
@echo "Docker Version: ${DOCKER_VERSION}" @echo "Docker Version: ${DOCKER_VERSION}"
@echo "Registry: ${DOCKER_REGISTRY}" @echo "Registry: ${DOCKER_REGISTRY}"
.PHONY: all
all: lint charts images all: lint charts images
.PHONY: build
build: bootstrap build: bootstrap
$(PYTHON) setup.py install $(PYTHON) setup.py install
.PHONY: bootstrap
bootstrap: bootstrap:
pip install -r requirements.txt pip install -r requirements.txt
.PHONY: bootstrap-all
bootstrap-all: bootstrap bootstrap-all: bootstrap
pip install -r test-requirements.txt pip install -r test-requirements.txt
.PHONY: check-docker
check-docker: check-docker:
@if [ -z $$(which docker) ]; then \ @if [ -z $$(which docker) ]; then \
echo "Missing \`docker\` client which is required for development"; \ echo "Missing \`docker\` client which is required for development"; \
exit 2; \ exit 2; \
fi fi
.PHONY: check-tox
check-tox: check-tox:
@if [ -z $$(which tox) ]; then \ @if [ -z $$(which tox) ]; then \
echo "Missing \`tox\` client which is required for development"; \ echo "Missing \`tox\` client which is required for development"; \
exit 2; \ exit 2; \
fi fi
.PHONY: images
images: check-docker build_armada images: check-docker build_armada
.PHONY: docs
docs: clean build_docs docs: clean build_docs
.PHONY: build_docs
build_docs: build_docs:
tox -e docs tox -e docs
.PHONY: run_images
run_images: run_armada run_images: run_armada
.PHONY: run_armada
run_armada: build_armada run_armada: build_armada
./tools/armada_image_run.sh $(IMAGE) ./tools/armada_image_run.sh $(IMAGE)
_BASE_IMAGE_ARG := $(if $(UBUNTU_BASE_IMAGE),--build-arg FROM="${UBUNTU_BASE_IMAGE}" ,) _BASE_IMAGE_ARG := $(if $(UBUNTU_BASE_IMAGE),--build-arg FROM="${UBUNTU_BASE_IMAGE}" ,)
.PHONY: build_armada
build_armada: build_armada:
ifeq ($(USE_PROXY), true) ifeq ($(USE_PROXY), true)
docker build --network host -t $(IMAGE) --label $(LABEL) \ docker build --network host -t $(IMAGE) --label $(LABEL) \
@ -130,11 +118,9 @@ ifeq ($(PUSH_IMAGE), true)
endif endif
# make tools # make tools
.PHONY: protoc
protoc: protoc:
@tools/helm-hapi.sh @tools/helm-hapi.sh
.PHONY: clean
clean: clean:
rm -rf build rm -rf build
rm -rf doc/build rm -rf doc/build
@ -143,79 +129,67 @@ clean:
rm -rf charts/*/charts rm -rf charts/*/charts
# testing checks # testing checks
.PHONY: tests
tests: check-tox tests: check-tox
tox tox
.PHONY: test-all
test-all: check-tox helm_lint test-all: check-tox helm_lint
tox tox
.PHONY: test-unit
test-unit: check-tox test-unit: check-tox
tox -e py35 tox -e py35
.PHONY: test-coverage
test-coverage: check-tox test-coverage: check-tox
tox -e cover tox -e cover
.PHONY: test-bandit
test-bandit: check-tox test-bandit: check-tox
tox -e bandit tox -e bandit
# Perform auto formatting # Perform auto formatting
.PHONY: format
format: format:
tox -e fmt tox -e fmt
# style checks # style checks
.PHONY: lint
lint: test-pep8 helm_lint lint: test-pep8 helm_lint
.PHONY: test-pep8
test-pep8: check-tox test-pep8: check-tox
tox -e pep8 tox -e pep8
chartbanner: chartbanner:
@echo Building charts: $(CHARTS) @echo Building charts: $(CHARTS)
.PHONY: charts
charts: $(CHARTS) charts: $(CHARTS)
@echo Done building charts. @echo Done building charts.
.PHONY: helm-init
helm-init: $(addprefix helm-init-,$(CHARTS)) helm-init: $(addprefix helm-init-,$(CHARTS))
.PHONY: helm-init-%
helm-init-%: helm-serve helm-init-%: helm-serve
@echo Initializing chart $* @echo Initializing chart $*
cd charts;if [ -s $*/requirements.yaml ]; then echo "Initializing $*";$(HELM) dep up $*; fi cd charts;if [ -s $*/requirements.yaml ]; then echo "Initializing $*";$(HELM) dep up $*; fi
.PHONY: helm-serve
helm-serve: helm-install helm-serve: helm-install
./tools/helm_tk.sh $(HELM) $(HELM_PIDFILE) ./tools/helm_tk.sh $(HELM) $(HELM_PIDFILE)
.PHONY: helm-lint
helm-lint: $(addprefix helm-lint-,$(CHARTS)) helm-lint: $(addprefix helm-lint-,$(CHARTS))
.PHONY: helm-lint-%
helm-lint-%: helm-init-% helm-lint-%: helm-init-%
@echo Linting chart $* @echo Linting chart $*
cd charts;$(HELM) lint $* cd charts;$(HELM) lint $*
.PHONY: dry-run
dry-run: clean $(addprefix dry-run-,$(CHARTS)) dry-run: clean $(addprefix dry-run-,$(CHARTS))
.PHONY: dry-run-%
dry-run-%: helm-lint-% dry-run-%: helm-lint-%
echo Running Dry-Run on chart $* echo Running Dry-Run on chart $*
cd charts;$(HELM) template --set pod.resources.enabled=true $* cd charts;$(HELM) template --set pod.resources.enabled=true $*
.PHONY: $(CHARTS)
$(CHARTS): $(addprefix dry-run-,$(CHARTS)) chartbanner $(CHARTS): $(addprefix dry-run-,$(CHARTS)) chartbanner
$(HELM) package -d charts charts/$@ $(HELM) package -d charts charts/$@
# Install helm binary # Install helm binary
.PHONY: helm-install
helm-install: helm-install:
./tools/helm_install.sh $(HELM) ./tools/helm_install.sh $(HELM)
.PHONY: $(CHARTS) all bootstrap bootstrap-all build build_armada \
build_docs charts check-docker check-tox clean docs dry-run \
dry-run-% format helm-init helm-init-% helm-install helm-lint \
helm-lint-% helm-serve images lint protoc run_armada run_images \
test-all test-bandit test-coverage test-pep8 tests test-unit

View File

@ -168,7 +168,7 @@ following additional functionality:
* Role-Based Access Control, allowing Armada to provide authorization around * Role-Based Access Control, allowing Armada to provide authorization around
specific Armada (and by extension) Tiller functionality. specific Armada (and by extension) Tiller functionality.
* `Keystone`_ authentication and project scoping, providing an additional * `Keystone`_ authentication and project scoping, providing an additional
layer of security. layer of security.
Before proceeding, ensure that the steps in :ref:`armada-cli-installation` Before proceeding, ensure that the steps in :ref:`armada-cli-installation`
have been followed. have been followed.

View File

@ -628,7 +628,7 @@ References
~~~~~~~~~~ ~~~~~~~~~~
For working examples please check the examples in our repo For working examples please check the examples in our repo
`here <https://github.com/openstack/airship-armada/tree/master/examples>`__ `here <https://opendev.org/airship/armada/src/branch/master/examples>`__.
.. _builtin chart dependencies: https://helm.sh/docs/developing_charts/#chart-dependencies .. _builtin chart dependencies: https://helm.sh/docs/developing_charts/#chart-dependencies

View File

@ -18,22 +18,24 @@
API Exceptions API Exceptions
-------------- --------------
.. autoexception:: armada.exceptions.api_exceptions.ApiException .. currentmodule:: armada.exceptions.api_exceptions
.. autoexception:: ApiException
:members: :members:
:show-inheritance: :show-inheritance:
:undoc-members: :undoc-members:
.. autoexception:: armada.exceptions.api_exceptions.ClientError .. autoexception:: ClientError
:members: :members:
:show-inheritance: :show-inheritance:
:undoc-members: :undoc-members:
.. autoexception:: armada.exceptions.api_exceptions.ClientForbiddenError .. autoexception:: ClientForbiddenError
:members: :members:
:show-inheritance: :show-inheritance:
:undoc-members: :undoc-members:
.. autoexception:: armada.exceptions.api_exceptions.ClientUnauthorizedError .. autoexception:: ClientUnauthorizedError
:members: :members:
:show-inheritance: :show-inheritance:
:undoc-members: :undoc-members:

View File

@ -17,37 +17,39 @@
Armada Exceptions Armada Exceptions
----------------- -----------------
.. autoexception:: armada.exceptions.armada_exceptions.ArmadaTimeoutException .. currentmodule:: armada.exceptions.armada_exceptions
.. autoexception:: ArmadaTimeoutException
:members: :members:
:show-inheritance: :show-inheritance:
:undoc-members: :undoc-members:
.. autoexception:: armada.exceptions.armada_exceptions.ProtectedReleaseException .. autoexception:: ProtectedReleaseException
:members: :members:
:show-inheritance: :show-inheritance:
:undoc-members: :undoc-members:
.. autoexception:: armada.exceptions.armada_exceptions.InvalidValuesYamlException .. autoexception:: InvalidValuesYamlException
:members: :members:
:show-inheritance: :show-inheritance:
:undoc-members: :undoc-members:
.. autoexception:: armada.exceptions.armada_exceptions.InvalidOverrideValuesYamlException .. autoexception:: InvalidOverrideValuesYamlException
:members: :members:
:show-inheritance: :show-inheritance:
:undoc-members: :undoc-members:
.. autoexception:: armada.exceptions.armada_exceptions.ChartDeployException .. autoexception:: ChartDeployException
:members: :members:
:show-inheritance: :show-inheritance:
:undoc-members: :undoc-members:
.. autoexception:: armada.exceptions.armada_exceptions.WaitException .. autoexception:: WaitException
:members: :members:
:show-inheritance: :show-inheritance:
:undoc-members: :undoc-members:
.. autoexception:: armada.exceptions.armada_exceptions.DeploymentLikelyPendingException .. autoexception:: DeploymentLikelyPendingException
:members: :members:
:show-inheritance: :show-inheritance:
:undoc-members: :undoc-members:

View File

@ -17,7 +17,9 @@
Base Exceptions Base Exceptions
--------------- ---------------
.. autoexception:: armada.exceptions.base_exception.ActionForbidden .. currentmodule:: armada.exceptions.base_exception
.. autoexception:: ActionForbidden
:members: :members:
:show-inheritance: :show-inheritance:
:undoc-members: :undoc-members:

View File

@ -17,27 +17,29 @@
Chartbuilder Exceptions Chartbuilder Exceptions
----------------------- -----------------------
.. autoexception:: armada.exceptions.chartbuilder_exceptions.DependencyException .. currentmodule:: armada.exceptions.chartbuilder_exceptions
.. autoexception:: DependencyException
:members: :members:
:show-inheritance: :show-inheritance:
:undoc-members: :undoc-members:
.. autoexception:: armada.exceptions.chartbuilder_exceptions.FilesLoadException .. autoexception:: FilesLoadException
:members: :members:
:show-inheritance: :show-inheritance:
:undoc-members: :undoc-members:
.. autoexception:: armada.exceptions.chartbuilder_exceptions.HelmChartBuildException .. autoexception:: HelmChartBuildException
:members: :members:
:show-inheritance: :show-inheritance:
:undoc-members: :undoc-members:
.. autoexception:: armada.exceptions.chartbuilder_exceptions.IgnoredFilesLoadException .. autoexception:: IgnoredFilesLoadException
:members: :members:
:show-inheritance: :show-inheritance:
:undoc-members: :undoc-members:
.. autoexception:: armada.exceptions.chartbuilder_exceptions.MetadataLoadException .. autoexception:: MetadataLoadException
:members: :members:
:show-inheritance: :show-inheritance:
:undoc-members: :undoc-members:

View File

@ -17,17 +17,19 @@
Kubernetes Exceptions Kubernetes Exceptions
--------------------- ---------------------
.. autoexception:: armada.exceptions.k8s_exceptions.KubernetesErrorEventException .. currentmodule:: armada.exceptions.k8s_exceptions
.. autoexception:: KubernetesErrorEventException
:members: :members:
:show-inheritance: :show-inheritance:
:undoc-members: :undoc-members:
.. autoexception:: armada.exceptions.k8s_exceptions.KubernetesUnknownStreamingEventTypeException .. autoexception:: KubernetesUnknownStreamingEventTypeException
:members: :members:
:show-inheritance: :show-inheritance:
:undoc-members: :undoc-members:
.. autoexception:: armada.exceptions.k8s_exceptions.KubernetesWatchTimeoutException .. autoexception:: KubernetesWatchTimeoutException
:members: :members:
:show-inheritance: :show-inheritance:
:undoc-members: :undoc-members:

View File

@ -17,7 +17,9 @@
Manifest Exceptions Manifest Exceptions
------------------- -------------------
.. autoexception:: armada.exceptions.manifest_exceptions.ManifestException .. currentmodule:: armada.exceptions.manifest_exceptions
.. autoexception:: ManifestException
:members: :members:
:show-inheritance: :show-inheritance:
:undoc-members: :undoc-members:

View File

@ -17,17 +17,19 @@
Override Exceptions Override Exceptions
------------------- -------------------
.. autoexception:: armada.exceptions.override_exceptions.InvalidOverrideFileException .. currentmodule:: armada.exceptions.override_exceptions
.. autoexception:: InvalidOverrideFileException
:members: :members:
:show-inheritance: :show-inheritance:
:undoc-members: :undoc-members:
.. autoexception:: armada.exceptions.override_exceptions.InvalidOverrideValueException .. autoexception:: InvalidOverrideValueException
:members: :members:
:show-inheritance: :show-inheritance:
:undoc-members: :undoc-members:
.. autoexception:: armada.exceptions.override_exceptions.UnknownDocumentOverrideException .. autoexception:: UnknownDocumentOverrideException
:members: :members:
:show-inheritance: :show-inheritance:
:undoc-members: :undoc-members:

View File

@ -17,27 +17,29 @@
Source Exceptions Source Exceptions
----------------- -----------------
.. autoexception:: armada.exceptions.source_exceptions.ChartSourceException .. currentmodule:: armada.exceptions.source_exceptions
.. autoexception:: ChartSourceException
:members: :members:
:show-inheritance: :show-inheritance:
:undoc-members: :undoc-members:
.. autoexception:: armada.exceptions.source_exceptions.GitException .. autoexception:: GitException
:members: :members:
:show-inheritance: :show-inheritance:
:undoc-members: :undoc-members:
.. autoexception:: armada.exceptions.source_exceptions.InvalidPathException .. autoexception:: InvalidPathException
:members: :members:
:show-inheritance: :show-inheritance:
:undoc-members: :undoc-members:
.. autoexception:: armada.exceptions.source_exceptions.TarballDownloadException .. autoexception:: TarballDownloadException
:members: :members:
:show-inheritance: :show-inheritance:
:undoc-members: :undoc-members:
.. autoexception:: armada.exceptions.source_exceptions.TarballExtractException .. autoexception:: TarballExtractException
:members: :members:
:show-inheritance: :show-inheritance:
:undoc-members: :undoc-members:

View File

@ -17,32 +17,34 @@
Tiller Exceptions Tiller Exceptions
----------------- -----------------
.. autoexception:: armada.exceptions.tiller_exceptions.ChannelException .. currentmodule:: armada.exceptions.tiller_exceptions
.. autoexception:: ChannelException
:members: :members:
:show-inheritance: :show-inheritance:
:undoc-members: :undoc-members:
.. autoexception:: armada.exceptions.tiller_exceptions.GetReleaseStatusException .. autoexception:: GetReleaseStatusException
:members: :members:
:show-inheritance: :show-inheritance:
:undoc-members: :undoc-members:
.. autoexception:: armada.exceptions.tiller_exceptions.PostUpdateJobCreateException .. autoexception:: PostUpdateJobCreateException
:members: :members:
:show-inheritance: :show-inheritance:
:undoc-members: :undoc-members:
.. autoexception:: armada.exceptions.tiller_exceptions.PreUpdateJobDeleteException .. autoexception:: PreUpdateJobDeleteException
:members: :members:
:show-inheritance: :show-inheritance:
:undoc-members: :undoc-members:
.. autoexception:: armada.exceptions.tiller_exceptions.ReleaseException .. autoexception:: ReleaseException
:members: :members:
:show-inheritance: :show-inheritance:
:undoc-members: :undoc-members:
.. autoexception:: armada.exceptions.tiller_exceptions.TillerListReleasesPagingException .. autoexception:: TillerListReleasesPagingException
:members: :members:
:show-inheritance: :show-inheritance:
:undoc-members: :undoc-members:

View File

@ -17,22 +17,24 @@
Lint (Validate) Exceptions Lint (Validate) Exceptions
-------------------------- --------------------------
.. autoexception:: armada.exceptions.validate_exceptions.InvalidManifestException .. currentmodule:: armada.exceptions.validate_exceptions
.. autoexception:: InvalidManifestException
:members: :members:
:show-inheritance: :show-inheritance:
:undoc-members: :undoc-members:
.. autoexception:: armada.exceptions.validate_exceptions.InvalidChartDefinitionException .. autoexception:: InvalidChartDefinitionException
:members: :members:
:show-inheritance: :show-inheritance:
:undoc-members: :undoc-members:
.. autoexception:: armada.exceptions.validate_exceptions.InvalidReleaseException .. autoexception:: InvalidReleaseException
:members: :members:
:show-inheritance: :show-inheritance:
:undoc-members: :undoc-members:
.. autoexception:: armada.exceptions.validate_exceptions.InvalidArmadaObjectException .. autoexception:: InvalidArmadaObjectException
:members: :members:
:show-inheritance: :show-inheritance:
:undoc-members: :undoc-members:

View File

@ -244,7 +244,7 @@ like openstack-keystone.
.. note:: .. note::
The bearer token option is available for the following commands The bearer token option is available for the following commands
armada apply armada apply,
armada delete armada delete,
armada tiller armada tiller,
armada rollback armada rollback

View File

@ -1,12 +1,12 @@
ARG FROM=opensuse/leap:15.1 ARG FROM=opensuse/leap:15.1
FROM ${FROM} FROM ${FROM}
LABEL org.opencontainers.image.authors='airship-discuss@lists.airshipit.org, irc://#airshipit@freenode' LABEL org.opencontainers.image.authors='airship-discuss@lists.airshipit.org, irc://#airshipit@freenode' \
LABEL org.opencontainers.image.url='https://airshipit.org' org.opencontainers.image.url='https://airshipit.org' \
LABEL org.opencontainers.image.documentation='https://airship-armada.readthedocs.org' org.opencontainers.image.documentation='https://airship-armada.readthedocs.org' \
LABEL org.opencontainers.image.source='https://opendev.org/airship/armada' org.opencontainers.image.source='https://opendev.org/airship/armada' \
LABEL org.opencontainers.image.vendor='The Airship Authors' org.opencontainers.image.vendor='The Airship Authors' \
LABEL org.opencontainers.image.licenses='Apache-2.0' org.opencontainers.image.licenses='Apache-2.0'
ENV LANG=C.UTF-8 ENV LANG=C.UTF-8
ENV LC_ALL=C.UTF-8 ENV LC_ALL=C.UTF-8

View File

@ -1,12 +1,12 @@
ARG FROM=ubuntu:18.04 ARG FROM=ubuntu:18.04
FROM ${FROM} FROM ${FROM}
LABEL org.opencontainers.image.authors='airship-discuss@lists.airshipit.org, irc://#airshipit@freenode' LABEL org.opencontainers.image.authors='airship-discuss@lists.airshipit.org, irc://#airshipit@freenode' \
LABEL org.opencontainers.image.url='https://airshipit.org' org.opencontainers.image.url='https://airshipit.org' \
LABEL org.opencontainers.image.documentation='https://airship-armada.readthedocs.org' org.opencontainers.image.documentation='https://airship-armada.readthedocs.org' \
LABEL org.opencontainers.image.source='https://opendev.org/airship/armada' org.opencontainers.image.source='https://opendev.org/airship/armada' \
LABEL org.opencontainers.image.vendor='The Airship Authors' org.opencontainers.image.vendor='The Airship Authors' \
LABEL org.opencontainers.image.licenses='Apache-2.0' org.opencontainers.image.licenses='Apache-2.0'
ENV DEBIAN_FRONTEND noninteractive ENV DEBIAN_FRONTEND noninteractive
ENV LANG=C.UTF-8 ENV LANG=C.UTF-8

View File

@ -1,12 +1,12 @@
ARG FROM=ubuntu:16.04 ARG FROM=ubuntu:16.04
FROM ${FROM} FROM ${FROM}
LABEL org.opencontainers.image.authors='airship-discuss@lists.airshipit.org, irc://#airshipit@freenode' LABEL org.opencontainers.image.authors='airship-discuss@lists.airshipit.org, irc://#airshipit@freenode' \
LABEL org.opencontainers.image.url='https://airshipit.org' org.opencontainers.image.url='https://airshipit.org' \
LABEL org.opencontainers.image.documentation='https://airship-armada.readthedocs.org' org.opencontainers.image.documentation='https://airship-armada.readthedocs.org' \
LABEL org.opencontainers.image.source='https://opendev.org/airship/armada' org.opencontainers.image.source='https://opendev.org/airship/armada' \
LABEL org.opencontainers.image.vendor='The Airship Authors' org.opencontainers.image.vendor='The Airship Authors' \
LABEL org.opencontainers.image.licenses='Apache-2.0' org.opencontainers.image.licenses='Apache-2.0'
ENV DEBIAN_FRONTEND noninteractive ENV DEBIAN_FRONTEND noninteractive
ENV LANG=C.UTF-8 ENV LANG=C.UTF-8