generated from kubernetes/kubernetes-template-project
-
Notifications
You must be signed in to change notification settings - Fork 299
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* kueue.x-k8s.io/pod-group-fast-admission annotation
- Loading branch information
1 parent
1549b5f
commit c5d077d
Showing
8 changed files
with
134 additions
and
11 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
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 |
---|---|---|
|
@@ -27,3 +27,4 @@ integrations: | |
- "kubeflow.org/tfjob" | ||
- "kubeflow.org/xgboostjob" | ||
- "pod" | ||
- "statefulset" |
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,85 @@ | ||
package e2e | ||
|
||
import ( | ||
"github.com/onsi/ginkgo/v2" | ||
"github.com/onsi/gomega" | ||
appsv1 "k8s.io/api/apps/v1" | ||
corev1 "k8s.io/api/core/v1" | ||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | ||
"sigs.k8s.io/controller-runtime/pkg/client" | ||
|
||
kueue "sigs.k8s.io/kueue/apis/kueue/v1beta1" | ||
"sigs.k8s.io/kueue/pkg/util/kubeversion" | ||
"sigs.k8s.io/kueue/pkg/util/testing" | ||
statefulsettesting "sigs.k8s.io/kueue/pkg/util/testingjobs/statefulset" | ||
"sigs.k8s.io/kueue/test/util" | ||
) | ||
|
||
var _ = ginkgo.Describe("Stateful set integration", func() { | ||
var ( | ||
ns *corev1.Namespace | ||
onDemandRF *kueue.ResourceFlavor | ||
) | ||
|
||
ginkgo.BeforeEach(func() { | ||
if kubeVersion().LessThan(kubeversion.KubeVersion1_27) { | ||
ginkgo.Skip("Unsupported in versions older than 1.27") | ||
} | ||
ns = &corev1.Namespace{ | ||
ObjectMeta: metav1.ObjectMeta{ | ||
GenerateName: "pod-e2e-", | ||
}, | ||
} | ||
gomega.Expect(k8sClient.Create(ctx, ns)).To(gomega.Succeed()) | ||
onDemandRF = testing.MakeResourceFlavor("statefulset-resource-flavour"). | ||
NodeLabel("instance-type", "on-demand"). | ||
Obj() | ||
gomega.Expect(k8sClient.Create(ctx, onDemandRF)).To(gomega.Succeed()) | ||
}) | ||
ginkgo.AfterEach(func() { | ||
gomega.Expect(util.DeleteNamespace(ctx, k8sClient, ns)).To(gomega.Succeed()) | ||
util.ExpectObjectToBeDeleted(ctx, k8sClient, onDemandRF, true) | ||
}) | ||
|
||
ginkgo.When("Single CQ", func() { | ||
var ( | ||
cq *kueue.ClusterQueue | ||
lq *kueue.LocalQueue | ||
) | ||
|
||
ginkgo.BeforeEach(func() { | ||
cq = testing.MakeClusterQueue("statefulset-cluster-queue"). | ||
ResourceGroup( | ||
*testing.MakeFlavorQuotas("statefulset-resource-flavour"). | ||
Resource(corev1.ResourceCPU, "5"). | ||
Obj(), | ||
). | ||
Preemption(kueue.ClusterQueuePreemption{ | ||
WithinClusterQueue: kueue.PreemptionPolicyLowerPriority, | ||
}). | ||
Obj() | ||
gomega.Expect(k8sClient.Create(ctx, cq)).To(gomega.Succeed()) | ||
lq = testing.MakeLocalQueue("statefulset-local-queue", ns.Name).ClusterQueue(cq.Name).Obj() | ||
gomega.Expect(k8sClient.Create(ctx, lq)).To(gomega.Succeed()) | ||
}) | ||
ginkgo.AfterEach(func() { | ||
gomega.Expect(util.DeleteAllPodsInNamespace(ctx, k8sClient, ns)).To(gomega.Succeed()) | ||
util.ExpectObjectToBeDeleted(ctx, k8sClient, cq, true) | ||
}) | ||
|
||
ginkgo.It("should admit group that fits", func() { | ||
statefulSet := statefulsettesting.MakeStatefulSet("sf", ns.Name). | ||
Image("gcr.io/k8s-staging-perf-tests/sleep:v0.1.0", []string{"1m"}). | ||
Replicas(3). | ||
Queue(lq.Name). | ||
Obj() | ||
gomega.Expect(k8sClient.Create(ctx, statefulSet)).To(gomega.Succeed()) | ||
gomega.Eventually(func(g gomega.Gomega) { | ||
createdStatefulSet := &appsv1.StatefulSet{} | ||
gomega.Expect(k8sClient.Get(ctx, client.ObjectKeyFromObject(statefulSet), createdStatefulSet)). | ||
To(gomega.Succeed()) | ||
g.Expect(createdStatefulSet.Status.ReadyReplicas).To(gomega.Equal(int32(3))) | ||
}).Should(gomega.Succeed()) | ||
}) | ||
}) | ||
}) |
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