Skip to content

Commit

Permalink
feat: flux tasks skeleton in Kapacitor (#2544)
Browse files Browse the repository at this point in the history
* feat: client work for queryFlux

* chore: update .gitignore

* chore: pull in flux task code verbatim from influxdb 2.x

* feat: flux task scheduler works

Including:
- configuration
- analytical store writes to remote influxdb
- zap logging adapter

* chore: update changelog

* fix: improve logging format

* chore: formatting and minor fixups

* make measurement name configurable

* fix: fix tests for rust dependency

* chore: fix comment

Co-authored-by: j. Emrys Landivar (docmerlin) <landivar@gmail.com>
  • Loading branch information
lesam and docmerlin authored May 12, 2021
1 parent ebee9bf commit 226f1ca
Show file tree
Hide file tree
Showing 59 changed files with 12,507 additions and 103 deletions.
1 change: 1 addition & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ commands:
steps:
- run:
name: Running Kapacitor Tests
no_output_timeout: 30m
command: |
./circle-test.sh
deploy_nightly:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
.*.swp
/.idea/
dist/*
/build/*
/*.conf
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
- [#2484](https://github.com/influxdata/kapacitor/pull/2484): Add Zenoss alert event handler.
- [#2512](https://github.com/influxdata/kapacitor/pull/2512): Pull in auth code from Kapacitor Enterprise.
- [#2493](https://github.com/influxdata/kapacitor/pull/2493): Route kafka alerts to partitions by ID, and allow for configuring the hashing strategy.
- [#2544](https://github.com/influxdata/kapacitor/pull/2544): flux tasks skeleton in Kapacitor

## v1.5.9 [2021-04-01]

Expand Down
7 changes: 4 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,10 +121,11 @@ go build ./cmd/kapacitord
```
Kapacitor builds two binares is named `kapacitor`, and `kapacitord`.

To run the tests, execute the following command:
To run the tests, execute the following commands:

```bash
go test $(go list ./... | grep -v /vendor/)
```
export CIRCLE_BUILD_NUM=0 CIRCLE_NODE_INDEX=0 CIRCLE_NODE_TOTAL=1
./circle-test.sh
```

Dependencies
Expand Down
8 changes: 7 additions & 1 deletion Dockerfile_build_ubuntu64
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ RUN apt-get -qq update && apt-get -qq install -y \
ruby-dev \
rpm \
zip \
pkg-config \
python \
python-setuptools \
python3 \
Expand Down Expand Up @@ -45,6 +46,11 @@ RUN wget -q https://github.com/google/protobuf/releases/download/v${PROTO_VERSIO
&& python3 setup.py install \
&& rm -rf /protobuf-${PROTO_VERSION} protobuf-python-${PROTO_VERSION}.tar.gz

# Install rust
ENV PATH "/root/.cargo/bin:$PATH"
RUN curl --proto '=https' --tlsv1.2 --tls-max 1.2 -sSf https://sh.rustup.rs | sh -s -- --default-toolchain stable -y && \
cargo --help

# Install go
ENV GOPATH /root/go
ENV GO_VERSION 1.15.5
Expand All @@ -53,8 +59,8 @@ RUN wget -q https://storage.googleapis.com/golang/go${GO_VERSION}.linux-${GO_ARC
tar -C /usr/local/ -xf /go${GO_VERSION}.linux-${GO_ARCH}.tar.gz ; \
rm /go${GO_VERSION}.linux-${GO_ARCH}.tar.gz
ENV PATH /usr/local/go/bin:$PATH

ENV PROJECT_DIR $GOPATH/src/github.com/influxdata/kapacitor
ENV PKG_CONFIG $PROJECT_DIR/pkg-config.sh
ENV PATH $GOPATH/bin:$PATH
RUN mkdir -p $PROJECT_DIR
WORKDIR $PROJECT_DIR
Expand Down
1 change: 1 addition & 0 deletions build.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,7 @@ def run_tests(race, parallel, timeout, no_vet):
test_command += " -timeout {}".format(timeout)
test_command += " ./..."
logging.info("Running tests...")
logging.info("Test command: " + test_command)
output = run(test_command, printOutput=logging.getLogger().getEffectiveLevel() == logging.DEBUG)
return True

Expand Down
18 changes: 12 additions & 6 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,23 @@ require (
github.com/BurntSushi/toml v0.3.1
github.com/armon/go-metrics v0.3.6 // indirect
github.com/aws/aws-sdk-go v1.38.3
github.com/benbjohnson/clock v1.1.0
github.com/benbjohnson/tmpl v1.0.0
github.com/bmizerany/pat v0.0.0-20170815010413-6226ea591a40 // indirect
github.com/cenkalti/backoff v2.2.1+incompatible
github.com/cespare/xxhash v1.1.0
github.com/davecgh/go-spew v1.1.1
github.com/dgrijalva/jwt-go v3.2.0+incompatible
github.com/dgryski/go-bits v0.0.0-20180113010104-bd8a69a71dc2 // indirect
github.com/dgryski/go-bitstream v0.0.0-20180413035011-3522498ce2c8 // indirect
github.com/docker/docker v20.10.5+incompatible
github.com/dustin/go-humanize v1.0.0
github.com/eclipse/paho.mqtt.golang v1.0.0
github.com/eclipse/paho.mqtt.golang v1.2.0
github.com/evanphx/json-patch v4.9.0+incompatible
github.com/frankban/quicktest v1.11.0 // indirect
github.com/geoffgarside/ber v0.0.0-20170306085127-854377f11dfb // indirect
github.com/ghodss/yaml v1.0.0
github.com/golang/protobuf v1.4.3
github.com/google/btree v1.0.0
github.com/google/go-cmp v0.5.5
github.com/google/gofuzz v1.2.0 // indirect
github.com/google/uuid v1.1.2
Expand All @@ -31,33 +33,37 @@ require (
github.com/hashicorp/go-msgpack v1.1.5 // indirect
github.com/hashicorp/go-uuid v1.0.2 // indirect
github.com/hashicorp/golang-lru v0.5.4 // indirect
github.com/imdario/mergo v0.3.6 // indirect
github.com/influxdata/cron v0.0.0-20201006132531-4bb0a200dcbe
github.com/influxdata/flux v0.114.1
github.com/influxdata/httprouter v1.3.1-0.20191122104820-ee83e2772f69
github.com/influxdata/influxdb v1.8.4
github.com/influxdata/influxdb/v2 v2.0.1-alpha.10.0.20210507184756-dc72dc3f0c07
github.com/influxdata/usage-client v0.0.0-20160829180054-6d3895376368
github.com/influxdata/wlog v0.0.0-20160411224016-7c63b0a71ef8
github.com/jwilder/encoding v0.0.0-20170811194829-b4e1701a28ef // indirect
github.com/k-sone/snmpgo v3.2.0+incompatible
github.com/kimor79/gollectd v1.0.0 // indirect
github.com/mailru/easyjson v0.7.7
github.com/mattn/go-runewidth v0.0.3 // indirect
github.com/mitchellh/copystructure v1.0.0
github.com/mitchellh/go-testing-interface v1.14.0 // indirect
github.com/mitchellh/mapstructure v1.4.1
github.com/mitchellh/reflectwalk v1.0.1
github.com/onsi/ginkgo v1.14.2 // indirect
github.com/onsi/gomega v1.10.3 // indirect
github.com/opentracing/opentracing-go v1.2.0
github.com/pierrec/lz4 v2.5.2+incompatible // indirect
github.com/pkg/errors v0.9.1
github.com/prometheus/client_golang v1.10.0
github.com/prometheus/common v0.20.0
github.com/prometheus/prometheus v1.8.2-0.20210331101223-3cafc58827d1
github.com/rakyll/statik v0.1.7 // indirect
github.com/russross/blackfriday v1.5.2 // indirect
github.com/segmentio/kafka-go v0.3.10
github.com/serenize/snaker v0.0.0-20161123064335-543781d2b79b
github.com/shurcooL/go v0.0.0-20170331015642-20b4b0a35211 // indirect
github.com/shurcooL/markdownfmt v0.0.0-20170214213350-10aae0a270ab
github.com/stretchr/testify v1.7.0
github.com/uber/jaeger-client-go v2.25.0+incompatible
go.etcd.io/bbolt v1.3.5
go.uber.org/zap v1.14.1
golang.org/x/crypto v0.0.0-20201221181555-eec23a3978ad
google.golang.org/protobuf v1.25.0
gopkg.in/alexcesaro/quotedprintable.v3 v3.0.0-20150716171945-2caba252f4dc // indirect
Expand Down
Loading

0 comments on commit 226f1ca

Please sign in to comment.