// @generated by protoc-gen-es v1.7.2 with parameter "target=ts"
// @generated from file flyteidl/plugins/kubeflow/tensorflow.proto (package flyteidl.plugins.kubeflow, syntax proto3)
/* eslint-disable */
// @ts-nocheck

import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf";
import { Message, proto3 } from "@bufbuild/protobuf";
import { RestartPolicy, RunPolicy } from "./common_pb.js";
import { Resources } from "../../core/tasks_pb.js";

/**
 * Proto for plugin that enables distributed training using https://github.com/kubeflow/tf-operator
 *
 * @generated from message flyteidl.plugins.kubeflow.DistributedTensorflowTrainingTask
 */
export class DistributedTensorflowTrainingTask extends Message<DistributedTensorflowTrainingTask> {
  /**
   * Worker replicas spec
   *
   * @generated from field: flyteidl.plugins.kubeflow.DistributedTensorflowTrainingReplicaSpec worker_replicas = 1;
   */
  workerReplicas?: DistributedTensorflowTrainingReplicaSpec;

  /**
   * Parameter server replicas spec
   *
   * @generated from field: flyteidl.plugins.kubeflow.DistributedTensorflowTrainingReplicaSpec ps_replicas = 2;
   */
  psReplicas?: DistributedTensorflowTrainingReplicaSpec;

  /**
   * Chief replicas spec
   *
   * @generated from field: flyteidl.plugins.kubeflow.DistributedTensorflowTrainingReplicaSpec chief_replicas = 3;
   */
  chiefReplicas?: DistributedTensorflowTrainingReplicaSpec;

  /**
   * RunPolicy encapsulates various runtime policies of the distributed training
   * job, for example how to clean up resources and how long the job can stay
   * active.
   *
   * @generated from field: flyteidl.plugins.kubeflow.RunPolicy run_policy = 4;
   */
  runPolicy?: RunPolicy;

  /**
   * Evaluator replicas spec
   *
   * @generated from field: flyteidl.plugins.kubeflow.DistributedTensorflowTrainingReplicaSpec evaluator_replicas = 5;
   */
  evaluatorReplicas?: DistributedTensorflowTrainingReplicaSpec;

  constructor(data?: PartialMessage<DistributedTensorflowTrainingTask>) {
    super();
    proto3.util.initPartial(data, this);
  }

  static readonly runtime: typeof proto3 = proto3;
  static readonly typeName = "flyteidl.plugins.kubeflow.DistributedTensorflowTrainingTask";
  static readonly fields: FieldList = proto3.util.newFieldList(() => [
    { no: 1, name: "worker_replicas", kind: "message", T: DistributedTensorflowTrainingReplicaSpec },
    { no: 2, name: "ps_replicas", kind: "message", T: DistributedTensorflowTrainingReplicaSpec },
    { no: 3, name: "chief_replicas", kind: "message", T: DistributedTensorflowTrainingReplicaSpec },
    { no: 4, name: "run_policy", kind: "message", T: RunPolicy },
    { no: 5, name: "evaluator_replicas", kind: "message", T: DistributedTensorflowTrainingReplicaSpec },
  ]);

  static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): DistributedTensorflowTrainingTask {
    return new DistributedTensorflowTrainingTask().fromBinary(bytes, options);
  }

  static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): DistributedTensorflowTrainingTask {
    return new DistributedTensorflowTrainingTask().fromJson(jsonValue, options);
  }

  static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): DistributedTensorflowTrainingTask {
    return new DistributedTensorflowTrainingTask().fromJsonString(jsonString, options);
  }

  static equals(a: DistributedTensorflowTrainingTask | PlainMessage<DistributedTensorflowTrainingTask> | undefined, b: DistributedTensorflowTrainingTask | PlainMessage<DistributedTensorflowTrainingTask> | undefined): boolean {
    return proto3.util.equals(DistributedTensorflowTrainingTask, a, b);
  }
}

/**
 * @generated from message flyteidl.plugins.kubeflow.DistributedTensorflowTrainingReplicaSpec
 */
export class DistributedTensorflowTrainingReplicaSpec extends Message<DistributedTensorflowTrainingReplicaSpec> {
  /**
   * Number of replicas
   *
   * @generated from field: int32 replicas = 1;
   */
  replicas = 0;

  /**
   * Image used for the replica group
   *
   * @generated from field: string image = 2;
   */
  image = "";

  /**
   * Resources required for the replica group
   *
   * @generated from field: flyteidl.core.Resources resources = 3;
   */
  resources?: Resources;

  /**
   * RestartPolicy Determines whether pods will be restarted when they exit
   *
   * @generated from field: flyteidl.plugins.kubeflow.RestartPolicy restart_policy = 4;
   */
  restartPolicy = RestartPolicy.NEVER;

  constructor(data?: PartialMessage<DistributedTensorflowTrainingReplicaSpec>) {
    super();
    proto3.util.initPartial(data, this);
  }

  static readonly runtime: typeof proto3 = proto3;
  static readonly typeName = "flyteidl.plugins.kubeflow.DistributedTensorflowTrainingReplicaSpec";
  static readonly fields: FieldList = proto3.util.newFieldList(() => [
    { no: 1, name: "replicas", kind: "scalar", T: 5 /* ScalarType.INT32 */ },
    { no: 2, name: "image", kind: "scalar", T: 9 /* ScalarType.STRING */ },
    { no: 3, name: "resources", kind: "message", T: Resources },
    { no: 4, name: "restart_policy", kind: "enum", T: proto3.getEnumType(RestartPolicy) },
  ]);

  static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): DistributedTensorflowTrainingReplicaSpec {
    return new DistributedTensorflowTrainingReplicaSpec().fromBinary(bytes, options);
  }

  static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): DistributedTensorflowTrainingReplicaSpec {
    return new DistributedTensorflowTrainingReplicaSpec().fromJson(jsonValue, options);
  }

  static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): DistributedTensorflowTrainingReplicaSpec {
    return new DistributedTensorflowTrainingReplicaSpec().fromJsonString(jsonString, options);
  }

  static equals(a: DistributedTensorflowTrainingReplicaSpec | PlainMessage<DistributedTensorflowTrainingReplicaSpec> | undefined, b: DistributedTensorflowTrainingReplicaSpec | PlainMessage<DistributedTensorflowTrainingReplicaSpec> | undefined): boolean {
    return proto3.util.equals(DistributedTensorflowTrainingReplicaSpec, a, b);
  }
}

