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

Remove Armada UUIDs from Event Ingester and Event Api #3886

Merged
merged 6 commits into from
Sep 2, 2024
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
8 changes: 1 addition & 7 deletions internal/common/eventutil/eventutil.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,12 +83,6 @@ func ShortSequenceString(sequence *armadaevents.EventSequence) string {

// ApiJobFromLogSubmitJob converts a SubmitJob log message into an api.Job struct, which is used by Armada internally.
func ApiJobFromLogSubmitJob(ownerId string, groups []string, queueName string, jobSetName string, time time.Time, e *armadaevents.SubmitJob) (*api.Job, error) {
jobId, err := armadaevents.UlidStringFromProtoUuid(e.JobId)
if err != nil {
err = errors.WithStack(err)
return nil, err
}

if e == nil || e.MainObject == nil || e.MainObject.Object == nil {
return nil, errors.Errorf("SubmitJob or one of its member pointers is nil")
}
Expand Down Expand Up @@ -146,7 +140,7 @@ func ApiJobFromLogSubmitJob(ownerId string, groups []string, queueName string, j
}

return &api.Job{
Id: jobId,
Id: e.JobIdStr,
ClientId: e.DeduplicationId,
Queue: queueName,
JobSetId: jobSetName,
Expand Down
21 changes: 9 additions & 12 deletions internal/eventingester/convert/conversions_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import (

"github.com/apache/pulsar-client-go/pulsar"
"github.com/gogo/protobuf/proto"
"github.com/google/uuid"
"github.com/stretchr/testify/assert"

"github.com/armadaproject/armada/internal/common/armadacontext"
Expand All @@ -26,8 +25,6 @@ const (
)

var (
jobIdProto, _ = armadaevents.ProtoUuidFromUlidString(jobIdString)
runIdProto = armadaevents.ProtoUuidFromUuid(uuid.MustParse(runIdString))
baseTime, _ = time.Parse("2006-01-02T15:04:05.000Z", "2022-03-01T15:04:05.000Z")
baseTimeProto = protoutil.ToTimestamp(baseTime)
)
Expand All @@ -37,8 +34,8 @@ var jobRunSucceeded = &armadaevents.EventSequence_Event{
Created: baseTimeProto,
Event: &armadaevents.EventSequence_Event_JobRunSucceeded{
JobRunSucceeded: &armadaevents.JobRunSucceeded{
RunId: runIdProto,
JobId: jobIdProto,
RunIdStr: runIdString,
JobIdStr: jobIdString,
},
},
}
Expand All @@ -48,7 +45,7 @@ var cancelled = &armadaevents.EventSequence_Event{
Created: baseTimeProto,
Event: &armadaevents.EventSequence_Event_CancelledJob{
CancelledJob: &armadaevents.CancelledJob{
JobId: jobIdProto,
JobIdStr: jobIdString,
},
},
}
Expand Down Expand Up @@ -93,8 +90,8 @@ func TestCancelled(t *testing.T) {
Created: baseTimeProto,
Event: &armadaevents.EventSequence_Event_CancelJob{
CancelJob: &armadaevents.CancelJob{
JobId: jobIdProto,
Reason: "some reason 1",
JobIdStr: jobIdString,
Reason: "some reason 1",
},
},
}, &armadaevents.EventSequence_Event{
Expand All @@ -108,8 +105,8 @@ func TestCancelled(t *testing.T) {
Created: baseTimeProto,
Event: &armadaevents.EventSequence_Event_CancelledJob{
CancelledJob: &armadaevents.CancelledJob{
JobId: jobIdProto,
Reason: "some reason 3",
JobIdStr: jobIdString,
Reason: "some reason 3",
},
},
})
Expand All @@ -124,7 +121,7 @@ func TestCancelled(t *testing.T) {
Created: baseTimeProto,
Event: &armadaevents.EventSequence_Event_CancelJob{
CancelJob: &armadaevents.CancelJob{
JobId: jobIdProto,
JobIdStr: jobIdString,
},
},
},
Expand All @@ -138,7 +135,7 @@ func TestCancelled(t *testing.T) {
Created: baseTimeProto,
Event: &armadaevents.EventSequence_Event_CancelledJob{
CancelledJob: &armadaevents.CancelledJob{
JobId: jobIdProto,
JobIdStr: jobIdString,
},
},
},
Expand Down
Loading