Remove rally-jobs/startup scripts/config in kuryr

These code should be in kuryr-libnetwork/kuryr-k8s now.

Partially Implements blueprint code-refactoring

Change-Id: If9779fb3369651781e7913e7d4b8472043409bff
This commit is contained in:
Liping Mao 2016-07-23 09:56:37 +08:00
parent 4287cf791b
commit 3dae373837
13 changed files with 0 additions and 342 deletions

View File

@ -1,14 +0,0 @@
description "Kuryr libnetwork driver"
author "Antoni Segura Puimedon <toni@kuryr.org>"
start on (net-device-up
and local-filesystems
and runlevel [2345])
stop on runlevel [016]
respawn
respawn limit 10 5
script
exec start-stop-daemon --start --exec /usr/bin/kuryr-server -- --config-file /etc/kuryr/kuryr.conf
end script

View File

@ -1,31 +0,0 @@
Rally job related files
=======================
This directory contains rally tasks and plugins that are run by OpenStack CI.
Structure
---------
* plugins - directory where you can add rally plugins. Almost everything in
Rally is a plugin. Benchmark context, Benchmark scenario, SLA checks, Generic
cleanup resources, ....
* extra - all files from this directory will be copy pasted to gates, so you
are able to use absolute paths in rally tasks.
Files will be located in ~/.rally/extra/*
* kuryr.yaml is a task that is run in gates against OpenStack with
Kuryr and Neutron deployed
Useful links
------------
* More about Rally: https://rally.readthedocs.org/en/latest/
* Rally release notes: https://rally.readthedocs.org/en/latest/release_notes.html
* How to add rally-gates: https://rally.readthedocs.org/en/latest/gates.html
* About plugins: https://rally.readthedocs.org/en/latest/plugins.html
* Plugin samples: https://github.com/openstack/rally/tree/master/samples/plugins

View File

@ -1,6 +0,0 @@
Extra files
===========
All files from this directory will be copy pasted to gates, so you are able to
use absolute path in rally tasks. Files will be in ~/.rally/extra/*

View File

@ -1,34 +0,0 @@
---
Kuryr.list_networks:
-
runner:
type: "constant"
times: 40
concurrency: 20
context:
users:
tenants: 2
users_per_tenant: 2
quotas:
neutron:
network: -1
sla:
failure_rate:
max: 0
Kuryr.create_and_delete_networks:
-
runner:
type: "constant"
times: 10
concurrency: 4
context:
users:
tenants: 2
users_per_tenant: 2
quotas:
neutron:
network: -1
sla:
failure_rate:
max: 0

View File

@ -1,9 +0,0 @@
Rally plugins
=============
All *.py modules from this directory will be auto-loaded by Rally and all
plugins will be discoverable. There is no need of any extra configuration
and there is no difference between writing them here and in rally code base.
Note that it is better to push all interesting and useful benchmarks to Rally
code base, this simplifies administration for Operators.

View File

@ -1,52 +0,0 @@
# Copyright 2016: IBM Inc.
# All Rights Reserved.
#
# 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 utils
from rally.plugins.openstack import scenario
from rally.task import validation
class Kuryr(utils.KuryrScenario):
"""Benchmark scenarios for Kuryr."""
@validation.required_openstack(users=True)
@scenario.configure(context={"cleanup": ["kuryr"]})
def list_networks(self, network_list_args=None):
"""List the networks.
Measure the "docker network ls" command performance under kuryr.
This will call the docker client API to list networks
TODO (baohua):
1. may support tenant/user in future.
2. validation.required_services add KURYR support
:param network_list_args: dict: names, ids
"""
self._list_networks(network_list_args or {})
@scenario.configure(context={"cleanup": ["kuryr"]})
def create_and_delete_networks(self, network_create_args=None):
"""Create and delete a network.
Measure the "docker network create" and "docker network rm" command
performance.
:param network_create_args: dict as options to create the network
"""
network = self._create_network(network_create_args or {})
self._delete_network(network)

View File

@ -1,62 +0,0 @@
# Copyright 2016: IBM Inc.
# All Rights Reserved.
#
# 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 docker
from rally.common import logging
from rally.plugins.openstack import scenario
from rally.task import atomic
LOG = logging.getLogger(__name__)
class KuryrScenario(scenario.OpenStackScenario):
"""Base class for Kuryr scenarios with basic atomic actions."""
def __init__(self, context=None, admin_clients=None, clients=None):
super(KuryrScenario, self).__init__(context, admin_clients, clients)
self.docker_client = docker.Client(base_url='tcp://0.0.0.0:2375')
@atomic.action_timer("kuryr.list_networks")
def _list_networks(self, network_list_args):
"""Return user networks list.
:param network_list_args: network list options
"""
LOG.debug("Running the list_networks scenario")
names = network_list_args.get('names')
ids = network_list_args.get('ids')
return self.docker_client.networks(names, ids)
@atomic.action_timer("kuryr.create_network")
def _create_network(self, network_create_args):
"""Create Kuryr network.
:param network_create_args: dict: name, driver and others
:returns: dict of the created network reference object
"""
name = self.generate_random_name()
return self.docker_client.create_network(name=name,
driver='kuryr',
options=network_create_args
)
@atomic.action_timer("kuryr.delete_network")
def _delete_network(self, network):
"""Delete Kuryr network.
:param network: Network object
"""
self.docker_client.remove_network(network['Id'])

View File

@ -1,28 +0,0 @@
{
"Kuryr.create_and_delete_networks": [
{
"runner": {
"type": "constant",
"concurrency": 2,
"times": 4
},
"args": {
"network_create_args": {}
},
"context": {
"users": {
"project_domain": "default",
"users_per_tenant": 3,
"tenants": 3,
"resource_management_workers": 10,
"user_domain": "default"
},
"quotas": {
"neutron": {
"network": -1
}
}
}
}
]
}

View File

@ -1,28 +0,0 @@
{
"Kuryr.list_networks": [
{
"runner": {
"type": "constant",
"concurrency": 10,
"times": 100
},
"args": {
"network_list_args": {}
},
"context": {
"users": {
"project_domain": "default",
"users_per_tenant": 3,
"tenants": 3,
"resource_management_workers": 10,
"user_domain": "default"
},
"quotas": {
"neutron": {
"network": -1
}
}
}
}
]
}

View File

@ -1,61 +0,0 @@
#!/usr/bin/env bash
#
# 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.
KURYR_HOME=${KURYR_HOME:-.}
KURYR_JSON_FILENAME=kuryr.json
KURYR_DEFAULT_JSON=${KURYR_HOME}/etc/${KURYR_JSON_FILENAME}
# See libnetwork's plugin discovery mechanism:
# https://github.com/docker/docker/blob/c4d45b6a29a91f2fb5d7a51ac36572f2a9b295c6/docs/extend/plugin_api.md#plugin-discovery
KURYR_JSON_DIR=${KURYR_JSON_DIR:-/usr/lib/docker/plugins/kuryr}
KURYR_JSON=${KURYR_JSON_DIR}/${KURYR_JSON_FILENAME}
KURYR_CONFIG_FILENAME=kuryr.conf
KURYR_DEFAULT_CONFIG=${KURYR_HOME}/etc/${KURYR_CONFIG_FILENAME}
KURYR_CONFIG_DIR=${KURYR_CONFIG_DIR:-/etc/kuryr}
KURYR_CONFIG=${KURYR_CONFIG_DIR}/${KURYR_CONFIG_FILENAME}
if [[ ! -d "${KURYR_JSON_DIR}" ]]; then
echo -n "${KURYR_JSON_DIR} directory is missing. Creating it... "
sudo mkdir -p ${KURYR_JSON_DIR}
echo "Done"
fi
if [[ ! -f "${KURYR_JSON}" ]]; then
echo -n "${KURYR_JSON} is missing. Copying the default one... "
sudo cp ${KURYR_DEFAULT_JSON} ${KURYR_JSON}
echo "Done"
fi
if [[ ! -d "${KURYR_CONFIG_DIR}" ]]; then
echo -n "${KURYR_CONFIG_DIR} directory is missing. Creating it... "
sudo mkdir -p ${KURYR_CONFIG_DIR}
echo "Done"
fi
if [[ ! -f "${KURYR_CONFIG}" ]]; then
if [[ -f "${KURYR_DEFAULT_CONFIG}" ]]; then
echo -n "${KURYR_CONFIG} is missing. Copying the default one... "
sudo cp ${KURYR_DEFAULT_CONFIG} ${KURYR_CONFIG}
else
echo -n "${KURYR_CONFIG} and the default config missing. Auto generating and copying one... "
cd ${KURYR_HOME}
tox -egenconfig
sudo cp ${KURYR_DEFAULT_CONFIG}.sample ${KURYR_DEFAULT_CONFIG}
sudo cp ${KURYR_DEFAULT_CONFIG} ${KURYR_CONFIG}
fi
echo "Done"
fi
PYTHONPATH=${KURYR_HOME} python ${KURYR_HOME}/scripts/run_server.py --config-file /etc/kuryr/kuryr.conf $@

View File

@ -1,17 +0,0 @@
#!/usr/bin/env python
#
# 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.
from kuryr import server
server.start()