Adding dep files and dependencies.

This commit is contained in:
Renan DelValle 2018-09-30 18:02:42 -07:00
parent 45f9efa578
commit b341c0a0e4
No known key found for this signature in database
GPG key ID: 3895800E03F17676
539 changed files with 313111 additions and 0 deletions

View file

@ -0,0 +1,9 @@
PROTO_PATH := ${GOPATH}/src:.
PROTO_PATH := ${PROTO_PATH}:${GOPATH}/src/github.com/gogo/protobuf/protobuf
PROTO_PATH := ${PROTO_PATH}:${GOPATH}/src/github.com/gogo/protobuf/gogoproto
.PHONY: all
all:
protoc --proto_path=${PROTO_PATH} --gogo_out=. *.proto
protoc --proto_path=${PROTO_PATH} --gogo_out=. ./scheduler/*.proto

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,64 @@
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package mesosproto;
import "github.com/gogo/protobuf/gogoproto/gogo.proto";
option (gogoproto.gostring_all) = true;
option (gogoproto.equal_all) = true;
option (gogoproto.verbose_equal_all) = true;
option (gogoproto.goproto_stringer_all) = false;
option (gogoproto.stringer_all) = true;
option (gogoproto.populate_all) = true;
option (gogoproto.testgen_all) = true;
option (gogoproto.benchgen_all) = true;
option (gogoproto.marshaler_all) = true;
option (gogoproto.sizer_all) = true;
option (gogoproto.unmarshaler_all) = true;
message AuthenticateMessage {
required string pid = 1; // PID that needs to be authenticated.
}
message AuthenticationMechanismsMessage {
repeated string mechanisms = 1; // List of available SASL mechanisms.
}
message AuthenticationStartMessage {
required string mechanism = 1;
optional bytes data = 2;
}
message AuthenticationStepMessage {
required bytes data = 1;
}
message AuthenticationCompletedMessage {}
message AuthenticationFailedMessage {}
message AuthenticationErrorMessage {
optional string error = 1;
}

View file

@ -0,0 +1,103 @@
// Code generated by protoc-gen-gogo.
// source: internal.proto
// DO NOT EDIT!
package mesosproto
import proto "github.com/gogo/protobuf/proto"
import fmt "fmt"
import math "math"
// discarding unused import gogoproto "github.com/gogo/protobuf/gogoproto"
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
// For use with detector callbacks
type InternalMasterChangeDetected struct {
// will be present if there's a new master, otherwise nil
Master *MasterInfo `protobuf:"bytes,1,opt,name=master" json:"master,omitempty"`
XXX_unrecognized []byte `json:"-"`
}
func (m *InternalMasterChangeDetected) Reset() { *m = InternalMasterChangeDetected{} }
func (m *InternalMasterChangeDetected) String() string { return proto.CompactTextString(m) }
func (*InternalMasterChangeDetected) ProtoMessage() {}
func (m *InternalMasterChangeDetected) GetMaster() *MasterInfo {
if m != nil {
return m.Master
}
return nil
}
type InternalTryAuthentication struct {
XXX_unrecognized []byte `json:"-"`
}
func (m *InternalTryAuthentication) Reset() { *m = InternalTryAuthentication{} }
func (m *InternalTryAuthentication) String() string { return proto.CompactTextString(m) }
func (*InternalTryAuthentication) ProtoMessage() {}
type InternalAuthenticationResult struct {
// true only if the authentication process completed and login was successful
Success *bool `protobuf:"varint,1,req,name=success" json:"success,omitempty"`
// true if the authentication process completed, successfully or not
Completed *bool `protobuf:"varint,2,req,name=completed" json:"completed,omitempty"`
// master pid that this result pertains to
Pid *string `protobuf:"bytes,3,req,name=pid" json:"pid,omitempty"`
XXX_unrecognized []byte `json:"-"`
}
func (m *InternalAuthenticationResult) Reset() { *m = InternalAuthenticationResult{} }
func (m *InternalAuthenticationResult) String() string { return proto.CompactTextString(m) }
func (*InternalAuthenticationResult) ProtoMessage() {}
func (m *InternalAuthenticationResult) GetSuccess() bool {
if m != nil && m.Success != nil {
return *m.Success
}
return false
}
func (m *InternalAuthenticationResult) GetCompleted() bool {
if m != nil && m.Completed != nil {
return *m.Completed
}
return false
}
func (m *InternalAuthenticationResult) GetPid() string {
if m != nil && m.Pid != nil {
return *m.Pid
}
return ""
}
type InternalNetworkError struct {
// master pid that this event pertains to
Pid *string `protobuf:"bytes,1,req,name=pid" json:"pid,omitempty"`
// driver session UUID
Session *string `protobuf:"bytes,2,opt,name=session" json:"session,omitempty"`
XXX_unrecognized []byte `json:"-"`
}
func (m *InternalNetworkError) Reset() { *m = InternalNetworkError{} }
func (m *InternalNetworkError) String() string { return proto.CompactTextString(m) }
func (*InternalNetworkError) ProtoMessage() {}
func (m *InternalNetworkError) GetPid() string {
if m != nil && m.Pid != nil {
return *m.Pid
}
return ""
}
func (m *InternalNetworkError) GetSession() string {
if m != nil && m.Session != nil {
return *m.Session
}
return ""
}

View file

@ -0,0 +1,30 @@
package mesosproto;
import "mesos.proto";
import "github.com/gogo/protobuf/gogoproto/gogo.proto";
// For use with detector callbacks
message InternalMasterChangeDetected {
// will be present if there's a new master, otherwise nil
optional MasterInfo master = 1;
}
message InternalTryAuthentication {
// empty message, serves as a signal to the scheduler bindings
}
message InternalAuthenticationResult {
// true only if the authentication process completed and login was successful
required bool success = 1;
// true if the authentication process completed, successfully or not
required bool completed = 2;
// master pid that this result pertains to
required string pid = 3;
}
message InternalNetworkError {
// master pid that this event pertains to
required string pid = 1;
// driver session UUID
optional string session = 2;
}

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,705 @@
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package mesosproto;
import "mesos.proto";
import "github.com/gogo/protobuf/gogoproto/gogo.proto";
option (gogoproto.gostring_all) = true;
option (gogoproto.equal_all) = true;
option (gogoproto.verbose_equal_all) = true;
option (gogoproto.goproto_stringer_all) = false;
option (gogoproto.stringer_all) = true;
option (gogoproto.populate_all) = true;
option (gogoproto.testgen_all) = true;
option (gogoproto.benchgen_all) = true;
option (gogoproto.marshaler_all) = true;
option (gogoproto.sizer_all) = true;
option (gogoproto.unmarshaler_all) = true;
// TODO(benh): Consider splitting these messages into different "packages"
// which represent which messages get handled by which components (e.g., the
// "mesos.executor" package includes messages that the executor handles).
// TODO(bmahler): Add executor_uuid here, and send it to the master. This will
// allow us to expose executor work directories for tasks in the webui when
// looking from the master level. Currently only the slave knows which run the
// task belongs to.
/**
* Describes a task, similar to `TaskInfo`.
*
* `Task` is used in some of the Mesos messages found below.
* `Task` is used instead of `TaskInfo` if:
* 1) we need additional IDs, such as a specific
* framework, executor, or agent; or
* 2) we do not need the additional data, such as the command run by the
* task, the specific containerization, or health checks. These
* additional fields may be large and unnecessary for some Mesos messages.
*
* `Task` is generally constructed from a `TaskInfo`. See protobuf::createTask.
*/
message Task {
required string name = 1;
required TaskID task_id = 2;
required FrameworkID framework_id = 3;
optional ExecutorID executor_id = 4;
required SlaveID slave_id = 5;
required TaskState state = 6; // Latest state of the task.
repeated Resource resources = 7;
repeated TaskStatus statuses = 8;
// These fields correspond to the state and uuid of the latest
// status update forwarded to the master.
// NOTE: Either both the fields must be set or both must be unset.
optional TaskState status_update_state = 9;
optional bytes status_update_uuid = 10;
optional Labels labels = 11;
// Service discovery information for the task. It is not interpreted
// or acted upon by Mesos. It is up to a service discovery system
// to use this information as needed and to handle tasks without
// service discovery information.
optional DiscoveryInfo discovery = 12;
}
// TODO(vinod): Create a new UUID message type.
/**
* Describes a task's status.
*
* `StatusUpdate` is used in some of the Mesos messages found below.
* The master and agent use `StatusUpdate` to wrap a `TaskStatus` when
* passing it from the agent to the framework that spawned the task.
*
* See protobuf::createStatusUpdate.
*/
message StatusUpdate {
required FrameworkID framework_id = 1;
optional ExecutorID executor_id = 2;
optional SlaveID slave_id = 3;
// Since 0.23.0 we set 'status.uuid' in the executor
// driver for all retryable status updates.
required TaskStatus status = 4;
required double timestamp = 5;
// Since 0.26.0 this is deprecated in favor of 'status.uuid'.
optional bytes uuid = 6;
// This corresponds to the latest state of the task according to the
// agent. Note that this state might be different than the state in
// 'status' because status update manager queues updates. In other
// words, 'status' corresponds to the update at top of the queue and
// 'latest_state' corresponds to the update at bottom of the queue.
optional TaskState latest_state = 7;
}
/**
* Encapsulates how we checkpoint a `StatusUpdate` to disk.
*
* See the StatusUpdateManager and slave/state.cpp.
*/
message StatusUpdateRecord {
enum Type {
UPDATE = 0;
ACK = 1;
}
required Type type = 1;
// Required if type == UPDATE.
optional StatusUpdate update = 2;
// Required if type == ACK.
optional bytes uuid = 3;
}
// TODO(josephw): Check if this can be removed. This appears to be
// for backwards compatibility with very early versions of Mesos.
message SubmitSchedulerRequest
{
required string name = 1;
}
// TODO(josephw): Remove for the same reason as `SubmitSchedulerRequest`.
message SubmitSchedulerResponse
{
required bool okay = 1;
}
/**
* Sends a free-form message from the executor to the framework.
* Mesos forwards the message, if necessary, via the agents and the master.
*
* See scheduler::Event::Message.
*/
message ExecutorToFrameworkMessage {
required SlaveID slave_id = 1;
required FrameworkID framework_id = 2;
required ExecutorID executor_id = 3;
required bytes data = 4;
}
/**
* Sends a free-form message from the framework to the executor.
* Mesos forwards the message, if necessary, via the agents and the master.
*
* See scheduler::Call::Message.
*/
message FrameworkToExecutorMessage {
required SlaveID slave_id = 1;
required FrameworkID framework_id = 2;
required ExecutorID executor_id = 3;
required bytes data = 4;
}
/**
* Subscribes the framework with the master to receive events.
*
* Used by the pre-Event/Call Mesos scheduler driver.
* See scheduler::Call::Subscribe.
*/
message RegisterFrameworkMessage {
required FrameworkInfo framework = 1;
}
/**
* Subscribes the framework with the master to receive events.
* This is used when the framework has previously registered and
* the master changes to a newly elected master.
*
* Used by the pre-Event/Call Mesos scheduler driver.
* See scheduler::Call::Subscribe.
*/
message ReregisterFrameworkMessage {
required FrameworkInfo framework = 2;
required bool failover = 3;
}
/**
* Notifies the framework that the master has registered it.
* The `framework_id` holds a unique ID for distinguishing this framework.
*
* See scheduler::Event::Subscribed.
*/
message FrameworkRegisteredMessage {
required FrameworkID framework_id = 1;
required MasterInfo master_info = 2;
}
/**
* Notifies the framework that the master has reregistered it.
* This message is used in the same conditions as `ReregisterFrameworkMessage`.
*
* See scheduler::Event::Subscribed.
*/
message FrameworkReregisteredMessage {
required FrameworkID framework_id = 1;
required MasterInfo master_info = 2;
}
/**
* Stops the framework and shuts down all its tasks and executors.
*
* Used by the pre-Event/Call Mesos scheduler driver.
* See scheduler::Call::Teardown.
*/
message UnregisterFrameworkMessage {
required FrameworkID framework_id = 1;
}
/**
* Aborts the scheduler driver and prevents further callbacks to the driver.
*
* Used exclusively by the pre-Event/Call Mesos scheduler driver.
*/
message DeactivateFrameworkMessage {
required FrameworkID framework_id = 1;
}
/**
* Requests specific resources from Mesos's allocator.
* If the allocator supports resource requests, any corresponding
* resources will be sent like a normal resource offer.
*
* Used by the pre-Event/Call Mesos scheduler driver.
* See scheduler::Call::Request.
*/
message ResourceRequestMessage {
required FrameworkID framework_id = 1;
repeated Request requests = 2;
}
/**
* Sends resources offers to the scheduler.
*
* See scheduler::Event::Offers.
*/
message ResourceOffersMessage {
repeated Offer offers = 1;
repeated string pids = 2;
// The `inverse_offers` field is added here because we currently use it in
// `master.cpp` when constructing the message to send to schedulers. We use
// the original version of the proto API until we do a full refactor of all
// the messages being sent.
// It is not fully implemented in the old scheduler; only the V1 scheduler
// currently implements inverse offers.
repeated InverseOffer inverse_offers = 3;
}
/**
* Launches tasks using resources from the specified offers.
*
* Used by the pre-Event/Call Mesos scheduler driver.
* See scheduler::Call::Accept and scheduler::Call::Decline.
*/
message LaunchTasksMessage {
required FrameworkID framework_id = 1;
repeated TaskInfo tasks = 3;
required Filters filters = 5;
repeated OfferID offer_ids = 6;
}
/**
* Notifies the scheduler that a particular offer is not longer valid.
*
* See scheduler::Event::Rescind.
*/
message RescindResourceOfferMessage {
required OfferID offer_id = 1;
}
/**
* Removes all filters previously set by the scheduler.
*
* Used by the pre-Event/Call Mesos scheduler driver.
* See scheduler::Call::Revive.
*/
message ReviveOffersMessage {
required FrameworkID framework_id = 1;
}
/**
* Depending on the `TaskInfo`, this message either notifies an existing
* executor to run the task, or starts a new executor and runs the task.
* This message is sent when scheduler::Call::Accept is sent with
* Offer::Operation::Launch.
*
* See executor::Event::Launch.
*/
message RunTaskMessage {
// TODO(karya): Remove framework_id after MESOS-2559 has shipped.
optional FrameworkID framework_id = 1 [deprecated = true];
required FrameworkInfo framework = 2;
required TaskInfo task = 4;
// The pid of the framework. This was moved to 'optional' in
// 0.24.0 to support schedulers using the HTTP API. For now, we
// continue to always set pid since it was required in 0.23.x.
// When 'pid' is unset, or set to empty string, the agent will
// forward executor messages through the master. For schedulers
// still using the driver, this will remain set.
optional string pid = 3;
}
/**
* Kills a specific task.
*
* See scheduler::Call::Kill and executor::Event::Kill.
*/
message KillTaskMessage {
// TODO(bmahler): Include the SlaveID here to improve the Master's
// ability to respond for non-activated agents.
required FrameworkID framework_id = 1;
required TaskID task_id = 2;
}
/**
* Sends a task status update to the scheduler.
*
* See scheduler::Event::Update.
*/
message StatusUpdateMessage {
required StatusUpdate update = 1;
// If present, scheduler driver automatically sends an acknowledgement
// to the `pid`. This only applies to the pre-Event/Call Mesos
// scheduler driver.
optional string pid = 2;
}
/**
* This message is used by the scheduler to acknowledge the receipt of a status
* update. Mesos forwards the acknowledgement to the executor running the task.
*
* See scheduler::Call::Acknowledge and executor::Event::Acknowledged.
*/
message StatusUpdateAcknowledgementMessage {
required SlaveID slave_id = 1;
required FrameworkID framework_id = 2;
required TaskID task_id = 3;
required bytes uuid = 4;
}
/**
* Notifies the scheduler that the agent was lost.
*
* See scheduler::Event::Failure.
*/
message LostSlaveMessage {
required SlaveID slave_id = 1;
}
/**
* Allows the scheduler to query the status for non-terminal tasks.
* This causes the master to send back the latest task status for
* each task in `statuses`, if possible. Tasks that are no longer
* known will result in a `TASK_LOST` update. If `statuses` is empty,
* then the master will send the latest status for each task
* currently known.
*/
message ReconcileTasksMessage {
required FrameworkID framework_id = 1;
repeated TaskStatus statuses = 2; // Should be non-terminal only.
}
/**
* Notifies the framework about errors during registration.
*
* See scheduler::Event::Error.
*/
message FrameworkErrorMessage {
required string message = 2;
}
/**
* Registers the agent with the master.
*
* If registration fails, a `ShutdownMessage` is sent to the agent.
* Failure conditions are documented inline in Master::registerSlave.
*/
message RegisterSlaveMessage {
required SlaveInfo slave = 1;
// Resources that are checkpointed by the agent (e.g., persistent
// volume or dynamic reservation). Frameworks need to release
// checkpointed resources explicitly.
repeated Resource checkpointed_resources = 3;
// NOTE: This is a hack for the master to detect the agent's
// version. If unset the agent is < 0.21.0.
// TODO(bmahler): Do proper versioning: MESOS-986.
optional string version = 2;
}
/**
* Registers the agent with the master.
* This is used when the agent has previously registered and
* the master changes to a newly elected master.
*
* If registration fails, a `ShutdownMessage` is sent to the agent.
* Failure conditions are documented inline in Master::reregisterSlave.
*/
message ReregisterSlaveMessage {
required SlaveInfo slave = 2;
// Resources that are checkpointed by the agent (e.g., persistent
// volume or dynamic reservation). Frameworks need to release
// checkpointed resources explicitly.
repeated Resource checkpointed_resources = 7;
repeated ExecutorInfo executor_infos = 4;
repeated Task tasks = 3;
repeated Archive.Framework completed_frameworks = 5;
// NOTE: This is a hack for the master to detect the agent's
// version. If unset the agent is < 0.21.0.
// TODO(bmahler): Do proper versioning: MESOS-986.
optional string version = 6;
}
/**
* Notifies the agent that the master has registered it.
* The `slave_id` holds a unique ID for distinguishing this agent.
*/
message SlaveRegisteredMessage {
required SlaveID slave_id = 1;
optional MasterSlaveConnection connection = 2;
}
/**
* Notifies the agent that the master has reregistered it.
* This message is used in the same conditions as `ReregisterSlaveMessage`.
*/
message SlaveReregisteredMessage {
required SlaveID slave_id = 1;
// Contains a list of non-terminal tasks that the master believes to
// be running on the agent. The agent should respond `TASK_LOST` to
// any tasks that are unknown, so the master knows to remove those.
repeated ReconcileTasksMessage reconciliations = 2;
optional MasterSlaveConnection connection = 3;
}
/**
* This message is sent by the agent to the master during agent shutdown.
* The master updates its state to reflect the removed agent.
*/
message UnregisterSlaveMessage {
required SlaveID slave_id = 1;
}
/**
* Describes the connection between the master and agent.
*/
message MasterSlaveConnection {
// Product of max_slave_ping_timeouts * slave_ping_timeout.
// If no pings are received within the total timeout,
// the master will remove the agent.
optional double total_ping_timeout_seconds = 1;
}
/**
* This message is periodically sent by the master to the agent.
* If the agent is connected to the master, "connected" is true.
*/
message PingSlaveMessage {
required bool connected = 1;
}
/**
* This message is sent by the agent to the master in response to the
* `PingSlaveMessage`.
*/
message PongSlaveMessage {}
/**
* Tells an agent to shut down all executors of the given framework.
*/
message ShutdownFrameworkMessage {
required FrameworkID framework_id = 1;
}
/**
* Tells an agent (and consequently the executor) to shutdown an executor.
*/
message ShutdownExecutorMessage {
// TODO(vinod): Make these fields required. These are made optional
// for backwards compatibility between 0.23.0 agent and pre 0.23.0
// executor driver.
optional ExecutorID executor_id = 1;
optional FrameworkID framework_id = 2;
}
/**
* Broadcasts updated framework information from master to all agents.
*/
message UpdateFrameworkMessage {
required FrameworkID framework_id = 1;
// See the comment on RunTaskMessage.pid.
optional string pid = 2;
}
/**
* This message is sent to the agent whenever there is an update of
* the resources that need to be checkpointed (e.g., persistent volume
* or dynamic reservation).
*/
message CheckpointResourcesMessage {
repeated Resource resources = 1;
}
/**
* This message is sent by the agent to the master to inform the
* master about the total amount of oversubscribed (allocated and
* allocatable) resources.
*/
message UpdateSlaveMessage {
required SlaveID slave_id = 1;
repeated Resource oversubscribed_resources = 2;
}
/**
* Subscribes the executor with the agent to receive events.
*
* See executor::Call::Subscribe.
*/
message RegisterExecutorMessage {
required FrameworkID framework_id = 1;
required ExecutorID executor_id = 2;
}
/**
* Notifies the executor that the agent has registered it.
*
* See executor::Event::Subscribed.
*/
message ExecutorRegisteredMessage {
required ExecutorInfo executor_info = 2;
required FrameworkID framework_id = 3;
required FrameworkInfo framework_info = 4;
required SlaveID slave_id = 5;
required SlaveInfo slave_info = 6;
}
/**
* Notifies the executor that the agent has reregistered it.
*
* See executor::Event::Subscribed.
*/
message ExecutorReregisteredMessage {
required SlaveID slave_id = 1;
required SlaveInfo slave_info = 2;
}
/**
* Notifies the scheduler about terminated executors.
*
* See scheduler::Event::Failure.
*/
message ExitedExecutorMessage {
required SlaveID slave_id = 1;
required FrameworkID framework_id = 2;
required ExecutorID executor_id = 3;
required int32 status = 4;
}
/**
* Reestablishes the connection between executor and agent after agent failover.
* This message originates from the agent.
*/
message ReconnectExecutorMessage {
required SlaveID slave_id = 1;
}
/**
* Subscribes the executor with the agent to receive events.
* This is used after a disconnection. The executor must include
* any unacknowledged tasks or updates.
*
* See executor::Call::Subscribe.
*/
message ReregisterExecutorMessage {
required ExecutorID executor_id = 1;
required FrameworkID framework_id = 2;
repeated TaskInfo tasks = 3;
repeated StatusUpdate updates = 4;
}
/**
* Sends a free-form message from the master to an agent.
* The agent should gracefully terminate in response, which includes
* shutting down all executors and tasks on the agent.
*/
message ShutdownMessage {
optional string message = 1;
}
// TODO(adam-mesos): Move this to an 'archive' package.
/**
* Describes Completed Frameworks, etc. for archival.
*/
message Archive {
message Framework {
required FrameworkInfo framework_info = 1;
optional string pid = 2;
repeated Task tasks = 3;
}
repeated Framework frameworks = 1;
}
/**
* Message describing task current health status that is sent by
* the task health checker to the command executor.
* The command executor reports the task status back to the
* on each receive. If the health checker configured failure
* condition meets, then `kill_task` flag will be set to true which
* the executor on message receive will kill the task.
*/
message TaskHealthStatus {
required TaskID task_id = 1;
required bool healthy = 2;
// Flag to initiate task kill.
optional bool kill_task = 3 [default = false];
// Number of consecutive counts in current status.
// This will not be populated if task is healthy.
optional int32 consecutive_failures = 4;
}
/**
* Message to signal completion of an event within a module.
*/
message HookExecuted {
optional string module = 1;
}

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,347 @@
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package mesosproto.scheduler;
import "github.com/mesos/mesos-go/mesosproto/mesos.proto";
import "github.com/gogo/protobuf/gogoproto/gogo.proto";
option go_package = "scheduler";
option (gogoproto.gostring_all) = true;
option (gogoproto.equal_all) = true;
option (gogoproto.verbose_equal_all) = true;
option (gogoproto.goproto_stringer_all) = false;
option (gogoproto.stringer_all) = true;
option (gogoproto.populate_all) = true;
option (gogoproto.testgen_all) = true;
option (gogoproto.benchgen_all) = true;
option (gogoproto.marshaler_all) = true;
option (gogoproto.sizer_all) = true;
option (gogoproto.unmarshaler_all) = true;
/**
* Scheduler event API.
*
* An event is described using the standard protocol buffer "union"
* trick, see:
* https://developers.google.com/protocol-buffers/docs/techniques#union.
*/
message Event {
// Possible event types, followed by message definitions if
// applicable.
enum Type {
SUBSCRIBED = 1; // See 'Subscribed' below.
OFFERS = 2; // See 'Offers' below.
RESCIND = 3; // See 'Rescind' below.
UPDATE = 4; // See 'Update' below.
MESSAGE = 5; // See 'Message' below.
FAILURE = 6; // See 'Failure' below.
ERROR = 7; // See 'Error' below.
// Periodic message sent by the Mesos master according to
// 'Subscribed.heartbeat_interval_seconds'. If the scheduler does
// not receive any events (including heartbeats) for an extended
// period of time (e.g., 5 x heartbeat_interval_seconds), there is
// likely a network partition. In such a case the scheduler should
// close the existing subscription connection and resubscribe
// using a backoff strategy.
HEARTBEAT = 8;
}
// First event received when the scheduler subscribes.
message Subscribed {
required FrameworkID framework_id = 1;
// This value will be set if the master is sending heartbeats. See
// the comment above on 'HEARTBEAT' for more details.
optional double heartbeat_interval_seconds = 2;
}
// Received whenever there are new resources that are offered to the
// scheduler or resources requested back from the scheduler. Each
// offer corresponds to a set of resources on a slave. Until the
// scheduler accepts or declines an offer the resources are
// considered allocated to the scheduler. Accepting or Declining an
// inverse offer informs the allocator of the scheduler's ability to
// release the resources without violating an SLA.
message Offers {
repeated Offer offers = 1;
repeated InverseOffer inverse_offers = 2;
}
// Received when a particular offer is no longer valid (e.g., the
// slave corresponding to the offer has been removed) and hence
// needs to be rescinded. Any future calls ('Accept' / 'Decline') made
// by the scheduler regarding this offer will be invalid.
message Rescind {
required OfferID offer_id = 1;
}
// Received whenever there is a status update that is generated by
// the executor or slave or master. Status updates should be used by
// executors to reliably communicate the status of the tasks that
// they manage. It is crucial that a terminal update (see TaskState
// in mesos.proto) is sent by the executor as soon as the task
// terminates, in order for Mesos to release the resources allocated
// to the task. It is also the responsibility of the scheduler to
// explicitly acknowledge the receipt of a status update. See
// 'Acknowledge' in the 'Call' section below for the semantics.
message Update {
required TaskStatus status = 1;
}
// Received when a custom message generated by the executor is
// forwarded by the master. Note that this message is not
// interpreted by Mesos and is only forwarded (without reliability
// guarantees) to the scheduler. It is up to the executor to retry
// if the message is dropped for any reason.
message Message {
required SlaveID slave_id = 1;
required ExecutorID executor_id = 2;
required bytes data = 3;
}
// Received when a slave is removed from the cluster (e.g., failed
// health checks) or when an executor is terminated. Note that, this
// event coincides with receipt of terminal UPDATE events for any
// active tasks belonging to the slave or executor and receipt of
// 'Rescind' events for any outstanding offers belonging to the
// slave. Note that there is no guaranteed order between the
// 'Failure', 'Update' and 'Rescind' events when a slave or executor
// is removed.
// TODO(vinod): Consider splitting the lost slave and terminated
// executor into separate events and ensure it's reliably generated.
message Failure {
optional SlaveID slave_id = 1;
// If this was just a failure of an executor on a slave then
// 'executor_id' will be set and possibly 'status' (if we were
// able to determine the exit status).
optional ExecutorID executor_id = 2;
optional int32 status = 3;
}
// Received when an invalid framework (e.g., unauthenticated,
// unauthorized) attempts to subscribe with the master. Error can
// also be received if scheduler sends invalid Calls (e.g., not
// properly initialized).
// TODO(vinod): Remove this once the old scheduler driver is no
// longer supported. With HTTP API all errors will be signaled via
// HTTP response codes.
message Error {
required string message = 1;
}
// Type of the event, indicates which optional field below should be
// present if that type has a nested message definition.
required Type type = 1;
optional Subscribed subscribed = 2;
optional Offers offers = 3;
optional Rescind rescind = 4;
optional Update update = 5;
optional Message message = 6;
optional Failure failure = 7;
optional Error error = 8;
}
/**
* Scheduler call API.
*
* Like Event, a Call is described using the standard protocol buffer
* "union" trick (see above).
*/
message Call {
// Possible call types, followed by message definitions if
// applicable.
enum Type {
SUBSCRIBE = 1; // See 'Subscribe' below.
TEARDOWN = 2; // Shuts down all tasks/executors and removes framework.
ACCEPT = 3; // See 'Accept' below.
DECLINE = 4; // See 'Decline' below.
REVIVE = 5; // Removes any previous filters set via ACCEPT or DECLINE.
KILL = 6; // See 'Kill' below.
SHUTDOWN = 7; // See 'Shutdown' below.
ACKNOWLEDGE = 8; // See 'Acknowledge' below.
RECONCILE = 9; // See 'Reconcile' below.
MESSAGE = 10; // See 'Message' below.
REQUEST = 11; // See 'Request' below.
SUPPRESS = 12; // Inform master to stop sending offers to the framework.
// TODO(benh): Consider adding an 'ACTIVATE' and 'DEACTIVATE' for
// already subscribed frameworks as a way of stopping offers from
// being generated and other events from being sent by the master.
// Note that this functionality existed originally to support
// SchedulerDriver::abort which was only necessary to handle
// exceptions getting thrown from within Scheduler callbacks,
// something that is not an issue with the Event/Call API.
}
// Subscribes the scheduler with the master to receive events. A
// scheduler must send other calls only after it has received the
// SUBCRIBED event.
message Subscribe {
// See the comments below on 'framework_id' on the semantics for
// 'framework_info.id'.
required FrameworkInfo framework_info = 1;
// 'force' field is only relevant when 'framework_info.id' is set.
// It tells the master what to do in case an instance of the
// scheduler attempts to subscribe when another instance of it is
// already connected (e.g., split brain due to network partition).
// If 'force' is true, this scheduler instance is allowed and the
// old connected scheduler instance is disconnected. If false,
// this scheduler instance is disallowed subscription in favor of
// the already connected scheduler instance.
//
// It is recommended to set this to true only when a newly elected
// scheduler instance is attempting to subscribe but not when a
// scheduler is retrying subscription (e.g., disconnection or
// master failover; see sched/sched.cpp for an example).
optional bool force = 2;
}
// Accepts an offer, performing the specified operations
// in a sequential manner.
//
// E.g. Launch a task with a newly reserved persistent volume:
//
// Accept {
// offer_ids: [ ... ]
// operations: [
// { type: RESERVE,
// reserve: { resources: [ disk(role):2 ] } }
// { type: CREATE,
// create: { volumes: [ disk(role):1+persistence ] } }
// { type: LAUNCH,
// launch: { task_infos ... disk(role):1;disk(role):1+persistence } }
// ]
// }
//
// Note that any of the offers resources not used in the 'Accept'
// call (e.g., to launch a task) are considered unused and might be
// reoffered to other frameworks. In other words, the same OfferID
// cannot be used in more than one 'Accept' call.
message Accept {
repeated OfferID offer_ids = 1;
repeated Offer.Operation operations = 2;
optional Filters filters = 3;
}
// Declines an offer, signaling the master to potentially reoffer
// the resources to a different framework. Note that this is same
// as sending an Accept call with no operations. See comments on
// top of 'Accept' for semantics.
message Decline {
repeated OfferID offer_ids = 1;
optional Filters filters = 2;
}
// Kills a specific task. If the scheduler has a custom executor,
// the kill is forwarded to the executor and it is up to the
// executor to kill the task and send a TASK_KILLED (or TASK_FAILED)
// update. Note that Mesos releases the resources for a task once it
// receives a terminal update (See TaskState in mesos.proto) for it.
// If the task is unknown to the master, a TASK_LOST update is
// generated.
message Kill {
required TaskID task_id = 1;
optional SlaveID slave_id = 2;
}
// Shuts down a custom executor. When the executor gets a shutdown
// event, it is expected to kill all its tasks (and send TASK_KILLED
// updates) and terminate. If the executor doesnt terminate within
// a certain timeout (configurable via
// '--executor_shutdown_grace_period' slave flag), the slave will
// forcefully destroy the container (executor and its tasks) and
// transition its active tasks to TASK_LOST.
message Shutdown {
required ExecutorID executor_id = 1;
required SlaveID slave_id = 2;
}
// Acknowledges the receipt of status update. Schedulers are
// responsible for explicitly acknowledging the receipt of status
// updates that have 'Update.status().uuid()' field set. Such status
// updates are retried by the slave until they are acknowledged by
// the scheduler.
message Acknowledge {
required SlaveID slave_id = 1;
required TaskID task_id = 2;
required bytes uuid = 3;
}
// Allows the scheduler to query the status for non-terminal tasks.
// This causes the master to send back the latest task status for
// each task in 'tasks', if possible. Tasks that are no longer known
// will result in a TASK_LOST update. If 'statuses' is empty, then
// the master will send the latest status for each task currently
// known.
message Reconcile {
// TODO(vinod): Support arbitrary queries than just state of tasks.
message Task {
required TaskID task_id = 1;
optional SlaveID slave_id = 2;
}
repeated Task tasks = 1;
}
// Sends arbitrary binary data to the executor. Note that Mesos
// neither interprets this data nor makes any guarantees about the
// delivery of this message to the executor.
message Message {
required SlaveID slave_id = 1;
required ExecutorID executor_id = 2;
required bytes data = 3;
}
// Requests a specific set of resources from Mesos's allocator. If
// the allocator has support for this, corresponding offers will be
// sent asynchronously via the OFFERS event(s).
//
// NOTE: The built-in hierarchical allocator doesn't have support
// for this call and hence simply ignores it.
message Request {
repeated mesosproto.Request requests = 1;
}
// Identifies who generated this call. Master assigns a framework id
// when a new scheduler subscribes for the first time. Once assigned,
// the scheduler must set the 'framework_id' here and within its
// FrameworkInfo (in any further 'Subscribe' calls). This allows the
// master to identify a scheduler correctly across disconnections,
// failovers, etc.
optional FrameworkID framework_id = 1;
// Type of the call, indicates which optional field below should be
// present if that type has a nested message definition.
required Type type = 2;
optional Subscribe subscribe = 3;
optional Accept accept = 4;
optional Decline decline = 5;
optional Kill kill = 6;
optional Shutdown shutdown = 7;
optional Acknowledge acknowledge = 8;
optional Reconcile reconcile = 9;
optional Message message = 10;
optional Request request = 11;
}