Skip to content

Commit

Permalink
Merge 93a0891 into 479884c
Browse files Browse the repository at this point in the history
  • Loading branch information
jdef committed Sep 11, 2017
2 parents 479884c + 93a0891 commit 8e2497c
Show file tree
Hide file tree
Showing 63 changed files with 53,794 additions and 1,547 deletions.
15 changes: 12 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,9 @@ GO_VERSION := $(shell go version|cut -f3 -d' '|dd bs=1 count=5 2>/dev/null)
all: test

.PHONY: install
install: INSTALL_FLAGS +=
install:
go install $(BINARIES)
go install $(INSTALL_FLAGS) $(BINARIES)

.PHONY: test
test:
Expand Down Expand Up @@ -62,6 +63,10 @@ protobufs: protobufs-requirements clean-protobufs
(cd ${API_PKG}; protoc --proto_path="${PROTO_PATH}" --gogo_out=. ./scheduler/*.proto)
(cd ${API_PKG}; protoc --proto_path="${PROTO_PATH}" --gogo_out=. ./executor/*.proto)
(cd ${API_PKG}; protoc --proto_path="${PROTO_PATH}" --gogo_out=. ./agent/*.proto)
(cd ${API_PKG}; protoc --proto_path="${PROTO_PATH}" --gogo_out=. ./quota/*.proto)
(cd ${API_PKG}; protoc --proto_path="${PROTO_PATH}" --gogo_out=. ./allocator/*.proto)
(cd ${API_PKG}; protoc --proto_path="${PROTO_PATH}" --gogo_out=. ./maintenance/*.proto)
(cd ${API_PKG}; protoc --proto_path="${PROTO_PATH}" --gogo_out=. ./master/*.proto)

.PHONY: clean-protobufs
clean-protobufs:
Expand All @@ -73,6 +78,10 @@ ffjson: clean-ffjson
(cd ${API_PKG}; ffjson scheduler/*.pb.go)
(cd ${API_PKG}; ffjson executor/*.pb.go)
(cd ${API_PKG}; ffjson agent/*.pb.go)
(cd ${API_PKG}; ffjson quota/*.pb.go)
(cd ${API_PKG}; ffjson allocator/*.pb.go)
(cd ${API_PKG}; ffjson maintenance/*.pb.go)
(cd ${API_PKG}; ffjson master/*.pb.go)

.PHONY: clean-ffjson
clean-ffjson:
Expand All @@ -85,7 +94,7 @@ sync:
(cd ${CMD_VENDOR}; govendor sync)

.PHONY: generate
generate: GENERATE_PACKAGES = ./api/v1/lib/extras/executor/eventrules ./api/v1/lib/extras/executor/callrules ./api/v1/lib/extras/scheduler/eventrules ./api/v1/lib/extras/scheduler/callrules ./api/v1/lib/executor/events ./api/v1/lib/executor/calls ./api/v1/lib/scheduler/events ./api/v1/lib/scheduler/calls
generate: GENERATE_PACKAGES = ./api/v1/lib/extras/executor/eventrules ./api/v1/lib/extras/executor/callrules ./api/v1/lib/extras/scheduler/eventrules ./api/v1/lib/extras/scheduler/callrules ./api/v1/lib/executor/events ./api/v1/lib/executor/calls ./api/v1/lib/scheduler/events ./api/v1/lib/scheduler/calls ./api/v1/lib/agent/calls ./api/v1/lib/master/calls ./api/v1/lib/httpcli/httpagent ./api/v1/lib/httpcli/httpmaster
generate:
go generate -x ${GENERATE_PACKAGES}

Expand Down Expand Up @@ -116,7 +125,7 @@ docker:
make -C api/${MESOS_API_VERSION}/docker

.PHONY: coveralls
coveralls: IGNORE_FILES = $(shell { find api/v1/cmd -type d ; ls api/v1/lib{,/scheduler,/executor,/agent}/*.pb{,_ffjson}.go ; find api/v0 -type d; } | tr '\n' ,)
coveralls: IGNORE_FILES = $(shell { find api/v1/cmd -type d ; ls api/v1/lib{,/scheduler,/executor,/agent,/quota,/allocator,/maintenance,/master}/*.pb{,_ffjson}.go ; find api/v0 -type d; } | tr '\n' ,)
coveralls: SHELL := /bin/bash
coveralls:
test "$(TRAVIS)" = "" || rm -rf $$HOME/gopath/pkg
Expand Down
3 changes: 2 additions & 1 deletion api/v1/cmd/example-executor/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (
"github.com/mesos/mesos-go/api/v1/lib"
"github.com/mesos/mesos-go/api/v1/lib/backoff"
"github.com/mesos/mesos-go/api/v1/lib/encoding"
"github.com/mesos/mesos-go/api/v1/lib/encoding/codecs"
"github.com/mesos/mesos-go/api/v1/lib/executor"
"github.com/mesos/mesos-go/api/v1/lib/executor/calls"
"github.com/mesos/mesos-go/api/v1/lib/executor/config"
Expand Down Expand Up @@ -54,7 +55,7 @@ func run(cfg config.Config) {
state = &internalState{
cli: httpcli.New(
httpcli.Endpoint(apiURL.String()),
httpcli.Codec(encoding.MediaTypeProtobuf.Codec()),
httpcli.Codec(codecs.ByMediaType[codecs.MediaTypeProtobuf]),
httpcli.Do(httpcli.With(httpcli.Timeout(httpTimeout))),
),
callOptions: executor.CallOptions{
Expand Down
4 changes: 2 additions & 2 deletions api/v1/cmd/example-scheduler/app/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"time"

"github.com/mesos/mesos-go/api/v1/cmd"
"github.com/mesos/mesos-go/api/v1/lib/encoding"
"github.com/mesos/mesos-go/api/v1/lib/encoding/codecs"
)

type Config struct {
Expand Down Expand Up @@ -86,7 +86,7 @@ func NewConfig() Config {
user: env("FRAMEWORK_USER", "root"),
name: env("FRAMEWORK_NAME", "example"),
url: env("MESOS_MASTER_HTTP", "http://:5050/api/v1/scheduler"),
codec: codec{Codec: encoding.MediaTypeProtobuf.Codec()},
codec: codec{Codec: codecs.ByMediaType[codecs.MediaTypeProtobuf]},
timeout: envDuration("MESOS_CONNECT_TIMEOUT", "20s"),
failoverTimeout: envDuration("SCHEDULER_FAILOVER_TIMEOUT", "1000h"),
checkpoint: true,
Expand Down
5 changes: 3 additions & 2 deletions api/v1/cmd/example-scheduler/app/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (

"github.com/mesos/mesos-go/api/v1/lib"
"github.com/mesos/mesos-go/api/v1/lib/encoding"
"github.com/mesos/mesos-go/api/v1/lib/encoding/codecs"
)

var (
Expand All @@ -29,8 +30,8 @@ type codec struct{ encoding.Codec }

func (c *codec) Set(value string) error {
v := strings.ToLower(value)
for _, codec := range encoding.DefaultCodecs {
if v == codec.Name() {
for _, codec := range codecs.ByMediaType {
if v == codec.Name {
c.Codec = codec
return nil
}
Expand Down
4 changes: 2 additions & 2 deletions api/v1/cmd/example-scheduler/app/state.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ func prepareExecutorInfo(
Type: mesos.ExecutorInfo_CUSTOM,
ExecutorID: mesos.ExecutorID{Value: "default"},
Name: proto.String("Test Executor"),
Command: mesos.CommandInfo{
Command: &mesos.CommandInfo{
Shell: func() *bool { x := false; return &x }(),
},
Container: &mesos.ContainerInfo{
Expand Down Expand Up @@ -77,7 +77,7 @@ func prepareExecutorInfo(
Type: mesos.ExecutorInfo_CUSTOM,
ExecutorID: mesos.ExecutorID{Value: "default"},
Name: proto.String("Test Executor"),
Command: mesos.CommandInfo{
Command: &mesos.CommandInfo{
Value: proto.String(executorCommand),
URIs: executorUris,
},
Expand Down

0 comments on commit 8e2497c

Please sign in to comment.