Skip to content

Commit

Permalink
Add optional LOG_CONFIG_FILE to all operables
Browse files Browse the repository at this point in the history
  • Loading branch information
jhbertra committed Mar 21, 2023
1 parent d2cd645 commit 2383596
Showing 1 changed file with 37 additions and 6 deletions.
43 changes: 37 additions & 6 deletions deploy/operables.nix
Expand Up @@ -127,6 +127,11 @@ in
# HTTP_PORT: port number for the HTTP healthcheck server
# Either DB_HOST or MASTER_REPLICA_SRV_DNS (for auto-discovery of DB host with srvaddr)
#################
# OPTIONAL VARS #
#################
# LOG_CONFIG_FILE: The path to the JSON logging config file
[ -z "''${NODE_CONFIG:-}" ] && echo "NODE_CONFIG env var must be set -- aborting" && exit 1
[ -z "''${CARDANO_NODE_SOCKET_PATH:-}" ] && echo "CARDANO_NODE_SOCKET_PATH env var must be set -- aborting" && exit 1
[ -z "''${DB_NAME:-}" ] && echo "DB_NAME env var must be set -- aborting" && exit 1
Expand Down Expand Up @@ -162,13 +167,14 @@ in
${wait-for-socket}/bin/wait-for-socket "$CARDANO_NODE_SOCKET_PATH"
${packages.marlowe-chain-indexer}/bin/marlowe-chain-indexer \
${packages.marlowe-chain-indexer}/bin/marlowe-chain-indexer $([ -z $LOG_CONFIG_FILE ] || echo --log-config-file "$LOG_CONFIG_FILE") \
--socket-path "$CARDANO_NODE_SOCKET_PATH" \
--database-uri "$DATABASE_URI" \
--shelley-genesis-config-file "$SHELLEY_GENESIS_CONFIG" \
--genesis-config-file "$BYRON_GENESIS_CONFIG" \
--genesis-config-file-hash "$BYRON_GENESIS_HASH" \
--http-port "$HTTP_PORT"
'';
};

Expand All @@ -185,6 +191,11 @@ in
# Either DB_HOST or MASTER_REPLICA_SRV_DNS (for auto-discovery of DB host with srvaddr)
# HTTP_PORT: port number for the HTTP healthcheck server
#################
# OPTIONAL VARS #
#################
# LOG_CONFIG_FILE: The path to the JSON logging config file
[ -z "''${HOST:-}" ] && echo "HOST env var must be set -- aborting" && exit 1
[ -z "''${PORT:-}" ] && echo "PORT env var must be set -- aborting" && exit 1
[ -z "''${QUERY_PORT:-}" ] && echo "QUERY_PORT env var must be set -- aborting" && exit 1
Expand All @@ -211,7 +222,7 @@ in
${wait-for-socket}/bin/wait-for-socket "$CARDANO_NODE_SOCKET_PATH"
DATABASE_URI=${database-uri}
${packages.marlowe-chain-sync}/bin/marlowe-chain-sync \
${packages.marlowe-chain-sync}/bin/marlowe-chain-sync $([ -z $LOG_CONFIG_FILE ] || echo --log-config-file "$LOG_CONFIG_FILE") \
--host "$HOST" \
--port "$PORT" \
--query-port "$QUERY_PORT" \
Expand All @@ -235,6 +246,11 @@ in
# Either DB_HOST or MASTER_REPLICA_SRV_DNS (for auto-discovery of DB host with srvaddr)
# HTTP_PORT: port number for the HTTP healthcheck server
#################
# OPTIONAL VARS #
#################
# LOG_CONFIG_FILE: The path to the JSON logging config file
[ -z "''${DB_NAME:-}" ] && echo "DB_NAME env var must be set -- aborting" && exit 1
[ -z "''${DB_USER:-}" ] && echo "DB_USER env var must be set -- aborting" && exit 1
[ -z "''${DB_PASS:-}" ] && echo "DB_PASS env var must be set -- aborting" && exit 1
Expand Down Expand Up @@ -264,7 +280,7 @@ in
${wait-for-tcp}/bin/wait-for-tcp "$MARLOWE_CHAIN_SYNC_HOST" "$MARLOWE_CHAIN_SYNC_PORT"
${packages.marlowe-indexer}/bin/marlowe-indexer \
${packages.marlowe-indexer}/bin/marlowe-indexer $([ -z $LOG_CONFIG_FILE ] || echo --log-config-file "$LOG_CONFIG_FILE") \
--database-uri "$DATABASE_URI" \
--chain-sync-port "$MARLOWE_CHAIN_SYNC_PORT" \
--chain-sync-query-port "$MARLOWE_CHAIN_SYNC_QUERY_PORT" \
Expand All @@ -286,6 +302,11 @@ in
# Either DB_HOST or MASTER_REPLICA_SRV_DNS (for auto-discovery of DB host with srvaddr)
# HTTP_PORT: port number for the HTTP healthcheck server
#################
# OPTIONAL VARS #
#################
# LOG_CONFIG_FILE: The path to the JSON logging config file
[ -z "''${HOST:-}" ] && echo "HOST env var must be set -- aborting" && exit 1
[ -z "''${MARLOWE_SYNC_PORT:-}" ] && echo "MARLOWE_SYNC_PORT env var must be set -- aborting" && exit 1
[ -z "''${MARLOWE_HEADER_SYNC_PORT:-}" ] && echo "MARLOWE_HEADER_SYNC_PORT env var must be set -- aborting" && exit 1
Expand All @@ -305,7 +326,7 @@ in
[ -z "''${DB_HOST:-}" ] && echo "DB_HOST env var must be set -- aborting" && exit 1
DATABASE_URI=${database-uri}
${packages.marlowe-sync}/bin/marlowe-sync \
${packages.marlowe-sync}/bin/marlowe-sync $([ -z $LOG_CONFIG_FILE ] || echo --log-config-file "$LOG_CONFIG_FILE") \
--database-uri "$DATABASE_URI" \
--host "$HOST" \
--sync-port "$MARLOWE_SYNC_PORT" \
Expand All @@ -326,6 +347,11 @@ in
# MARLOWE_CHAIN_SYNC_HOST, MARLOWE_CHAIN_SYNC_PORT, MARLOWE_CHAIN_SYNC_QUERY_PORT, MARLOWE_CHAIN_SYNC_COMMAND_PORT: connection info to marlowe-chain-sync
# HTTP_PORT: port number for the HTTP healthcheck server
#################
# OPTIONAL VARS #
#################
# LOG_CONFIG_FILE: The path to the JSON logging config file
[ -z "''${HOST:-}" ] && echo "HOST env var must be set -- aborting" && exit 1
[ -z "''${PORT:-}" ] && echo "PORT env var must be set -- aborting" && exit 1
[ -z "''${MARLOWE_CHAIN_SYNC_HOST:-}" ] && echo "MARLOWE_CHAIN_SYNC_HOST env var must be set -- aborting" && exit 1
Expand All @@ -336,7 +362,7 @@ in
${wait-for-tcp}/bin/wait-for-tcp "$MARLOWE_CHAIN_SYNC_HOST" "$MARLOWE_CHAIN_SYNC_PORT"
${packages.marlowe-tx}/bin/marlowe-tx \
${packages.marlowe-tx}/bin/marlowe-tx $([ -z $LOG_CONFIG_FILE ] || echo --log-config-file "$LOG_CONFIG_FILE") \
--host "$HOST" \
--command-port "$PORT" \
--chain-sync-port "$MARLOWE_CHAIN_SYNC_PORT" \
Expand All @@ -358,6 +384,11 @@ in
# SYNC_HOST, MARLOWE_SYNC_PORT, MARLOWE_HEADER_SYNC_PORT, MARLOWE_QUERY_PORT: connection info to marlowe-sync
# HTTP_PORT: port number for the HTTP healthcheck server
#################
# OPTIONAL VARS #
#################
# LOG_CONFIG_FILE: The path to the JSON logging config file
[ -z "''${HOST:-}" ] && echo "HOST env var must be set -- aborting" && exit 1
[ -z "''${PORT:-}" ] && echo "PORT env var must be set -- aborting" && exit 1
[ -z "''${TX_HOST:-}" ] && echo "TX_HOST env var must be set -- aborting" && exit 1
Expand All @@ -371,7 +402,7 @@ in
${wait-for-tcp}/bin/wait-for-tcp "$TX_HOST" "$TX_PORT"
${wait-for-tcp}/bin/wait-for-tcp "$SYNC_HOST" "$MARLOWE_QUERY_PORT"
${packages.marlowe-proxy}/bin/marlowe-proxy \
${packages.marlowe-proxy}/bin/marlowe-proxy $([ -z $LOG_CONFIG_FILE ] || echo --log-config-file "$LOG_CONFIG_FILE") \
--host "$HOST" \
--port "$PORT" \
--marlowe-sync-host "$SYNC_HOST" \
Expand Down

0 comments on commit 2383596

Please sign in to comment.