Skip to content

Commit

Permalink
chore: integrate dual kind clusters with CI
Browse files Browse the repository at this point in the history
Signed-off-by: Nathan Klick <[email protected]>
  • Loading branch information
nathanklick committed Feb 14, 2025
1 parent 36e3a08 commit 81bebac
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/flow-pull-request-checks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ jobs:
- { name: "Node Delete - Separate commands", npm-test-script: "test-${{ needs.env-vars.outputs.e2e-node-delete-separate-commands-test-subdir }}", coverage-subdirectory: "${{ needs.env-vars.outputs.e2e-node-delete-separate-commands-test-subdir }}", coverage-report-name: "${{ needs.env-vars.outputs.e2e-node-delete-separate-commands-coverage-report }}", cluster-name: "${{ needs.env-vars.outputs.e2e-node-delete-separate-commands-test-subdir }}-${{ github.run_id }}-${{ github.run_attempt }}" }
- { name: "Node Add - Separate commands", npm-test-script: "test-${{ needs.env-vars.outputs.e2e-node-add-separate-commands-test-subdir }}", coverage-subdirectory: "${{ needs.env-vars.outputs.e2e-node-add-separate-commands-test-subdir }}", coverage-report-name: "${{ needs.env-vars.outputs.e2e-node-add-separate-commands-coverage-report }}", cluster-name: "${{ needs.env-vars.outputs.e2e-node-add-separate-commands-test-subdir }}-${{ github.run_id }}-${{ github.run_attempt }}" }
- { name: "Node Upgrade - Separate commands", npm-test-script: "test-${{ needs.env-vars.outputs.e2e-node-upgrade-separate-commands-test-subdir }}", coverage-subdirectory: "${{ needs.env-vars.outputs.e2e-node-upgrade-separate-commands-test-subdir }}", coverage-report-name: "${{ needs.env-vars.outputs.e2e-node-upgrade-separate-commands-coverage-report }}", cluster-name: "${{ needs.env-vars.outputs.e2e-node-upgrade-separate-commands-test-subdir }}-${{ github.run_id }}-${{ github.run_attempt }}" }
max-parallel: 3
max-parallel: 5
with:
custom-job-label: ${{ matrix.e2e-test-type.name }}
npm-test-script: ${{ matrix.e2e-test-type.npm-test-script }}
Expand Down
8 changes: 6 additions & 2 deletions .github/workflows/zxc-e2e-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ permissions:

env:
#CG_EXEC: export R_UID=$(id -u); CGROUP_LOGLEVEL=DEBUG cgexec -g cpu,memory:user.slice/user-${R_UID}.slice/user@${R_UID}.service/e2e-${{ github.run_id }} --sticky ionice -c 2 -n 2 nice -n 19
CG_EXEC: ""
CG_EXEC: "ionice -c 2 -n 2 nice -n 19"

jobs:
e2e-test:
Expand Down Expand Up @@ -182,13 +182,17 @@ jobs:
run: |
npm link
echo "SOLO_TEST_CLUSTER=${{ inputs.cluster-name }}"
${{ env.CG_EXEC }} SOLO_TEST_CLUSTER=${{ inputs.cluster-name }} ./test/e2e/setup-e2e.sh
${{ env.CG_EXEC }} SOLO_TEST_CLUSTER=${{ inputs.cluster-name }} ./test/e2e/dual-cluster/setup-dual-e2e.sh
- name: Run E2E Tests
run: |
echo "SOLO_TEST_CLUSTER=${{ inputs.cluster-name }}"
${{ env.CG_EXEC }} SOLO_TEST_CLUSTER=${{ inputs.cluster-name }} npm run ${{ inputs.npm-test-script }}
- name: Sleep on Failure
if: ${{ failure() }}
run: sleep 3600

- name: Upload E2E Logs to GitHub
if: ${{ !cancelled() }}
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
Expand Down
25 changes: 17 additions & 8 deletions test/e2e/dual-cluster/setup-dual-e2e.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ for i in {1..2}; do
kind delete cluster -n "${SOLO_CLUSTER_NAME}-c${i}" || true
done

docker network rm kind
docker network rm -f kind || true
docker network create kind --scope local --subnet 172.19.0.0/16 --driver bridge

# Setup Helm Repos
Expand All @@ -40,7 +40,10 @@ for i in {1..2}; do

kubectl apply -f "${SCRIPT_PATH}/metallb-cluster-${i}.yaml"

"${CLUSTER_DIAGNOSTICS_PATH}"/deploy.sh
# Deploy the diagnostics container if not running in CI
if [[ -z "${CI}" ]]; then
"${CLUSTER_DIAGNOSTICS_PATH}"/deploy.sh
fi
done

# **********************************************************************************************************************
Expand All @@ -52,9 +55,15 @@ done
# Init and deploy a network for e2e tests in (test/e2e/core)
# -d ${SOLO_CHARTS_DIR} is optional, if you want to use a local chart, it will be ignored if not set
# **********************************************************************************************************************
# SOLO_CLUSTER_SETUP_NAMESPACE=solo-setup
# npm run build
#npm run solo -- init || exit 1 # cache args for subsequent commands
#npm run solo -- cluster setup -s "${SOLO_CLUSTER_SETUP_NAMESPACE}" || exit 1
#helm list --all-namespaces
#sleep 10 # give time for solo-setup to finish deploying
SOLO_CLUSTER_SETUP_NAMESPACE=solo-setup
npm run build
npm run solo -- init || exit 1 # cache args for subsequent commands

for i in {1..2}; do
kubectl config use-context "kind-${SOLO_CLUSTER_NAME}-c${i}"
npm run solo -- cluster setup -s "${SOLO_CLUSTER_SETUP_NAMESPACE}" || exit 1
helm list --all-namespaces
done

kubectl config use-context "kind-${SOLO_CLUSTER_NAME}-c1"
sleep 10 # give time for solo-setup to finish deploying

0 comments on commit 81bebac

Please sign in to comment.