Skip to content

Commit

Permalink
Minor ledgerexporter infrastructure improvements (#4461)
Browse files Browse the repository at this point in the history
* Push the stellar/horizon-ledgerexporter docker image when pushing to the lighthorizon branch
* Fix the ledger exporter aws batch jobs when running on the first batch
  • Loading branch information
2opremio authored Jul 19, 2022
1 parent 6e864fc commit 291e99e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 11 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/horizon.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Horizon

on:
push:
branches: [master]
branches: [master, lighthorizon]
pull_request:

jobs:
Expand Down Expand Up @@ -146,6 +146,6 @@ jobs:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- if: github.ref == 'refs/heads/master'
- if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/lighthorizon'
name: Push to DockerHub
run: docker push stellar/horizon-ledgerexporter:latest
15 changes: 6 additions & 9 deletions services/horizon/docker/ledgerexporter/start
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,14 @@ if [ ! -z "$AWS_BATCH_JOB_ARRAY_INDEX" ]; then
# AWS_BATCH_JOB_ARRAY_INDEX=2: [191, 255]
# AWS_BATCH_JOB_ARRAY_INDEX=3: [255, 319]
# ...
START=`expr "$BATCH_SIZE" \* "$AWS_BATCH_JOB_ARRAY_INDEX" + "$BATCH_START_LEDGER"`
END=`expr "$BATCH_SIZE" \* "$AWS_BATCH_JOB_ARRAY_INDEX" + "$BATCH_START_LEDGER" + "$BATCH_SIZE"`

if [ $BATCH_START_LEDGER -eq 1 ]; then
export START=`expr "$BATCH_SIZE" \* "$AWS_BATCH_JOB_ARRAY_INDEX" + "$BATCH_START_LEDGER" - "2"`
export END=`expr "$BATCH_SIZE" \* "$AWS_BATCH_JOB_ARRAY_INDEX" + "$BATCH_START_LEDGER" + "$BATCH_SIZE" - "2"`
if [ $START -eq -1 ]; then
export START="1"
fi
else
export START=`expr "$BATCH_SIZE" \* "$AWS_BATCH_JOB_ARRAY_INDEX" + "$BATCH_START_LEDGER"`
export END=`expr "$BATCH_SIZE" \* "$AWS_BATCH_JOB_ARRAY_INDEX" + "$BATCH_START_LEDGER" + "$BATCH_SIZE"`
if [ "$START" -lt 2 ]; then
# The minimum ledger expected by the ledger exporter is 2
START=2
fi

fi

echo "START: $START END: $END"
Expand Down

0 comments on commit 291e99e

Please sign in to comment.