Merge branch 'master' into initial_api_service
This commit is contained in:
commit
96aa70b18e
@ -1,4 +1,4 @@
|
|||||||
# helm_drydock
|
# drydock_provisioner
|
||||||
A python REST orchestrator to translate a YAML host topology to a provisioned set of hosts and provide a set of cloud-init post-provisioning instructions.
|
A python REST orchestrator to translate a YAML host topology to a provisioned set of hosts and provide a set of cloud-init post-provisioning instructions.
|
||||||
|
|
||||||
To run:
|
To run:
|
||||||
@ -6,7 +6,7 @@ To run:
|
|||||||
$ virtualenv -p python3 /var/tmp/drydock
|
$ virtualenv -p python3 /var/tmp/drydock
|
||||||
$ . /var/tmp/drydock/bin/activate
|
$ . /var/tmp/drydock/bin/activate
|
||||||
$ python setup.py install
|
$ python setup.py install
|
||||||
$ uwsgi --http :9000 -w helm_drydock.drydock --callable drydock --enable-threads -L
|
$ uwsgi --http :9000 -w drydock_provisioner.drydock --callable drydock --enable-threads -L
|
||||||
|
|
||||||
## Modular service
|
## Modular service
|
||||||
|
|
||||||
|
@ -33,12 +33,12 @@ class DrydockConfig(object):
|
|||||||
}
|
}
|
||||||
|
|
||||||
ingester_config = {
|
ingester_config = {
|
||||||
'plugins': ['helm_drydock.ingester.plugins.yaml.YamlIngester'],
|
'plugins': ['drydock_provisioner.ingester.plugins.yaml.YamlIngester'],
|
||||||
}
|
}
|
||||||
|
|
||||||
orchestrator_config = {
|
orchestrator_config = {
|
||||||
'drivers': {
|
'drivers': {
|
||||||
'oob': 'helm_drydock.drivers.oob.pyghmi_driver.PyghmiDriver',
|
'oob': 'drydock_provisioner.drivers.oob.pyghmi_driver.PyghmiDriver',
|
||||||
'node': 'helm_drydock.drivers.node.maasdriver.driver.MaasNodeDriver',
|
'node': 'drydock_provisioner.drivers.node.maasdriver.driver.MaasNodeDriver',
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -23,9 +23,9 @@ def start_api(state_manager=None, ingester=None, orchestrator=None):
|
|||||||
"""
|
"""
|
||||||
Start the Drydock API service
|
Start the Drydock API service
|
||||||
|
|
||||||
:param state_manager: Instance of helm_drydock.statemgmt.manager.DesignState for accessing
|
:param state_manager: Instance of drydock_provisioner.statemgmt.manager.DesignState for accessing
|
||||||
state persistence
|
state persistence
|
||||||
:param ingester: Instance of helm_drydock.ingester.ingester.Ingester for handling design
|
:param ingester: Instance of drydock_provisioner.ingester.ingester.Ingester for handling design
|
||||||
part input
|
part input
|
||||||
"""
|
"""
|
||||||
control_api = falcon.API(request_type=DrydockRequest,
|
control_api = falcon.API(request_type=DrydockRequest,
|
@ -16,7 +16,7 @@ import uuid
|
|||||||
import json
|
import json
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
import helm_drydock.error as errors
|
import drydock_provisioner.error as errors
|
||||||
|
|
||||||
class BaseResource(object):
|
class BaseResource(object):
|
||||||
|
|
@ -16,8 +16,8 @@ import json
|
|||||||
import uuid
|
import uuid
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
import helm_drydock.objects as hd_objects
|
import drydock_provisioner.objects as hd_objects
|
||||||
import helm_drydock.error as errors
|
import drydock_provisioner.error as errors
|
||||||
|
|
||||||
from .base import StatefulResource
|
from .base import StatefulResource
|
||||||
|
|
@ -16,7 +16,7 @@ import falcon
|
|||||||
import logging
|
import logging
|
||||||
import uuid
|
import uuid
|
||||||
|
|
||||||
import helm_drydock.config as config
|
import drydock_provisioner.config as config
|
||||||
|
|
||||||
class AuthMiddleware(object):
|
class AuthMiddleware(object):
|
||||||
|
|
@ -16,7 +16,7 @@ import json
|
|||||||
import threading
|
import threading
|
||||||
import traceback
|
import traceback
|
||||||
|
|
||||||
import helm_drydock.objects.task as obj_task
|
import drydock_provisioner.objects.task as obj_task
|
||||||
from .base import StatefulResource
|
from .base import StatefulResource
|
||||||
|
|
||||||
class TasksResource(StatefulResource):
|
class TasksResource(StatefulResource):
|
@ -15,10 +15,10 @@ from threading import Thread, Lock
|
|||||||
import uuid
|
import uuid
|
||||||
import time
|
import time
|
||||||
|
|
||||||
import helm_drydock.objects.fields as hd_fields
|
import drydock_provisioner.objects.fields as hd_fields
|
||||||
import helm_drydock.statemgmt as statemgmt
|
import drydock_provisioner.statemgmt as statemgmt
|
||||||
import helm_drydock.objects.task as tasks
|
import drydock_provisioner.objects.task as tasks
|
||||||
import helm_drydock.error as errors
|
import drydock_provisioner.error as errors
|
||||||
|
|
||||||
# This is the interface for the orchestrator to access a driver
|
# This is the interface for the orchestrator to access a driver
|
||||||
# TODO Need to have each driver spin up a seperate thread to manage
|
# TODO Need to have each driver spin up a seperate thread to manage
|
@ -13,10 +13,10 @@
|
|||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
#
|
#
|
||||||
|
|
||||||
import helm_drydock.objects.fields as hd_fields
|
import drydock_provisioner.objects.fields as hd_fields
|
||||||
import helm_drydock.error as errors
|
import drydock_provisioner.error as errors
|
||||||
|
|
||||||
from helm_drydock.drivers import ProviderDriver
|
from drydock_provisioner.drivers import ProviderDriver
|
||||||
|
|
||||||
class NodeDriver(ProviderDriver):
|
class NodeDriver(ProviderDriver):
|
||||||
|
|
@ -11,17 +11,17 @@
|
|||||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
import helm_drydock.error as errors
|
import drydock_provisioner.error as errors
|
||||||
import helm_drydock.config as config
|
import drydock_provisioner.config as config
|
||||||
import helm_drydock.drivers as drivers
|
import drydock_provisioner.drivers as drivers
|
||||||
import helm_drydock.objects.fields as hd_fields
|
import drydock_provisioner.objects.fields as hd_fields
|
||||||
import helm_drydock.objects.task as task_model
|
import drydock_provisioner.objects.task as task_model
|
||||||
|
|
||||||
from helm_drydock.drivers.node import NodeDriver
|
from drydock_provisioner.drivers.node import NodeDriver
|
||||||
from .api_client import MaasRequestFactory
|
from .api_client import MaasRequestFactory
|
||||||
import helm_drydock.drivers.node.maasdriver.models.fabric as maas_fabric
|
import drydock_provisioner.drivers.node.maasdriver.models.fabric as maas_fabric
|
||||||
import helm_drydock.drivers.node.maasdriver.models.vlan as maas_vlan
|
import drydock_provisioner.drivers.node.maasdriver.models.vlan as maas_vlan
|
||||||
import helm_drydock.drivers.node.maasdriver.models.subnet as maas_subnet
|
import drydock_provisioner.drivers.node.maasdriver.models.subnet as maas_subnet
|
||||||
|
|
||||||
class MaasNodeDriver(NodeDriver):
|
class MaasNodeDriver(NodeDriver):
|
||||||
|
|
@ -14,7 +14,7 @@
|
|||||||
import json
|
import json
|
||||||
import re
|
import re
|
||||||
|
|
||||||
import helm_drydock.error as errors
|
import drydock_provisioner.error as errors
|
||||||
"""
|
"""
|
||||||
A representation of a MaaS REST resource. Should be subclassed
|
A representation of a MaaS REST resource. Should be subclassed
|
||||||
for different resources and augmented with operations specific
|
for different resources and augmented with operations specific
|
@ -13,8 +13,8 @@
|
|||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
import json
|
import json
|
||||||
|
|
||||||
import helm_drydock.drivers.node.maasdriver.models.base as model_base
|
import drydock_provisioner.drivers.node.maasdriver.models.base as model_base
|
||||||
import helm_drydock.drivers.node.maasdriver.models.vlan as model_vlan
|
import drydock_provisioner.drivers.node.maasdriver.models.vlan as model_vlan
|
||||||
|
|
||||||
class Fabric(model_base.ResourceBase):
|
class Fabric(model_base.ResourceBase):
|
||||||
|
|
@ -12,7 +12,7 @@
|
|||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
import helm_drydock.drivers.node.maasdriver.models.base as model_base
|
import drydock_provisioner.drivers.node.maasdriver.models.base as model_base
|
||||||
|
|
||||||
class Subnet(model_base.ResourceBase):
|
class Subnet(model_base.ResourceBase):
|
||||||
|
|
@ -13,8 +13,8 @@
|
|||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
import json
|
import json
|
||||||
|
|
||||||
import helm_drydock.error as errors
|
import drydock_provisioner.error as errors
|
||||||
import helm_drydock.drivers.node.maasdriver.models.base as model_base
|
import drydock_provisioner.drivers.node.maasdriver.models.base as model_base
|
||||||
|
|
||||||
class Vlan(model_base.ResourceBase):
|
class Vlan(model_base.ResourceBase):
|
||||||
|
|
@ -12,10 +12,10 @@
|
|||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
import helm_drydock.objects.fields as hd_fields
|
import drydock_provisioner.objects.fields as hd_fields
|
||||||
import helm_drydock.error as errors
|
import drydock_provisioner.error as errors
|
||||||
|
|
||||||
from helm_drydock.drivers import ProviderDriver
|
from drydock_provisioner.drivers import ProviderDriver
|
||||||
|
|
||||||
class OobDriver(ProviderDriver):
|
class OobDriver(ProviderDriver):
|
||||||
|
|
@ -15,14 +15,14 @@ import time
|
|||||||
|
|
||||||
from pyghmi.ipmi.command import Command
|
from pyghmi.ipmi.command import Command
|
||||||
|
|
||||||
import helm_drydock.error as errors
|
import drydock_provisioner.error as errors
|
||||||
import helm_drydock.config as config
|
import drydock_provisioner.config as config
|
||||||
|
|
||||||
import helm_drydock.objects.fields as hd_fields
|
import drydock_provisioner.objects.fields as hd_fields
|
||||||
import helm_drydock.objects.task as task_model
|
import drydock_provisioner.objects.task as task_model
|
||||||
|
|
||||||
import helm_drydock.drivers.oob as oob
|
import drydock_provisioner.drivers.oob as oob
|
||||||
import helm_drydock.drivers as drivers
|
import drydock_provisioner.drivers as drivers
|
||||||
|
|
||||||
|
|
||||||
class PyghmiDriver(oob.OobDriver):
|
class PyghmiDriver(oob.OobDriver):
|
@ -13,12 +13,12 @@
|
|||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
import helm_drydock.config as config
|
import drydock_provisioner.config as config
|
||||||
import helm_drydock.objects as objects
|
import drydock_provisioner.objects as objects
|
||||||
import helm_drydock.ingester as ingester
|
import drydock_provisioner.ingester as ingester
|
||||||
import helm_drydock.statemgmt as statemgmt
|
import drydock_provisioner.statemgmt as statemgmt
|
||||||
import helm_drydock.orchestrator as orch
|
import drydock_provisioner.orchestrator as orch
|
||||||
import helm_drydock.control.api as api
|
import drydock_provisioner.control.api as api
|
||||||
|
|
||||||
def start_drydock():
|
def start_drydock():
|
||||||
objects.register_all()
|
objects.register_all()
|
@ -20,14 +20,14 @@ import yaml
|
|||||||
import uuid
|
import uuid
|
||||||
import importlib
|
import importlib
|
||||||
|
|
||||||
import helm_drydock.objects as objects
|
import drydock_provisioner.objects as objects
|
||||||
import helm_drydock.objects.site as site
|
import drydock_provisioner.objects.site as site
|
||||||
import helm_drydock.objects.network as network
|
import drydock_provisioner.objects.network as network
|
||||||
import helm_drydock.objects.hwprofile as hwprofile
|
import drydock_provisioner.objects.hwprofile as hwprofile
|
||||||
import helm_drydock.objects.node as node
|
import drydock_provisioner.objects.node as node
|
||||||
import helm_drydock.objects.hostprofile as hostprofile
|
import drydock_provisioner.objects.hostprofile as hostprofile
|
||||||
|
|
||||||
from helm_drydock.statemgmt import DesignState
|
from drydock_provisioner.statemgmt import DesignState
|
||||||
|
|
||||||
class Ingester(object):
|
class Ingester(object):
|
||||||
|
|
||||||
@ -42,7 +42,7 @@ class Ingester(object):
|
|||||||
:params plugins: - A list of strings naming class objects denoting the ingester plugins to be enabled
|
:params plugins: - A list of strings naming class objects denoting the ingester plugins to be enabled
|
||||||
|
|
||||||
Enable plugins that can be used for ingest_data calls. Each plugin should use
|
Enable plugins that can be used for ingest_data calls. Each plugin should use
|
||||||
helm_drydock.ingester.plugins.IngesterPlugin as its base class. As long as one
|
drydock_provisioner.ingester.plugins.IngesterPlugin as its base class. As long as one
|
||||||
enabled plugin successfully initializes, the call is considered successful. Otherwise
|
enabled plugin successfully initializes, the call is considered successful. Otherwise
|
||||||
it will throw an exception
|
it will throw an exception
|
||||||
"""
|
"""
|
@ -19,10 +19,10 @@
|
|||||||
import yaml
|
import yaml
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
import helm_drydock.objects.fields as hd_fields
|
import drydock_provisioner.objects.fields as hd_fields
|
||||||
|
|
||||||
from helm_drydock import objects
|
from drydock_provisioner import objects
|
||||||
from helm_drydock.ingester.plugins import IngesterPlugin
|
from drydock_provisioner.ingester.plugins import IngesterPlugin
|
||||||
|
|
||||||
class YamlIngester(IngesterPlugin):
|
class YamlIngester(IngesterPlugin):
|
||||||
|
|
||||||
@ -38,7 +38,7 @@ class YamlIngester(IngesterPlugin):
|
|||||||
|
|
||||||
filenames - Array of absolute path to the YAML files to ingest
|
filenames - Array of absolute path to the YAML files to ingest
|
||||||
|
|
||||||
returns an array of objects from helm_drydock.model
|
returns an array of objects from drydock_provisioner.model
|
||||||
|
|
||||||
"""
|
"""
|
||||||
def ingest_data(self, **kwargs):
|
def ingest_data(self, **kwargs):
|
@ -6,7 +6,7 @@ different sources.
|
|||||||
|
|
||||||
Each ingester plugin should be able source data
|
Each ingester plugin should be able source data
|
||||||
based on user-provided parameters and parse that data
|
based on user-provided parameters and parse that data
|
||||||
into the Drydock internal model (helm_drydock.model).
|
into the Drydock internal model (drydock_provisioner.model).
|
||||||
|
|
||||||
Each plugin does not need to support every type of design
|
Each plugin does not need to support every type of design
|
||||||
data as a single site design may be federated from multiple
|
data as a single site design may be federated from multiple
|
@ -12,7 +12,7 @@
|
|||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
#
|
#
|
||||||
# Models for helm_drydock
|
# Models for drydock_provisioner
|
||||||
#
|
#
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
@ -23,11 +23,11 @@ def register_all():
|
|||||||
# NOTE(sh8121att) - Import all versioned objects so
|
# NOTE(sh8121att) - Import all versioned objects so
|
||||||
# they are available via RPC. Any new object definitions
|
# they are available via RPC. Any new object definitions
|
||||||
# need to be added here.
|
# need to be added here.
|
||||||
__import__('helm_drydock.objects.network')
|
__import__('drydock_provisioner.objects.network')
|
||||||
__import__('helm_drydock.objects.node')
|
__import__('drydock_provisioner.objects.node')
|
||||||
__import__('helm_drydock.objects.hostprofile')
|
__import__('drydock_provisioner.objects.hostprofile')
|
||||||
__import__('helm_drydock.objects.hwprofile')
|
__import__('drydock_provisioner.objects.hwprofile')
|
||||||
__import__('helm_drydock.objects.site')
|
__import__('drydock_provisioner.objects.site')
|
||||||
|
|
||||||
# Utility class for calculating inheritance
|
# Utility class for calculating inheritance
|
||||||
|
|
@ -16,12 +16,12 @@ import datetime
|
|||||||
from oslo_versionedobjects import base
|
from oslo_versionedobjects import base
|
||||||
from oslo_versionedobjects import fields as obj_fields
|
from oslo_versionedobjects import fields as obj_fields
|
||||||
|
|
||||||
import helm_drydock.objects as objects
|
import drydock_provisioner.objects as objects
|
||||||
|
|
||||||
class DrydockObjectRegistry(base.VersionedObjectRegistry):
|
class DrydockObjectRegistry(base.VersionedObjectRegistry):
|
||||||
|
|
||||||
# Steal this from Cinder to bring all registered objects
|
# Steal this from Cinder to bring all registered objects
|
||||||
# into the helm_drydock.objects namespace
|
# into the drydock_provisioner.objects namespace
|
||||||
|
|
||||||
def registration_hook(self, cls, index):
|
def registration_hook(self, cls, index):
|
||||||
setattr(objects, cls.obj_name(), cls)
|
setattr(objects, cls.obj_name(), cls)
|
||||||
@ -30,7 +30,7 @@ class DrydockObject(base.VersionedObject):
|
|||||||
|
|
||||||
VERSION = '1.0'
|
VERSION = '1.0'
|
||||||
|
|
||||||
OBJ_PROJECT_NAMESPACE = 'helm_drydock.objects'
|
OBJ_PROJECT_NAMESPACE = 'drydock_provisioner.objects'
|
||||||
|
|
||||||
# Return None for undefined attributes
|
# Return None for undefined attributes
|
||||||
def obj_load_attr(self, attrname):
|
def obj_load_attr(self, attrname):
|
@ -16,9 +16,9 @@ from copy import deepcopy
|
|||||||
|
|
||||||
import oslo_versionedobjects.fields as obj_fields
|
import oslo_versionedobjects.fields as obj_fields
|
||||||
|
|
||||||
import helm_drydock.objects as objects
|
import drydock_provisioner.objects as objects
|
||||||
import helm_drydock.objects.base as base
|
import drydock_provisioner.objects.base as base
|
||||||
import helm_drydock.objects.fields as hd_fields
|
import drydock_provisioner.objects.fields as hd_fields
|
||||||
|
|
||||||
|
|
||||||
@base.DrydockObjectRegistry.register
|
@base.DrydockObjectRegistry.register
|
@ -16,9 +16,9 @@ from copy import deepcopy
|
|||||||
|
|
||||||
from oslo_versionedobjects import fields as ovo_fields
|
from oslo_versionedobjects import fields as ovo_fields
|
||||||
|
|
||||||
import helm_drydock.objects as objects
|
import drydock_provisioner.objects as objects
|
||||||
import helm_drydock.objects.base as base
|
import drydock_provisioner.objects.base as base
|
||||||
import helm_drydock.objects.fields as hd_fields
|
import drydock_provisioner.objects.fields as hd_fields
|
||||||
|
|
||||||
@base.DrydockObjectRegistry.register
|
@base.DrydockObjectRegistry.register
|
||||||
class HardwareProfile(base.DrydockPersistentObject, base.DrydockObject):
|
class HardwareProfile(base.DrydockPersistentObject, base.DrydockObject):
|
@ -12,7 +12,7 @@
|
|||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
#
|
#
|
||||||
# Models for helm_drydock
|
# Models for drydock_provisioner
|
||||||
#
|
#
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
@ -20,9 +20,9 @@ from copy import deepcopy
|
|||||||
|
|
||||||
import oslo_versionedobjects.fields as ovo_fields
|
import oslo_versionedobjects.fields as ovo_fields
|
||||||
|
|
||||||
import helm_drydock.objects as objects
|
import drydock_provisioner.objects as objects
|
||||||
import helm_drydock.objects.base as base
|
import drydock_provisioner.objects.base as base
|
||||||
import helm_drydock.objects.fields as hd_fields
|
import drydock_provisioner.objects.fields as hd_fields
|
||||||
|
|
||||||
@base.DrydockObjectRegistry.register
|
@base.DrydockObjectRegistry.register
|
||||||
class NetworkLink(base.DrydockPersistentObject, base.DrydockObject):
|
class NetworkLink(base.DrydockPersistentObject, base.DrydockObject):
|
@ -12,7 +12,7 @@
|
|||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
#
|
#
|
||||||
# Models for helm_drydock
|
# Models for drydock_provisioner
|
||||||
#
|
#
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
@ -20,13 +20,13 @@ from copy import deepcopy
|
|||||||
|
|
||||||
from oslo_versionedobjects import fields as ovo_fields
|
from oslo_versionedobjects import fields as ovo_fields
|
||||||
|
|
||||||
import helm_drydock.objects as objects
|
import drydock_provisioner.objects as objects
|
||||||
import helm_drydock.objects.hostprofile
|
import drydock_provisioner.objects.hostprofile
|
||||||
import helm_drydock.objects.base as base
|
import drydock_provisioner.objects.base as base
|
||||||
import helm_drydock.objects.fields as hd_fields
|
import drydock_provisioner.objects.fields as hd_fields
|
||||||
|
|
||||||
@base.DrydockObjectRegistry.register
|
@base.DrydockObjectRegistry.register
|
||||||
class BaremetalNode(helm_drydock.objects.hostprofile.HostProfile):
|
class BaremetalNode(drydock_provisioner.objects.hostprofile.HostProfile):
|
||||||
|
|
||||||
VERSION = '1.0'
|
VERSION = '1.0'
|
||||||
|
|
@ -12,7 +12,7 @@
|
|||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
#
|
#
|
||||||
# Models for helm_drydock
|
# Models for drydock_provisioner
|
||||||
#
|
#
|
||||||
from copy import deepcopy
|
from copy import deepcopy
|
||||||
import uuid
|
import uuid
|
||||||
@ -20,9 +20,9 @@ import datetime
|
|||||||
|
|
||||||
import oslo_versionedobjects.fields as ovo_fields
|
import oslo_versionedobjects.fields as ovo_fields
|
||||||
|
|
||||||
import helm_drydock.objects as objects
|
import drydock_provisioner.objects as objects
|
||||||
import helm_drydock.objects.base as base
|
import drydock_provisioner.objects.base as base
|
||||||
import helm_drydock.objects.fields as hd_fields
|
import drydock_provisioner.objects.fields as hd_fields
|
||||||
|
|
||||||
|
|
||||||
@base.DrydockObjectRegistry.register
|
@base.DrydockObjectRegistry.register
|
@ -15,9 +15,9 @@ import uuid
|
|||||||
|
|
||||||
from threading import Lock
|
from threading import Lock
|
||||||
|
|
||||||
import helm_drydock.error as errors
|
import drydock_provisioner.error as errors
|
||||||
|
|
||||||
import helm_drydock.objects.fields as hd_fields
|
import drydock_provisioner.objects.fields as hd_fields
|
||||||
|
|
||||||
class Task(object):
|
class Task(object):
|
||||||
|
|
@ -19,10 +19,10 @@ import importlib
|
|||||||
|
|
||||||
from copy import deepcopy
|
from copy import deepcopy
|
||||||
|
|
||||||
import helm_drydock.drivers as drivers
|
import drydock_provisioner.drivers as drivers
|
||||||
import helm_drydock.objects.task as tasks
|
import drydock_provisioner.objects.task as tasks
|
||||||
import helm_drydock.error as errors
|
import drydock_provisioner.error as errors
|
||||||
import helm_drydock.objects.fields as hd_fields
|
import drydock_provisioner.objects.fields as hd_fields
|
||||||
|
|
||||||
class Orchestrator(object):
|
class Orchestrator(object):
|
||||||
|
|
@ -18,10 +18,10 @@ from threading import Lock
|
|||||||
|
|
||||||
import uuid
|
import uuid
|
||||||
|
|
||||||
import helm_drydock.objects as objects
|
import drydock_provisioner.objects as objects
|
||||||
import helm_drydock.objects.task as tasks
|
import drydock_provisioner.objects.task as tasks
|
||||||
|
|
||||||
from helm_drydock.error import DesignError, StateError
|
from drydock_provisioner.error import DesignError, StateError
|
||||||
|
|
||||||
class DesignState(object):
|
class DesignState(object):
|
||||||
|
|
@ -1,58 +0,0 @@
|
|||||||
# Copyright 2017 AT&T Intellectual Property. All other 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.
|
|
||||||
#############################################################################
|
|
||||||
#
|
|
||||||
# bootstrap_hwdefinition.yaml - Definitions of server hardware layout
|
|
||||||
#
|
|
||||||
#############################################################################
|
|
||||||
# version the schema in this file so consumers can rationally parse it
|
|
||||||
---
|
|
||||||
apiVersion: 'v1.0'
|
|
||||||
kind: HardwareProfile
|
|
||||||
metadata:
|
|
||||||
name: HPGen8v3
|
|
||||||
region: sitename
|
|
||||||
date: 17-FEB-2017
|
|
||||||
description: Sample hardware definition
|
|
||||||
author: Scott Hussey
|
|
||||||
spec:
|
|
||||||
# Vendor of the server chassis
|
|
||||||
vendor: HP
|
|
||||||
# Generation of the chassis model
|
|
||||||
generation: '8'
|
|
||||||
# Version of the chassis model within its generation - not version of the hardware definition
|
|
||||||
hw_version: '3'
|
|
||||||
# The certified version of the chassis BIOS
|
|
||||||
bios_version: '2.2.3'
|
|
||||||
# Mode of the default boot of hardware - bios, uefi
|
|
||||||
boot_mode: bios
|
|
||||||
# Protocol of boot of the hardware - pxe, usb, hdd
|
|
||||||
bootstrap_protocol: pxe
|
|
||||||
# Which interface to use for network booting within the OOB manager, not OS device
|
|
||||||
pxe_interface: 0
|
|
||||||
# Map hardware addresses to aliases/roles to allow a mix of hardware configs
|
|
||||||
# in a site to result in a consistent configuration
|
|
||||||
device_aliases:
|
|
||||||
pci:
|
|
||||||
- address: pci@0000:00:03.0
|
|
||||||
alias: prim_nic01
|
|
||||||
# type could identify expected hardware - used for hardware manifest validation
|
|
||||||
type: '82540EM Gigabit Ethernet Controller'
|
|
||||||
- address: pci@0000:00:04.0
|
|
||||||
alias: prim_nic02
|
|
||||||
type: '82540EM Gigabit Ethernet Controller'
|
|
||||||
scsi:
|
|
||||||
- address: scsi@2:0.0.0
|
|
||||||
alias: primary_boot
|
|
||||||
type: 'VBOX HARDDISK'
|
|
@ -1,420 +0,0 @@
|
|||||||
# Copyright 2017 AT&T Intellectual Property. All other 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.
|
|
||||||
####################
|
|
||||||
#
|
|
||||||
# bootstrap_seed.yaml - Site server design definition for physical layer
|
|
||||||
#
|
|
||||||
####################
|
|
||||||
# version the schema in this file so consumers can rationally parse it
|
|
||||||
---
|
|
||||||
apiVersion: 'v1.0'
|
|
||||||
kind: Region
|
|
||||||
metadata:
|
|
||||||
name: sitename
|
|
||||||
date: 17-FEB-2017
|
|
||||||
description: Sample site design
|
|
||||||
author: sh8121@att.com
|
|
||||||
spec:
|
|
||||||
# Not sure if we have site wide data that doesn't fall into another 'Kind'
|
|
||||||
---
|
|
||||||
apiVersion: 'v1.0'
|
|
||||||
kind: NetworkLink
|
|
||||||
metadata:
|
|
||||||
name: oob
|
|
||||||
region: sitename
|
|
||||||
date: 17-FEB-2017
|
|
||||||
author: sh8121@att.com
|
|
||||||
description: Describe layer 1 attributes. Primary key is 'name'. These settings will generally be things the switch and server have to agree on
|
|
||||||
spec:
|
|
||||||
bonding:
|
|
||||||
mode: none
|
|
||||||
mtu: 1500
|
|
||||||
linkspeed: 100full
|
|
||||||
trunking:
|
|
||||||
mode: none
|
|
||||||
default_network: oob
|
|
||||||
---
|
|
||||||
# pxe is a bit of 'magic' indicating the link config used when PXE booting
|
|
||||||
# a node. All other links indicate network configs applied when the node
|
|
||||||
# is deployed.
|
|
||||||
apiVersion: 'v1.0'
|
|
||||||
kind: NetworkLink
|
|
||||||
metadata:
|
|
||||||
name: pxe
|
|
||||||
region: sitename
|
|
||||||
date: 17-FEB-2017
|
|
||||||
author: sh8121@att.com
|
|
||||||
description: Describe layer 1 attributes. Primary key is 'name'. These settings will generally be things the switch and server have to agree on
|
|
||||||
spec:
|
|
||||||
bonding:
|
|
||||||
mode: none
|
|
||||||
mtu: 1500
|
|
||||||
linkspeed: auto
|
|
||||||
# Is this link supporting multiple layer 2 networks?
|
|
||||||
# none is a port-based VLAN identified by default_network
|
|
||||||
# tagged is is using 802.1q VLAN tagging. Untagged packets will default to default_netwokr
|
|
||||||
trunking:
|
|
||||||
mode: none
|
|
||||||
# use name, will translate to VLAN ID
|
|
||||||
default_network: pxe
|
|
||||||
---
|
|
||||||
apiVersion: 'v1.0'
|
|
||||||
kind: NetworkLink
|
|
||||||
metadata:
|
|
||||||
name: gp
|
|
||||||
region: sitename
|
|
||||||
date: 17-FEB-2017
|
|
||||||
author: sh8121@att.com
|
|
||||||
description: Describe layer 1 attributes. These CIs will generally be things the switch and server have to agree on
|
|
||||||
# pxe is a bit of 'magic' indicating the link config used when PXE booting
|
|
||||||
# a node. All other links indicate network configs applied when the node
|
|
||||||
# is deployed.
|
|
||||||
spec:
|
|
||||||
# If this link is a bond of physical links, how is it configured
|
|
||||||
# 802.3ad
|
|
||||||
# active-backup
|
|
||||||
# balance-rr
|
|
||||||
# Can add support for others down the road
|
|
||||||
bonding:
|
|
||||||
mode: 802.3ad
|
|
||||||
# For LACP (802.3ad) xmit hashing policy: layer2, layer2+3, layer3+4, encap3+4
|
|
||||||
hash: layer3+4
|
|
||||||
# 802.3ad specific options
|
|
||||||
peer_rate: slow
|
|
||||||
mon_rate: default
|
|
||||||
up_delay: default
|
|
||||||
down_delay: default
|
|
||||||
mtu: 9000
|
|
||||||
linkspeed: auto
|
|
||||||
# Is this link supporting multiple layer 2 networks?
|
|
||||||
trunking:
|
|
||||||
mode: tagged
|
|
||||||
default_network: mgmt
|
|
||||||
---
|
|
||||||
apiVersion: 'v1.0'
|
|
||||||
kind: Network
|
|
||||||
metadata:
|
|
||||||
name: oob
|
|
||||||
region: sitename
|
|
||||||
date: 17-FEB-2017
|
|
||||||
author: sh8121@att.com
|
|
||||||
description: Describe layer 2/3 attributes. Primarily CIs used for configuring server interfaces
|
|
||||||
spec:
|
|
||||||
allocation: static
|
|
||||||
cidr: 172.16.100.0/24
|
|
||||||
ranges:
|
|
||||||
- type: static
|
|
||||||
start: 172.16.100.15
|
|
||||||
end: 172.16.100.254
|
|
||||||
dns:
|
|
||||||
domain: ilo.sitename.att.com
|
|
||||||
servers: 172.16.100.10
|
|
||||||
---
|
|
||||||
apiVersion: 'v1.0'
|
|
||||||
kind: Network
|
|
||||||
metadata:
|
|
||||||
name: pxe
|
|
||||||
region: sitename
|
|
||||||
date: 17-FEB-2017
|
|
||||||
author: sh8121@att.com
|
|
||||||
description: Describe layer 2/3 attributes. Primarily CIs used for configuring server interfaces
|
|
||||||
spec:
|
|
||||||
# Layer 2 VLAN segment id, could support other segmentations. Optional
|
|
||||||
vlan_id: '99'
|
|
||||||
# How are addresses assigned?
|
|
||||||
allocation: dhcp
|
|
||||||
# MTU for this VLAN interface, if not specified it will be inherited from the link
|
|
||||||
mtu: 1500
|
|
||||||
# Network address
|
|
||||||
cidr: 172.16.0.0/24
|
|
||||||
# Desribe IP address ranges
|
|
||||||
ranges:
|
|
||||||
- type: dhcp
|
|
||||||
start: 172.16.0.5
|
|
||||||
end: 172.16.0.254
|
|
||||||
# DNS settings for this network
|
|
||||||
dns:
|
|
||||||
# Domain addresses on this network will be registered under
|
|
||||||
domain: admin.sitename.att.com
|
|
||||||
# DNS servers that a server using this network as its default gateway should use
|
|
||||||
servers: 172.16.0.10
|
|
||||||
---
|
|
||||||
apiVersion: 'v1.0'
|
|
||||||
kind: Network
|
|
||||||
metadata:
|
|
||||||
name: mgmt
|
|
||||||
region: sitename
|
|
||||||
date: 17-FEB-2017
|
|
||||||
author: sh8121@att.com
|
|
||||||
description: Describe layer 2/3 attributes. Primarily CIs used for configuring server interfaces
|
|
||||||
spec:
|
|
||||||
vlan_id: '100'
|
|
||||||
# How are addresses assigned?
|
|
||||||
allocation: static
|
|
||||||
# Allow MTU to be inherited from link the network rides on
|
|
||||||
mtu: 1500
|
|
||||||
# Network address
|
|
||||||
cidr: 172.16.1.0/24
|
|
||||||
# Desribe IP address ranges
|
|
||||||
ranges:
|
|
||||||
- type: static
|
|
||||||
start: 172.16.1.15
|
|
||||||
end: 172.16.1.254
|
|
||||||
# Static routes to be added for this network
|
|
||||||
routes:
|
|
||||||
- subnet: 0.0.0.0/0
|
|
||||||
# A blank gateway would leave to a static route specifying
|
|
||||||
# only the interface as a source
|
|
||||||
gateway: 172.16.1.1
|
|
||||||
metric: 10
|
|
||||||
# DNS settings for this network
|
|
||||||
dns:
|
|
||||||
# Domain addresses on this network will be registered under
|
|
||||||
domain: mgmt.sitename.example.com
|
|
||||||
# DNS servers that a server using this network as its default gateway should use
|
|
||||||
servers: 172.16.1.9,172.16.1.10
|
|
||||||
---
|
|
||||||
apiVersion: 'v1.0'
|
|
||||||
kind: Network
|
|
||||||
metadata:
|
|
||||||
name: private
|
|
||||||
region: sitename
|
|
||||||
date: 17-FEB-2017
|
|
||||||
author: sh8121@att.com
|
|
||||||
description: Describe layer 2/3 attributes. Primarily CIs used for configuring server interfaces
|
|
||||||
spec:
|
|
||||||
vlan_id: '101'
|
|
||||||
allocation: static
|
|
||||||
mtu: 9000
|
|
||||||
cidr: 172.16.2.0/24
|
|
||||||
# Desribe IP address ranges
|
|
||||||
ranges:
|
|
||||||
# Type can be reserved (not used for baremetal), static (all explicit
|
|
||||||
# assignments should fall here), dhcp (will be used by a DHCP server on this network)
|
|
||||||
- type: static
|
|
||||||
start: 172.16.2.15
|
|
||||||
end: 172.16.2.254
|
|
||||||
dns:
|
|
||||||
domain: priv.sitename.example.com
|
|
||||||
servers: 172.16.2.9,172.16.2.10
|
|
||||||
---
|
|
||||||
apiVersion: 'v1.0'
|
|
||||||
kind: Network
|
|
||||||
metadata:
|
|
||||||
name: public
|
|
||||||
region: sitename
|
|
||||||
date: 17-FEB-2017
|
|
||||||
author: sh8121@att.com
|
|
||||||
description: Describe layer 2/3 attributes. Primarily CIs used for configuring server interfaces
|
|
||||||
spec:
|
|
||||||
vlan_id: '102'
|
|
||||||
# How are addresses assigned?
|
|
||||||
allocation: static
|
|
||||||
# MTU size for the VLAN interface
|
|
||||||
mtu: 1500
|
|
||||||
cidr: 172.16.3.0/24
|
|
||||||
# Desribe IP address ranges
|
|
||||||
ranges:
|
|
||||||
- type: static
|
|
||||||
start: 172.16.3.15
|
|
||||||
end: 172.16.3.254
|
|
||||||
routes:
|
|
||||||
- subnet: 0.0.0.0/0
|
|
||||||
gateway: 172.16.3.1
|
|
||||||
metric: 9
|
|
||||||
dns:
|
|
||||||
domain: sitename.example.com
|
|
||||||
servers: 8.8.8.8
|
|
||||||
---
|
|
||||||
apiVersion: 'v1.0'
|
|
||||||
kind: HostProfile
|
|
||||||
metadata:
|
|
||||||
name: default
|
|
||||||
region: sitename
|
|
||||||
date: 17-FEB-2017
|
|
||||||
author: sh8121@att.com
|
|
||||||
description: Describe layer 2/3 attributes. Primarily CIs used for configuring server interfaces
|
|
||||||
# No magic to this host_profile, it just provides a way to specify
|
|
||||||
# sitewide settings. If it is absent from a node's inheritance chain
|
|
||||||
# then these values will NOT be applied
|
|
||||||
spec:
|
|
||||||
# OOB (iLO, iDRAC, etc...) settings. Should prefer open standards such
|
|
||||||
# as IPMI over vender-specific when possible.
|
|
||||||
oob:
|
|
||||||
type: ipmi
|
|
||||||
# OOB networking should be preconfigured, but we can include a network
|
|
||||||
# definition for validation or enhancement (DNS registration)
|
|
||||||
network: oob
|
|
||||||
account: admin
|
|
||||||
credential: admin
|
|
||||||
# Specify storage layout of base OS. Ceph out of scope
|
|
||||||
storage:
|
|
||||||
# How storage should be carved up: lvm (logical volumes), flat
|
|
||||||
# (single partition)
|
|
||||||
layout: lvm
|
|
||||||
# Info specific to the boot and root disk/partitions
|
|
||||||
bootdisk:
|
|
||||||
# Device will specify an alias defined in hwdefinition.yaml
|
|
||||||
device: primary_boot
|
|
||||||
# For LVM, the size of the partition added to VG as a PV
|
|
||||||
# For flat, the size of the partition formatted as ext4
|
|
||||||
root_size: 50g
|
|
||||||
# The /boot partition. If not specified, /boot will in root
|
|
||||||
boot_size: 2g
|
|
||||||
# Info for additional partitions. Need to balance between
|
|
||||||
# flexibility and complexity
|
|
||||||
partitions:
|
|
||||||
- name: logs
|
|
||||||
device: primary_boot
|
|
||||||
# Partition uuid if needed
|
|
||||||
part_uuid: 84db9664-f45e-11e6-823d-080027ef795a
|
|
||||||
size: 10g
|
|
||||||
# Optional, can carve up unformatted block devices
|
|
||||||
mountpoint: /var/log
|
|
||||||
fstype: ext4
|
|
||||||
mount_options: defaults
|
|
||||||
# Filesystem UUID or label can be specified. UUID recommended
|
|
||||||
fs_uuid: cdb74f1c-9e50-4e51-be1d-068b0e9ff69e
|
|
||||||
fs_label: logs
|
|
||||||
# Platform (Operating System) settings
|
|
||||||
platform:
|
|
||||||
image: ubuntu_16.04_hwe
|
|
||||||
kernel_params: default
|
|
||||||
# Additional metadata to apply to a node
|
|
||||||
metadata:
|
|
||||||
# Base URL of the introspection service - may go in curtin data
|
|
||||||
introspection_url: http://172.16.1.10:9090
|
|
||||||
---
|
|
||||||
apiVersion: 'v1.0'
|
|
||||||
kind: HostProfile
|
|
||||||
metadata:
|
|
||||||
name: k8-node
|
|
||||||
region: sitename
|
|
||||||
date: 17-FEB-2017
|
|
||||||
author: sh8121@att.com
|
|
||||||
description: Describe layer 2/3 attributes. Primarily CIs used for configuring server interfaces
|
|
||||||
spec:
|
|
||||||
# host_profile inheritance allows for deduplication of common CIs
|
|
||||||
# Inheritance is additive for CIs that are lists of multiple items
|
|
||||||
# To remove an inherited list member, prefix the primary key value
|
|
||||||
# with '!'.
|
|
||||||
host_profile: defaults
|
|
||||||
# Hardware profile will map hardware specific details to the abstract
|
|
||||||
# names uses in the host profile as well as specify hardware specific
|
|
||||||
# configs. A viable model should be to build a host profile without a
|
|
||||||
# hardware_profile and then for each node inherit the host profile and
|
|
||||||
# specify a hardware_profile to map that node's hardware to the abstract
|
|
||||||
# settings of the host_profile
|
|
||||||
hardware_profile: HPGen9v3
|
|
||||||
# Network interfaces.
|
|
||||||
interfaces:
|
|
||||||
# Keyed on device_name
|
|
||||||
# pxe is a special marker indicating which device should be used for pxe boot
|
|
||||||
- device_name: pxe
|
|
||||||
# The network link attached to this
|
|
||||||
network_link: pxe
|
|
||||||
# Slaves will specify aliases from hwdefinition.yaml
|
|
||||||
slaves:
|
|
||||||
- prim_nic01
|
|
||||||
# Which networks will be configured on this interface
|
|
||||||
networks:
|
|
||||||
- name: pxe
|
|
||||||
- device_name: bond0
|
|
||||||
network_link: gp
|
|
||||||
# If multiple slaves are specified, but no bonding config
|
|
||||||
# is applied to the link, design validation will fail
|
|
||||||
slaves:
|
|
||||||
- prim_nic01
|
|
||||||
- prim_nic02
|
|
||||||
# If multiple networks are specified, but no trunking
|
|
||||||
# config is applied to the link, design validation will fail
|
|
||||||
networks:
|
|
||||||
- name: mgmt
|
|
||||||
- name: private
|
|
||||||
metadata:
|
|
||||||
# Explicit tag assignment
|
|
||||||
tags:
|
|
||||||
- 'test'
|
|
||||||
# MaaS supports key/value pairs. Not sure of the use yet
|
|
||||||
owner_data:
|
|
||||||
foo: bar
|
|
||||||
---
|
|
||||||
apiVersion: 'v1.0'
|
|
||||||
kind: HostProfile
|
|
||||||
metadata:
|
|
||||||
name: k8-node-public
|
|
||||||
region: sitename
|
|
||||||
date: 17-FEB-2017
|
|
||||||
author: sh8121@att.com
|
|
||||||
description: Describe layer 2/3 attributes. Primarily CIs used for configuring server interfaces
|
|
||||||
spec:
|
|
||||||
host_profile: k8-node
|
|
||||||
interfaces:
|
|
||||||
- device_name: bond0
|
|
||||||
networks:
|
|
||||||
# This is additive, so adds a network to those defined in the host_profile
|
|
||||||
# inheritance chain
|
|
||||||
- name: public
|
|
||||||
---
|
|
||||||
apiVersion: 'v1.0'
|
|
||||||
kind: BaremetalNode
|
|
||||||
metadata:
|
|
||||||
name: controller01
|
|
||||||
region: sitename
|
|
||||||
date: 17-FEB-2017
|
|
||||||
author: sh8121@att.com
|
|
||||||
description: Describe layer 2/3 attributes. Primarily CIs used for configuring server interfaces
|
|
||||||
spec:
|
|
||||||
host_profile: k8-node-public
|
|
||||||
# the hostname for a server, could be used in multiple DNS domains to
|
|
||||||
# represent different interfaces
|
|
||||||
interfaces:
|
|
||||||
- device_name: bond0
|
|
||||||
networks:
|
|
||||||
# '!' prefix for the value of the primary key indicates a record should be removed
|
|
||||||
- name: '!private'
|
|
||||||
# Addresses assigned to network interfaces
|
|
||||||
addressing:
|
|
||||||
# Which network the address applies to. If a network appears in addressing
|
|
||||||
# that isn't assigned to an interface, design validation will fail
|
|
||||||
- network: pxe
|
|
||||||
# The address assigned. Either a explicit IPv4 or IPv6 address
|
|
||||||
# or dhcp or slaac
|
|
||||||
address: dhcp
|
|
||||||
- network: mgmt
|
|
||||||
address: 172.16.1.20
|
|
||||||
- network: public
|
|
||||||
address: 172.16.3.20
|
|
||||||
metadata:
|
|
||||||
tags:
|
|
||||||
- os_ctl
|
|
||||||
rack: rack01
|
|
||||||
---
|
|
||||||
apiVersion: 'v1.0'
|
|
||||||
kind: BaremetalNode
|
|
||||||
metadata:
|
|
||||||
name: compute01
|
|
||||||
region: sitename
|
|
||||||
date: 17-FEB-2017
|
|
||||||
author: sh8121@att.com
|
|
||||||
description: Describe layer 2/3 attributes. Primarily CIs used for configuring server interfaces
|
|
||||||
spec:
|
|
||||||
host_profile: k8-node
|
|
||||||
addressing:
|
|
||||||
- network: pxe
|
|
||||||
address: dhcp
|
|
||||||
- network: mgmt
|
|
||||||
address: 172.16.1.21
|
|
||||||
- network: private
|
|
||||||
address: 172.16.2.21
|
|
331
examples/designparts_v1.0.yaml
Normal file
331
examples/designparts_v1.0.yaml
Normal file
@ -0,0 +1,331 @@
|
|||||||
|
# Copyright 2017 AT&T Intellectual Property. All other 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.
|
||||||
|
---
|
||||||
|
# Site/Region wide definitions. Each design part will be a constituent
|
||||||
|
# of the design for exactly one Region
|
||||||
|
apiVersion: 'v1.0'
|
||||||
|
kind: Region
|
||||||
|
metadata:
|
||||||
|
name: sitename
|
||||||
|
date: 17-FEB-2017
|
||||||
|
description: Sample site design
|
||||||
|
author: sh8121@att.com
|
||||||
|
spec:
|
||||||
|
# List of query-based definitions for applying tags to deployed nodes
|
||||||
|
tag_definitions:
|
||||||
|
- tag: 'high_memory'
|
||||||
|
# Tag to apply to nodes that qualify for the query
|
||||||
|
definition_type: 'lshw_xpath'
|
||||||
|
# Only support on type for now - 'lshw_xpath' used by MaaS
|
||||||
|
definition: //node[@id="memory"]/'size units="bytes"' > 137438953472
|
||||||
|
# an xpath query that is run against the output of 'lshw -xml' from the node
|
||||||
|
# Image and package repositories needed by Drydock drivers. Needs to be defined
|
||||||
|
repositories:
|
||||||
|
- name: 'ubuntu-main'
|
||||||
|
---
|
||||||
|
apiVersion: 'v1.0'
|
||||||
|
kind: NetworkLink
|
||||||
|
metadata:
|
||||||
|
name: oob
|
||||||
|
region: sitename
|
||||||
|
date: 17-FEB-2017
|
||||||
|
author: sh8121@att.com
|
||||||
|
description: Describe layer 1 attributes. Primary key is 'name'. These settings will generally be things the switch and server have to agree on
|
||||||
|
spec:
|
||||||
|
bonding:
|
||||||
|
# Mode can be 'disabled', '802.3ad', 'balanced-rr', 'active-backup'. Defaults to disabled
|
||||||
|
mode: '802.3ad'
|
||||||
|
# The below apply to 802.3ad (LACP
|
||||||
|
# Link selection hash. Supports 'layer3+4', 'layer2', 'layer2+3'. Defaults to 'layer3+4'
|
||||||
|
hash: 'layer3+4'
|
||||||
|
# LACP peering rate. Supports 'slow', 'fast'. Defaults to 'fast'
|
||||||
|
peer_rate: 'fast'
|
||||||
|
# LACP link monitor rate in milliseconds. Defaults to 100ms
|
||||||
|
mon_rate: 100
|
||||||
|
# LACP delay for marking link up in milliseconds. Must be greater than mon_rate. Defaults to 200ms
|
||||||
|
up_delay: 200
|
||||||
|
# LACP dleay for marking link down in milliseconds. Must be greater than mon_rate. Defaults to 200ms
|
||||||
|
down_delay: 200
|
||||||
|
# Physical link default MTU size. No default
|
||||||
|
mtu: 1500
|
||||||
|
# Physical link speed. Supports 'auto', '100full'. Gigabit+ speeds require auto. No default
|
||||||
|
linkspeed: 'auto'
|
||||||
|
# Settings for using a link for multiple L2 networks
|
||||||
|
trunking:
|
||||||
|
# Trunking mode. Supports 'disabled', '802.1q'. Defaults to disabled
|
||||||
|
mode: disabled
|
||||||
|
# If disabled, what network is this port on. If '802.1q' what is the default network for the port. No default.
|
||||||
|
default_network: oob
|
||||||
|
---
|
||||||
|
apiVersion: 'v1.0'
|
||||||
|
kind: Network
|
||||||
|
metadata:
|
||||||
|
name: oob
|
||||||
|
region: sitename
|
||||||
|
date: 17-FEB-2017
|
||||||
|
author: sh8121@att.com
|
||||||
|
description: Describe layer 2 and 3 attributes. Primary key is 'name'.
|
||||||
|
spec:
|
||||||
|
# CIDR representation of network number and netmask
|
||||||
|
cidr: '172.16.1.0/24'
|
||||||
|
# How addresses are allocated on the network. Supports 'static', 'dhcp'. Defaults to 'static'
|
||||||
|
allocation: 'static'
|
||||||
|
# VLAN of this network. Defaults to None
|
||||||
|
vlan: 100
|
||||||
|
# MTU of this network. Defaults to the MTU specified for the NetworkLink used for this network
|
||||||
|
dns:
|
||||||
|
# Domain name used to register addresses assigned from this network. Defaults to 'local'
|
||||||
|
domain: 'aic.att.com'
|
||||||
|
# Comma-separated list of DNS server IP addresses. These will be configured on the node if
|
||||||
|
# this network is identified as the node's primary network
|
||||||
|
servers: '8.8.8.8, 4.4.4.4'
|
||||||
|
# Defined IP address ranges. All node IP address assignments must fall into a defined range
|
||||||
|
# of the correct type
|
||||||
|
ranges:
|
||||||
|
# Type of range. Supports 'static' or 'dhcp'. No default
|
||||||
|
- type: 'dhcp'
|
||||||
|
# Start of the address range, inclusive. No default
|
||||||
|
start: '172.16.1.100'
|
||||||
|
# End of the address range, inclusive. No default
|
||||||
|
end: '172.16.1.254'
|
||||||
|
# Routes defined for this network, including the default route (i.e. default gateway)
|
||||||
|
routes:
|
||||||
|
# The network being routed to in CIDR notation. Default gateway is 0.0.0.0/0.
|
||||||
|
- subnet: '0.0.0.0/0'
|
||||||
|
# Next hop for traffic using this route
|
||||||
|
gateway: '172.16.1.3'
|
||||||
|
# Selection metric for the host selecting this route. No default
|
||||||
|
metric: 10
|
||||||
|
---
|
||||||
|
apiVersion: 'v1.0'
|
||||||
|
kind: HardwareProfile
|
||||||
|
metadata:
|
||||||
|
name: DellR720v2
|
||||||
|
region: sitename
|
||||||
|
date: 17-FEB-2017
|
||||||
|
author: sh8121@att.com
|
||||||
|
description: Describe server hardware attributes. Not a specific server, but profile adopted by a server defintion.
|
||||||
|
spec:
|
||||||
|
# Chassis vendor
|
||||||
|
vendor: 'Dell'
|
||||||
|
# Chassis model generation
|
||||||
|
generation: '1'
|
||||||
|
# Chassis model version
|
||||||
|
hw_version: '2'
|
||||||
|
# Certified BIOS version for this chassis
|
||||||
|
bios_version: '2.2.3'
|
||||||
|
# Boot mode. Supports 'bios' or 'uefi'
|
||||||
|
boot_mode: 'bios'
|
||||||
|
# How the node should be initially bootstrapped. Supports 'pxe'
|
||||||
|
bootstrap_protocol: 'pxe'
|
||||||
|
# What network interface to use for PXE booting
|
||||||
|
# for chassis that support selection
|
||||||
|
pxe_interface: '0'
|
||||||
|
# Mapping of hardware alias/role to physical address
|
||||||
|
device_aliases:
|
||||||
|
# the device alias that will be referenced in HostProfile or BaremetalNode design parts
|
||||||
|
- alias: 'pnic01'
|
||||||
|
# The hardware bus the device resides on. Supports 'pci' and 'scsi'. No default
|
||||||
|
bus_type: 'pci'
|
||||||
|
# The type of device as reported by lshw. Can be used to validate hardware manifest. No default
|
||||||
|
dev_type: 'Intel 10Gbps NIC'
|
||||||
|
# Physical address on the bus
|
||||||
|
address: '0000:00:03.0'
|
||||||
|
---
|
||||||
|
apiVersion: 'v1.0'
|
||||||
|
kind: HostProfile
|
||||||
|
metadata:
|
||||||
|
name: lcp_node
|
||||||
|
region: sitename
|
||||||
|
date: 17-FEB-2017
|
||||||
|
author: sh8121@att.com
|
||||||
|
description: Describe server configuration attributes. Not a specific server, but profile adopted by a server definition
|
||||||
|
spec:
|
||||||
|
# The HostProfile this profile adopts initial state from. No default.
|
||||||
|
# See drydock_provisioner/objects/readme.md for information on how HostProfile and BaremetalNode inheritance works
|
||||||
|
host_profile: 'defaults'
|
||||||
|
# The HardwareProfile describing the node hardware. No default.
|
||||||
|
hardware_profile: 'DellR720v1'
|
||||||
|
# OOB access to node
|
||||||
|
oob:
|
||||||
|
# Type of OOB access. Supports 'ipmi'
|
||||||
|
type: 'ipmi'
|
||||||
|
# Which network - as defined in a Network design part - to access the OOB interface on
|
||||||
|
network: 'oob'
|
||||||
|
# Account name for authenticating on the OOB interface
|
||||||
|
account: 'admin'
|
||||||
|
# Credential for authentication on the OOB interface. The OOB driver will interpret this.
|
||||||
|
credential: 'admin'
|
||||||
|
# How local node storage is configured
|
||||||
|
storage:
|
||||||
|
# How storage is laid out. Supports 'lvm' and 'flat'. Defaults to 'lvm'
|
||||||
|
layout: 'lvm'
|
||||||
|
# Configuration for the boot disk
|
||||||
|
bootdisk:
|
||||||
|
# Hardware disk (or hardware RAID device) used for booting. Can refer to a
|
||||||
|
# HardwareProfile device alias or a explicit device name
|
||||||
|
device: 'bootdisk'
|
||||||
|
# Size of the root volume. Can be specified by percentage or explicit size in
|
||||||
|
# megabytes or gigabytes. Defaults to 100% of boot device.
|
||||||
|
root_size: '100g'
|
||||||
|
# If a separate boot volume is needed, specify size. Defaults to 0 where /boot goes on root.
|
||||||
|
boot_size: '0'
|
||||||
|
# Non-boot volumes that should be carved out of local storage
|
||||||
|
partitions:
|
||||||
|
# Name of the volume. Doesn't translate to any operating system config
|
||||||
|
name: 'logs'
|
||||||
|
# Hardware device the volume should go on
|
||||||
|
device: 'bootdisk'
|
||||||
|
# Partition UUID. Defaults to None. A value of 'generate' means Drydock will generate a UUID
|
||||||
|
part_uuid:
|
||||||
|
# Size of the volume in megabytes or gigabytes
|
||||||
|
size: '10g'
|
||||||
|
# Filesystem mountpoint if volume should be a filesystem
|
||||||
|
mountpoint: '/var/logs'
|
||||||
|
# The below are ignored if mountpoint is None
|
||||||
|
# Format of filesystem. Defaults to ext4
|
||||||
|
fstype: 'ext4'
|
||||||
|
# Mount options of the file system as used in /etc/fstab. Defaults to 'defaults'
|
||||||
|
mount_options: 'defaults'
|
||||||
|
# Filesystem UUID. Defaults to None. A value of 'generate' means Drydock will generate a UUID
|
||||||
|
fs_uuid:
|
||||||
|
# A filesystem label. Defaults to None
|
||||||
|
fs_label:
|
||||||
|
# Physical and logical network interfaces
|
||||||
|
interfaces:
|
||||||
|
# What the interface should be named in the operating system. May not match a hardware device name
|
||||||
|
device_name: bond0
|
||||||
|
# The NetworkLink connected to this interface. Must be the name of a NetworkLink design part
|
||||||
|
device_link: 'gp'
|
||||||
|
# Whether this interface is considered the primary interface on the server. Supports true and false. Defaults to false
|
||||||
|
primary: true
|
||||||
|
# Hardware devices that support this interface. For configurating a physical device, this would be a list of one
|
||||||
|
# For bonds, this would be a list of all the physical devices in the bond. These can refer to HardwareProfile device aliases
|
||||||
|
# or explicit device names
|
||||||
|
slaves:
|
||||||
|
- 'pnic01'
|
||||||
|
- 'pnic02'
|
||||||
|
# Network that will be accessed on this interface. These should each be to the name of a Network design part
|
||||||
|
# Multiple networks listed here assume that this interface is attached to a NetworkLink supporting trunking
|
||||||
|
networks:
|
||||||
|
- 'mgmt'
|
||||||
|
- 'admin'
|
||||||
|
# Metadata about the node
|
||||||
|
metadata:
|
||||||
|
# Explicit tags to propagate to Kubernetes. Simple strings of any value
|
||||||
|
tags:
|
||||||
|
- 'lcp_node'
|
||||||
|
# Key/value mapping that will propagate to the node for next-step bootstrapping
|
||||||
|
owner_data:
|
||||||
|
nic_access: 'sriov'
|
||||||
|
# The rack a node sits in. Simple string
|
||||||
|
rack: r1
|
||||||
|
---
|
||||||
|
apiVersion: 'v1.0'
|
||||||
|
kind: BaremetalNode
|
||||||
|
metadata:
|
||||||
|
name: lcp_controller01
|
||||||
|
region: sitename
|
||||||
|
date: 17-FEB-2017
|
||||||
|
author: sh8121@att.com
|
||||||
|
description: Specify a physical server.
|
||||||
|
spec:
|
||||||
|
# The HostProfile this server adopts initial state from. No default.
|
||||||
|
# See drydock_provisioner/objects/readme.md for information on how HostProfile and BaremetalNode inheritance works
|
||||||
|
host_profile: 'defaults'
|
||||||
|
# The HardwareProfile describing the node hardware. No default.
|
||||||
|
hardware_profile: 'DellR720v1'
|
||||||
|
# OOB access to node
|
||||||
|
oob:
|
||||||
|
# Type of OOB access. Supports 'ipmi'
|
||||||
|
type: 'ipmi'
|
||||||
|
# Which network - as defined in a Network design part - to access the OOB interface on
|
||||||
|
network: 'oob'
|
||||||
|
# Account name for authenticating on the OOB interface
|
||||||
|
account: 'admin'
|
||||||
|
# Credential for authentication on the OOB interface. The OOB driver will interpret this.
|
||||||
|
credential: 'admin'
|
||||||
|
# How local node storage is configured
|
||||||
|
storage:
|
||||||
|
# How storage is laid out. Supports 'lvm' and 'flat'. Defaults to 'lvm'
|
||||||
|
layout: 'lvm'
|
||||||
|
# Configuration for the boot disk
|
||||||
|
bootdisk:
|
||||||
|
# Hardware disk (or hardware RAID device) used for booting. Can refer to a
|
||||||
|
# HardwareProfile device alias or a explicit device name
|
||||||
|
device: 'bootdisk'
|
||||||
|
# Size of the root volume. Can be specified by percentage or explicit size in
|
||||||
|
# megabytes or gigabytes. Defaults to 100% of boot device.
|
||||||
|
root_size: '100g'
|
||||||
|
# If a separate boot volume is needed, specify size. Defaults to 0 where /boot goes on root.
|
||||||
|
boot_size: '0'
|
||||||
|
# Non-boot volumes that should be carved out of local storage
|
||||||
|
partitions:
|
||||||
|
# Name of the volume. Doesn't translate to any operating system config
|
||||||
|
name: 'logs'
|
||||||
|
# Hardware device the volume should go on
|
||||||
|
device: 'bootdisk'
|
||||||
|
# Partition UUID. Defaults to None. A value of 'generate' means Drydock will generate a UUID
|
||||||
|
part_uuid:
|
||||||
|
# Size of the volume in megabytes or gigabytes
|
||||||
|
size: '10g'
|
||||||
|
# Filesystem mountpoint if volume should be a filesystem
|
||||||
|
mountpoint: '/var/logs'
|
||||||
|
# The below are ignored if mountpoint is None
|
||||||
|
# Format of filesystem. Defaults to ext4
|
||||||
|
fstype: 'ext4'
|
||||||
|
# Mount options of the file system as used in /etc/fstab. Defaults to 'defaults'
|
||||||
|
mount_options: 'defaults'
|
||||||
|
# Filesystem UUID. Defaults to None. A value of 'generate' means Drydock will generate a UUID
|
||||||
|
fs_uuid:
|
||||||
|
# A filesystem label. Defaults to None
|
||||||
|
fs_label:
|
||||||
|
# Physical and logical network interfaces
|
||||||
|
interfaces:
|
||||||
|
# What the interface should be named in the operating system. May not match a hardware device name
|
||||||
|
- device_name: bond0
|
||||||
|
# The NetworkLink connected to this interface. Must be the name of a NetworkLink design part
|
||||||
|
device_link: 'gp'
|
||||||
|
# Whether this interface is considered the primary interface on the server. Supports true and false. Defaults to false
|
||||||
|
primary: true
|
||||||
|
# Hardware devices that support this interface. For configurating a physical device, this would be a list of one
|
||||||
|
# For bonds, this would be a list of all the physical devices in the bond. These can refer to HardwareProfile device aliases
|
||||||
|
# or explicit device names
|
||||||
|
slaves:
|
||||||
|
- 'pnic01'
|
||||||
|
- 'pnic02'
|
||||||
|
# Network that will be accessed on this interface. These should each be to the name of a Network design part
|
||||||
|
# Multiple networks listed here assume that this interface is attached to a NetworkLink supporting trunking
|
||||||
|
networks:
|
||||||
|
- 'mgmt'
|
||||||
|
- 'admin'
|
||||||
|
# Metadata about the node
|
||||||
|
metadata:
|
||||||
|
# Explicit tags to propagate to Kubernetes. Simple strings of any value
|
||||||
|
tags:
|
||||||
|
- 'lcp_node'
|
||||||
|
# Key/value mapping that will propagate to the node for next-step bootstrapping
|
||||||
|
owner_data:
|
||||||
|
nic_access: 'sriov'
|
||||||
|
# The rack a node sits in. Simple string
|
||||||
|
rack: r1
|
||||||
|
# How each attached network is accessed by this node
|
||||||
|
addressing:
|
||||||
|
# The name of a defined Network design part also listed in the 'networks' section of a interface definition
|
||||||
|
- network: 'pxe'
|
||||||
|
# Address should be an explicit IP address assignment or 'dhcp'
|
||||||
|
address: 'dhcp'
|
||||||
|
- network: 'mgmt'
|
||||||
|
address: '172.16.1.83'
|
||||||
|
---
|
7
examples/readme.md
Normal file
7
examples/readme.md
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
# File Definition Examples
|
||||||
|
|
||||||
|
## designparts_v1.0.yaml
|
||||||
|
|
||||||
|
This is a reference file for the YAML schema supported by the Drydock YAML
|
||||||
|
ingester. Each design part currently supported is listed with all supported
|
||||||
|
attributes and comments on attribute use and restrictions.
|
32
setup.py
32
setup.py
@ -12,7 +12,7 @@
|
|||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
#
|
#
|
||||||
# helm_drydock - A tool to consume a host topology and orchestrate
|
# drydock_provisioner - A tool to consume a host topology and orchestrate
|
||||||
# and monitor the provisioning of those hosts and execution of bootstrap
|
# and monitor the provisioning of those hosts and execution of bootstrap
|
||||||
# scripts
|
# scripts
|
||||||
#
|
#
|
||||||
@ -32,27 +32,27 @@
|
|||||||
|
|
||||||
from setuptools import setup
|
from setuptools import setup
|
||||||
|
|
||||||
setup(name='helm_drydock',
|
setup(name='drydock_provisioner',
|
||||||
version='0.1a1',
|
version='0.1a1',
|
||||||
description='Bootstrapper for Kubernetes infrastructure',
|
description='Bootstrapper for Kubernetes infrastructure',
|
||||||
url='http://github.com/att-comdev/drydock',
|
url='http://github.com/att-comdev/drydock',
|
||||||
author='Scott Hussey - AT&T',
|
author='Scott Hussey - AT&T',
|
||||||
author_email='sh8121@att.com',
|
author_email='sh8121@att.com',
|
||||||
license='Apache 2.0',
|
license='Apache 2.0',
|
||||||
packages=['helm_drydock',
|
packages=['drydock_provisioner',
|
||||||
'helm_drydock.objects',
|
'drydock_provisioner.objects',
|
||||||
'helm_drydock.ingester',
|
'drydock_provisioner.ingester',
|
||||||
'helm_drydock.ingester.plugins',
|
'drydock_provisioner.ingester.plugins',
|
||||||
'helm_drydock.statemgmt',
|
'drydock_provisioner.statemgmt',
|
||||||
'helm_drydock.orchestrator',
|
'drydock_provisioner.orchestrator',
|
||||||
'helm_drydock.control',
|
'drydock_provisioner.control',
|
||||||
'helm_drydock.drivers',
|
'drydock_provisioner.drivers',
|
||||||
'helm_drydock.drivers.oob',
|
'drydock_provisioner.drivers.oob',
|
||||||
'helm_drydock.drivers.oob.pyghmi_driver',
|
'drydock_provisioner.drivers.oob.pyghmi_driver',
|
||||||
'helm_drydock.drivers.node',
|
'drydock_provisioner.drivers.node',
|
||||||
'helm_drydock.drivers.node.maasdriver',
|
'drydock_provisioner.drivers.node.maasdriver',
|
||||||
'helm_drydock.drivers.node.maasdriver.models',
|
'drydock_provisioner.drivers.node.maasdriver.models',
|
||||||
'helm_drydock.control'],
|
'drydock_provisioner.control'],
|
||||||
install_requires=[
|
install_requires=[
|
||||||
'PyYAML',
|
'PyYAML',
|
||||||
'pyghmi>=1.0.18',
|
'pyghmi>=1.0.18',
|
||||||
|
@ -13,8 +13,8 @@
|
|||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
import json
|
import json
|
||||||
|
|
||||||
import helm_drydock.config as config
|
import drydock_provisioner.config as config
|
||||||
import helm_drydock.drivers.node.maasdriver.api_client as client
|
import drydock_provisioner.drivers.node.maasdriver.api_client as client
|
||||||
|
|
||||||
class TestClass(object):
|
class TestClass(object):
|
||||||
|
|
||||||
|
@ -14,10 +14,10 @@
|
|||||||
import json
|
import json
|
||||||
import uuid
|
import uuid
|
||||||
|
|
||||||
import helm_drydock.config as config
|
import drydock_provisioner.config as config
|
||||||
import helm_drydock.drivers.node.maasdriver.api_client as client
|
import drydock_provisioner.drivers.node.maasdriver.api_client as client
|
||||||
import helm_drydock.drivers.node.maasdriver.models.fabric as maas_fabric
|
import drydock_provisioner.drivers.node.maasdriver.models.fabric as maas_fabric
|
||||||
import helm_drydock.drivers.node.maasdriver.models.subnet as maas_subnet
|
import drydock_provisioner.drivers.node.maasdriver.models.subnet as maas_subnet
|
||||||
|
|
||||||
class TestClass(object):
|
class TestClass(object):
|
||||||
|
|
||||||
|
@ -17,23 +17,23 @@ import shutil
|
|||||||
import os
|
import os
|
||||||
import uuid
|
import uuid
|
||||||
|
|
||||||
import helm_drydock.config as config
|
import drydock_provisioner.config as config
|
||||||
import helm_drydock.drivers.node.maasdriver.api_client as client
|
import drydock_provisioner.drivers.node.maasdriver.api_client as client
|
||||||
import helm_drydock.ingester.plugins.yaml
|
import drydock_provisioner.ingester.plugins.yaml
|
||||||
import helm_drydock.statemgmt as statemgmt
|
import drydock_provisioner.statemgmt as statemgmt
|
||||||
import helm_drydock.objects as objects
|
import drydock_provisioner.objects as objects
|
||||||
import helm_drydock.orchestrator as orch
|
import drydock_provisioner.orchestrator as orch
|
||||||
import helm_drydock.objects.fields as hd_fields
|
import drydock_provisioner.objects.fields as hd_fields
|
||||||
import helm_drydock.objects.task as task
|
import drydock_provisioner.objects.task as task
|
||||||
import helm_drydock.drivers as drivers
|
import drydock_provisioner.drivers as drivers
|
||||||
from helm_drydock.ingester import Ingester
|
from drydock_provisioner.ingester import Ingester
|
||||||
|
|
||||||
class TestClass(object):
|
class TestClass(object):
|
||||||
|
|
||||||
def test_client_verify(self):
|
def test_client_verify(self):
|
||||||
design_state = statemgmt.DesignState()
|
design_state = statemgmt.DesignState()
|
||||||
orchestrator = orch.Orchestrator(state_manager=design_state,
|
orchestrator = orch.Orchestrator(state_manager=design_state,
|
||||||
enabled_drivers={'node': 'helm_drydock.drivers.node.maasdriver.driver.MaasNodeDriver'})
|
enabled_drivers={'node': 'drydock_provisioner.drivers.node.maasdriver.driver.MaasNodeDriver'})
|
||||||
|
|
||||||
orch_task = orchestrator.create_task(task.OrchestratorTask,
|
orch_task = orchestrator.create_task(task.OrchestratorTask,
|
||||||
site='sitename',
|
site='sitename',
|
||||||
@ -57,14 +57,14 @@ class TestClass(object):
|
|||||||
design_state.post_design(design_data)
|
design_state.post_design(design_data)
|
||||||
|
|
||||||
ingester = Ingester()
|
ingester = Ingester()
|
||||||
ingester.enable_plugins([helm_drydock.ingester.plugins.yaml.YamlIngester])
|
ingester.enable_plugins([drydock_provisioner.ingester.plugins.yaml.YamlIngester])
|
||||||
ingester.ingest_data(plugin_name='yaml', design_state=design_state,
|
ingester.ingest_data(plugin_name='yaml', design_state=design_state,
|
||||||
filenames=[str(input_file)], design_id=design_id)
|
filenames=[str(input_file)], design_id=design_id)
|
||||||
|
|
||||||
design_data = design_state.get_design(design_id)
|
design_data = design_state.get_design(design_id)
|
||||||
|
|
||||||
orchestrator = orch.Orchestrator(state_manager=design_state,
|
orchestrator = orch.Orchestrator(state_manager=design_state,
|
||||||
enabled_drivers={'node': 'helm_drydock.drivers.node.maasdriver.driver.MaasNodeDriver'})
|
enabled_drivers={'node': 'drydock_provisioner.drivers.node.maasdriver.driver.MaasNodeDriver'})
|
||||||
|
|
||||||
orch_task = orchestrator.create_task(task.OrchestratorTask,
|
orch_task = orchestrator.create_task(task.OrchestratorTask,
|
||||||
site='sitename',
|
site='sitename',
|
||||||
|
@ -12,16 +12,16 @@
|
|||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
from helm_drydock.ingester import Ingester
|
from drydock_provisioner.ingester import Ingester
|
||||||
from helm_drydock.statemgmt import DesignState
|
from drydock_provisioner.statemgmt import DesignState
|
||||||
from helm_drydock.orchestrator import Orchestrator
|
from drydock_provisioner.orchestrator import Orchestrator
|
||||||
|
|
||||||
from copy import deepcopy
|
from copy import deepcopy
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
import shutil
|
import shutil
|
||||||
import os
|
import os
|
||||||
import helm_drydock.ingester.plugins.yaml
|
import drydock_provisioner.ingester.plugins.yaml
|
||||||
import yaml
|
import yaml
|
||||||
|
|
||||||
class TestClass(object):
|
class TestClass(object):
|
||||||
@ -32,7 +32,7 @@ class TestClass(object):
|
|||||||
|
|
||||||
def test_design_inheritance(self, loaded_design):
|
def test_design_inheritance(self, loaded_design):
|
||||||
orchestrator = Orchestrator(state_manager=loaded_design,
|
orchestrator = Orchestrator(state_manager=loaded_design,
|
||||||
enabled_drivers={'oob': 'helm_drydock.drivers.oob.pyghmi_driver.PyghmiDriver'})
|
enabled_drivers={'oob': 'drydock_provisioner.drivers.oob.pyghmi_driver.PyghmiDriver'})
|
||||||
|
|
||||||
design_data = orchestrator.load_design_data("sitename")
|
design_data = orchestrator.load_design_data("sitename")
|
||||||
|
|
||||||
@ -63,7 +63,7 @@ class TestClass(object):
|
|||||||
design_state.post_design_base(design_data)
|
design_state.post_design_base(design_data)
|
||||||
|
|
||||||
ingester = Ingester()
|
ingester = Ingester()
|
||||||
ingester.enable_plugins([helm_drydock.ingester.plugins.yaml.YamlIngester])
|
ingester.enable_plugins([drydock_provisioner.ingester.plugins.yaml.YamlIngester])
|
||||||
ingester.ingest_data(plugin_name='yaml', design_state=design_state, filenames=[str(input_file)])
|
ingester.ingest_data(plugin_name='yaml', design_state=design_state, filenames=[str(input_file)])
|
||||||
|
|
||||||
return design_state
|
return design_state
|
||||||
|
@ -12,14 +12,14 @@
|
|||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
from helm_drydock.ingester import Ingester
|
from drydock_provisioner.ingester import Ingester
|
||||||
from helm_drydock.statemgmt import DesignState
|
from drydock_provisioner.statemgmt import DesignState
|
||||||
import helm_drydock.objects as objects
|
import drydock_provisioner.objects as objects
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
import shutil
|
import shutil
|
||||||
import os
|
import os
|
||||||
import helm_drydock.ingester.plugins.yaml
|
import drydock_provisioner.ingester.plugins.yaml
|
||||||
|
|
||||||
class TestClass(object):
|
class TestClass(object):
|
||||||
|
|
||||||
@ -37,7 +37,7 @@ class TestClass(object):
|
|||||||
design_state.post_design(design_data)
|
design_state.post_design(design_data)
|
||||||
|
|
||||||
ingester = Ingester()
|
ingester = Ingester()
|
||||||
ingester.enable_plugins([helm_drydock.ingester.plugins.yaml.YamlIngester])
|
ingester.enable_plugins([drydock_provisioner.ingester.plugins.yaml.YamlIngester])
|
||||||
ingester.ingest_data(plugin_name='yaml', design_state=design_state,
|
ingester.ingest_data(plugin_name='yaml', design_state=design_state,
|
||||||
filenames=[str(input_file)], design_id=design_id)
|
filenames=[str(input_file)], design_id=design_id)
|
||||||
|
|
||||||
@ -59,7 +59,7 @@ class TestClass(object):
|
|||||||
design_state.post_design(design_data)
|
design_state.post_design(design_data)
|
||||||
|
|
||||||
ingester = Ingester()
|
ingester = Ingester()
|
||||||
ingester.enable_plugins([helm_drydock.ingester.plugins.yaml.YamlIngester])
|
ingester.enable_plugins([drydock_provisioner.ingester.plugins.yaml.YamlIngester])
|
||||||
ingester.ingest_data(plugin_name='yaml', design_state=design_state, design_id=design_id,
|
ingester.ingest_data(plugin_name='yaml', design_state=design_state, design_id=design_id,
|
||||||
filenames=[str(profiles_file), str(networks_file), str(nodes_file)])
|
filenames=[str(profiles_file), str(networks_file), str(nodes_file)])
|
||||||
|
|
||||||
|
@ -16,7 +16,7 @@ import shutil
|
|||||||
import os
|
import os
|
||||||
import uuid
|
import uuid
|
||||||
|
|
||||||
from helm_drydock.ingester.plugins.yaml import YamlIngester
|
from drydock_provisioner.ingester.plugins.yaml import YamlIngester
|
||||||
|
|
||||||
class TestClass(object):
|
class TestClass(object):
|
||||||
|
|
||||||
|
@ -14,8 +14,8 @@
|
|||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
import helm_drydock.objects as objects
|
import drydock_provisioner.objects as objects
|
||||||
from helm_drydock.objects import fields
|
from drydock_provisioner.objects import fields
|
||||||
|
|
||||||
class TestClass(object):
|
class TestClass(object):
|
||||||
|
|
||||||
@ -23,7 +23,7 @@ class TestClass(object):
|
|||||||
objects.register_all()
|
objects.register_all()
|
||||||
|
|
||||||
model_attr = {
|
model_attr = {
|
||||||
'versioned_object.namespace': 'helm_drydock.objects',
|
'versioned_object.namespace': 'drydock_provisioner.objects',
|
||||||
'versioned_object.name': 'HardwareProfile',
|
'versioned_object.name': 'HardwareProfile',
|
||||||
'versioned_object.version': '1.0',
|
'versioned_object.version': '1.0',
|
||||||
'versioned_object.data': {
|
'versioned_object.data': {
|
||||||
@ -38,13 +38,13 @@ class TestClass(object):
|
|||||||
'bootstrap_protocol': 'pxe',
|
'bootstrap_protocol': 'pxe',
|
||||||
'pxe_interface': '0',
|
'pxe_interface': '0',
|
||||||
'devices': {
|
'devices': {
|
||||||
'versioned_object.namespace': 'helm_drydock.objects',
|
'versioned_object.namespace': 'drydock_provisioner.objects',
|
||||||
'versioned_object.name': 'HardwareDeviceAliasList',
|
'versioned_object.name': 'HardwareDeviceAliasList',
|
||||||
'versioned_object.version': '1.0',
|
'versioned_object.version': '1.0',
|
||||||
'versioned_object.data': {
|
'versioned_object.data': {
|
||||||
'objects': [
|
'objects': [
|
||||||
{
|
{
|
||||||
'versioned_object.namespace': 'helm_drydock.objects',
|
'versioned_object.namespace': 'drydock_provisioner.objects',
|
||||||
'versioned_object.name': 'HardwareDeviceAlias',
|
'versioned_object.name': 'HardwareDeviceAlias',
|
||||||
'versioned_object.version': '1.0',
|
'versioned_object.version': '1.0',
|
||||||
'versioned_object.data': {
|
'versioned_object.data': {
|
||||||
@ -56,7 +56,7 @@ class TestClass(object):
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
'versioned_object.namespace': 'helm_drydock.objects',
|
'versioned_object.namespace': 'drydock_provisioner.objects',
|
||||||
'versioned_object.name': 'HardwareDeviceAlias',
|
'versioned_object.name': 'HardwareDeviceAlias',
|
||||||
'versioned_object.version': '1.0',
|
'versioned_object.version': '1.0',
|
||||||
'versioned_object.data': {
|
'versioned_object.data': {
|
||||||
|
@ -18,11 +18,11 @@
|
|||||||
import threading
|
import threading
|
||||||
import time
|
import time
|
||||||
|
|
||||||
import helm_drydock.orchestrator as orch
|
import drydock_provisioner.orchestrator as orch
|
||||||
import helm_drydock.objects.fields as hd_fields
|
import drydock_provisioner.objects.fields as hd_fields
|
||||||
import helm_drydock.statemgmt as statemgmt
|
import drydock_provisioner.statemgmt as statemgmt
|
||||||
import helm_drydock.objects.task as task
|
import drydock_provisioner.objects.task as task
|
||||||
import helm_drydock.drivers as drivers
|
import drydock_provisioner.drivers as drivers
|
||||||
|
|
||||||
|
|
||||||
class TestClass(object):
|
class TestClass(object):
|
||||||
|
@ -23,15 +23,15 @@ import os
|
|||||||
import shutil
|
import shutil
|
||||||
import uuid
|
import uuid
|
||||||
|
|
||||||
from helm_drydock.ingester import Ingester
|
from drydock_provisioner.ingester import Ingester
|
||||||
|
|
||||||
import helm_drydock.orchestrator as orch
|
import drydock_provisioner.orchestrator as orch
|
||||||
import helm_drydock.objects.fields as hd_fields
|
import drydock_provisioner.objects.fields as hd_fields
|
||||||
import helm_drydock.statemgmt as statemgmt
|
import drydock_provisioner.statemgmt as statemgmt
|
||||||
import helm_drydock.objects as objects
|
import drydock_provisioner.objects as objects
|
||||||
import helm_drydock.objects.task as task
|
import drydock_provisioner.objects.task as task
|
||||||
import helm_drydock.drivers as drivers
|
import drydock_provisioner.drivers as drivers
|
||||||
import helm_drydock.ingester.plugins.yaml as yaml_ingester
|
import drydock_provisioner.ingester.plugins.yaml as yaml_ingester
|
||||||
|
|
||||||
class TestClass(object):
|
class TestClass(object):
|
||||||
|
|
||||||
@ -44,7 +44,7 @@ class TestClass(object):
|
|||||||
#mocker.patch.object('pyghmi.ipmi.command.Command','get_asset_tag')
|
#mocker.patch.object('pyghmi.ipmi.command.Command','get_asset_tag')
|
||||||
|
|
||||||
orchestrator = orch.Orchestrator(state_manager=loaded_design,
|
orchestrator = orch.Orchestrator(state_manager=loaded_design,
|
||||||
enabled_drivers={'oob': 'helm_drydock.drivers.oob.pyghmi_driver.PyghmiDriver'})
|
enabled_drivers={'oob': 'drydock_provisioner.drivers.oob.pyghmi_driver.PyghmiDriver'})
|
||||||
|
|
||||||
orch_task = orchestrator.create_task(task.OrchestratorTask,
|
orch_task = orchestrator.create_task(task.OrchestratorTask,
|
||||||
site='sitename',
|
site='sitename',
|
||||||
@ -63,7 +63,7 @@ class TestClass(object):
|
|||||||
#mocker.patch.object('pyghmi.ipmi.command.Command','set_bootdev')
|
#mocker.patch.object('pyghmi.ipmi.command.Command','set_bootdev')
|
||||||
|
|
||||||
orchestrator = orch.Orchestrator(state_manager=loaded_design,
|
orchestrator = orch.Orchestrator(state_manager=loaded_design,
|
||||||
enabled_drivers={'oob': 'helm_drydock.drivers.oob.pyghmi_driver.PyghmiDriver'})
|
enabled_drivers={'oob': 'drydock_provisioner.drivers.oob.pyghmi_driver.PyghmiDriver'})
|
||||||
|
|
||||||
orch_task = orchestrator.create_task(task.OrchestratorTask,
|
orch_task = orchestrator.create_task(task.OrchestratorTask,
|
||||||
site='sitename',
|
site='sitename',
|
||||||
|
@ -15,8 +15,8 @@ import pytest
|
|||||||
import shutil
|
import shutil
|
||||||
|
|
||||||
|
|
||||||
import helm_drydock.objects as objects
|
import drydock_provisioner.objects as objects
|
||||||
import helm_drydock.statemgmt as statemgmt
|
import drydock_provisioner.statemgmt as statemgmt
|
||||||
|
|
||||||
class TestClass(object):
|
class TestClass(object):
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user