Skip to content

Commit

Permalink
Merge pull request #108 from jrbalderrama/73
Browse files Browse the repository at this point in the history
fix #73
  • Loading branch information
jrbalderrama committed Apr 6, 2018
2 parents de5d5a2 + f95f477 commit 9204476
Show file tree
Hide file tree
Showing 99 changed files with 101 additions and 616 deletions.
16 changes: 0 additions & 16 deletions main.py

This file was deleted.

Empty file added orchestrator/__init__.py
Empty file.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions campaign.py → orchestrator/campaign.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from enoslib.errors import EnosError
from execo_engine import sweep, ParamSweeper, HashableDict

import tasks as t
import orchestrator.tasks as t


def filter_1(parameters):
Expand Down Expand Up @@ -198,7 +198,7 @@ def campaign(test, provider, force, config, env):
print(error, file=sys.stderr)
print(error.args, file=sys.stderr)
finally:
#t.destroy()
t.destroy()
current_parameters = sweeper.get_next(TEST_CASES[test]['filtr'])


Expand Down
50 changes: 7 additions & 43 deletions cli.py → orchestrator/cli.py
Original file line number Diff line number Diff line change
@@ -1,47 +1,15 @@
#!/usr/bin/env python

import logging
from os import path

import click
import yaml

import campaign as c
import tasks as t
import orchestrator.campaign as c
import orchestrator.tasks as t
from orchestrator.constants import TIMEOUT, PAUSE, NBR_CALLS, EXECUTOR, \
LENGTH, ITERATION_PAUSE, CONF, BACKUP_DIR, NBR_CLIENTS, NBR_SERVERS, \
CALL_TYPE, VERSION, NBR_TOPICS, DRIVER_NAME

logging.basicConfig(level=logging.DEBUG)

# default app configuration
CONF = path.join(
path.dirname(
path.realpath(__file__)), "conf.yaml")
# default driver type
DRIVER = "rabbitmq"
# default number of clients
NBR_CLIENTS = 1
# default number of servers
NBR_SERVERS = 1
# default number topics
NBR_TOPICS = 1
# default call type
CALL_TYPE = "rpc-call"
# default number of calls
NBR_CALLS = 100
# default pause between calls
PAUSE = 0.0
# default timeout
TIMEOUT = 60
# default version of ombt container
VERSION = "msimonin/ombt:singleton"
# default backup directory name
BACKUP_DIR = "backup"
# default length of messages
LENGTH = 1024
# default type of ombt executor
EXECUTOR = "threading"
# default pause between iterations (seconds)
ITERATION_PAUSE = 1.0


def load_config(file_path):
"""
Expand All @@ -62,7 +30,7 @@ def cli():
@cli.command(help="Claim resources from a PROVIDER and configure them.")
@click.argument("provider")
@click.option("--driver",
default=DRIVER,
default=DRIVER_NAME,
help="communication bus driver")
@click.option("--constraints",
help="network constraints")
Expand Down Expand Up @@ -131,7 +99,7 @@ def inventory(env):
# TODO declare in the doc that driver and TC are configured on the yaml file
@cli.command(help="Configure available resources [after deploy, inventory or destroy].")
@click.option("--driver",
default=DRIVER,
default=DRIVER_NAME,
help="communication bus driver")
@click.option("--env",
help="alternative environment directory")
Expand Down Expand Up @@ -385,7 +353,3 @@ def campaign(test, provider, force, incremental, pause, conf, env):
force=force,
config=config,
env=env)


if __name__ == "__main__":
cli()
37 changes: 37 additions & 0 deletions orchestrator/constants.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import os

OO_PATH = os.path.abspath(os.path.dirname(os.path.realpath(__file__)))

ANSIBLE_DIR = os.path.join(OO_PATH, "ansible")
# default app configuration
CONF = os.path.join(os.getcwd(), "conf.yaml")
# default driver type
DRIVER_NAME = "broker"
# default number of clients
NBR_CLIENTS = 1
# default number of servers
NBR_SERVERS = 1
# default number topics
NBR_TOPICS = 1
# default call type
CALL_TYPE = "rpc-call"
# default number of calls
NBR_CALLS = 100
# default pause between calls
PAUSE = 0.0
# default timeout
TIMEOUT = 60
# default version of ombt container
VERSION = "msimonin/ombt:singleton"
# default backup directory name
BACKUP_DIR = "backup"
# default length of messages
LENGTH = 1024
# default type of ombt executor
EXECUTOR = "threading"
# default pause between iterations (seconds)
ITERATION_PAUSE = 1.0

DRIVER = {'type': 'rabbitmq',
'mode': 'standalone'}

File renamed without changes.
18 changes: 9 additions & 9 deletions tasks.py → orchestrator/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
from enoslib.infra.enos_vagrant.provider import Enos_vagrant
from enoslib.task import enostask

from cli import DRIVER, BACKUP_DIR
from qpid_dispatchgen import get_conf, generate, round_robin
from orchestrator.constants import BACKUP_DIR, ANSIBLE_DIR, DRIVER
from orchestrator.qpid_dispatchgen import get_conf, generate, round_robin

if sys.version_info[0] < 3:
import pathlib2 as pathlib
Expand Down Expand Up @@ -412,7 +412,7 @@ def prepare(**kwargs):
env = kwargs["env"]
driver = kwargs["driver"]
# Generate inventory
config = env['config']['drivers'].get(driver, {'type': DRIVER})
config = env['config']['drivers'].get(driver, DRIVER)
extra_vars = {
"registry": env["config"]["registry"],
"broker": config["type"]
Expand All @@ -427,7 +427,7 @@ def prepare(**kwargs):
ansible_bus_conf = generate_ansible_conf("bus_conf", bus_conf, config)

# NOTE(msimonin): still hardcoding the control_bus configuration for now
control_config = {'type': DRIVER, 'mode': 'standalone'}
control_config = DRIVER
control_bus_conf = generate_bus_conf(control_config, env["roles"]["control-bus"], context="control-bus")
env["control_bus_conf"] = control_bus_conf
ansible_control_bus_conf = generate_ansible_conf("control_bus_conf", control_bus_conf, config)
Expand All @@ -436,7 +436,7 @@ def prepare(**kwargs):
extra_vars.update(ansible_bus_conf)
extra_vars.update(ansible_control_bus_conf)

run_ansible(["ansible/site.yml"], env["inventory"], extra_vars=extra_vars)
run_ansible([path.join(ANSIBLE_DIR, "site.yml")], env["inventory"], extra_vars=extra_vars)
env["broker"] = config['type']


Expand Down Expand Up @@ -681,7 +681,7 @@ def serialize_ombt_confs(_ombt_confs):
"ombt_confs": serialize_ombt_confs(ombt_confs)
}

run_ansible(["ansible/test_case_1.yml"], env["inventory"], extra_vars=extra_vars)
run_ansible([path.join(ANSIBLE_DIR, "test_case.yml")], env["inventory"], extra_vars=extra_vars)


@enostask()
Expand Down Expand Up @@ -727,7 +727,7 @@ def backup(**kwargs):
extra_vars.update(ansible_bus_conf)
extra_vars.update(ansible_control_bus_conf)

run_ansible(["ansible/site.yml"], env["inventory"], extra_vars=extra_vars)
run_ansible([path.join(ANSIBLE_DIR, "site.yml")], env["inventory"], extra_vars=extra_vars)


@enostask()
Expand All @@ -746,5 +746,5 @@ def destroy(**kwargs):
extra_vars.update(ansible_bus_conf)
extra_vars.update(ansible_control_bus_conf)

run_ansible(["ansible/site.yml"], env["inventory"], extra_vars=extra_vars)
run_ansible(["ansible/ombt.yml"], env["inventory"], extra_vars=extra_vars)
run_ansible([path.join(ANSIBLE_DIR, "site.yml")], env["inventory"], extra_vars=extra_vars)
run_ansible([path.join(ANSIBLE_DIR, "ombt.yml")], env["inventory"], extra_vars=extra_vars)
6 changes: 0 additions & 6 deletions requirements.txt

This file was deleted.

43 changes: 43 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
[metadata]
name = ombt-orchestrator
version = 1.0.0
description = Oslo messaging benchmarking orchestrator
keywords = benchmark, oslo messaging, RPC
license = GPL-3.0
url = https://github.com/msimonin/ombt-orchestrator/
author = Matthieu Simonin
author_email = [email protected]
long_description = file: README.md
project_urls =
Bug Reports = https://github.com/msimonin/ombt-orchestrator/issues
Source = https://github.com/msimonin/ombt-orchestrator/
classifier =
Development Status :: 3 - Alpha
Environment :: Console
Intended Audience :: Developers
Intended Audience :: Information Technology
Intended Audience :: Science/Research
Topic :: Scientific/Engineering
Topic :: Software Development :: Libraries :: Application Frameworks
Topic :: System :: Networking
License :: OSI Approved :: GNU General Public License v3 (GPLv3)
Operating System :: POSIX :: Linux
Programming Language :: Python :: 2.7

[options]
include_package_data = True
packages = find:
install_requires =
PyYAML
pathlib2; python_version<"3"
networkx==2.1
click>=6.7,<7
enoslib>=1.0.0

[options.packages.find]
exclude =
notebooks

[options.entry_points]
console_scripts =
oo = orchestrator.cli:cli
3 changes: 3 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from setuptools import setup

setup()
1 change: 0 additions & 1 deletion vagrant/openstack/.gitignore

This file was deleted.

1 change: 0 additions & 1 deletion vagrant/openstack/.python-version

This file was deleted.

1 change: 0 additions & 1 deletion vagrant/openstack/README.md

This file was deleted.

63 changes: 0 additions & 63 deletions vagrant/openstack/Vagrantfile

This file was deleted.

4 changes: 0 additions & 4 deletions vagrant/openstack/configs_vbox/global.conf

This file was deleted.

3 changes: 0 additions & 3 deletions vagrant/openstack/configs_vbox/nova/nova-compute.conf

This file was deleted.

Loading

0 comments on commit 9204476

Please sign in to comment.