Skip to content
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

Add support for namespaces in load tester. #255

Merged
merged 3 commits into from
Nov 22, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions internal/client/domain/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,10 @@ type SubmissionDescription struct {
}

type JobSubmissionDescription struct {
Name string
Count int
Spec *v1.PodSpec
Name string
Count int
Namespace string
Spec *v1.PodSpec
}

type OpenIdConnectClientDetails struct {
Expand Down
14 changes: 7 additions & 7 deletions internal/client/load-test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import (

log "github.com/sirupsen/logrus"
"google.golang.org/grpc"
v1 "k8s.io/api/core/v1"

"github.com/G-Research/armada/internal/armada/api"
"github.com/G-Research/armada/internal/client/domain"
Expand Down Expand Up @@ -107,7 +106,7 @@ func (apiLoadTester ArmadaLoadTester) runSubmission(submission *domain.Submissio
log.Infof("Queue %s created.\n", queue)

for _, job := range jobs {
jobRequestItems := createJobSubmitRequestItems(job.Spec, job.Count)
jobRequestItems := createJobSubmitRequestItems(job)
requests := CreateChunkedSubmitRequests(queue, jobSetId, jobRequestItems)

for _, request := range requests {
Expand Down Expand Up @@ -169,13 +168,14 @@ func (apiLoadTester ArmadaLoadTester) monitorJobsUntilCompletion(jobSetId string
})
}

func createJobSubmitRequestItems(spec *v1.PodSpec, count int) []*api.JobSubmitRequestItem {
requestItems := make([]*api.JobSubmitRequestItem, 0, count)
func createJobSubmitRequestItems(jobDesc *domain.JobSubmissionDescription) []*api.JobSubmitRequestItem {
requestItems := make([]*api.JobSubmitRequestItem, 0, jobDesc.Count)
job := api.JobSubmitRequestItem{
Priority: 1,
PodSpec: spec,
Priority: 1,
Namespace: jobDesc.Namespace,
PodSpec: jobDesc.Spec,
}
for i := 0; i < count; i++ {
for i := 0; i < jobDesc.Count; i++ {
requestItems = append(requestItems, &job)
}

Expand Down