Skip to content

Commit

Permalink
Merge pull request #79 from prometheus-community/superq/update
Browse files Browse the repository at this point in the history
Update for Prometheus Community
  • Loading branch information
SuperQ committed May 26, 2020
2 parents bb165c0 + f78377d commit eeadbe7
Show file tree
Hide file tree
Showing 490 changed files with 190,645 additions and 13,147 deletions.
17 changes: 10 additions & 7 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,23 @@ orbs:
executors:
golang:
docker:
- image: circleci/golang:1.13
- image: circleci/golang:1.14

jobs:
test:
executor: golang
environment:
prom_ver: 2.18.1
node_ver: 1.0.0
steps:
- prometheus/setup_environment
- run: make build
- run: wget https://github.com/prometheus/node_exporter/releases/download/v0.18.1/node_exporter-0.18.1.linux-amd64.tar.gz
- run: tar xzf node_exporter-0.18.1.linux-amd64.tar.gz
- run: cp -v node_exporter-0.18.1.linux-amd64/node_exporter ./node_exporter
- run: wget https://github.com/prometheus/prometheus/releases/download/v2.15.2/prometheus-2.15.2.linux-amd64.tar.gz
- run: tar xzf prometheus-2.15.2.linux-amd64.tar.gz
- run: cp -v prometheus-2.15.2.linux-amd64/prometheus ./prometheus
- run: wget https://github.com/prometheus/node_exporter/releases/download/v${node_ver}/node_exporter-${node_ver}.linux-amd64.tar.gz
- run: tar xzf node_exporter-${node_ver}.linux-amd64.tar.gz
- run: cp -v node_exporter-${node_ver}.linux-amd64/node_exporter ./node_exporter
- run: wget https://github.com/prometheus/prometheus/releases/download/v${prom_ver}/prometheus-${prom_ver}.linux-amd64.tar.gz
- run: tar xzf prometheus-${prom_ver}.linux-amd64.tar.gz
- run: cp -v prometheus-${prom_ver}.linux-amd64/prometheus ./prometheus
- run:
name: Configure Prometheus
command: |
Expand Down
7 changes: 3 additions & 4 deletions .promu.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
go:
# Whenever the Go version is updated here, .travis.yml and
# .circle/config.yml should also be updated.
version: 1.13
# This must match .circle/config.yml.
version: 1.14
repository:
path: github.com/robustperception/pushprox
path: github.com/prometheus-community/pushprox
build:
binaries:
- name: pushprox-client
Expand Down
17 changes: 17 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
# Copyright 2020 The Prometheus Authors
# Licensed 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.

# Needs to be defined before including Makefile.common to auto-generate targets
DOCKER_ARCHS ?= amd64
DOCKER_REPO ?= prometheuscommunity

include Makefile.common

DOCKER_IMAGE_NAME ?= pushprox
31 changes: 27 additions & 4 deletions Makefile.common
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,15 @@ else
GO_BUILD_PLATFORM ?= $(GOHOSTOS)-$(GOHOSTARCH)
endif

GOTEST := $(GO) test
GOTEST_DIR :=
ifneq ($(CIRCLE_JOB),)
ifneq ($(shell which gotestsum),)
GOTEST_DIR := test-results
GOTEST := gotestsum --junitfile $(GOTEST_DIR)/unit-tests.xml --
endif
endif

PROMU_VERSION ?= 0.5.0
PROMU_URL := https://github.com/prometheus/promu/releases/download/v$(PROMU_VERSION)/promu-$(PROMU_VERSION).$(GO_BUILD_PLATFORM).tar.gz

Expand Down Expand Up @@ -141,15 +150,29 @@ else
$(GO) get $(GOOPTS) -t ./...
endif

.PHONY: update-go-deps
update-go-deps:
@echo ">> updating Go dependencies"
@for m in $$($(GO) list -mod=readonly -m -f '{{ if and (not .Indirect) (not .Main)}}{{.Path}}{{end}}' all); do \
$(GO) get $$m; \
done
GO111MODULE=$(GO111MODULE) $(GO) mod tidy
ifneq (,$(wildcard vendor))
GO111MODULE=$(GO111MODULE) $(GO) mod vendor
endif

.PHONY: common-test-short
common-test-short:
common-test-short: $(GOTEST_DIR)
@echo ">> running short tests"
GO111MODULE=$(GO111MODULE) $(GO) test -short $(GOOPTS) $(pkgs)
GO111MODULE=$(GO111MODULE) $(GOTEST) -short $(GOOPTS) $(pkgs)

.PHONY: common-test
common-test:
common-test: $(GOTEST_DIR)
@echo ">> running all tests"
GO111MODULE=$(GO111MODULE) $(GO) test $(test-flags) $(GOOPTS) $(pkgs)
GO111MODULE=$(GO111MODULE) $(GOTEST) $(test-flags) $(GOOPTS) $(pkgs)

$(GOTEST_DIR):
@mkdir -p $@

.PHONY: common-format
common-format:
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# PushProx [![CircleCI](https://circleci.com/gh/RobustPerception/PushProx.svg?style=shield)](https://circleci.com/gh/RobustPerception/PushProx)
# PushProx [![CircleCI](https://circleci.com/gh/prometheus-community/PushProx.svg?style=shield)](https://circleci.com/gh/prometheus-community/PushProx)

PushProx is a client and proxy that allows transversing of NAT and other
similar network topologies by Prometheus, while still following the pull model.
Expand All @@ -10,7 +10,7 @@ While this is reasonably robust in practice, this is a work in progress.
First build the proxy and client:

```
git clone https://github.com/robustperception/pushprox.git
git clone https://github.com/prometheus-community/pushprox.git
cd pushprox
make build
```
Expand Down
15 changes: 14 additions & 1 deletion cmd/client/main.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
// Copyright 2020 The Prometheus Authors
// Licensed 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 main

import (
Expand Down Expand Up @@ -26,7 +39,7 @@ import (
"github.com/prometheus/client_golang/prometheus/promhttp"
"github.com/prometheus/common/promlog"
"github.com/prometheus/common/promlog/flag"
"github.com/robustperception/pushprox/util"
"github.com/prometheus-community/pushprox/util"
)

var (
Expand Down
13 changes: 13 additions & 0 deletions cmd/client/main_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
// Copyright 2020 The Prometheus Authors
// Licensed 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 main

import (
Expand Down
15 changes: 14 additions & 1 deletion cmd/proxy/coordinator.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
// Copyright 2020 The Prometheus Authors
// Licensed 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 main

import (
Expand All @@ -14,7 +27,7 @@ import (
"github.com/google/uuid"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promauto"
"github.com/robustperception/pushprox/util"
"github.com/prometheus-community/pushprox/util"
)

var (
Expand Down
15 changes: 14 additions & 1 deletion cmd/proxy/main.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
// Copyright 2020 The Prometheus Authors
// Licensed 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 main

import (
Expand All @@ -21,7 +34,7 @@ import (
"github.com/prometheus/common/promlog"
"github.com/prometheus/common/promlog/flag"

"github.com/robustperception/pushprox/util"
"github.com/prometheus-community/pushprox/util"
)

const (
Expand Down
11 changes: 4 additions & 7 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,17 +1,14 @@
module github.com/robustperception/pushprox
module github.com/prometheus-community/pushprox

go 1.13

require (
github.com/ShowMax/go-fqdn v0.0.0-20180501083314-6f60894d629f
github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d // indirect
github.com/go-kit/kit v0.9.0
github.com/go-logfmt/logfmt v0.5.0 // indirect
github.com/golang/protobuf v1.3.3 // indirect
github.com/go-kit/kit v0.10.0
github.com/google/uuid v1.1.1
github.com/pkg/errors v0.9.1
github.com/prometheus/client_golang v1.4.0
github.com/prometheus/common v0.9.1
golang.org/x/sys v0.0.0-20200124204421-9fbb57f87de9 // indirect
github.com/prometheus/client_golang v1.6.0
github.com/prometheus/common v0.10.0
gopkg.in/alecthomas/kingpin.v2 v2.2.6
)

0 comments on commit eeadbe7

Please sign in to comment.