From eca07e47e492bb5286f5f90fc1161aa6b6479100 Mon Sep 17 00:00:00 2001 From: Scott Hussey Date: Thu, 13 Jul 2017 21:04:51 -0500 Subject: [PATCH 1/3] Fix Dockerfile Fix build issues in Dockerfile and update dev environment instructions to use Docker instead of virtualenv --- Dockerfile | 4 +--- README.md | 10 +++++----- examples/bootdata/join.sh | 2 ++ 3 files changed, 8 insertions(+), 8 deletions(-) create mode 100644 examples/bootdata/join.sh diff --git a/Dockerfile b/Dockerfile index 341b3cea..c352d748 100644 --- a/Dockerfile +++ b/Dockerfile @@ -11,9 +11,7 @@ # 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 drydock_base:0.1 - -ARG VERSION +FROM ubuntu:16.04 ENV DEBIAN_FRONTEND noninteractive ENV container docker diff --git a/README.md b/README.md index 8e2f0347..f968056a 100644 --- a/README.md +++ b/README.md @@ -3,10 +3,10 @@ A python REST orchestrator to translate a YAML host topology to a provisioned se To run: - $ virtualenv -p python3 /var/tmp/drydock - $ . /var/tmp/drydock/bin/activate - $ python setup.py install - $ uwsgi --http :9000 -w drydock_provisioner.drydock --callable drydock --enable-threads -L + $ docker build . -t drydock + $ docker run -v /path/to/drydock/repo/examples:/etc/drydock -P --name='drydock' drydock + $ DDPORT=$(docker ps -f name=drydock | grep -oE '0.0.0.0:[0-9]+' | cut -d':' -f 2) + $ curl -v http://localhost:${DDPORT}/api/v1.0/designs ## Modular service @@ -56,4 +56,4 @@ Pluggable provisioner for server bootstrapping. Initial implementation is MaaS c aka introspection API for bootstrapping nodes to load self data. Possibly pluggable as this is basically an -authenticated bridge to the Design State API \ No newline at end of file +authenticated bridge to the Design State API diff --git a/examples/bootdata/join.sh b/examples/bootdata/join.sh new file mode 100644 index 00000000..2ecbe6c0 --- /dev/null +++ b/examples/bootdata/join.sh @@ -0,0 +1,2 @@ +#!/bin/bash +echo 'Test' From ae5d18cb12dbdbe86c48472d949adcfb381748d1 Mon Sep 17 00:00:00 2001 From: Scott Hussey Date: Thu, 13 Jul 2017 21:06:02 -0500 Subject: [PATCH 2/3] Clean missed merge conflicts --- drydock_provisioner/drydock.py | 18 --------- drydock_provisioner/ingester/plugins/yaml.py | 39 -------------------- 2 files changed, 57 deletions(-) diff --git a/drydock_provisioner/drydock.py b/drydock_provisioner/drydock.py index 6311aa5b..28f85127 100644 --- a/drydock_provisioner/drydock.py +++ b/drydock_provisioner/drydock.py @@ -12,15 +12,10 @@ # See the License for the specific language governing permissions and # limitations under the License. import logging -<<<<<<< HEAD import sys import os from oslo_config import cfg -======= -from oslo_config import cfg -import sys ->>>>>>> attcomdev/master import drydock_provisioner.config as config import drydock_provisioner.objects as objects @@ -42,11 +37,7 @@ def start_drydock(): cfg.CONF(sys.argv[1:]) if cfg.CONF.debug: -<<<<<<< HEAD cfg.CONF.set_override(name='log_level', override='DEBUG', group='logging') -======= - cfg.CONF.logging.log_level = 'DEBUG' ->>>>>>> attcomdev/master # Setup root logger logger = logging.getLogger(cfg.CONF.logging.global_logger_name) @@ -72,7 +63,6 @@ def start_drydock(): input_ingester = ingester.Ingester() input_ingester.enable_plugins(cfg.CONF.plugins.ingester) -<<<<<<< HEAD # Check if we have an API key in the environment # Hack around until we move MaaS configs to the YAML schema if 'MAAS_API_KEY' in os.environ: @@ -85,14 +75,6 @@ def start_drydock(): cfg.CONF.log_opt_values(logging.getLogger(cfg.CONF.logging.global_logger_name), logging.DEBUG) return wsgi_callable -======= - # Now that loggers are configured, log the effective config - cfg.CONF.log_opt_values(logging.getLogger(cfg.CONF.logging.global_logger_name), logging.DEBUG) - - # Now that loggers are configured, log the effective config - drydock_provisioner.conf.log_opt_values(logging.getLogger(drydock_provisioner.conf.logging.global_logger_name), logging.DEBUG) ->>>>>>> attcomdev/master - drydock = start_drydock() diff --git a/drydock_provisioner/ingester/plugins/yaml.py b/drydock_provisioner/ingester/plugins/yaml.py index ad7ce600..f9e6b7d7 100644 --- a/drydock_provisioner/ingester/plugins/yaml.py +++ b/drydock_provisioner/ingester/plugins/yaml.py @@ -272,19 +272,10 @@ class YamlIngester(IngesterPlugin): storage = spec.get('storage', {}) model.storage_layout = storage.get('layout', 'lvm') -<<<<<<< HEAD bootdisk = storage.get('bootdisk', {}) model.bootdisk_device = bootdisk.get('device', None) model.bootdisk_root_size = bootdisk.get('root_size', None) model.bootdisk_boot_size = bootdisk.get('boot_size', None) -======= - model.oob_parameters = {} - for k,v in oob.items(): - if k == 'type': - model.oob_type = oob.get('type', None) - else: - model.oob_parameters[k] = v ->>>>>>> attcomdev/master partitions = storage.get('partitions', []) model.partitions = objects.HostPartitionList() @@ -317,13 +308,8 @@ class YamlIngester(IngesterPlugin): int_model.hardware_slaves = [] slaves = i.get('slaves', []) -<<<<<<< HEAD for s in slaves: int_model.hardware_slaves.append(s) -======= - int_model.device_name = i.get('device_name', None) - int_model.network_link = i.get('device_link', None) ->>>>>>> attcomdev/master int_model.networks = [] networks = i.get('networks', []) @@ -347,24 +333,6 @@ class YamlIngester(IngesterPlugin): node_metadata = spec.get('metadata', {}) metadata_tags = node_metadata.get('tags', []) -<<<<<<< HEAD - model.tags = [t for t in metadata_tags] -======= - platform = spec.get('platform', {}) - - model.image = platform.get('image', None) - model.kernel = platform.get('kernel', None) - - model.kernel_params = {} - for k, v in platform.get('kernel_params', {}).items(): - model.kernel_params[k] = v - - model.primary_network = spec.get('primary_network', None) - - node_metadata = spec.get('metadata', {}) - metadata_tags = node_metadata.get('tags', []) - model.tags = [] ->>>>>>> attcomdev/master owner_data = node_metadata.get('owner_data', {}) model.owner_data = {} @@ -377,14 +345,7 @@ class YamlIngester(IngesterPlugin): if kind == 'BaremetalNode': model.boot_mac = node_metadata.get('boot_mac', None) -<<<<<<< HEAD addresses = spec.get('addressing', []) -======= - if kind == 'BaremetalNode': - model.boot_mac = node_metadata.get('boot_mac', None) - - addresses = spec.get('addressing', []) ->>>>>>> attcomdev/master if len(addresses) == 0: raise ValueError('BaremetalNode needs at least' \ From 267b0cfdcc0e21c9ce6b04c0c3a1daf12e36f9d9 Mon Sep 17 00:00:00 2001 From: Scott Hussey Date: Thu, 13 Jul 2017 21:06:20 -0500 Subject: [PATCH 3/3] Add bootdata to sample config --- examples/drydock.conf | 2 ++ 1 file changed, 2 insertions(+) diff --git a/examples/drydock.conf b/examples/drydock.conf index 48d6cf3d..f22de127 100644 --- a/examples/drydock.conf +++ b/examples/drydock.conf @@ -46,3 +46,5 @@ deploy_node = 45 maas_api_url = 'http://localhost:8000/MAAS/api/2.0/' maas_api_key = 'your:secret:key' +[bootdata] +prom_init = '/etc/drydock/bootdata/join.sh'