Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 21 additions & 13 deletions .buildkite/scripts/build-stable.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,31 +8,37 @@ source "$here"/common.sh

agent="${1-solana}"

partitions=$(
cat <<EOF
parallelism=5
partitions=()
for i in $(seq 1 $parallelism); do
partitions+=("$(
cat <<EOF
{
"name": "partitions",
"command": "ci/docker-run-default-image.sh ci/stable/run-partition.sh",
"name": "partition-$i",
"command": "ci/docker-run-default-image.sh ci/stable/run-partition.sh $i $parallelism",
"timeout_in_minutes": 25,
"agent": "$agent",
"parallelism": 5,
"retry": 3
}
EOF
)
)")
done

local_cluster_partitions=$(
cat <<EOF
parallelism=10
local_cluster_partitions=()
for i in $(seq 1 $parallelism); do
local_cluster_partitions+=("$(
cat <<EOF
{
"name": "local-cluster",
"command": "ci/docker-run-default-image.sh ci/stable/run-local-cluster-partially.sh",
"name": "local-cluster-$i",
"command": "ci/docker-run-default-image.sh ci/stable/run-local-cluster-partially.sh $i $parallelism",
"timeout_in_minutes": 15,
"agent": "$agent",
"parallelism": 10,
"retry": 3
}
EOF
)
)")
done

localnet=$(
cat <<EOF
Expand All @@ -46,4 +52,6 @@ EOF
)

# shellcheck disable=SC2016
group "stable" "$partitions" "$local_cluster_partitions" "$localnet"
group "stable" "${partitions[@]}"
group "local-cluster" "${local_cluster_partitions[@]}"
group "localnet" "$localnet"
19 changes: 12 additions & 7 deletions ci/stable/run-local-cluster-partially.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@
#!/usr/bin/env bash
set -e

CURRENT=$1
: "${CURRENT:?}"

TOTAL=$2
: "${TOTAL:?}"

if [ "$CURRENT" -gt "$TOTAL" ]; then
echo "Error: The value of CURRENT (\$1) cannot be greater than the value of TOTAL (\$2)."
exit 1
fi

here="$(dirname "$0")"

#shellcheck source=ci/common/shared-functions.sh
Expand All @@ -9,16 +20,10 @@ source "$here"/../common/shared-functions.sh
#shellcheck source=ci/stable/common.sh
source "$here"/common.sh

INDEX=${1:-"$BUILDKITE_PARALLEL_JOB"}
: "${INDEX:?}"

LIMIT=${2:-"$BUILDKITE_PARALLEL_JOB_COUNT"}
: "${LIMIT:?}"

_ cargo nextest run \
--profile ci \
--package solana-local-cluster \
--test local_cluster \
--partition hash:"$((INDEX + 1))/$LIMIT" \
--partition hash:"$CURRENT/$TOTAL" \
--test-threads=1 \
--no-tests=warn
26 changes: 12 additions & 14 deletions ci/stable/run-partition.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@
#!/usr/bin/env bash
set -eo pipefail

CURRENT=$1
: "${CURRENT:?}"

TOTAL=$2
: "${TOTAL:?}"

if [ "$CURRENT" -gt "$TOTAL" ]; then
echo "Error: The value of CURRENT (\$1) cannot be greater than the value of TOTAL (\$2)."
exit 1
fi

here="$(dirname "$0")"

#shellcheck source=ci/common/shared-functions.sh
Expand All @@ -12,25 +23,12 @@ source "$here"/../common/limit-threads.sh
#shellcheck source=ci/stable/common.sh
source "$here"/common.sh

# check partition info
INDEX=${1:-"$BUILDKITE_PARALLEL_JOB"} # BUILDKITE_PARALLEL_JOB from 0 to (BUILDKITE_PARALLEL_JOB_COUNT - 1)
: "${INDEX:?}"

# if LIMIT = 3, the valid INDEX is 0~2
LIMIT=${2:-"$BUILDKITE_PARALLEL_JOB_COUNT"}
: "${LIMIT:?}"

if [ ! "$LIMIT" -gt "$INDEX" ]; then
echo "LIMIT(\$2) should greater than INDEX(\$1)"
exit 1
fi

ARGS=(
--profile ci
--workspace
--tests
--jobs "$JOBS"
--partition hash:"$((INDEX + 1))/$LIMIT"
--partition hash:"$CURRENT/$TOTAL"
--verbose
--exclude solana-local-cluster
--no-tests=warn
Expand Down