summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xbuild-dockers.sh42
-rwxr-xr-xconductor.conf328
-rwxr-xr-xconductor/docker/Dockerfile (renamed from conductor/docker/solver/Dockerfile)18
-rwxr-xr-xconductor/docker/api/Dockerfile38
-rwxr-xr-xconductor/docker/api_paste.ini (renamed from conductor/docker/api/api_paste.ini)0
-rwxr-xr-xconductor/docker/controller/Dockerfile25
-rwxr-xr-xconductor/docker/data/Dockerfile25
-rwxr-xr-xconductor/docker/reservation/Dockerfile26
-rw-r--r--log.conf64
-rwxr-xr-xpush-dockers.sh42
-rwxr-xr-xrun-dockers.sh97
-rwxr-xr-xstop-dockers.sh7
12 files changed, 533 insertions, 179 deletions
diff --git a/build-dockers.sh b/build-dockers.sh
index 6814e3e..b531542 100755
--- a/build-dockers.sh
+++ b/build-dockers.sh
@@ -1,8 +1,36 @@
#!/bin/bash
-# TODO (IKRAM): need to test api only first to test the docker upload chain.
-# Will enable the others once api is tested
-docker build -t api conductor/docker/api/
-docker build -t controller conductor/docker/controller/
-docker build -t data conductor/docker/data/
-docker build -t solver conductor/docker/solver/
-docker build -t reservation conductor/docker/reservation/
+BUILD_ARGS="--no-cache"
+ORG="onap"
+VERSION="1.1.1"
+STAGING="1.1.1-STAGING"
+PROJECT="optf-has"
+DOCKER_REPOSITORY="nexus3.onap.org:10003"
+IMAGE_NAME="${DOCKER_REPOSITORY}/${ORG}/${PROJECT}"
+TIMESTAMP=$(date +"%Y%m%dT%H%M%S")
+
+if [ $HTTP_PROXY ]; then
+BUILD_ARGS+=" --build-arg HTTP_PROXY=${HTTP_PROXY}"
+fi
+if [ $HTTPS_PROXY ]; then
+ BUILD_ARGS+=" --build-arg HTTPS_PROXY=${HTTPS_PROXY}"
+fi
+
+function build_image(){
+ echo Building Image
+ docker build -t ${IMAGE_NAME}:${VERSION} -t ${IMAGE_NAME}:latest -t ${IMAGE_NAME}:${STAGING} conductor/docker
+ echo ... Built
+}
+
+function push_image(){
+ echo Pushing image starts.
+ build_image
+
+ docker push ${IMAGE_NAME}:${VERSION}
+ docker push ${IMAGE_NAME}:latest
+ docker push ${IMAGE_NAME}:STAGING
+
+ echo ... Pushed $1
+}
+
+push_image
+
diff --git a/conductor.conf b/conductor.conf
new file mode 100755
index 0000000..d6e85e5
--- /dev/null
+++ b/conductor.conf
@@ -0,0 +1,328 @@
+[DEFAULT]
+
+#
+# From conductor
+#
+
+# Configuration file for WSGI definition of API. (string value)
+#api_paste_config = api_paste.ini
+
+# Music keyspace for content (string value)
+keyspace = conductor_rui_test_active
+
+#
+# From oslo.log
+#
+
+# If set to true, the logging level will be set to DEBUG instead of the default
+# INFO level. (boolean value)
+# Note: This option can be changed without restarting.
+debug = true
+
+# DEPRECATED: If set to false, the logging level will be set to WARNING instead
+# of the default INFO level. (boolean value)
+# This option is deprecated for removal.
+# Its value may be silently ignored in the future.
+#verbose = true
+
+# The name of a logging configuration file. This file is appended to any
+# existing logging configuration files. For details about logging configuration
+# files, see the Python logging module documentation. Note that when logging
+# configuration files are used then all logging configuration is set in the
+# configuration file and other logging configuration options are ignored (for
+# example, logging_context_format_string). (string value)
+# Note: This option can be changed without restarting.
+# Deprecated group/name - [DEFAULT]/log_config
+log_config_append = /usr/local/bin/log.conf
+
+# Defines the format string for %%(asctime)s in log records. Default:
+# %(default)s . This option is ignored if log_config_append is set. (string
+# value)
+#log_date_format = %Y-%m-%d %H:%M:%S
+
+# (Optional) Name of log file to send logging output to. If no default is set,
+# logging will go to stderr as defined by use_stderr. This option is ignored if
+# log_config_append is set. (string value)
+# Deprecated group/name - [DEFAULT]/logfile
+#log_file = <None>
+
+# (Optional) The base directory used for relative log_file paths. This option
+# is ignored if log_config_append is set. (string value)
+# Deprecated group/name - [DEFAULT]/logdir
+#log_dir = <None>
+
+# Uses logging handler designed to watch file system. When log file is moved or
+# removed this handler will open a new log file with specified path
+# instantaneously. It makes sense only if log_file option is specified and
+# Linux platform is used. This option is ignored if log_config_append is set.
+# (boolean value)
+#watch_log_file = false
+
+# Use syslog for logging. Existing syslog format is DEPRECATED and will be
+# changed later to honor RFC5424. This option is ignored if log_config_append
+# is set. (boolean value)
+#use_syslog = false
+
+# Syslog facility to receive log lines. This option is ignored if
+# log_config_append is set. (string value)
+#syslog_log_facility = LOG_USER
+
+# Log output to standard error. This option is ignored if log_config_append is
+# set. (boolean value)
+#use_stderr = false
+
+# Format string to use for log messages with context. (string value)
+#logging_context_format_string = %(asctime)s.%(msecs)03d %(process)d %(levelname)s %(name)s [%(request_id)s %(user_identity)s] %(instance)s%(message)s
+
+# Format string to use for log messages when context is undefined. (string
+# value)
+#logging_default_format_string = %(asctime)s.%(msecs)03d %(process)d %(levelname)s %(name)s [-] %(instance)s%(message)s
+
+# Additional data to append to log message when logging level for the message
+# is DEBUG. (string value)
+#logging_debug_format_suffix = %(funcName)s %(pathname)s:%(lineno)d
+
+# Prefix each line of exception output with this format. (string value)
+#logging_exception_prefix = %(asctime)s.%(msecs)03d %(process)d ERROR %(name)s %(instance)s
+
+# Defines the format string for %(user_identity)s that is used in
+# logging_context_format_string. (string value)
+#logging_user_identity_format = %(user)s %(tenant)s %(domain)s %(user_domain)s %(project_domain)s
+
+# List of package logging levels in logger=LEVEL pairs. This option is ignored
+# if log_config_append is set. (list value)
+#default_log_levels = amqp=WARN,amqplib=WARN,boto=WARN,qpid=WARN,sqlalchemy=WARN,suds=INFO,oslo.messaging=INFO,iso8601=WARN,requests.packages.urllib3.connectionpool=WARN,urllib3.connectionpool=WARN,websocket=WARN,requests.packages.urllib3.util.retry=WARN,urllib3.util.retry=WARN,keystonemiddleware=WARN,routes.middleware=WARN,stevedore=WARN,taskflow=WARN,keystoneauth=WARN,oslo.cache=INFO,dogpile.core.dogpile=INFO
+
+# Enables or disables publication of error events. (boolean value)
+#publish_errors = false
+
+# The format for an instance that is passed with the log message. (string
+# value)
+#instance_format = "[instance: %(uuid)s] "
+
+# The format for an instance UUID that is passed with the log message. (string
+# value)
+#instance_uuid_format = "[instance: %(uuid)s] "
+
+# Interval, number of seconds, of log rate limiting. (integer value)
+#rate_limit_interval = 0
+
+# Maximum number of logged messages per rate_limit_interval. (integer value)
+#rate_limit_burst = 0
+
+# Log level name used by rate limiting: CRITICAL, ERROR, INFO, WARNING, DEBUG
+# or empty string. Logs with level greater or equal to rate_limit_except_level
+# are not filtered. An empty string means that all levels are filtered. (string
+# value)
+#rate_limit_except_level = CRITICAL
+
+# Enables or disables fatal status of deprecations. (boolean value)
+#fatal_deprecations = false
+
+
+[aai]
+
+#
+# From conductor
+#
+
+# Interval with which to refresh the local cache, in minutes. (integer value)
+cache_refresh_interval = 1
+complex_cache_refresh_interval = 60
+
+# Data Store table prefix. (string value)
+#table_prefix = aai
+
+# Base URL for A&AI, up to and not including the version, and without a
+# trailing slash. (string value)
+server_url = https://aai-conexus-e2e.ecomp.cci.att.com:8443/aai
+
+# The version of A&AI in v# format. (string value)
+server_url_version = v11
+
+# SSL/TLS certificate file in pem format. This certificate must be registered
+# with the A&AI endpoint. (string value)
+certificate_file = /usr/local/bin/aai_cert.cer
+
+# Private Certificate Key file in pem format. (string value)
+certificate_key_file = /usr/local/bin/aai_key.key
+
+# Certificate Authority Bundle file in pem format. Must contain the appropriate
+# trust chain for the Certificate file. (string value)
+#certificate_authority_bundle_file = /opt/app/conductor/etc/certs/ca_bundle.pem
+certificate_authority_bundle_file =/usr/local/bin/bundle.pem
+
+[api]
+
+#
+# From conductor
+#
+
+# Toggle Pecan Debug Middleware. (boolean value)
+#pecan_debug = false
+
+# Default maximum number of items returned by API request. (integer value)
+# Minimum value: 1
+#default_api_return_limit = 100
+
+
+[controller]
+
+#
+# From conductor
+#
+
+# Timeout for planning requests. Default value is 10. (integer value)
+# Minimum value: 1
+timeout = 200
+
+# Maximum number of result sets to return. Default value is 1. (integer value)
+# Minimum value: 1
+#limit = 1
+
+# Number of workers for controller service. Default value is 1. (integer value)
+# Minimum value: 1
+#workers = 1
+
+# Time between checking for new plans. Default value is 1. (integer value)
+# Minimum value: 1
+#polling_interval = 1
+concurrent = true
+
+
+[inventory_provider]
+
+#
+# From conductor
+#
+
+# Extensions list to use (list value)
+#extensions = aai
+
+
+[messaging_server]
+
+#
+# From conductor
+#
+
+# Music keyspace for messages (string value)
+#keyspace = conductor_rpc
+
+# Wait interval while checking for a message response. Default value is 1
+# second. (integer value)
+# Minimum value: 1
+#check_interval = 1
+
+# Overall message response timeout. Default value is 10 seconds. (integer
+# value)
+# Minimum value: 1
+timeout = 300
+
+# Number of workers for messaging service. Default value is 1. (integer value)
+# Minimum value: 1
+#workers = 1
+
+# Time between checking for new messages. Default value is 1. (integer value)
+# Minimum value: 1
+#polling_interval = 1
+
+# Log debug messages. Default value is False. (boolean value)
+#debug = false
+
+
+[music_api]
+
+#
+# From conductor
+#
+
+# Base URL for Music REST API without a trailing slash. (string value)
+server_url = http://135.25.84.108:8080/MUSIC/rest
+
+# DEPRECATED: List of hostnames (round-robin access) (list value)
+# This option is deprecated for removal.
+# Its value may be silently ignored in the future.
+# Reason: Use server_url instead
+#hostnames = <None>
+
+# DEPRECATED: Port (integer value)
+# This option is deprecated for removal.
+# Its value may be silently ignored in the future.
+# Reason: Use server_url instead
+#port = <None>
+
+# DEPRECATED: Path (string value)
+# This option is deprecated for removal.
+# Its value may be silently ignored in the future.
+# Reason: Use server_url instead
+#path = <None>
+
+# Lock timeout (integer value)
+#lock_timeout = 10
+
+# Log debug messages. Default value is False. (boolean value)
+#debug = false
+
+# Use mock API (boolean value)
+#mock = false
+
+# Socket connection timeout (floating point value)
+connect_timeout = 3.05
+
+# Socket read timeout (floating point value)
+read_timeout = 12.05
+
+
+
+[sdnc]
+
+#
+# From conductor
+#
+
+# Interval with which to refresh the local cache, in minutes. (integer value)
+#cache_refresh_interval = 1440
+
+# Data Store table prefix. (string value)
+#table_prefix = sdnc
+
+# Base URL for SDN-C, up to and including the version. (string value)
+server_url = https://sdncodl-conexus-e2e.ecomp.cci.att.com:8543/restconf/
+
+# Basic Authentication Username (string value)
+username = admin
+
+# Basic Authentication Password (string value)
+password = sdnc.15
+
+
+[service_controller]
+
+#
+# From conductor
+#
+
+# Extensions list to use (list value)
+#extensions = sdnc
+
+
+[solver]
+
+#
+# From conductor
+#
+
+# Number of workers for solver service. Default value is 1. (integer value)
+# Minimum value: 1
+#workers = 1
+
+# Set to True when solver will run in active-active mode. When set to False,
+# solver will restart any orphaned solving requests at startup. (boolean value)
+#concurrent = false
+concurrent = true
+
+
+
+[reservation]
+concurrent = true
diff --git a/conductor/docker/solver/Dockerfile b/conductor/docker/Dockerfile
index b1a3125..3e1f43c 100755
--- a/conductor/docker/solver/Dockerfile
+++ b/conductor/docker/Dockerfile
@@ -16,10 +16,16 @@
# -------------------------------------------------------------------------
FROM python:2.7
-RUN apt-get update
-RUN apt-get --assume-yes install python-setuptools
+ENV CON_ADDR "127.0.0.1"
+ENV CON_PORT "8091"
+
+EXPOSE 8091
+
+RUN apt-get update && apt-get --assume-yes install python-setuptools && \
+apt-get install -y unzip && \
+apt-get install -y curl && \
+apt-get install -y wget
+
RUN git clone https://gerrit.onap.org/r/optf/has
-WORKDIR ./has/conductor
-RUN pip install -e .
-RUN echo "Starting conductor-solver"
-CMD ["python","/usr/local/bin/conductor-solver", "--config-file=/usr/local/bin/conductor.conf"]
+RUN cd ./has/conductor/ && pip install -e .
+COPY api_paste.ini /usr/local/bin/api_paste.ini
diff --git a/conductor/docker/api/Dockerfile b/conductor/docker/api/Dockerfile
deleted file mode 100755
index 9280c6c..0000000
--- a/conductor/docker/api/Dockerfile
+++ /dev/null
@@ -1,38 +0,0 @@
-# -------------------------------------------------------------------------
-# Copyright (c) 2015-2017 AT&T Intellectual Property
-#
-# 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 python:2.7
-ENV CON_ADDR "127.0.0.1"
-ENV CON_PORT "8091"
-
-EXPOSE 8091
-
-RUN apt-get update
-RUN apt-get --assume-yes install python-setuptools
-RUN apt-get install -y unzip
-RUN apt-get install -y curl
-RUN apt-get install -y wget
-RUN rm -rf ./has
-RUN git clone https://gerrit.onap.org/r/optf/has
-WORKDIR ./has/conductor/
-#RUN ls
-RUN pip install -e .
-#COPY ./conductor.conf conductor.conf
-WORKDIR ./has/conductor/docker/api
-COPY api_paste.ini /usr/local/bin/api_paste.ini
-RUN ls
-CMD ["sh","-c", "python /usr/local/bin/conductor-api --port=8091 -- --config-file=/usr/local/bin/conductor.conf"]
diff --git a/conductor/docker/api/api_paste.ini b/conductor/docker/api_paste.ini
index 4299f46..4299f46 100755
--- a/conductor/docker/api/api_paste.ini
+++ b/conductor/docker/api_paste.ini
diff --git a/conductor/docker/controller/Dockerfile b/conductor/docker/controller/Dockerfile
deleted file mode 100755
index 4f9bfdd..0000000
--- a/conductor/docker/controller/Dockerfile
+++ /dev/null
@@ -1,25 +0,0 @@
-# -------------------------------------------------------------------------
-# Copyright (c) 2015-2017 AT&T Intellectual Property
-#
-# 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 python:2.7
-RUN apt-get update
-RUN apt-get --assume-yes install python-setuptools
-RUN git clone https://gerrit.onap.org/r/optf/has
-WORKDIR ./has/conductor/
-RUN pip install -e .
-RUN echo "Starting conductor-controller"
-CMD ["python","/usr/local/bin/conductor-controller", "--config-file=/usr/local/bin/conductor.conf"]
diff --git a/conductor/docker/data/Dockerfile b/conductor/docker/data/Dockerfile
deleted file mode 100755
index 9485644..0000000
--- a/conductor/docker/data/Dockerfile
+++ /dev/null
@@ -1,25 +0,0 @@
-# -------------------------------------------------------------------------
-# Copyright (c) 2015-2017 AT&T Intellectual Property
-#
-# 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 python:2.7
-RUN apt-get update
-RUN apt-get --assume-yes install python-setuptools
-RUN git clone https://gerrit.onap.org/r/optf/has
-WORKDIR ./has/conductor
-RUN pip install -e .
-RUN echo "Starting conductor-data"
-CMD ["python","/usr/local/bin/conductor-data", "--config-file=/usr/local/bin/conductor.conf"]
diff --git a/conductor/docker/reservation/Dockerfile b/conductor/docker/reservation/Dockerfile
deleted file mode 100755
index 323f15d..0000000
--- a/conductor/docker/reservation/Dockerfile
+++ /dev/null
@@ -1,26 +0,0 @@
-# -------------------------------------------------------------------------
-# Copyright (c) 2015-2017 AT&T Intellectual Property
-#
-# 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 python:2.7
-RUN apt-get update
-RUN apt-get --assume-yes install python-setuptools
-RUN git clone https://gerrit.onap.org/r/optf/has
-WORKDIR ./has/conductor/
-RUN pip install -e .
-RUN pwd
-RUN echo "Starting conductor-reservation"
-CMD ["python","/usr/local/bin/conductor-reservation", "--config-file=/usr/local/bin/conductor.conf"]
diff --git a/log.conf b/log.conf
new file mode 100644
index 0000000..d0ec41b
--- /dev/null
+++ b/log.conf
@@ -0,0 +1,64 @@
+[loggers]
+keys=root
+
+[handlers]
+keys=trfhand,consoleHandler,audithand,metrichand,errhand,debughand
+
+[logger_root]
+level=NOTSET
+handlers=trfhand,consoleHandler,audithand,metrichand,errhand,debughand
+
+[handler_consoleHandler]
+class=StreamHandler
+level=NOTSET
+formatter=generic
+args=(sys.stdout,)
+
+[handler_trfhand]
+class=handlers.TimedRotatingFileHandler
+level=NOTSET
+formatter=generic
+args=('application.log','midnight', 1, 10)
+
+[handler_audithand]
+class=handlers.TimedRotatingFileHandler
+level=INFO
+formatter=audit
+args=('audit.log', 'midnight', 1, 10)
+
+[handler_metrichand]
+class=handlers.TimedRotatingFileHandler
+level=INFO
+formatter=metric
+args=('metric.log','midnight', 1, 10)
+
+[handler_errhand]
+class=handlers.TimedRotatingFileHandler
+level=ERROR
+formatter=error
+args=('error.log','midnight', 1, 10)
+
+[handler_debughand]
+class=handlers.TimedRotatingFileHandler
+level=DEBUG
+formatter=generic
+args=('debug.log','midnight', 1, 10)
+
+[formatters]
+keys=generic,audit,metric,error
+
+[formatter_audit]
+format=%(asctime)s|%(asctime)s|00000000-0000-0000-0000-000000000000||%(thread)d||Conductor|N/A|COMPLETE|200|sucessful||%(levelname)s|||0|%(module)s|||||||||%(name)s : [-] %(message)s
+datefmt=
+
+[formatter_metric]
+format=%(asctime)s|%(asctime)s|00000000-0000-0000-0000-000000000000||%(thread)d||Conductor|N/A|N/A|N/A|COMPLETE|200|sucessful||%(levelname)s|||0|%(module)s||||||||||%(name)s : [-] %(message)s
+datefmt=
+
+[formatter_error]
+format=%(asctime)s|00000000-0000-0000-0000-000000000000|%(thread)d|Conductor|N/A|N/A|N/A|ERROR|500|N/A|%(name)s : [-] %(message)s
+datefmt=
+
+[formatter_generic]
+format=%(asctime)s||%(thread)d|%(levelname)s|%(module)s|%(name)s: [-] %(message)s
+datefmt=
diff --git a/push-dockers.sh b/push-dockers.sh
deleted file mode 100755
index f67944e..0000000
--- a/push-dockers.sh
+++ /dev/null
@@ -1,42 +0,0 @@
-#!/bin/bash
-BUILD_ARGS="--no-cache"
-ORG="onap"
-VERSION="1.1.0"
-PROJECT="optf"
-IMAGE="api"
-DOCKER_REPOSITORY="nexus3.onap.org:10003"
-IMAGE_NAME="${DOCKER_REPOSITORY}/${ORG}/${PROJECT}/${IMAGE}"
-TIMESTAMP=$(date +"%Y%m%dT%H%M%S")
-
-if [ $HTTP_PROXY ]; then
-BUILD_ARGS+=" --build-arg HTTP_PROXY=${HTTP_PROXY}"
-fi
-if [ $HTTPS_PROXY ]; then
- BUILD_ARGS+=" --build-arg HTTPS_PROXY=${HTTPS_PROXY}"
-fi
-
-function tag {
- echo "Tagging !!!"
- docker tag api "nexus3.onap.org:10003/onap/optf/api"
- docker tag data "nexus3.onap.org:10003/onap/optf/data"
- docker tag controller "nexus3.onap.org:10003/onap/optf/controller"
- docker tag solver "nexus3.onap.org:10003/onap/optf/solver"
- docker tag reservation "nexus3.onap.org:10003/onap/optf/reservation"
-}
-
-function push_image {
- echo "Start push ${IMAGE_NAME}:latest"
-
- tag
- docker push "nexus3.onap.org:10003/onap/optf/api"
- docker push "nexus3.onap.org:10003/onap/optf/data"
- docker push "nexus3.onap.org:10003/onap/optf/controller"
- docker push "nexus3.onap.org:10003/onap/optf/solver"
- docker push "nexus3.onap.org:10003/onap/optf/reservation"
-
- #docker push ${IMAGE_NAME}:latest
- #push_image_tag ${IMAGE_NAME}:${VERSION}-SNAPSHOT-latest
- #push_image_tag ${IMAGE_NAME}:${VERSION}-STAGING-latest
- #push_image_tag ${IMAGE_NAME}:${VERSION}-STAGING-${TIMESTAMP}
- }
-push_image
diff --git a/run-dockers.sh b/run-dockers.sh
index f8ae249..569957c 100755
--- a/run-dockers.sh
+++ b/run-dockers.sh
@@ -1,7 +1,94 @@
+#!/bin/bash
### example run - provide the conductor configuration file as input to the run script
# ./run-dockers.sh <path-to>/conductor.conf
-docker run -v $1:/usr/local/bin/conductor.conf data &
-docker run -v $1:/usr/local/bin/conductor.conf controller &
-docker run -p "8091:8091" -v $1:/usr/local/bin/conductor.conf api &
-docker run -v $1:/usr/local/bin/conductor.conf solver &
-docker run -v $1:/usr/local/bin/conductor.conf reservation &
+
+BUILD_ARGS="--no-cache"
+ORG="onap"
+VERSION="1.1.1"
+STAGING="1.1.1-STAGING"
+PROJECT="optf-has"
+DOCKER_REPOSITORY="nexus3.onap.org:10003"
+IMAGE_NAME="${DOCKER_REPOSITORY}/${ORG}/${PROJECT}"
+
+function print_usage {
+ echo Usage:
+ echo 1. conductor.conf file location
+ echo 2. log.conf file location
+ echo 3. AAI Certificate file location
+ echo 4. AAI Key file location
+ echo 5. AAI CA bundle file location
+}
+
+function get_default_location(){
+ [ -f "$1" ] # run the test
+ return $? # store the result
+}
+
+function get_from_arguments_or_default(){
+ default_name=$1
+ arg_num=$2
+ echo $arg_num argument $default_name file. Not provided
+ echo ... Trying to get using default name $default_name in current direcotry.
+
+ get_default_location $default_name
+ if(($? == 0)); then
+ echo ... Found $default_name in the current directory using this as $arg_num argument
+ echo default_name is $arg_num
+ if (($arg_num == 1)); then
+ COND_CONF=$(pwd)/$default_name
+ elif (($arg_num == 2)); then
+ LOG_CONF=$(pwd)/$default_name
+ elif (($arg_num == 3)); then
+ CERT=$(pwd)/$default_name
+ elif (($arg_num == 4)); then
+ KEY=$(pwd)/$default_name
+ elif (($arg_num == 5)); then
+ BUNDLE=$(pwd)/$default_name
+ fi
+ else
+ echo ... Could not find $default_name in the location you are running this script from. Either provide as $arg_num argument to the script or copy as $default_name in current directory.
+ print_usage
+ exit 0;
+ fi
+}
+#conductor.conf
+if [ -z "$1" ]
+ then
+ get_from_arguments_or_default 'conductor.conf' 1
+fi
+
+#log.conf
+if [ -z "$2" ]
+ then
+ get_from_arguments_or_default 'log.conf' 2
+fi
+
+#aai_cert.cer
+if [ -z "$3" ]
+ then
+ get_from_arguments_or_default './aai_cert.cer' 3
+fi
+
+
+#aai_key.key
+if [ -z "$4" ]
+ then
+ get_from_arguments_or_default './aai_key.key' 4
+fi
+
+
+#aai_ca_bundle.pem
+if [ -z "$5" ]
+ then
+ get_from_arguments_or_default 'aai_ca_bundle.pem' 5
+fi
+
+echo Value is .... $COND_CONF $LOG_FILE
+echo Attempting to run multiple containers on image .... ${IMAGE_NAME}
+docker login -u anonymous -p anonymous ${DOCKER_REPOSITORY}
+docker run -d --name controller -v $COND_CONF:/usr/local/bin/conductor.conf -v $LOG_CONF:/usr/local/bin/log.conf ${IMAGE_NAME}:latest python /usr/local/bin/conductor-controller --config-file=/usr/local/bin/conductor.conf
+docker run -d --name api -p "8091:8091" -v $COND_CONF:/usr/local/bin/conductor.conf -v $LOG_CONF:/usr/local/bin/log.conf ${IMAGE_NAME}:latest python /usr/local/bin/conductor-api --port=8091 -- --config-file=/usr/local/bin/conductor.conf
+docker run -d --name solver -v $COND_CONF:/usr/local/bin/conductor.conf -v $LOG_CONF:/usr/local/bin/log.conf ${IMAGE_NAME}:latest python /usr/local/bin/conductor-solver --config-file=/usr/local/bin/conductor.conf
+docker run -d --name reservation -v $COND_CONF:/usr/local/bin/conductor.conf -v $LOG_CONF:/usr/local/bin/log.conf ${IMAGE_NAME}:latest python /usr/local/bin/conductor-reservation --config-file=/usr/local/bin/conductor.conf
+docker run -d --name data -v $COND_CONF:/usr/local/bin/conductor.conf -v $LOG_CONF:/usr/local/bin/log.conf -v $CERT:/usr/local/bin/aai_cert.cer -v $KEY:/usr/local/bin/aai_key.key -v $BUNDLE:/usr/local/bin/bundle.pem ${IMAGE_NAME}:latest python /usr/local/bin/conductor-data --config-file=/usr/local/bin/conductor.conf
+
diff --git a/stop-dockers.sh b/stop-dockers.sh
index 72595e8..7032284 100755
--- a/stop-dockers.sh
+++ b/stop-dockers.sh
@@ -1,5 +1,2 @@
-docker stop $(sudo docker ps -a -q --filter ancestor=api)
-docker stop $(sudo docker ps -a -q --filter ancestor=solver)
-docker stop $(sudo docker ps -a -q --filter ancestor=reservation)
-docker stop $(sudo docker ps -a -q --filter ancestor=data)
-docker stop $(sudo docker ps -a -q --filter ancestor=controller)
+docker stop api solver reservation data controller
+docker rm api solver reservation data controller