Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ releasenotes/build

# CloudMon specifics
**/artifacts
.cloudmon_artifact
ansible/env
config.yaml
git_repos
Expand Down
1 change: 0 additions & 1 deletion ansible/inventory/group_vars/all.yaml

This file was deleted.

11 changes: 0 additions & 11 deletions ansible/inventory/hosts

This file was deleted.

2 changes: 0 additions & 2 deletions ansible/inventory_quickstart/group_vars/all.yml

This file was deleted.

31 changes: 0 additions & 31 deletions ansible/inventory_quickstart/hosts

This file was deleted.

18 changes: 0 additions & 18 deletions cloudmon/__init__.py
Original file line number Diff line number Diff line change
@@ -1,18 +0,0 @@
# -*- coding: utf-8 -*-

# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.

import pbr.version


__version__ = pbr.version.VersionInfo("cloudmon").version_string()
File renamed without changes.
6 changes: 6 additions & 0 deletions cloudmon/plugin/apimon.py
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,7 @@ def provision_schedulers(self, check):

r = ansible_runner.run(
private_data_dir=self.config.private_data_dir,
artifact_dir=".cloudmon_artifact",
playbook="install_scheduler.yaml",
inventory=self.config.inventory_path,
extravars=extravars,
Expand Down Expand Up @@ -306,6 +307,7 @@ def provision_executors(self, check):

r = ansible_runner.run(
private_data_dir=self.config.private_data_dir,
artifact_dir=".cloudmon_artifact",
playbook="install_executor.yaml",
inventory=self.config.inventory_path,
extravars=extravars,
Expand Down Expand Up @@ -345,6 +347,7 @@ def stop_schedulers(self, apimon_config, check):
)
r = ansible_runner.run(
private_data_dir=self.config.private_data_dir,
artifact_dir=".cloudmon_artifact",
playbook="stop_schedulers.yaml",
inventory=self.config.inventory_path,
extravars=extravars,
Expand All @@ -364,6 +367,7 @@ def stop_executors(self, apimon_config, check):
)
r = ansible_runner.run(
private_data_dir=self.config.private_data_dir,
artifact_dir=".cloudmon_artifact",
playbook="stop_executors.yaml",
inventory=self.config.inventory_path,
extravars=extravars,
Expand All @@ -383,6 +387,7 @@ def start_schedulers(self, apimon_config, check):
)
r = ansible_runner.run(
private_data_dir=self.config.private_data_dir,
artifact_dir=".cloudmon_artifact",
playbook="start_schedulers.yaml",
inventory=self.config.inventory_path,
extravars=extravars,
Expand All @@ -402,6 +407,7 @@ def start_executors(self, apimon_config, check):
)
r = ansible_runner.run(
private_data_dir=self.config.private_data_dir,
artifact_dir=".cloudmon_artifact",
playbook="start_executors.yaml",
inventory=self.config.inventory_path,
extravars=extravars,
Expand Down
3 changes: 3 additions & 0 deletions cloudmon/plugin/epmon.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ def provision(self, check):
)
r = ansible_runner.run(
private_data_dir=self.config.private_data_dir,
artifact_dir=".cloudmon_artifact",
playbook="install_epmon.yaml",
inventory=self.config.inventory_path,
extravars=extravars,
Expand All @@ -178,6 +179,7 @@ def stop(self, check=False):
)
r = ansible_runner.run(
private_data_dir=self.config.private_data_dir,
artifact_dir=".cloudmon_artifact",
playbook="stop_epmon.yaml",
inventory=self.config.inventory_path,
extravars=extravars,
Expand All @@ -198,6 +200,7 @@ def start(self, check=False):
)
r = ansible_runner.run(
private_data_dir=self.config.private_data_dir,
artifact_dir=".cloudmon_artifact",
playbook="start_epmon.yaml",
inventory=self.config.inventory_path,
extravars=extravars,
Expand Down
9 changes: 8 additions & 1 deletion cloudmon/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@
# limitations under the License.

import argparse
import importlib.resources
import logging
import pathlib
import sys

import ansible_runner
Expand Down Expand Up @@ -218,7 +220,9 @@ def create_parser(self):
parser.add_argument(
"--private-data-dir",
dest="private_data_dir",
default="ansible",
default=pathlib.Path(
importlib.resources.files("cloudmon"),
"ansible"),
help="Ansible-runner project dir",
)
parser.add_argument(
Expand Down Expand Up @@ -264,6 +268,9 @@ def main(self):
with open(self.args.config, "r") as f:
self.config = yaml.load(f)

self.args.inventory = pathlib.Path(
self.args.inventory).resolve().as_posix()

out, err = ansible_runner.get_inventory(
action="list",
inventories=[self.args.inventory],
Expand Down
1 change: 1 addition & 0 deletions cloudmon/service/grafana.py
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,7 @@ def provision(self, config, check):

r = ansible_runner.run(
private_data_dir=config.private_data_dir,
artifact_dir=".cloudmon_artifact",
playbook="install_grafana.yaml",
inventory=config.inventory_path,
extravars=extravars,
Expand Down
2 changes: 2 additions & 0 deletions cloudmon/service/sqldb.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ def provision(self, check):
)
r = ansible_runner.run(
private_data_dir=self.config.private_data_dir,
artifact_dir=".cloudmon_artifact",
playbook="install_postgresql.yaml",
inventory=self.config.inventory_path,
extravars=extravars,
Expand All @@ -56,6 +57,7 @@ def provision(self, check):

r = ansible_runner.run(
private_data_dir=self.config.private_data_dir,
artifact_dir=".cloudmon_artifact",
playbook="manage_databases.yaml",
inventory=self.config.inventory_path,
extravars=extravars,
Expand Down
1 change: 1 addition & 0 deletions cloudmon/service/statsd.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ def provision(self, check):
)
r = ansible_runner.run(
private_data_dir=self.config.private_data_dir,
artifact_dir=".cloudmon_artifact",
playbook="install_statsd.yaml",
inventory=self.config.inventory_path,
extravars=extravars,
Expand Down
1 change: 1 addition & 0 deletions cloudmon/service/tsdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ def provision(self, check):
)
r = ansible_runner.run(
private_data_dir=self.config.private_data_dir,
artifact_dir=".cloudmon_artifact",
playbook="install_graphite.yaml",
inventory=self.config.inventory_path,
extravars=extravars,
Expand Down
16 changes: 16 additions & 0 deletions cloudmon/version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.


import pbr.version

__version__ = pbr.version.VersionInfo('stackmon').version_string()
13 changes: 9 additions & 4 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
[metadata]
name = cloudmon
name = stackmon
summary = CloudMon controller
description-file =
description_file =
README.rst
author = Open Telekom Cloud
home-page = https://open.telekom.cloud/
python-requires = >=3.6
home_page = https://open.telekom.cloud/
python_requires = >=3.6
classifier =
Environment :: OpenStack
Intended Audience :: Information Technology
Expand All @@ -20,9 +20,14 @@ classifier =
Programming Language :: Python :: 3 :: Only
Programming Language :: Python :: Implementation :: CPython

[pbr]
warnerrors = True

[files]
packages =
cloudmon
package-data =
cloudmon = ansible/**/*.yaml

[entry_points]
console_scripts =
Expand Down
3 changes: 0 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# Copyright (c) 2013 Hewlett-Packard Development Company, L.P.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
Expand All @@ -13,7 +11,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.

# THIS FILE IS MANAGED BY THE GLOBAL REQUIREMENTS REPO - DO NOT EDIT
import setuptools

setuptools.setup(
Expand Down
17 changes: 1 addition & 16 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
[tox]
minversion = 3.2.0
minversion = 3.6.0
envlist = py39,pep8
skipsdist = True
ignore_basepython_conflict = true


[testenv]
basepython = python3
usedevelop = True
Expand All @@ -25,16 +24,6 @@ commands = flake8 {posargs}
[testenv:venv]
commands = {posargs}

[testenv:cover]
setenv =
VIRTUAL_ENV={envdir}
PYTHON=coverage run --source cloudmon --parallel-mode
commands =
stestr run {posargs}
coverage combine
coverage html -d cover
coverage xml -o cover/coverage.xml

[testenv:docs]
deps = -r{toxinidir}/doc/requirements.txt
commands = sphinx-build -W -b html doc/source doc/build/html
Expand All @@ -44,12 +33,8 @@ deps = {[testenv:docs]deps}
commands =
sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html

[testenv:debug]
commands = oslo_debug_helper {posargs}

[flake8]
# E123, E125 skipped as they are invalid PEP-8.

show-source = True
ignore = E123,E125,W503,H101
builtins = _
Expand Down