Skip to content

Commit

Permalink
Update docker-entrypoint.sh
Browse files Browse the repository at this point in the history
- Replace `${NETWORK}`, `${NETWORK_URL}`, `${S3_BUCKET}`, `${S3_REGION}` and `${OUTPUT_STORE}` with full URLs variable `${SUBSTREAMS_ENDPOINT}` and `${OUTPUT_STORE_PATH}`
- Add check for `${SUBSTREAMS_ENDPOINT}` and `${OUTPUT_STORE_PATH}` existence
  • Loading branch information
0237h authored Jan 24, 2025
1 parent bf3bfef commit 72cd391
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,20 @@ set -e
: "${ENCODER:=parquet}"
: "${PARQUET_DEFAULT_COLUMN_COMPRESSION:=snappy}"
: "${FILE_BLOCK_COUNT:=10000}"
: "${S3_REGION:=us-east-1}"
: "${STATE_STORE:=state.yaml}"
: "${PRODUCTION_MODE:=false}"
: "${METRICS_LISTEN_PORT:=9102}"

OUTPUT_STORE="s3://pinax/${NETWORK}/${S3_BUCKET}?region=${S3_REGION}"
NETWORK_URL="${NETWORK}.substreams.pinax.network:443"
METRICS_LISTEN_ADDR="0.0.0.0:${METRICS_LISTEN_PORT}"

if [[ -z "${SUBSTREAMS_ENDPOINT}" ]]; then
echo "Error: missing substreams endpoint (SUBSTREAMS_ENDPOINT)"
fi

if [[ -z "${OUTPUT_STORE_PATH}" ]]; then
echo "Error: missing s3 output store path (OUTPUT_STORE_PATH)"
fi

# Conditionally add --development-mode
if [ "${PRODUCTION_MODE}" = "true" ]; then
DEV_FLAG=""
Expand All @@ -22,10 +27,10 @@ else
fi

substreams-sink-files run \
"${NETWORK_URL}" \
"${SUBSTREAMS_ENDPOINT}" \
"${MANIFEST}" \
"${MODULE}" \
"${OUTPUT_STORE}" \
"${OUTPUT_STORE_PATH}" \
"${START_BLOCK}:${STOP_BLOCK}" \
--encoder "${ENCODER}" \
--parquet-default-column-compression "${PARQUET_DEFAULT_COLUMN_COMPRESSION}" \
Expand Down

0 comments on commit 72cd391

Please sign in to comment.