test/new-e2e/tests/autoscaling/spot: add spot scheduling local kind cluster e2e tests#48821
Conversation
5502ac2 to
118bc84
Compare
118bc84 to
ed544e3
Compare
ed544e3 to
2b74a50
Compare
Files inventory check summaryFile checks results against ancestor 3eb519ee: Results for datadog-agent_7.80.0~devel.git.258.435a3e4.pipeline.109943923-1_amd64.deb:No change detected |
c033ca3 to
eb77f83
Compare
…tion (#48684) ### What does this PR do? Add support for customizing kind cluster topology and pre-loading Docker images into the cluster before the agent is deployed. ### Motivation Local e2e tests for Spot Scheduling #47429 ### Describe how you validated your changes I am testing spot scheduling via #48821 and extracted these changes into a separate PR. ### Additional Notes Co-authored-by: alexander.yastrebov <[email protected]>
eb77f83 to
6934a8e
Compare
| image := os.Getenv("DD_TEST_CLUSTER_AGENT_IMAGE") | ||
| if image == "" { | ||
| t.Skip("DD_TEST_CLUSTER_AGENT_IMAGE not set; skipping spot scheduling e2e tests") | ||
| } |
There was a problem hiding this comment.
This is necessary atm because spot scheduling is not released yet. After a while I plan to relax this check and allow testing both custom built image for development as well as running tests against published image.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6934a8e1fa
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| switch node.Labels[karpenterCapacityTypeLabel] { | ||
| case karpenterCapacityTypeSpot: | ||
| s.spotNode = node.Name | ||
| default: | ||
| s.onDemandNode = node.Name |
There was a problem hiding this comment.
Exclude control-plane nodes when selecting on-demand worker
identifyNodes treats every non-spot node as the on-demand target, so in a kind cluster it can select the control-plane node (which is also non-spot) instead of the labeled on-demand worker. Because the control-plane is typically NoSchedule, expectRunningOnDemand then counts zero pods on s.onDemandNode and the suite fails/flakes depending on node list ordering. Filter to worker nodes (or explicitly require karpenter.sh/capacity-type=on-demand) when assigning s.onDemandNode to make placement assertions deterministic.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Nah, its spot vs non-spot really because spot scheduler by design does not modify non-spot pods and they can end up on control plane node as well which is OK.
2a9104c to
bc58e9f
Compare
315c83e to
50ae720
Compare
This comment has been minimized.
This comment has been minimized.
50ae720 to
fb13f55
Compare
…luster e2e tests Add spot scheduling e2e test suite using a locally-built cluster-agent image loaded into kind. Exclude test package from bazel build for now similar to other e2e packages. Co-Authored-By Claude Sonnet 4.6 <[email protected]>
fb13f55 to
435a3e4
Compare
…ter e2e tests Add a CI path for the spot scheduling e2e test suite using an AWS kindvm provisioner (kind running on an EC2 VM), alongside the existing local kind path. - Add `TestSpotSchedulingKindCI` — skips unless `E2E_PIPELINE_ID` is set; uses the AWS kindvm provisioner with the `cluster-agent-qa` ECR image auto-resolved by the framework from pipeline/commit env vars. - Extend `scenarios/aws/kindvm` with `workerNodes` support (`WithKindWorkerNodes` option + `NewKindClusterWithConfig` call) so the cloud kindvm path can provision spot/on-demand node topology, matching what `localkubernetes.Provisioner` already supported. - Add `new-e2e-autoscaling` GitLab CI job (depends on `qa_dca` for the ECR image, `allow_failure: true`). - Add `.on_autoscaling_or_e2e_changes` trigger rule covering the spot test directory and `pkg/clusteragent/autoscaling/cluster/`. The local-only e2e tests introduced in #48821 cannot catch regressions introduced on the main branch because they require a Docker daemon and a locally-built image — neither of which is available on CI pod runners. Running on AWS kindvm closes this gap: every change to the spot scheduler or its tests now triggers a real cluster verification automatically. Updates https://datadoghq.atlassian.net/browse/CASCL-1222 Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
…ter e2e tests Add a CI path for the spot scheduling e2e test suite using an AWS kindvm provisioner (kind running on an EC2 VM), alongside the existing local kind path. - Add `TestSpotSchedulingKindCI` — skips unless `E2E_PIPELINE_ID` is set; uses the AWS kindvm provisioner with the `cluster-agent-qa` ECR image auto-resolved by the framework from pipeline/commit env vars. - Extend `scenarios/aws/kindvm` with `workerNodes` support (`WithKindWorkerNodes` option + `NewKindClusterWithConfig` call) so the cloud kindvm path can provision spot/on-demand node topology, matching what `localkubernetes.Provisioner` already supported. - Add `new-e2e-autoscaling` GitLab CI job (depends on `qa_dca` for the ECR image, `allow_failure: true`). - Add `.on_autoscaling_or_e2e_changes` trigger rule covering the spot test directory and `pkg/clusteragent/autoscaling/cluster/`. The local-only e2e tests introduced in #48821 cannot catch regressions introduced on the main branch because they require a Docker daemon and a locally-built image — neither of which is available on CI pod runners. Running on AWS kindvm closes this gap: every change to the spot scheduler or its tests now triggers a real cluster verification automatically. Updates https://datadoghq.atlassian.net/browse/CASCL-1222 Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
…ter e2e tests (#49985) ### What does this PR do? Add a CI path for the spot scheduling e2e test suite using an AWS kindvm provisioner (kind running on an EC2 VM), alongside the existing local kind path. ### Motivation The local-only e2e tests introduced in #48821 cannot catch regressions introduced on the main branch because they require a Docker daemon and a locally-built image — neither of which is available on CI pod runners. Running on AWS kindvm closes this gap: every change to the spot scheduler or its tests now triggers a real cluster verification automatically. ### Describe how you validated your changes Newly added `new-e2e-autoscaling` pipeline passed. ### Additional Notes - Add `TestSpotSchedulingKindCI` — skips unless `E2E_PIPELINE_ID` is set; uses the AWS kindvm provisioner with the `cluster-agent-qa` ECR image auto-resolved by the framework from pipeline/commit env vars. - Extend `scenarios/aws/kindvm` with `workerNodes` support (`WithKindWorkerNodes` option + `NewKindClusterWithConfig` call) so the cloud kindvm path can provision spot/on-demand node topology, matching what `localkubernetes.Provisioner` already supported. - Add `new-e2e-autoscaling` GitLab CI job (depends on `qa_dca` for the ECR image, `allow_failure: true`). - Add `.on_autoscaling_or_e2e_changes` trigger rule covering the spot test directory and `pkg/clusteragent/autoscaling/cluster/`. Updates https://datadoghq.atlassian.net/browse/CASCL-1222 Co-authored-by: alexander.yastrebov <[email protected]>
What does this PR do?
Add spot scheduling e2e test suite using a locally-built cluster-agent image loaded into kind.
In the subsequent steps I plan to expand it into CI-compatible test in EKS cluster.
Motivation
Verify spot scheduling works.
Describe how you validated your changes
See README.md
Additional Notes
Updates https://datadoghq.atlassian.net/browse/CASCL-1222
Exclude test package from bazel build for now similra to other e2e packages.