Skip to content
This repository was archived by the owner on Aug 23, 2023. It is now read-only.

Commit fdd5285

Browse files
committed
fix circleci
1 parent 5d1a19a commit fdd5285

File tree

162 files changed

+31
-27113
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

162 files changed

+31
-27113
lines changed

.circleci/config.yml

+3-1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ jobs:
55
docker:
66
- image: circleci/golang:1.10
77
steps:
8+
- run: sudo apt-get install libssl-dev openssl libsasl2-2 libsasl2-dev zlib1g-dev
89
- checkout
910
- run: scripts/build.sh
1011
- run: scripts/build_tools.sh
@@ -25,14 +26,15 @@ jobs:
2526
- image: circleci/golang:1.10
2627
steps:
2728
- checkout
28-
- run: go test -v -race $(go list ./... | grep -v github.com/grafana/metrictank/chaos)
29+
- run: go test -v -race -tags static $(go list ./... | grep -v github.com/grafana/metrictank/chaos)
2930

3031
qa:
3132
working_directory: /go/src/github.com/grafana/metrictank
3233
docker:
3334
- image: circleci/golang:1.10
3435
steps:
3536
- checkout
37+
- run: scripts/build_deps.sh
3638
- run: scripts/qa/gofmt.sh
3739
- run: scripts/qa/go-generate.sh
3840
- run: scripts/qa/ineffassign.sh

cmd/mt-kafka-mdm-sniff-out-of-order/main.go

+1-6
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,8 @@ package main
33
import (
44
"flag"
55
"fmt"
6-
"math/rand"
76
"os"
87
"os/signal"
9-
"strconv"
108
"strings"
119
"sync"
1210
"syscall"
@@ -121,7 +119,6 @@ func main() {
121119
}
122120
flag.Parse()
123121
log.NewLogger(0, "console", fmt.Sprintf(`{"level": %d, "formatting":false}`, 2))
124-
instance := "mt-kafka-mdm-sniff-out-of-order" + strconv.Itoa(rand.Int())
125122

126123
// Only try and parse the conf file if it exists
127124
path := ""
@@ -141,10 +138,8 @@ func main() {
141138

142139
// config may have had it disabled
143140
inKafkaMdm.Enabled = true
144-
// important: we don't want to share the same offset tracker as the mdm input of MT itself
145-
inKafkaMdm.DataDir = "/tmp/" + instance
146141

147-
inKafkaMdm.ConfigProcess(instance)
142+
inKafkaMdm.ConfigProcess()
148143

149144
stats.NewDevnull() // make sure metrics don't pile up without getting discarded
150145

cmd/mt-kafka-mdm-sniff/main.go

+1-6
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,8 @@ package main
33
import (
44
"flag"
55
"fmt"
6-
"math/rand"
76
"os"
87
"os/signal"
9-
"strconv"
108
"strings"
119
"sync"
1210
"syscall"
@@ -73,7 +71,6 @@ func main() {
7371
}
7472
flag.Parse()
7573
log.NewLogger(0, "console", fmt.Sprintf(`{"level": %d, "formatting":false}`, 2))
76-
instance := "mt-kafka-mdm-sniff" + strconv.Itoa(rand.Int())
7774

7875
// Only try and parse the conf file if it exists
7976
path := ""
@@ -93,10 +90,8 @@ func main() {
9390

9491
// config may have had it disabled
9592
inKafkaMdm.Enabled = true
96-
// important: we don't want to share the same offset tracker as the mdm input of MT itself
97-
inKafkaMdm.DataDir = "/tmp/" + instance
9893

99-
inKafkaMdm.ConfigProcess(instance)
94+
inKafkaMdm.ConfigProcess()
10095

10196
stats.NewDevnull() // make sure metrics don't pile up without getting discarded
10297

cmd/mt-replicator-via-tsdb/main.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ func main() {
9393
cluster.Mode = cluster.ModeSingle
9494
cluster.Init(*instance, gitHash, time.Now(), "", 0)
9595

96-
inKafkaMdm.ConfigProcess(*instance)
96+
inKafkaMdm.ConfigProcess()
9797
statsConfig.ConfigProcess(*instance)
9898

9999
sigChan := make(chan os.Signal, 1)

input/kafkamdm/kafkamdm.go

-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ var netMaxOpenRequests int
5252
var offsetCommitInterval time.Duration
5353
var offsetStr string
5454
var partitionStr string
55-
var partitions []int32
5655
var sessionTimeout int
5756
var topicStr string
5857

kafka/consumer.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ func (c *Consumer) Start(processBacklog *sync.WaitGroup) error {
157157

158158
go c.monitorLag(processBacklog)
159159

160-
for _ = range c.Partitions {
160+
for range c.Partitions {
161161
go c.consume()
162162
}
163163

mdata/notifierKafka/notifierKafka.go

+3
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,9 @@ func (c *NotifierKafka) flush() {
151151

152152
hasher.Reset()
153153
_, err = hasher.Write(key)
154+
if err != nil {
155+
log.Fatal(4, "Unable to write key %s to hasher: %s", key, err)
156+
}
154157
partition := int32(hasher.Sum32()) % int32(len(c.consumer.Partitions))
155158
if partition < 0 {
156159
partition = -partition

scripts/build_deps.sh

+8
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ cd $LIB_RDKAFKA_DIR
1111
./configure --prefix=$TMP_DIR
1212
make
1313
make install
14+
make clean
1415

1516
export PKG_CONFIG_PATH=$TMP_DIR/lib/pkgconfig
1617

@@ -22,3 +23,10 @@ else
2223
fi
2324

2425
cd $OLDPWD
26+
27+
# cleanup
28+
rm \
29+
vendor/github.com/edenhill/librdkafka/Makefile.config \
30+
vendor/github.com/edenhill/librdkafka/config.cache \
31+
vendor/github.com/edenhill/librdkafka/config.log \
32+
vendor/github.com/edenhill/librdkafka/config.log.old

scripts/build_tools.sh

+4-4
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ BUILDDIR=$(pwd)/build
99
# Make dir
1010
mkdir -p $BUILDDIR
1111

12-
# disable cgo
13-
export CGO_ENABLED=0
12+
# enable cgo
13+
export CGO_ENABLED=1
1414

1515
function fail () {
1616
echo "Aborting due to failure." >&2
@@ -24,10 +24,10 @@ for tool in *; do
2424
if [ "$1" == "-race" ]
2525
then
2626
set -x
27-
CGO_ENABLED=1 go build -race -ldflags "-X main.gitHash=$GITVERSION" -o $BUILDDIR/$tool || fail
27+
go build -tags static -race -ldflags "-X main.gitHash=$GITVERSION" -o $BUILDDIR/$tool || fail
2828
else
2929
set -x
30-
CGO_ENABLED=1 go build -ldflags "-X main.gitHash=$GITVERSION" -o $BUILDDIR/$tool || fail
30+
go build -tags static -ldflags "-X main.gitHash=$GITVERSION" -o $BUILDDIR/$tool || fail
3131
fi
3232
set +x
3333
cd ..

vendor/github.com/edenhill/librdkafka/Makefile.config

-88
This file was deleted.

vendor/github.com/edenhill/librdkafka/config.cache

-37
This file was deleted.

vendor/github.com/edenhill/librdkafka/config.h

+9-8
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/edenhill/librdkafka/config.log

-39
This file was deleted.

0 commit comments

Comments
 (0)