From e01ce1602addba1eb132ebbe0c03439fdf060f58 Mon Sep 17 00:00:00 2001 From: Gyanendra Mishra Date: Tue, 17 Oct 2023 14:13:01 +0100 Subject: [PATCH] fix: big table spin up logic for k8s (#298) tested locally on digital ocean --- .../full_beaconchain_launcher.star | 35 ++++++++++++------- 1 file changed, 23 insertions(+), 12 deletions(-) diff --git a/src/full_beaconchain/full_beaconchain_launcher.star b/src/full_beaconchain/full_beaconchain_launcher.star index 375ec0313..d4bbb20ff 100644 --- a/src/full_beaconchain/full_beaconchain_launcher.star +++ b/src/full_beaconchain/full_beaconchain_launcher.star @@ -104,28 +104,39 @@ def launch_full_beacon( # Initialize the db schema initdbschema = plan.add_service( - name="explorer-initdbschema", + name="explorer-schema-initializer", config=ServiceConfig( image=IMAGE_NAME, files={ "/app/config/": config_files_artifact_name, }, - entrypoint=["./misc"], - cmd=["-config", "/app/config/config.yml", "-command", "applyDbSchema"], + entrypoint=["tail", "-f", "/dev/null"], ), ) + + plan.print("applying db schema") + plan.exec( + service_name=initdbschema.name, + recipe=ExecRecipe( + ["./misc", "-config", "/app/config/config.yml", "-command", "applyDbSchema"] + ), + ) + + plan.print("applying big table schema") # Initialize the bigtable schema - initbigtableschema = plan.add_service( - name="explorer-initbigtableschema", - config=ServiceConfig( - image=IMAGE_NAME, - files={ - "/app/config/": config_files_artifact_name, - }, - entrypoint=["./misc"], - cmd=["-config", "/app/config/config.yml", "-command", "initBigtableSchema"], + plan.exec( + service_name=initdbschema.name, + recipe=ExecRecipe( + [ + "./misc", + "-config", + "/app/config/config.yml", + "-command", + "initBigtableSchema", + ] ), ) + # Start the indexer indexer = plan.add_service( name="explorer-indexer",