-
Notifications
You must be signed in to change notification settings - Fork 3
ci: nested SDS E2E on skeleton #1693
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
yachmenevas
wants to merge
14
commits into
chore/ci/e2e-matrix-skeleton
Choose a base branch
from
ci-e2e-nested-sds
base: chore/ci/e2e-matrix-skeleton
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from 13 commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
b10fc10
ci: nested SDS setup only (prepare+cleanup); remove E2E tests and rep…
yachmenevas bc0e586
ci(e2e): clean values and debug; simplify SDS wiring; minimal helper …
yachmenevas 22b75f5
ci(e2e): workflow fixes and cleanups for SDS-only PR
yachmenevas 66d4150
ci(e2e): workflow fixes and cleanups for SDS-only PR\n\n- top-level c…
yachmenevas 6945030
ci(e2e): remove unused task infra:attach-worker-disks (redundant; rep…
yachmenevas 092aa3f
ci(e2e): hardcode kubernetesVersion=Automatic in ClusterConfiguration…
yachmenevas c6babf1
ci(e2e): move namespace cleanup logic into Taskfile (task cleanup:nam…
yachmenevas d887e7d
ci(e2e): address review — move kubeconfig/registry steps into Taskfil…
yachmenevas 6ca0c24
ci(e2e): fix infra:attach-storage-disks-hotplug stray duplicate loop …
yachmenevas d7ab555
ci(e2e): address PR review comments
yachmenevas 43f0699
Update ci/dvp-e2e/charts/cluster-config/values.yaml
yachmenevas 9fa177e
chore(ci): refactor E2E workflow and Taskfile
yachmenevas ff007a7
refactor(ci): consolidate e2e workflow, move bootstrap to task, use m…
yachmenevas 2ec6d93
chore(ci): read data disk count from matrix
yachmenevas File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or 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 |
|---|---|---|
|
|
@@ -12,7 +12,7 @@ | |
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
|
|
||
| name: E2E Matrix Tests (Skeleton) | ||
| name: E2E Storage Matrix | ||
|
|
||
| on: | ||
| push: | ||
|
|
@@ -26,15 +26,6 @@ on: | |
| schedule: | ||
| - cron: "30 2 * * *" | ||
| workflow_dispatch: | ||
| inputs: | ||
| profiles: | ||
| description: "Storage profiles (comma-separated): sds, cephrbd" | ||
| required: false | ||
| default: "sds,cephrbd" | ||
| timeout: | ||
| description: "Ginkgo timeout (e.g. 2h, 4h)" | ||
| required: false | ||
| default: "4h" | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
@@ -44,49 +35,31 @@ env: | |
|
|
||
| jobs: | ||
| setup: | ||
| name: Setup Profiles | ||
| name: Setup (${{ matrix.profile }}) | ||
| runs-on: ubuntu-latest | ||
| outputs: | ||
| profiles: ${{ steps.profiles.outputs.profiles }} | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - name: Load storage profiles | ||
| id: profiles | ||
| run: | | ||
| # Single profile: sds with storage class sds-replicated-volume | ||
| echo 'profiles=["sds"]' >> "$GITHUB_OUTPUT" | ||
|
|
||
| - name: Print matrix | ||
| run: | | ||
| echo "Will test profiles: ${{ steps.profiles.outputs.profiles }}" | ||
|
|
||
| prepare: | ||
| name: Matrix Setup (${{ matrix.profile }}) | ||
| needs: [setup] | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 300 | ||
| concurrency: | ||
| group: prepare-${{ github.ref }}-${{ matrix.profile }} | ||
| cancel-in-progress: true | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| profile: ${{ fromJson(needs.setup.outputs.profiles) }} | ||
|
|
||
| include: | ||
| - profile: sds-replicated-volume | ||
| storage_name: sds | ||
| storage_class: linstor-thin-r2 | ||
| parent_storage_class: linstor-thin-r1-immediate | ||
| image_storage_class: linstor-thin-r1-immediate | ||
| attach_disk_size: 10Gi | ||
| data_disk_count: 2 | ||
| concurrency: | ||
| group: setup-${{ github.head_ref || github.ref_name }}-${{ matrix.profile }} | ||
| cancel-in-progress: true | ||
| env: | ||
| GO_VERSION: "1.24.6" | ||
| TMP_ROOT: ${{ github.workspace }}/ci/dvp-e2e/tmp | ||
| STORAGE_CLASS: sds-replicated-volume | ||
|
|
||
| outputs: | ||
| run_id: ${{ steps.prep.outputs.run_id }} | ||
| storage_class: ${{ env.STORAGE_CLASS }} | ||
|
|
||
| RUN_ID: nightly-nested-e2e-${{ matrix.storage_name }}-${{ github.run_number }} | ||
| PROFILE: ${{ matrix.profile }} | ||
| STORAGE_CLASS: ${{ matrix.storage_class }} | ||
| PARENT_STORAGE_CLASS: ${{ matrix.parent_storage_class }} | ||
| IMAGE_STORAGE_CLASS: ${{ matrix.image_storage_class }} | ||
| ATTACH_DISK_SIZE: ${{ matrix.attach_disk_size }} | ||
| DATA_DISK_COUNT: ${{ matrix.data_disk_count }} | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 0 | ||
|
|
||
| - name: Install Task | ||
| uses: arduino/setup-task@v2 | ||
|
|
@@ -102,184 +75,74 @@ jobs: | |
| - name: Install kubectl | ||
| uses: azure/setup-kubectl@v4 | ||
| with: | ||
| version: 'latest' | ||
| version: "latest" | ||
|
|
||
| - name: Install Deckhouse CLI | ||
| env: | ||
| D8_VERSION: v0.13.2 | ||
| run: | | ||
| set -euo pipefail | ||
| echo "Installing d8 ${D8_VERSION}..." | ||
| curl -fsSL -o d8.tgz "https://deckhouse.io/downloads/deckhouse-cli/${D8_VERSION}/d8-${D8_VERSION}-linux-amd64.tar.gz" | ||
| tar -xzf d8.tgz linux-amd64/bin/d8 | ||
| mv linux-amd64/bin/d8 /usr/local/bin/d8 | ||
| chmod +x /usr/local/bin/d8 | ||
| rm -rf d8.tgz linux-amd64 | ||
| d8 --version | ||
| - name: Setup d8 | ||
| uses: werf/trdl/actions/[email protected] | ||
| with: | ||
| repo: d8 | ||
| url: https://deckhouse.ru/downloads/deckhouse-cli-trdl/ | ||
| root-version: 1 | ||
| root-sha512: 343bd5f0d8811254e5f0b6fe292372a7b7eda08d276ff255229200f84e58a8151ab2729df3515cb11372dc3899c70df172a4e54c8a596a73d67ae790466a0491 | ||
| group: 0 | ||
| channel: stable | ||
|
|
||
| - name: Install yq | ||
| run: | | ||
| echo "Installing yq..." | ||
| curl -L -o /usr/local/bin/yq https://github.com/mikefarah/yq/releases/download/v4.44.1/yq_linux_amd64 | ||
| chmod +x /usr/local/bin/yq | ||
|
|
||
| - name: Prepare environment | ||
| id: prep | ||
| run: | | ||
| RUN_ID="nightly-nested-e2e-${{ matrix.profile }}-$(date +%H%M)" | ||
| echo "run_id=$RUN_ID" >> "$GITHUB_OUTPUT" | ||
| echo "RUN_ID=$RUN_ID" >> "$GITHUB_ENV" | ||
| echo "PROFILE=${{ matrix.profile }}" >> "$GITHUB_ENV" | ||
| echo "TMP_ROOT=${{ env.TMP_ROOT }}" >> "$GITHUB_ENV" | ||
| mkdir -p "${{ env.TMP_ROOT }}/shared" "${{ env.TMP_ROOT }}/matrix-logs" | ||
|
|
||
| - name: Build parent kubeconfig from secret | ||
| shell: bash | ||
| run: | | ||
| set -euo pipefail | ||
| mkdir -p "$HOME/.kube" | ||
| cat > "$HOME/.kube/config" <<EOF | ||
| apiVersion: v1 | ||
| kind: Config | ||
| clusters: | ||
| - cluster: | ||
| server: ${E2E_K8S_URL} | ||
| insecure-skip-tls-verify: true | ||
| name: parent | ||
| contexts: | ||
| - context: | ||
| cluster: parent | ||
| user: sa | ||
| name: parent | ||
| current-context: parent | ||
| users: | ||
| - name: sa | ||
| user: | ||
| token: "${{ secrets.E2E_NESTED_SA_SECRET }}" | ||
| EOF | ||
| chmod 600 "$HOME/.kube/config" | ||
| echo "KUBECONFIG=$HOME/.kube/config" >> "$GITHUB_ENV" | ||
|
|
||
| - name: Prepare run values.yaml | ||
| working-directory: ci/dvp-e2e | ||
| run: | | ||
| task run:values:prepare \ | ||
| RUN_ID="${{ env.RUN_ID }}" \ | ||
| RUN_NAMESPACE="${{ env.RUN_ID }}" \ | ||
| RUN_DIR="${{ env.TMP_ROOT }}/runs/${{ env.RUN_ID }}" | ||
| echo "VALUES_TEMPLATE_FILE=${{ env.TMP_ROOT }}/runs/${{ env.RUN_ID }}/values.yaml" >> $GITHUB_ENV | ||
|
|
||
| - name: Configure storage profile | ||
| - name: Setup nested environment | ||
| env: | ||
| RUN_ID: ${{ env.RUN_ID }} | ||
| PROFILE: ${{ env.PROFILE }} | ||
| STORAGE_CLASS: ${{ env.STORAGE_CLASS }} | ||
| PARENT_STORAGE_CLASS: ${{ env.PARENT_STORAGE_CLASS }} | ||
| IMAGE_STORAGE_CLASS: ${{ env.IMAGE_STORAGE_CLASS }} | ||
| ATTACH_DISK_SIZE: ${{ env.ATTACH_DISK_SIZE }} | ||
| DATA_DISK_COUNT: ${{ env.DATA_DISK_COUNT }} | ||
| REGISTRY_DOCKER_CFG: ${{ secrets.DEV_REGISTRY_DOCKER_CFG }} | ||
| API_URL: ${{ env.E2E_K8S_URL }} | ||
| SA_TOKEN: ${{ secrets.E2E_NESTED_SA_SECRET }} | ||
| working-directory: ci/dvp-e2e | ||
| run: | | ||
| # Set storage profile to sds with storage class sds-replicated-volume | ||
| PROFILE='sds' yq eval --inplace '.storageProfile = strenv(PROFILE)' "${{ env.TMP_ROOT }}/runs/${{ env.RUN_ID }}/values.yaml" | ||
| echo "Configured storage profile: sds with storage class: ${STORAGE_CLASS}" | ||
|
|
||
| - name: Upload run context | ||
| if: always() | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: run-context-${{ env.RUN_ID }} | ||
| path: | | ||
| ci/dvp-e2e/tmp/runs/${{ env.RUN_ID }} | ||
| ci/dvp-e2e/tmp/shared | ||
| if-no-files-found: warn | ||
|
|
||
| run-e2e: | ||
| name: E2E (${{ matrix.profile }}) [skeleton] | ||
| needs: [setup, prepare] | ||
| runs-on: ubuntu-latest | ||
| concurrency: | ||
| group: e2e-${{ github.ref }}-${{ matrix.profile }} | ||
| cancel-in-progress: true | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| profile: ${{ fromJson(needs.setup.outputs.profiles) }} | ||
| steps: | ||
| - name: Echo run | ||
| run: | | ||
| echo "E2E stage for profile=${{ matrix.profile }} (skeleton - placeholder)" | ||
| report: | ||
| name: Report [skeleton] | ||
| needs: [setup, run-e2e] | ||
| if: always() | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Echo report | ||
| run: | | ||
| echo "Report stage (skeleton). Collecting results from matrix..." | ||
| task ci:setup-nested-env | ||
|
|
||
| cleanup: | ||
| name: Cleanup Resources | ||
| needs: report | ||
| name: Cleanup (${{ matrix.profile }}) | ||
| needs: setup | ||
| if: always() | ||
| runs-on: ubuntu-latest | ||
| strategy: | ||
| matrix: | ||
| include: | ||
| - profile: sds-replicated-volume | ||
| storage_name: sds | ||
| storage_class: linstor-thin-r2 | ||
| parent_storage_class: linstor-thin-r1-immediate | ||
| image_storage_class: linstor-thin-r1-immediate | ||
| attach_disk_size: 10Gi | ||
| data_disk_count: 2 | ||
| env: | ||
| CLEANUP_PREFIX: ${{ vars.CLEANUP_PREFIX || 'nightly-nested-e2e-' }} | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - name: Install Task | ||
| uses: arduino/setup-task@v2 | ||
| with: | ||
| version: 3.x | ||
|
|
||
| - name: Install kubectl | ||
| uses: azure/setup-kubectl@v4 | ||
| with: | ||
| version: 'latest' | ||
|
|
||
| - name: Build parent kubeconfig from secret (cleanup) | ||
| shell: bash | ||
| run: | | ||
| set -euo pipefail | ||
| mkdir -p "$HOME/.kube" | ||
| cat > "$HOME/.kube/config" <<EOF | ||
| apiVersion: v1 | ||
| kind: Config | ||
| clusters: | ||
| - cluster: | ||
| server: ${E2E_K8S_URL} | ||
| insecure-skip-tls-verify: true | ||
| name: parent | ||
| contexts: | ||
| - context: | ||
| cluster: parent | ||
| user: sa | ||
| name: parent | ||
| current-context: parent | ||
| users: | ||
| - name: sa | ||
| user: | ||
| token: "${{ secrets.E2E_NESTED_SA_SECRET }}" | ||
| EOF | ||
| chmod 600 "$HOME/.kube/config" | ||
| echo "KUBECONFIG=$HOME/.kube/config" >> "$GITHUB_ENV" | ||
| version: "latest" | ||
|
|
||
| - name: Cleanup test namespaces | ||
| working-directory: ci/dvp-e2e | ||
| run: | | ||
| set -euo pipefail | ||
| PREFIX="nightly-nested-e2e-" | ||
| echo "🧹 Cleaning up namespaces matching prefix '${PREFIX}'" | ||
| mapfile -t CANDIDATES < <(kubectl get ns -o jsonpath='{range .items[*]}{.metadata.name}{"\n"}{end}' | grep "^${PREFIX}" || true) | ||
| OURS=() | ||
| for ns in "${CANDIDATES[@]:-}"; do | ||
| [ -z "$ns" ] && continue | ||
| if kubectl -n "$ns" get deploy jump-host >/dev/null 2>&1; then | ||
| OURS+=("$ns") | ||
| fi | ||
| done | ||
| if [ "${#OURS[@]}" -eq 0 ]; then | ||
| echo "[INFO] No namespaces to delete." | ||
| else | ||
| echo "[INFO] Deleting namespaces:" | ||
| printf ' - %s\n' "${OURS[@]}" | ||
| for ns in "${OURS[@]}"; do | ||
| kubectl delete ns "$ns" --wait=false || true | ||
| done | ||
| fi | ||
|
|
||
| - name: Report cleanup results | ||
| if: always() | ||
| run: | | ||
| echo "### Cleanup Results" >> $GITHUB_STEP_SUMMARY | ||
| echo "✅ Cleanup job completed" >> $GITHUB_STEP_SUMMARY | ||
| echo "🧹 Attempted to clean up namespaces matching 'nightly-nested-e2e-*'" >> $GITHUB_STEP_SUMMARY | ||
| task cleanup:namespaces \ | ||
| PREFIX="${CLEANUP_PREFIX}" \ | ||
| API_URL="${E2E_K8S_URL}" \ | ||
| SA_TOKEN="${{ secrets.E2E_NESTED_SA_SECRET }}" | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we use matrix.data_disk_count here, instead of env.DATA_DISK_COUNT?