diff --git a/docker-compose.yml b/docker-compose.yml index 9f462ed..2866cbd 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -4,7 +4,7 @@ version: '3.8' # reg: services: - witnesses: + witness-demo: # container_name: witnesshost # hostname: witnesshost image: 2byrds/keripy:latest @@ -18,16 +18,16 @@ services: - 5644:5644 # witness entrypoint: kli witness demo healthcheck: - test: ['CMD', 'curl', '-f', 'http://localhost:5642/oobi'] - interval: 2s - timeout: 3s - retries: 5 - start_period: 2s + test: ['CMD', 'curl', '-f', 'http://localhost:5642/oobi'] + interval: 2s + timeout: 3s + retries: 5 + start_period: 2s - vlei: + vlei-server: image: 2byrds/vlei:latest - container_name: vlei - hostname: vlei + container_name: vlei-server + hostname: vlei-server ports: - 7723:7723 environment: @@ -35,15 +35,15 @@ services: - PYTHONIOENCODING=UTF-8 entrypoint: [ "vLEI-server", "-s", "./schema/acdc", "-c" , "./samples/acdc/", "-o", "./samples/oobis/" ] healthcheck: - test: - - CMD - - curl - - -f - - http://localhost:7723/oobi/EBfdlu8R27Fbx-ehrqwImnK-8Cm79sqbAQ4MmvEAYqao - interval: 2s - timeout: 3s - retries: 5 - start_period: 2s + test: + - CMD + - curl + - -f + - http://localhost:7723/oobi/EBfdlu8R27Fbx-ehrqwImnK-8Cm79sqbAQ4MmvEAYqao + interval: 2s + timeout: 3s + retries: 5 + start_period: 2s vlei-verifier: build: @@ -53,28 +53,28 @@ services: container_name: vlei-verifier hostname: vlei-verifier depends_on: - - vlei - - witnesses + - vlei-server + - witness-demo ports: - 7676:7676 healthcheck: - test: - - CMD - - curl - - -f - - http://localhost:7676/authorizations/BGj25ISqZ7vw79h6R3o20EHZebS6I6ey5Q0xuAabSveW - interval: 2s - timeout: 3s - retries: 5 - start_period: 2s + test: + - CMD + - curl + - -f + - http://localhost:7676/health + interval: 2s + timeout: 3s + retries: 5 + start_period: 2s deps: - image: alpine - command: ['echo', 'Dependencies running'] - depends_on: - vlei: - condition: service_healthy - vlei-verifier: - condition: service_healthy - witnesses: - condition: service_healthy \ No newline at end of file + image: alpine + command: ['echo', 'Dependencies running'] + depends_on: + vlei-server: + condition: service_healthy + vlei-verifier: + condition: service_healthy + witness-demo: + condition: service_healthy \ No newline at end of file diff --git a/src/verifier/core/verifying.py b/src/verifier/core/verifying.py index 9c61734..3bce7c7 100644 --- a/src/verifier/core/verifying.py +++ b/src/verifier/core/verifying.py @@ -34,6 +34,8 @@ def loadEnds(app, hby, vdb, tvy, vry): """ + healthEnd = HealthEndpoint() + app.add_route("/health", healthEnd) presentEnd = PresentationResourceEndpoint(hby, vdb, tvy, vry) app.add_route("/presentations/{said}", presentEnd) presentResEnd = AuthorizationResourceEnd(hby, vdb) @@ -260,3 +262,10 @@ def on_post(self, req, rep, aid): raise falcon.HTTPUnauthorized(description=f"{aid} provided invalid signature on request data") rep.status = falcon.HTTP_ACCEPTED + +class HealthEndpoint: + def __init__(self): + pass + def on_get(self, req, rep): + rep.status = falcon.HTTP_OK + rep.data = json.dumps(dict(health="vLEI verification service is healthy")).encode("utf-8") \ No newline at end of file