commit | d76905b9c98ec32f17bb9568ff80c04068aa213e | [log] [tgz] |
---|---|---|
author | fkrzywka <filip.krzywka@nokia.com> | Mon Jul 30 12:55:03 2018 +0200 |
committer | Piotr Jaszczyk <piotr.jaszczyk@nokia.com> | Fri Aug 03 10:24:25 2018 +0200 |
tree | 83154a3bcea680fd5902b48f4c27828e33167c9a | |
parent | a2d874fd73825b254a3e0be81cff57a5c3e1d9d7 [diff] |
Define simple healthchecks for simulators - currently containers are healthy if they have successfully started their Http servers thus simple endpoint at /healthcheck is sufficient - to enable docker healthcheck we need to add `curl` to docker images - http_proxy needs to be provided for docker to be able to build images behind proxy Closes ONAP-695 Change-Id: I02f0b8cc2732713b5307dbc34ba604d8185b74fc Signed-off-by: fkrzywka <filip.krzywka@nokia.com> Issue-ID: DCAEGEN2-601
diff --git a/hv-collector-dcae-app-simulator/Dockerfile b/hv-collector-dcae-app-simulator/Dockerfile index 39bd878..55bf645 100644 --- a/hv-collector-dcae-app-simulator/Dockerfile +++ b/hv-collector-dcae-app-simulator/Dockerfile
@@ -5,6 +5,10 @@ LABEL license.url="http://www.apache.org/licenses/LICENSE-2.0" LABEL maintainer="Nokia Wroclaw ONAP Team" +RUN apt-get update \ + && apt-get install -y --no-install-recommends curl \ + && apt-get clean + WORKDIR /opt/ves-hv-dcae-app-simulator ENTRYPOINT ["java", "-cp", "*:", "org.onap.dcae.collectors.veshv.simulators.dcaeapp.MainKt"] COPY target/libs/external/* ./
diff --git a/hv-collector-dcae-app-simulator/src/main/kotlin/org/onap/dcae/collectors/veshv/simulators/dcaeapp/remote/ApiServer.kt b/hv-collector-dcae-app-simulator/src/main/kotlin/org/onap/dcae/collectors/veshv/simulators/dcaeapp/remote/ApiServer.kt index cb1484b..79f143e 100644 --- a/hv-collector-dcae-app-simulator/src/main/kotlin/org/onap/dcae/collectors/veshv/simulators/dcaeapp/remote/ApiServer.kt +++ b/hv-collector-dcae-app-simulator/src/main/kotlin/org/onap/dcae/collectors/veshv/simulators/dcaeapp/remote/ApiServer.kt
@@ -93,6 +93,9 @@ .block() } } + .get("healthcheck") { ctx -> + ctx.response.status(STATUS_OK).send() + } } private fun generateEvents(ctx: Context, parameters: List<MessageParameters>):