Skip to content

Commit

Permalink
Proto changes
Browse files Browse the repository at this point in the history
Signed-off-by: JamesMurkin <jamesmurkin@hotmail.com>
  • Loading branch information
JamesMurkin committed Aug 16, 2024
1 parent a31633f commit 1c751ba
Show file tree
Hide file tree
Showing 7 changed files with 523 additions and 414 deletions.
9 changes: 6 additions & 3 deletions pkg/api/api.swagger.go
Original file line number Diff line number Diff line change
Expand Up @@ -920,6 +920,9 @@ func SwaggerJsonTemplate() string {
" \"apiJobCancellingEvent\": {\n" +
" \"type\": \"object\",\n" +
" \"properties\": {\n" +
" \"cause\": {\n" +
" \"type\": \"string\"\n" +
" },\n" +
" \"created\": {\n" +
" \"type\": \"string\",\n" +
" \"format\": \"date-time\"\n" +
Expand All @@ -933,9 +936,6 @@ func SwaggerJsonTemplate() string {
" \"queue\": {\n" +
" \"type\": \"string\"\n" +
" },\n" +
" \"reason\": {\n" +
" \"type\": \"string\"\n" +
" },\n" +
" \"requestor\": {\n" +
" \"type\": \"string\"\n" +
" }\n" +
Expand Down Expand Up @@ -1265,6 +1265,9 @@ func SwaggerJsonTemplate() string {
" \"queue\": {\n" +
" \"type\": \"string\"\n" +
" },\n" +
" \"reason\": {\n" +
" \"type\": \"string\"\n" +
" },\n" +
" \"runId\": {\n" +
" \"type\": \"string\"\n" +
" }\n" +
Expand Down
9 changes: 6 additions & 3 deletions pkg/api/api.swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -909,6 +909,9 @@
"apiJobCancellingEvent": {
"type": "object",
"properties": {
"cause": {
"type": "string"
},
"created": {
"type": "string",
"format": "date-time"
Expand All @@ -922,9 +925,6 @@
"queue": {
"type": "string"
},
"reason": {
"type": "string"
},
"requestor": {
"type": "string"
}
Expand Down Expand Up @@ -1254,6 +1254,9 @@
"queue": {
"type": "string"
},
"reason": {
"type": "string"
},
"runId": {
"type": "string"
}
Expand Down
360 changes: 206 additions & 154 deletions pkg/api/event.pb.go

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion pkg/api/event.proto
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ message JobPreemptedEvent {
string run_id = 6;
string preemptive_job_id = 7;
string preemptive_run_id = 8;
string reason = 9;
}

message JobSucceededEvent {
Expand Down Expand Up @@ -194,7 +195,7 @@ message JobCancellingEvent {
string queue = 3;
google.protobuf.Timestamp created = 4;
string requestor = 5;
string reason = 6;
string cause = 6;
}

message JobCancelledEvent {
Expand Down
530 changes: 291 additions & 239 deletions pkg/armadaevents/events.pb.go

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions pkg/armadaevents/events.proto
Original file line number Diff line number Diff line change
Expand Up @@ -556,6 +556,7 @@ message JobRunPreempted{
Uuid preemptive_run_id = 4;
string preempted_job_id_str = 5;
string preempted_run_id_str = 6;
string cause = 7;
}

// Message used internally by Armada to see if messages can be propagated through a pulsar partition
Expand Down
25 changes: 11 additions & 14 deletions pkg/client/load-test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,12 @@ import (
"sync"
"time"

"github.com/sirupsen/logrus"
log "github.com/sirupsen/logrus"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"

"github.com/armadaproject/armada/internal/common"
"github.com/armadaproject/armada/internal/common/logging"
"github.com/armadaproject/armada/pkg/api"
"github.com/armadaproject/armada/pkg/client/domain"
"github.com/sirupsen/logrus"
log "github.com/sirupsen/logrus"
)

type LoadTester interface {
Expand Down Expand Up @@ -133,15 +130,15 @@ func (apiLoadTester ArmadaLoadTester) runSubmission(
err := WithSubmitClient(apiLoadTester.apiConnectionDetails, func(client api.SubmitClient) error {
defer submissionComplete.Done()

e := CreateQueue(client, &api.Queue{Name: queue, PriorityFactor: priorityFactor})
if status.Code(e) == codes.AlreadyExists {
log.Infof("queue %s already exists so no need to create it.\n", queue)
} else if e != nil {
log.Errorf("failed to create queue: %s because: %s\n", queue, e)
return nil
} else {
log.Infof("queue %s created.\n", queue)
}
//e := CreateQueue(client, &api.Queue{Name: queue, PriorityFactor: priorityFactor})
//if status.Code(e) == codes.AlreadyExists {
// log.Infof("queue %s already exists so no need to create it.\n", queue)
//} else if e != nil {
// log.Errorf("failed to create queue: %s because: %s\n", queue, e)
// return nil
//} else {
// log.Infof("queue %s created.\n", queue)
//}

for len(jobs) > 0 {
select {
Expand Down

0 comments on commit 1c751ba

Please sign in to comment.