Skip to content

Commit a0f3d38

Browse files
committed
split work across nodes
1 parent ca939fd commit a0f3d38

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

.circleci/orca_generate.sh

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,17 +20,23 @@ deterministic_shuffle()
2020
shuf --random-source=<(get_seeded_random "0")
2121
}
2222

23-
if [ -z "$CIRCLECI" ]
23+
if [ "$CIRCLECI" = true ];
2424
then
25-
echo "Work split accross $CIRCLE_NODE_TOTAL nodes"
26-
echo "Currently $CIRCLE_NODE_INDEX"
25+
echo "Work split across $CIRCLE_NODE_TOTAL nodes"
26+
echo "Node index $CIRCLE_NODE_INDEX"
2727
sleep 1
2828
else
2929
echo "Running locally"
30+
CIRCLE_NODE_TOTAL=1
31+
CIRCLE_NODE_INDEX=0
3032
fi
3133

34+
ls $MOCKS/*.json | deterministic_shuffle > /tmp/all
35+
split -d -a1 -n l/$CIRCLE_NODE_TOTAL /tmp/all /tmp/queue
36+
37+
echo ""
3238
echo "Generating test images"
33-
ls $MOCKS/*.json | awk '!/mapbox/' | \
39+
cat /tmp/queue$CIRCLE_NODE_INDEX | awk '!/mapbox/' | \
3440
# Shuffle to distribute randomly slow and fast mocks
3541
deterministic_shuffle | \
3642
# head -n 10 | \

0 commit comments

Comments
 (0)