-
Notifications
You must be signed in to change notification settings - Fork 86
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
7 changed files
with
170 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
#!/bin/bash | ||
|
||
set -euo pipefail | ||
|
||
# Constants for valid topologies for CI tests | ||
readonly VALID_TOPOLOGIES=( | ||
"1:1" # 1 node, 1 shard | ||
"1:2" # 1 node, 2 shards | ||
"3:1" # 3 nodes, 1 shard | ||
"3:3" # 3 nodes, 3 shards | ||
"6:1" # 6 nodes, 1 shard | ||
"6:2" # 6 nodes, 2 shards | ||
"6:3" # 6 nodes, 3 shards | ||
"6:6" # 6 nodes, 6 shards | ||
"9:1" # 9 nodes, 1 shard | ||
"9:3" # 9 nodes, 3 shards | ||
"9:6" # 9 nodes, 6 shards | ||
"9:9" # 9 nodes, 9 shards | ||
) | ||
|
||
generate_kustomization() { | ||
local node_count=$1 | ||
local shard_count=$2 | ||
local kustomization_file="kustomization.yaml" | ||
local topology_key="${node_count}:${shard_count}" | ||
local base_yaml="" | ||
|
||
mkdir -p "$(dirname "$kustomization_file")" | ||
|
||
# Validate topology | ||
local valid_topology=false | ||
for topology in "${VALID_TOPOLOGIES[@]}"; do | ||
if [[ "$topology" == "$topology_key" ]]; then | ||
valid_topology=true | ||
break | ||
fi | ||
done | ||
|
||
if ! $valid_topology; then | ||
echo "Error: Invalid topology - ${node_count} nodes, ${shard_count} shards" | ||
exit 1 | ||
fi | ||
|
||
# Set base YAML based on topology | ||
base_yaml="mongodb-sharded-${node_count}-node" | ||
if [[ "$shard_count" -gt 1 ]]; then | ||
base_yaml="${base_yaml}-${shard_count}-shards" | ||
fi | ||
base_yaml="${base_yaml}.yaml" | ||
|
||
# Generate kustomization file | ||
cat > "$kustomization_file" << EOF | ||
apiVersion: kustomize.config.k8s.io/v1beta1 | ||
kind: Kustomization | ||
resources: | ||
- ./_build/root/deploy/${base_yaml} | ||
patchesStrategicMerge: | ||
- |- | ||
apiVersion: apps/v1 | ||
kind: StatefulSet | ||
metadata: | ||
name: data-db-mongodb-sharded-configsvr | ||
spec: | ||
volumeClaimTemplates: | ||
- metadata: | ||
name: datadir | ||
annotations: | ||
spec: | ||
accessModes: | ||
- "ReadWriteOnce" | ||
resources: | ||
requests: | ||
storage: "8Gi" | ||
storageClassName: standard | ||
EOF | ||
|
||
# Add shard patches | ||
for ((i=0; i<shard_count; i++)); do | ||
cat >> "$kustomization_file" << EOF | ||
- |- | ||
apiVersion: apps/v1 | ||
kind: StatefulSet | ||
metadata: | ||
name: data-db-mongodb-sharded-shard${i}-data | ||
spec: | ||
volumeClaimTemplates: | ||
- metadata: | ||
name: datadir | ||
annotations: | ||
spec: | ||
accessModes: | ||
- "ReadWriteOnce" | ||
resources: | ||
requests: | ||
storage: "8Gi" | ||
storageClassName: standard | ||
EOF | ||
done | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -639,6 +639,54 @@ jobs: | |
- name: Clean Up | ||
run: kind delete cluster | ||
|
||
ctst-end2end-sharded-3-shards: | ||
needs: [build-kafka, lint-and-build-ctst] | ||
runs-on: | ||
- ubuntu-22.04-8core | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Install dependencies | ||
uses: ./.github/actions/install-end2end-dependencies | ||
- name: Wait for Docker daemon to be ready | ||
uses: ./.github/actions/wait-docker-ready | ||
- name: Kubectl tool installer | ||
uses: Azure/setup-kubectl@v4 | ||
- name: Login to Registry | ||
uses: docker/login-action@v3 | ||
with: | ||
username: "${{ github.repository_owner }}" | ||
password: "${{ github.token }}" | ||
registry: ghcr.io | ||
- name: Deploy Zenko | ||
uses: ./.github/actions/deploy | ||
env: | ||
GIT_ACCESS_TOKEN: ${{ secrets.GIT_ACCESS_TOKEN }} | ||
ZENKO_ENABLE_SOSAPI: true | ||
TIME_PROGRESSION_FACTOR: 86400 | ||
TRANSITION_ONE_DAY_EARLIER: false | ||
EXPIRE_ONE_DAY_EARLIER: false | ||
MONGODB_SHARD_COUNT: 2 | ||
- name: Configure E2E test environment | ||
run: bash configure-e2e-ctst.sh | ||
working-directory: ./.github/scripts/end2end | ||
- name: Run CTST end to end tests | ||
run: bash run-e2e-ctst.sh "" "" "" "" --tags 'not @PRA' | ||
working-directory: ./.github/scripts/end2end | ||
- name: Debug wait | ||
uses: ./.github/actions/debug-wait | ||
timeout-minutes: 60 | ||
if: failure() && runner.debug == '1' | ||
- name: Archive and publish artifacts | ||
uses: ./.github/actions/archive-artifacts | ||
with: | ||
user: ${{ secrets.ARTIFACTS_USER }} | ||
password: ${{ secrets.ARTIFACTS_PASSWORD }} | ||
trunk_token: ${{ secrets.TRUNK_TOKEN }} | ||
if: always() | ||
- name: Clean Up | ||
run: kind delete cluster | ||
|
||
write-final-status: | ||
runs-on: ubuntu-latest | ||
needs: | ||
|
@@ -654,6 +702,7 @@ jobs: | |
- end2end-sharded | ||
- end2end-pra | ||
- ctst-end2end-sharded | ||
- ctst-end2end-sharded-3-shards | ||
steps: | ||
- name: Upload final status | ||
uses: scality/actions/[email protected] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters