func ExtractMPICurrentCondition(jobConditions []commonKf.JobCondition) (commonKf.JobCondition, error) {
	if jobConditions != nil {
		sort.Slice(jobConditions, func(i, j int) bool {
			return jobConditions[i].LastTransitionTime.Time.After(jobConditions[j].LastTransitionTime.Time)
		})
		for _, jc := range jobConditions {
			if jc.Status == v1.ConditionTrue {
				return jc, nil
			}
		}
	}
	return commonKf.JobCondition{}, fmt.Errorf("found no current condition. Conditions: %+v", jobConditions)
}
ExtractMPICurrentCondition will return the first job condition for MPI
package common
import (
	"fmt"
	"sort"
	"time"
	"github.com/flyteorg/flyteplugins/go/tasks/pluginmachinery/tasklog"
	"github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/core"
	flyteerr "github.com/flyteorg/flyteplugins/go/tasks/errors"
	"github.com/flyteorg/flyteplugins/go/tasks/logs"
	pluginsCore "github.com/flyteorg/flyteplugins/go/tasks/pluginmachinery/core"
	commonKf "github.com/kubeflow/common/pkg/apis/common/v1"
	commonOp "github.com/kubeflow/tf-operator/pkg/apis/common/v1"
	v1 "k8s.io/api/core/v1"
)
const (
	TensorflowTaskType = "tensorflow"
	MPITaskType        = "mpi"
	PytorchTaskType    = "pytorch"
)