@@ -303,114 +303,92 @@ jobs:
303303 docker logs mssqltestdb
304304 shell : bash
305305
306- - name : Verify that UI is up and running standalone
307- uses : HSLdevcom/jore4-tools/github-actions/healthcheck@healthcheck-v1
308- with :
309- command : " curl --fail http://localhost:3302 --output /dev/null --silent"
310-
311- - name : Verify that UI is up and running through proxy
312- uses : HSLdevcom/jore4-tools/github-actions/healthcheck@healthcheck-v1
306+ - name : Setup Python
307+ uses : actions/setup-python@v6
313308 with :
314- command : " curl --fail http://localhost:3300 --output /dev/null --silent "
309+ python-version : ' 3.13 '
315310
316- - name : Verify that hasura is up and running standalone
317- uses : HSLdevcom/jore4-tools/github-actions/healthcheck@healthcheck-v1
318- with :
319- command : " curl --fail http://localhost:3201/healthz --output /dev/null --silent"
320-
321- - name : Verify that hasura is up and running through proxy
322- uses : HSLdevcom/jore4-tools/github-actions/healthcheck@healthcheck-v1
323- with :
324- command : " curl --fail http://localhost:3300/api/graphql/healthz --output
325- /dev/null --silent"
326-
327- - name : Verify that jore3 importer is up and running standalone
328- if : ${{ inputs.start_jore3_importer == 'true' }}
329- uses : HSLdevcom/jore4-tools/github-actions/healthcheck@healthcheck-v1
330- with :
331- command :
332- " curl --fail http://localhost:3004/actuator/health --output /dev/null
333- --silent"
311+ - name : Setup Development Environment
312+ run : |
313+ python \
314+ <<EOF
315+ import argparse
316+ import asyncio
317+ import sys
318+
319+
320+ async def main():
321+ args = parse_args()
322+
323+ for i in range(0, 60):
324+ print(f"Try #{i + 1}")
325+
326+ # Create a list of tasks for each command
327+ tasks = [
328+ check_service_status(name, url)
329+ for name, url in (
330+ ("UI", "http://localhost:3302"),
331+ ("UI (through proxy)", "http://localhost:3300"),
332+ ("Hasura", "http://localhost:3201/healthz"),
333+ ("Hasura (proxy)", "http://localhost:3300/api/graphql/healthz"),
334+ ("Auth backend", "http://localhost:3200/actuator/health"),
335+ ("Auth backend (database)", "http://localhost:3200/public/v1/login"),
336+ ("Auth backend (proxy)", "http://localhost:3300/api/auth/actuator/health"),
337+ ("mbtiles server", "http://localhost:3203/services"),
338+ ("mbtiles server (proxy)", "http://localhost:3300/api/mbtiles/services"),
339+ # JORE3 IMPORTER PUUTTUU
340+ ("map matching", "http://localhost:3005/actuator/health"),
341+ ("map matching (proxy)", "http://localhost:3300/api/mapmatching/actuator/health"),
342+ ("hastus", "http://localhost:3008/actuator/health"),
343+ ("hastus (proxy)", "http://localhost:3300/api/hastus/actuator/health"),
344+ ("timetables-api", "http://localhost:3009/actuator/health"),
345+ ("tiamat", "http://localhost:3010/actuator/health"),
346+ )
347+ ]
348+
349+ # Run all tasks concurrently and get their results
350+ results = await asyncio.gather(*tasks)
351+
352+ if all(results):
353+ break
354+
355+ await asyncio.sleep(1)
356+
357+
358+ if all(results):
359+ print("\n✅ All commands succeeded. Exiting.")
360+ else:
361+ print("Fail")
362+ sys.exit(1)
363+
364+ async def check_service_status(name, url):
365+ process = await asyncio.create_subprocess_exec(
366+ "curl",
367+ "--fail",
368+ "--silent",
369+ url,
370+ stdout=asyncio.subprocess.PIPE,
371+ stderr=asyncio.subprocess.PIPE
372+ )
373+
374+ await process.wait()
375+
376+ result = process.returncode == 0
377+
378+ print(f"{url}: {result}")
379+
380+ return result
381+
382+
383+ if __name__ == "__main__":
384+ asyncio.run(main())
385+ EOF
334386
335387 - name : Verify that cypress test container is up and running standalone
336388 uses : HSLdevcom/jore4-tools/github-actions/healthcheck@healthcheck-v1
337389 with :
338390 command : " docker exec cypress yarn cypress --version"
339391
340- - name : Verify that timetables-api is up and running standalone
341- uses : HSLdevcom/jore4-tools/github-actions/healthcheck@healthcheck-v1
342- with :
343- command : " curl --fail http://localhost:3009/actuator/health --output
344- /dev/null --silent"
345-
346- - name : Verify that mbtiles server is up and running standalone
347- uses : HSLdevcom/jore4-tools/github-actions/healthcheck@healthcheck-v1
348- with :
349- command : " curl --fail http://localhost:3203/services --output /dev/null
350- --silent"
351-
352- - name : Verify that mbtiles server is up and running through proxy
353- uses : HSLdevcom/jore4-tools/github-actions/healthcheck@healthcheck-v1
354- with :
355- command :
356- " curl --fail http://localhost:3300/api/mbtiles/services --output
357- /dev/null --silent"
358-
359- - name : Verify that map matching server is up and running standalone
360- uses : HSLdevcom/jore4-tools/github-actions/healthcheck@healthcheck-v1
361- with :
362- command :
363- " curl --fail http://localhost:3005/actuator/health --output /dev/null
364- --silent"
365-
366- - name : Verify that map matching server is up and running through proxy
367- uses : HSLdevcom/jore4-tools/github-actions/healthcheck@healthcheck-v1
368- with :
369- command :
370- " curl --fail http://localhost:3300/api/mapmatching/actuator/health
371- --output /dev/null --silent"
372-
373- - name : Verify that hastus importer is up and running standalone
374- uses : HSLdevcom/jore4-tools/github-actions/healthcheck@healthcheck-v1
375- with :
376- command :
377- " curl --fail http://localhost:3008/actuator/health --output /dev/null
378- --silent"
379-
380- - name : Verify that hastus importer is up and running through proxy
381- uses : HSLdevcom/jore4-tools/github-actions/healthcheck@healthcheck-v1
382- with :
383- command :
384- " curl --fail http://localhost:3300/api/hastus/actuator/health --output
385- /dev/null --silent"
386-
387- - name : Verify that auth backend is up and running standalone
388- uses : HSLdevcom/jore4-tools/github-actions/healthcheck@healthcheck-v1
389- with :
390- command :
391- " curl --fail http://localhost:3200/actuator/health --output /dev/null
392- --silent"
393-
394- - name : Verify that auth backend has access to database
395- uses : HSLdevcom/jore4-tools/github-actions/healthcheck@healthcheck-v1
396- with :
397- command :
398- " curl --fail http://localhost:3200/public/v1/login --output /dev/null
399- --silent"
400-
401- - name : Verify that auth backend is up and running through proxy
402- uses : HSLdevcom/jore4-tools/github-actions/healthcheck@healthcheck-v1
403- with :
404- command :
405- " curl --fail http://localhost:3300/api/auth/actuator/health --output
406- /dev/null --silent"
407-
408- - name : Verify that tiamat is up and running standalone
409- uses : HSLdevcom/jore4-tools/github-actions/healthcheck@healthcheck-v1
410- with :
411- command : " curl --fail http://localhost:3010/actuator/health --output
412- /dev/null --silent"
413-
414392 - name : Reload Hasura metadata to re-establish connection to Tiamat
415393 # Hasura remote schema will break if it cannot establish connection on startup. Force reload after everything is running.
416394 env :
0 commit comments