Skip to content

Commit

Permalink
Merge pull request #3 from 2byrds/docker_fixes
Browse files Browse the repository at this point in the history
service health check added
  • Loading branch information
2byrds authored Apr 25, 2024
2 parents e7e3e94 + 90661fd commit 1ab9a15
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 38 deletions.
76 changes: 38 additions & 38 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ version: '3.8'
# reg:

services:
witnesses:
witness-demo:
# container_name: witnesshost
# hostname: witnesshost
image: 2byrds/keripy:latest
Expand All @@ -18,32 +18,32 @@ 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:
- PYTHONUNBUFFERED=1
- 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:
Expand All @@ -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
image: alpine
command: ['echo', 'Dependencies running']
depends_on:
vlei-server:
condition: service_healthy
vlei-verifier:
condition: service_healthy
witness-demo:
condition: service_healthy
9 changes: 9 additions & 0 deletions src/verifier/core/verifying.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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")

0 comments on commit 1ab9a15

Please sign in to comment.