Skip to content

Commit be326e7

Browse files
committed
Update for Prometheus Community
* Bump build to Go 1.14 * Update license headers. * Update end-to-end test versions. * Update github paths. * Bump vendoring. Signed-off-by: Ben Kochie <[email protected]>
1 parent bb165c0 commit be326e7

File tree

13 files changed

+444
-34
lines changed

13 files changed

+444
-34
lines changed

.circleci/config.yml

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,23 @@ orbs:
77
executors:
88
golang:
99
docker:
10-
- image: circleci/golang:1.13
10+
- image: circleci/golang:1.14
1111

1212
jobs:
1313
test:
1414
executor: golang
15+
environment:
16+
prom_ver: 2.18.1
17+
node_ver: 1.0.0
1518
steps:
1619
- prometheus/setup_environment
1720
- run: make build
18-
- run: wget https://github.com/prometheus/node_exporter/releases/download/v0.18.1/node_exporter-0.18.1.linux-amd64.tar.gz
19-
- run: tar xzf node_exporter-0.18.1.linux-amd64.tar.gz
20-
- run: cp -v node_exporter-0.18.1.linux-amd64/node_exporter ./node_exporter
21-
- run: wget https://github.com/prometheus/prometheus/releases/download/v2.15.2/prometheus-2.15.2.linux-amd64.tar.gz
22-
- run: tar xzf prometheus-2.15.2.linux-amd64.tar.gz
23-
- run: cp -v prometheus-2.15.2.linux-amd64/prometheus ./prometheus
21+
- run: wget https://github.com/prometheus/node_exporter/releases/download/v${node_ver}/node_exporter-${node_ver}.linux-amd64.tar.gz
22+
- run: tar xzf node_exporter-${node_ver}.linux-amd64.tar.gz
23+
- run: cp -v node_exporter-${node_ver}.linux-amd64/node_exporter ./node_exporter
24+
- run: wget https://github.com/prometheus/prometheus/releases/download/v${prom_ver}/prometheus-${prom_ver}.linux-amd64.tar.gz
25+
- run: tar xzf prometheus-${prom_ver}.linux-amd64.tar.gz
26+
- run: cp -v prometheus-${prom_ver}.linux-amd64/prometheus ./prometheus
2427
- run:
2528
name: Configure Prometheus
2629
command: |

.promu.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
go:
2-
# Whenever the Go version is updated here, .travis.yml and
3-
# .circle/config.yml should also be updated.
4-
version: 1.13
2+
# This must match .circle/config.yml.
3+
version: 1.14
54
repository:
6-
path: github.com/robustperception/pushprox
5+
path: github.com/prometheus-community/pushprox
76
build:
87
binaries:
98
- name: pushprox-client

Makefile

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,20 @@
1+
# Copyright 2020 The Prometheus Authors
2+
# Licensed under the Apache License, Version 2.0 (the "License");
3+
# you may not use this file except in compliance with the License.
4+
# You may obtain a copy of the License at
5+
#
6+
# http://www.apache.org/licenses/LICENSE-2.0
7+
#
8+
# Unless required by applicable law or agreed to in writing, software
9+
# distributed under the License is distributed on an "AS IS" BASIS,
10+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11+
# See the License for the specific language governing permissions and
12+
# limitations under the License.
13+
14+
# Needs to be defined before including Makefile.common to auto-generate targets
15+
DOCKER_ARCHS ?= amd64
16+
DOCKER_REPO ?= prometheuscommunity
17+
118
include Makefile.common
219

320
DOCKER_IMAGE_NAME ?= pushprox

Makefile.common

Lines changed: 27 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,15 @@ else
6969
GO_BUILD_PLATFORM ?= $(GOHOSTOS)-$(GOHOSTARCH)
7070
endif
7171

72+
GOTEST := $(GO) test
73+
GOTEST_DIR :=
74+
ifneq ($(CIRCLE_JOB),)
75+
ifneq ($(shell which gotestsum),)
76+
GOTEST_DIR := test-results
77+
GOTEST := gotestsum --junitfile $(GOTEST_DIR)/unit-tests.xml --
78+
endif
79+
endif
80+
7281
PROMU_VERSION ?= 0.5.0
7382
PROMU_URL := https://github.com/prometheus/promu/releases/download/v$(PROMU_VERSION)/promu-$(PROMU_VERSION).$(GO_BUILD_PLATFORM).tar.gz
7483

@@ -141,15 +150,29 @@ else
141150
$(GO) get $(GOOPTS) -t ./...
142151
endif
143152

153+
.PHONY: update-go-deps
154+
update-go-deps:
155+
@echo ">> updating Go dependencies"
156+
@for m in $$($(GO) list -mod=readonly -m -f '{{ if and (not .Indirect) (not .Main)}}{{.Path}}{{end}}' all); do \
157+
$(GO) get $$m; \
158+
done
159+
GO111MODULE=$(GO111MODULE) $(GO) mod tidy
160+
ifneq (,$(wildcard vendor))
161+
GO111MODULE=$(GO111MODULE) $(GO) mod vendor
162+
endif
163+
144164
.PHONY: common-test-short
145-
common-test-short:
165+
common-test-short: $(GOTEST_DIR)
146166
@echo ">> running short tests"
147-
GO111MODULE=$(GO111MODULE) $(GO) test -short $(GOOPTS) $(pkgs)
167+
GO111MODULE=$(GO111MODULE) $(GOTEST) -short $(GOOPTS) $(pkgs)
148168

149169
.PHONY: common-test
150-
common-test:
170+
common-test: $(GOTEST_DIR)
151171
@echo ">> running all tests"
152-
GO111MODULE=$(GO111MODULE) $(GO) test $(test-flags) $(GOOPTS) $(pkgs)
172+
GO111MODULE=$(GO111MODULE) $(GOTEST) $(test-flags) $(GOOPTS) $(pkgs)
173+
174+
$(GOTEST_DIR):
175+
@mkdir -p $@
153176

154177
.PHONY: common-format
155178
common-format:

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# PushProx [![CircleCI](https://circleci.com/gh/RobustPerception/PushProx.svg?style=shield)](https://circleci.com/gh/RobustPerception/PushProx)
1+
# PushProx [![CircleCI](https://circleci.com/gh/prometheus-community/PushProx.svg?style=shield)](https://circleci.com/gh/prometheus-community/PushProx)
22

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

1212
```
13-
git clone https://github.com/robustperception/pushprox.git
13+
git clone https://github.com/prometheus-community/pushprox.git
1414
cd pushprox
1515
make build
1616
```

cmd/client/main.go

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
1+
// Copyright 2020 The Prometheus Authors
2+
// Licensed under the Apache License, Version 2.0 (the "License");
3+
// you may not use this file except in compliance with the License.
4+
// You may obtain a copy of the License at
5+
//
6+
// http://www.apache.org/licenses/LICENSE-2.0
7+
//
8+
// Unless required by applicable law or agreed to in writing, software
9+
// distributed under the License is distributed on an "AS IS" BASIS,
10+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11+
// See the License for the specific language governing permissions and
12+
// limitations under the License.
13+
114
package main
215

316
import (
@@ -26,7 +39,7 @@ import (
2639
"github.com/prometheus/client_golang/prometheus/promhttp"
2740
"github.com/prometheus/common/promlog"
2841
"github.com/prometheus/common/promlog/flag"
29-
"github.com/robustperception/pushprox/util"
42+
"github.com/prometheus-community/pushprox/util"
3043
)
3144

3245
var (

cmd/client/main_test.go

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
1+
// Copyright 2020 The Prometheus Authors
2+
// Licensed under the Apache License, Version 2.0 (the "License");
3+
// you may not use this file except in compliance with the License.
4+
// You may obtain a copy of the License at
5+
//
6+
// http://www.apache.org/licenses/LICENSE-2.0
7+
//
8+
// Unless required by applicable law or agreed to in writing, software
9+
// distributed under the License is distributed on an "AS IS" BASIS,
10+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11+
// See the License for the specific language governing permissions and
12+
// limitations under the License.
13+
114
package main
215

316
import (

cmd/proxy/coordinator.go

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
1+
// Copyright 2020 The Prometheus Authors
2+
// Licensed under the Apache License, Version 2.0 (the "License");
3+
// you may not use this file except in compliance with the License.
4+
// You may obtain a copy of the License at
5+
//
6+
// http://www.apache.org/licenses/LICENSE-2.0
7+
//
8+
// Unless required by applicable law or agreed to in writing, software
9+
// distributed under the License is distributed on an "AS IS" BASIS,
10+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11+
// See the License for the specific language governing permissions and
12+
// limitations under the License.
13+
114
package main
215

316
import (
@@ -14,7 +27,7 @@ import (
1427
"github.com/google/uuid"
1528
"github.com/prometheus/client_golang/prometheus"
1629
"github.com/prometheus/client_golang/prometheus/promauto"
17-
"github.com/robustperception/pushprox/util"
30+
"github.com/prometheus-community/pushprox/util"
1831
)
1932

2033
var (

cmd/proxy/main.go

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
1+
// Copyright 2020 The Prometheus Authors
2+
// Licensed under the Apache License, Version 2.0 (the "License");
3+
// you may not use this file except in compliance with the License.
4+
// You may obtain a copy of the License at
5+
//
6+
// http://www.apache.org/licenses/LICENSE-2.0
7+
//
8+
// Unless required by applicable law or agreed to in writing, software
9+
// distributed under the License is distributed on an "AS IS" BASIS,
10+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11+
// See the License for the specific language governing permissions and
12+
// limitations under the License.
13+
114
package main
215

316
import (
@@ -21,7 +34,7 @@ import (
2134
"github.com/prometheus/common/promlog"
2235
"github.com/prometheus/common/promlog/flag"
2336

24-
"github.com/robustperception/pushprox/util"
37+
"github.com/prometheus-community/pushprox/util"
2538
)
2639

2740
const (

go.mod

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,14 @@
1-
module github.com/robustperception/pushprox
1+
module github.com/prometheus-community/pushprox
22

33
go 1.13
44

55
require (
66
github.com/ShowMax/go-fqdn v0.0.0-20180501083314-6f60894d629f
77
github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d // indirect
8-
github.com/go-kit/kit v0.9.0
9-
github.com/go-logfmt/logfmt v0.5.0 // indirect
10-
github.com/golang/protobuf v1.3.3 // indirect
8+
github.com/go-kit/kit v0.10.0
119
github.com/google/uuid v1.1.1
1210
github.com/pkg/errors v0.9.1
13-
github.com/prometheus/client_golang v1.4.0
14-
github.com/prometheus/common v0.9.1
15-
golang.org/x/sys v0.0.0-20200124204421-9fbb57f87de9 // indirect
11+
github.com/prometheus/client_golang v1.6.0
12+
github.com/prometheus/common v0.10.0
1613
gopkg.in/alecthomas/kingpin.v2 v2.2.6
1714
)

0 commit comments

Comments
 (0)