Optimize application name accessing in Docker Compose.
Issue-ID: CCSDK-1917
Signed-off-by: Brinda Santh <bs2796@att.com>
Change-Id: I6b055de7ef5a8ac4a0c103499997ed272bd74ac6
CLUSTER_STORAGE_PATH: /opt/app/onap/config/cluster
#CLUSTER_CONFIG_FILE: /opt/app/onap/config/atomix/atomix-multicast.conf
NATS_CLUSTER_ID: cds-cluster
- NATS_HOSTS: nats://nats:4222
- APPLICATIONNAME: cds-controller
+ APP_NAME: cds-controller
BUNDLEVERSION: 1.0.0
APP_CONFIG_HOME: /opt/app/onap/config
STICKYSELECTORKEY:
CLUSTER_STORAGE_PATH: /opt/app/onap/config/cluster
#CLUSTER_CONFIG_FILE: /opt/app/onap/config/atomix/atomix-multicast.conf
NATS_CLUSTER_ID: cds-cluster
- NATS_HOSTS: nats://nats:4222
- APPLICATIONNAME: resource-resolution
+ APP_NAME: resource-resolution
BUNDLEVERSION: 1.0.0
APP_CONFIG_HOME: /opt/app/onap/config
STICKYSELECTORKEY:
CLUSTER_NODE_ID: py-executor-0
CLUSTER_MEMBERS: cds-controller-0,resource-resolution-0,py-executor-0
NATS_CLUSTER_ID: cds-cluster
- NATS_HOSTS: nats://nats:4222
- APPLICATIONNAME: py-executor
+ APP_NAME: py-executor
BUNDLEVERSION: 1.0.0
APP_CONFIG_HOME: /opt/app/onap/config
STICKYSELECTORKEY:
cds-controller-default:
depends_on:
- db
+ - nats
image: onap/ccsdk-blueprintsprocessor:latest
container_name: cds-controller-default
hostname: cds-controller-default
type: volume
source: controller-config
environment:
- APPLICATIONNAME: cds-controller
+ APP_NAME: cds-controller
BUNDLEVERSION: 1.0.0
APP_CONFIG_HOME: /opt/app/onap/config
STICKYSELECTORKEY:
py-executor-default:
depends_on:
- db
+ - nats
image: onap/ccsdk-py-executor
container_name: py-executor-default
hostname: py-executor-default
type: volume
source: blueprints-deploy
environment:
- APPLICATIONNAME: py-executor
+ APP_NAME: py-executor
BUNDLEVERSION: 1.0.0
APP_CONFIG_HOME: /opt/app/onap/config
STICKYSELECTORKEY:
keytool -import -noprompt -trustcacerts -keystore $JAVA_HOME/jre/lib/security/cacerts -storepass changeit -alias ONAP -import -file $APP_CONFIG_HOME/ONAP_RootCA.cer
exec java -classpath "/etc:${APP_HOME}/lib/*:/lib/*:/src:/schema:/generated-sources:${APP_CONFIG_HOME}:${APP_HOME}" \
--DappName=${APPLICATIONNAME} -DappVersion=${BUNDLEVERSION} \
+-DappName=${APP_NAME} -DappVersion=${BUNDLEVERSION} \
-DrouteOffer=${ROUTEOFFER} \
-DVERSION_ROUTEOFFER_ENVCONTEXT=${BUNDLEVERSION}/${STICKYSELECTORKEY}/${ENVCONTEXT} \
-DSecurityFilePath=/etc \
-Dms_name=org.onap.ccsdk.cds.blueprintsprocessor \
-Dlogging.config=${APP_CONFIG_HOME}/logback.xml \
-Djava.security.egd=file:/dev/./urandom \
--DAPPNAME=${APPLICATIONNAME} -DAPPENV=${APP_ENV} -DAPPVERSION=${APP_VERSION} -DNAMESPACE=${NAMESPACE} \
+-DAPPNAME=${APP_NAME} -DAPPENV=${APP_ENV} -DAPPVERSION=${APP_VERSION} -DNAMESPACE=${NAMESPACE} \
-Dspring.config.location=${APP_CONFIG_HOME}/ \
org.onap.ccsdk.cds.blueprintsprocessor.BlueprintProcessorApplicationKt
/** This is sample scheduler implementation used during starting application with configuration.
@EventListener(ApplicationReadyEvent::class)
open fun init() = runBlocking {
- log.info("Starting PrioritizationListeners...")
- startScheduling(MessagePrioritizationSample.samplePrioritizationConfiguration())
+ log.info("Starting PrioritizationListeners...")
+ startScheduling(MessagePrioritizationSample.samplePrioritizationConfiguration())
}
- */
+ */
open suspend fun startScheduling() {
val prioritizationConfiguration = messagePrioritizationService.getConfiguration()
}
}
- open suspend fun shutdownScheduling(prioritizationConfiguration: PrioritizationConfiguration) {
+ open suspend fun shutdownScheduling() {
keepGoing = false
+ val prioritizationConfiguration = messagePrioritizationService.getConfiguration()
delay(prioritizationConfiguration.shutDownConfiguration.waitMill)
}
launch {
/** To debug increase the delay time */
delay(20)
- messagePrioritizationSchedulerService.shutdownScheduling(configuration)
+ messagePrioritizationSchedulerService.shutdownScheduling()
}
}
}
*/
object BluePrintConstants {
- val APP_NAME = System.getProperty("APPLICATION_NAME")
- ?: System.getProperty("APP_NAME")
- ?: System.getProperty("APPNAME")
+ val APP_NAME = System.getenv("APP_NAME")
?: "cds-controller"
const val DATE_TIME_PATTERN = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'"
if (!::streamingConnection.isInitialized) {
log.info(
"NATS connection requesting for cluster(${natsConnectionProperties.clusterId}) with" +
- "clientId($natsConnectionProperties.clientId)"
+ "clientId(${natsConnectionProperties.clientId})"
)
val serverList = natsConnectionProperties.host.splitCommaAsList()