Skip to content

Commit

Permalink
Add support for namespaces in load tester. (#255)
Browse files Browse the repository at this point in the history
* Add support for namespaces in load tester.

* Fix build.
  • Loading branch information
jankaspar authored Nov 22, 2019
1 parent e66a8a7 commit 827b3ae
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
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

0 comments on commit 827b3ae

Please sign in to comment.