diff options
author | Sebastien Premont-Tendland <sebastien.premont@bell.ca> | 2019-10-31 15:37:48 -0400 |
---|---|---|
committer | Sebastien Premont-Tendland <sebastien.premont@bell.ca> | 2019-11-14 14:52:38 -0500 |
commit | 03c7a8ddc3049f1b79b40ec96913eaaf8a539ef2 (patch) | |
tree | 231a1ec8048408c38074e840763a095d13e1e23f /ms/blueprintsprocessor/distribution/src | |
parent | 558ac2c252f5d22ff74b4f963ba1f23b26dcd248 (diff) |
Rolling upgrade support for in-flight requests
Three entry points are being handled :
1 - REST endpoint
2 - gRPC endpoint
3 - Kafka consumer
We make use of Phaser object to make sure the PreDestroy callback wait
for all requests to be executed before stopping the process.
The docker image was also modified to make sure the java process becomes
PID 1 in the container in order to catch the SIGTERM signal which
triggers the PreDestroy callback of Spring. This was done by using
the "exec" command in bash.
Issue-ID: CCSDK-1885
Signed-off-by: Sebastien Premont-Tendland <sebastien.premont@bell.ca>
Change-Id: I64611e569ddb78499aed2375e6186f028d1d8fa0
Diffstat (limited to 'ms/blueprintsprocessor/distribution/src')
-rwxr-xr-x | ms/blueprintsprocessor/distribution/src/main/docker/Dockerfile | 3 | ||||
-rw-r--r-- | ms/blueprintsprocessor/distribution/src/main/docker/startService.sh | 13 |
2 files changed, 13 insertions, 3 deletions
diff --git a/ms/blueprintsprocessor/distribution/src/main/docker/Dockerfile b/ms/blueprintsprocessor/distribution/src/main/docker/Dockerfile index 207cec5cb..2a85f1c95 100755 --- a/ms/blueprintsprocessor/distribution/src/main/docker/Dockerfile +++ b/ms/blueprintsprocessor/distribution/src/main/docker/Dockerfile @@ -1,7 +1,6 @@ FROM omahoco1/alpine-java-python # add entrypoint -COPY run.source /etc/run.source COPY startService.sh /startService.sh RUN chmod 777 /startService.sh && dos2unix /startService.sh @@ -12,4 +11,4 @@ RUN tar -xzf /source.tar.gz -C /tmp \ && rm -rf /source.tar.gz \ && rm -rf /tmp/@project.build.finalName@ -ENTRYPOINT /startService.sh +ENTRYPOINT [ "/startService.sh" ] diff --git a/ms/blueprintsprocessor/distribution/src/main/docker/startService.sh b/ms/blueprintsprocessor/distribution/src/main/docker/startService.sh index d1e09ddc3..752b5526c 100644 --- a/ms/blueprintsprocessor/distribution/src/main/docker/startService.sh +++ b/ms/blueprintsprocessor/distribution/src/main/docker/startService.sh @@ -7,4 +7,15 @@ export APP_HOME=/opt/app/onap keytool -import -trustcacerts -keystore $JAVA_HOME/jre/lib/security/cacerts -storepass changeit -alias ONAP -import -file $APP_CONFIG_HOME/ONAP_RootCA.cer -source /etc/run.source +exec java -classpath "/etc:${APP_HOME}/lib/*:/lib/*:/src:/schema:/generated-sources:${APP_CONFIG_HOME}:${APP_HOME}" \ +-DappName=${APPLICATIONNAME} -DappVersion=${BUNDLEVERSION} \ +-DrouteOffer=${ROUTEOFFER} \ +-DVERSION_ROUTEOFFER_ENVCONTEXT=${BUNDLEVERSION}/${STICKYSELECTORKEY}/${ENVCONTEXT} \ +-DSecurityFilePath=/etc \ +-DREST_NAME_NORMALIZER_PATTERN_FILE=/etc/PatternInputs.txt \ +-Dms_name=org.onap.ccsdk.cds.blueprintsprocessor \ +-Dlogging.config=${APP_CONFIG_HOME}/logback.xml \ +-Djava.security.egd=file:/dev/./urandom \ +-DAPPNAME=${APP_NAME} -DAPPENV=${APP_ENV} -DAPPVERSION=${APP_VERSION} -DNAMESPACE=${NAMESPACE} \ +-Dspring.config.location=${APP_CONFIG_HOME}/ \ +org.onap.ccsdk.cds.blueprintsprocessor.BlueprintProcessorApplication |