@@ -5,12 +5,49 @@ import (
55 "time"
66
77 "github.com/microsoft/retina/test/e2e/common"
8+ "github.com/microsoft/retina/test/e2e/framework/azure"
9+ "github.com/microsoft/retina/test/e2e/framework/generic"
810 "github.com/microsoft/retina/test/e2e/framework/kubernetes"
911 "github.com/microsoft/retina/test/e2e/framework/scaletest"
1012 "github.com/microsoft/retina/test/e2e/framework/types"
1113)
1214
1315func DefaultScaleTestOptions () scaletest.Options {
16+ // var NumRealDeployments int
17+ // var NumReplicas int
18+ // var err error
19+ //
20+ // if env.NumDeployments != "" {
21+ // NumRealDeployments, err = strconv.Atoi(env.NumDeployments)
22+ // require.NoError(t, err, "Failed to convert NUM_DEPLOYMENTS to int")
23+ // } else {
24+ // NumRealDeployments = 1000
25+ // }
26+ //
27+ // if env.NumReplicas != "" {
28+ // NumReplicas, err = strconv.Atoi(env.NumReplicas)
29+ // require.NoError(t, err, "Failed to convert NUM_REPLICAS to int")
30+ // } else {
31+ // NumReplicas = "40"
32+ // NumNetworkPolicies := env.NumNetworkPolicies
33+ // CleanUp := env.CleanUp
34+ //
35+ // if NumDeployments != "" {
36+ // } else {
37+ // NumRealDeployments = 1000
38+ // }
39+ // if NumReplicas != "" {
40+ // opt.NumRealReplicas, err = strconv.Atoi(NumReplicas)
41+ // require.NoError(t, err)
42+ // }
43+ // if NumNetworkPolicies != "" {
44+ // opt.NumNetworkPolicies, err = strconv.Atoi(NumNetworkPolicies)
45+ // require.NoError(t, err)
46+ // }
47+ // if CleanUp != "" {
48+ // opt.DeleteLabels, err = strconv.ParseBool(CleanUp)
49+ // require.NoError(t, err)
50+ // }
1451 return scaletest.Options {
1552 Namespace : "scale-test" ,
1653 MaxKwokPodsPerNode : 0 ,
@@ -45,6 +82,57 @@ func DefaultScaleTestOptions() scaletest.Options {
4582 }
4683}
4784
85+ func GetScaleTestInfra (subID , rg , clusterName , location , kubeConfigFilePath string , nodesPerPool int32 , createInfra bool ) * types.Job {
86+ job := types .NewJob ("Get scale test infrastructure" )
87+
88+ if createInfra {
89+ job .AddStep (& azure.CreateResourceGroup {
90+ SubscriptionID : subID ,
91+ ResourceGroupName : rg ,
92+ Location : location ,
93+ }, nil )
94+
95+ job .AddStep (& azure.CreateVNet {
96+ VnetName : "testvnet" ,
97+ VnetAddressSpace : "10.0.0.0/9" ,
98+ }, nil )
99+
100+ job .AddStep (& azure.CreateSubnet {
101+ SubnetName : "testsubnet" ,
102+ SubnetAddressSpace : "10.0.0.0/12" ,
103+ }, nil )
104+
105+ job .AddStep (& azure.CreateNPMCluster {
106+ ClusterName : clusterName ,
107+ PodCidr : "10.128.0.0/9" ,
108+ DNSServiceIP : "192.168.0.10" ,
109+ ServiceCidr : "192.168.0.0/28" ,
110+ NodesPerPool : nodesPerPool ,
111+ }, nil )
112+
113+ job .AddStep (& azure.GetAKSKubeConfig {
114+ KubeConfigFilePath : kubeConfigFilePath ,
115+ }, nil )
116+
117+ } else {
118+ job .AddStep (& azure.GetAKSKubeConfig {
119+ KubeConfigFilePath : kubeConfigFilePath ,
120+ ClusterName : clusterName ,
121+ SubscriptionID : subID ,
122+ ResourceGroupName : rg ,
123+ Location : location ,
124+ }, nil )
125+ }
126+
127+ job .AddStep (& generic.LoadFlags {
128+ TagEnv : generic .DefaultTagEnv ,
129+ ImageNamespaceEnv : generic .DefaultImageNamespace ,
130+ ImageRegistryEnv : generic .DefaultImageRegistry ,
131+ }, nil )
132+
133+ return job
134+ }
135+
48136func ScaleTest (opt * scaletest.Options ) * types.Job {
49137 job := types .NewJob ("Scale Test" )
50138
0 commit comments