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 gogo timestamp from public api protos #3750

Merged
merged 12 commits into from
Jul 1, 2024
Merged
49 changes: 25 additions & 24 deletions internal/armada/event/conversion/conversions.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
log "github.com/sirupsen/logrus"

"github.com/armadaproject/armada/internal/common/eventutil"
protoutil "github.com/armadaproject/armada/internal/common/proto"
"github.com/armadaproject/armada/pkg/api"
"github.com/armadaproject/armada/pkg/armadaevents"
)
Expand Down Expand Up @@ -87,15 +88,15 @@ func FromInternalSubmit(owner string, groups []string, queue string, jobSet stri
JobId: jobId,
JobSetId: jobSet,
Queue: queue,
Created: time,
Created: protoutil.ToTimestamp(time),
Job: *job,
}

queuedEvent := &api.JobQueuedEvent{
JobId: jobId,
JobSetId: jobSet,
Queue: queue,
Created: time,
Created: protoutil.ToTimestamp(time),
}

return []*api.EventMessage{
Expand Down Expand Up @@ -125,7 +126,7 @@ func FromInternalPreemptionRequested(userId string, queueName string, jobSetName
JobId: jobId,
JobSetId: jobSetName,
Queue: queueName,
Created: time,
Created: protoutil.ToTimestamp(time),
Requestor: userId,
},
},
Expand All @@ -146,7 +147,7 @@ func FromInternalCancel(userId string, queueName string, jobSetName string, time
JobId: jobId,
JobSetId: jobSetName,
Queue: queueName,
Created: time,
Created: protoutil.ToTimestamp(time),
Requestor: userId,
},
},
Expand All @@ -167,7 +168,7 @@ func FromInternalCancelled(userId string, queueName string, jobSetName string, t
JobId: jobId,
JobSetId: jobSetName,
Queue: queueName,
Created: time,
Created: protoutil.ToTimestamp(time),
Requestor: userId,
},
},
Expand All @@ -187,7 +188,7 @@ func FromInternalReprioritiseJob(userId string, queueName string, jobSetName str
JobId: jobId,
JobSetId: jobSetName,
Queue: queueName,
Created: time,
Created: protoutil.ToTimestamp(time),
NewPriority: float64(e.Priority),
Requestor: userId,
},
Expand All @@ -208,7 +209,7 @@ func FromInternalReprioritisedJob(userId string, queueName string, jobSetName st
JobId: jobId,
JobSetId: jobSetName,
Queue: queueName,
Created: time,
Created: protoutil.ToTimestamp(time),
NewPriority: float64(e.Priority),
Requestor: userId,
},
Expand All @@ -229,7 +230,7 @@ func FromInternalLogJobRunLeased(queueName string, jobSetName string, time time.
JobId: jobId,
JobSetId: jobSetName,
Queue: queueName,
Created: time,
Created: protoutil.ToTimestamp(time),
ClusterId: e.ExecutorId,
},
},
Expand All @@ -247,7 +248,7 @@ func FromInternalJobSucceeded(queueName string, jobSetName string, time time.Tim
JobId: jobId,
JobSetId: jobSetName,
Queue: queueName,
Created: time,
Created: protoutil.ToTimestamp(time),
}

if len(e.ResourceInfos) > 0 {
Expand Down Expand Up @@ -285,7 +286,7 @@ func FromInternalJobRunErrors(queueName string, jobSetName string, time time.Tim
JobId: jobId,
JobSetId: jobSetName,
Queue: queueName,
Created: time,
Created: protoutil.ToTimestamp(time),
},
},
}
Expand All @@ -305,7 +306,7 @@ func FromInternalJobRunErrors(queueName string, jobSetName string, time time.Tim
PodNumber: reason.PodUnschedulable.GetPodNumber(),
JobSetId: jobSetName,
Queue: queueName,
Created: time,
Created: protoutil.ToTimestamp(time),
},
},
}
Expand All @@ -318,7 +319,7 @@ func FromInternalJobRunErrors(queueName string, jobSetName string, time time.Tim
JobId: jobId,
JobSetId: jobSetName,
Queue: queueName,
Created: time,
Created: protoutil.ToTimestamp(time),
ClusterId: objectMeta.GetExecutorId(),
Reason: reason.PodLeaseReturned.GetMessage(),
KubernetesId: objectMeta.GetKubernetesId(),
Expand All @@ -338,7 +339,7 @@ func FromInternalJobRunErrors(queueName string, jobSetName string, time time.Tim
PodNamespace: objectMeta.GetNamespace(),
PodName: objectMeta.GetName(),
Queue: queueName,
Created: time,
Created: protoutil.ToTimestamp(time),
ClusterId: objectMeta.GetExecutorId(),
Reason: reason.PodTerminated.GetMessage(),
KubernetesId: objectMeta.GetKubernetesId(),
Expand Down Expand Up @@ -379,7 +380,7 @@ func FromInternalJobErrors(queueName string, jobSetName string, time time.Time,
JobId: jobId,
JobSetId: jobSetName,
Queue: queueName,
Created: time,
Created: protoutil.ToTimestamp(time),
Reason: "preempted",
},
},
Expand All @@ -392,7 +393,7 @@ func FromInternalJobErrors(queueName string, jobSetName string, time time.Time,
JobId: jobId,
JobSetId: jobSetName,
Queue: queueName,
Created: time,
Created: protoutil.ToTimestamp(time),
Reason: reason.MaxRunsExceeded.Message,
},
},
Expand All @@ -405,7 +406,7 @@ func FromInternalJobErrors(queueName string, jobSetName string, time time.Time,
JobId: jobId,
JobSetId: jobSetName,
Queue: queueName,
Created: time,
Created: protoutil.ToTimestamp(time),
Reason: reason.GangJobUnschedulable.Message,
},
},
Expand All @@ -418,7 +419,7 @@ func FromInternalJobErrors(queueName string, jobSetName string, time time.Time,
JobId: jobId,
JobSetId: jobSetName,
Queue: queueName,
Created: time,
Created: protoutil.ToTimestamp(time),
Reason: reason.JobRejected.Message,
Cause: api.Cause_Rejected,
},
Expand All @@ -433,7 +434,7 @@ func FromInternalJobErrors(queueName string, jobSetName string, time time.Time,
JobId: jobId,
JobSetId: jobSetName,
Queue: queueName,
Created: time,
Created: protoutil.ToTimestamp(time),
},
},
}
Expand All @@ -453,7 +454,7 @@ func FromInternalJobRunRunning(queueName string, jobSetName string, time time.Ti
JobId: jobId,
JobSetId: jobSetName,
Queue: queueName,
Created: time,
Created: protoutil.ToTimestamp(time),
}

if len(e.ResourceInfos) > 0 {
Expand Down Expand Up @@ -485,7 +486,7 @@ func FromInternalJobRunAssigned(queueName string, jobSetName string, time time.T
JobId: jobId,
JobSetId: jobSetName,
Queue: queueName,
Created: time,
Created: protoutil.ToTimestamp(time),
}

if len(e.ResourceInfos) > 0 {
Expand Down Expand Up @@ -540,7 +541,7 @@ func FromInternalJobRunPreempted(queueName string, jobSetName string, time time.
JobId: jobId,
JobSetId: jobSetName,
Queue: queueName,
Created: time,
Created: protoutil.ToTimestamp(time),
RunId: runId,
PreemptiveJobId: preemptiveJobId,
PreemptiveRunId: preemptiveRunId,
Expand All @@ -565,7 +566,7 @@ func FromInternalResourceUtilisation(queueName string, jobSetName string, time t
JobId: jobId,
JobSetId: jobSetName,
Queue: queueName,
Created: time,
Created: protoutil.ToTimestamp(time),
ClusterId: e.GetResourceInfo().GetObjectMeta().GetExecutorId(),
KubernetesId: e.GetResourceInfo().GetObjectMeta().GetKubernetesId(),
MaxResourcesForPeriod: e.MaxResourcesForPeriod,
Expand Down Expand Up @@ -595,7 +596,7 @@ func FromInternalStandaloneIngressInfo(queueName string, jobSetName string, time
JobId: jobId,
JobSetId: jobSetName,
Queue: queueName,
Created: time,
Created: protoutil.ToTimestamp(time),
ClusterId: e.GetObjectMeta().GetExecutorId(),
KubernetesId: e.GetObjectMeta().GetKubernetesId(),
NodeName: e.GetNodeName(),
Expand All @@ -620,7 +621,7 @@ func makeJobFailed(jobId string, queueName string, jobSetName string, time time.
JobId: jobId,
JobSetId: jobSetName,
Queue: queueName,
Created: time,
Created: protoutil.ToTimestamp(time),
ClusterId: podError.GetObjectMeta().GetExecutorId(),
PodNamespace: podError.GetObjectMeta().GetNamespace(),
KubernetesId: podError.GetObjectMeta().GetKubernetesId(),
Expand Down
Loading