Skip to content

Commit

Permalink
Merge 1c70403 into 56ac038
Browse files Browse the repository at this point in the history
  • Loading branch information
nfnt committed Aug 1, 2019
2 parents 56ac038 + 1c70403 commit 9729522
Show file tree
Hide file tree
Showing 351 changed files with 101,988 additions and 1,372 deletions.
1 change: 0 additions & 1 deletion .gitignore
Expand Up @@ -4,4 +4,3 @@ bin/
*.bak
*.swp
_output/
**/vendor/*/
Empty file removed .gitmodules
Empty file.
9 changes: 3 additions & 6 deletions .travis.yml
@@ -1,23 +1,20 @@
sudo: false
language: go
# handle submodules ourselves
git:
submodules: false
env:
- PROTOBUF_VERSION=3.3.0
go:
# update validate-protobufs Makefile target once golang 1.11.x is no longer tested here
- 1.9.x
- 1.10.x
- 1.11.x
- 1.12.x
before_install:
#these two lines help users who fork mesos-go. It's a noop when running from the mesos organization
- RepoName=`basename $PWD`; SrcDir=`dirname $PWD`; DestDir="`dirname $SrcDir`/mesos"
- if [[ "$SrcDir" != "$DestDir" ]]; then mv "$SrcDir" "$DestDir"; cd ../../mesos/$RepoName; export TRAVIS_BUILD_DIR=`dirname $TRAVIS_BUILD_DIR`/$RepoName; fi
- go get github.com/mattn/goveralls
- go get github.com/kardianos/govendor
- make sync
- api/v1/vendor/github.com/gogo/protobuf/install-protobuf.sh
- vendor/install-protobuf.sh
- go get github.com/gogo/protobuf/protoc-gen-gogo
# re-generate protobuf and json code, check that there are no differences w/ respect to what's been checked in
# ONLY for golang1.11.x; generated protobufs are not guaranteed to be consistent across golang versions
- make validate-protobufs
Expand Down
10 changes: 2 additions & 8 deletions Makefile
Expand Up @@ -3,7 +3,7 @@ current_dir := $(patsubst %/,%,$(dir $(mkfile_path)))

MESOS_API_VERSION := v1
API_PKG := ./api/${MESOS_API_VERSION}/lib
API_VENDOR := ${current_dir}/api/${MESOS_API_VERSION}/vendor
API_VENDOR := ${current_dir}/vendor
CMD_PKG := ./api/${MESOS_API_VERSION}/cmd
CMD_VENDOR := ./api/${MESOS_API_VERSION}/cmd/vendor

Expand Down Expand Up @@ -125,12 +125,6 @@ ffjson: clean-ffjson
clean-ffjson:
(cd ${API_PKG}; rm -f *ffjson.go */*ffjson.go)

.PHONY: sync
sync:
@which govendor >/dev/null || { echo "govendor not found in $$PATH"; exit 1; }
(cd ${API_VENDOR}; govendor 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 ./api/v1/lib/agent/calls ./api/v1/lib/master/calls ./api/v1/lib/httpcli/httpagent ./api/v1/lib/httpcli/httpmaster ./api/v1/lib/httpcli/httpexec
generate:
Expand Down Expand Up @@ -175,7 +169,7 @@ coveralls:
ifeq ($(GO_VERSION),go1.11)
validate-protobufs: SHELL := /bin/bash
validate-protobufs:
(cd api/v1; govendor install +vendor,program) && $(MAKE) -s protobufs ffjson && [[ `{ git status --porcelain || echo "failed"; } | tee /tmp/status | wc -l` = "0" ]] || { cat /tmp/status; git diff; false; }
$(MAKE) -s protobufs ffjson && [[ `{ git status --porcelain || echo "failed"; } | tee /tmp/status | wc -l` = "0" ]] || { cat /tmp/status; git diff; false; }
else
validate-protobufs:
endif
3 changes: 2 additions & 1 deletion api/v1/cmd/example-scheduler/app/metrics.go
Expand Up @@ -8,12 +8,13 @@ import (
schedmetrics "github.com/mesos/mesos-go/api/v1/cmd/example-scheduler/app/metrics"
xmetrics "github.com/mesos/mesos-go/api/v1/lib/extras/metrics"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promhttp"
)

func initMetrics(cfg Config) *metricsAPI {
schedmetrics.Register()
metricsAddress := net.JoinHostPort(cfg.server.address, strconv.Itoa(cfg.metrics.port))
http.Handle(cfg.metrics.path, prometheus.Handler())
http.Handle(cfg.metrics.path, promhttp.Handler())
api := newMetricsAPI()
go forever("api-server", cfg.jobRestartDelay, api.jobStartCount, func() error { return http.ListenAndServe(metricsAddress, nil) })
return api
Expand Down

0 comments on commit 9729522

Please sign in to comment.