Skip to content

Commit

Permalink
app/vmctl: move vmctl code from github.com/VictoriaMetrics/vmctl
Browse files Browse the repository at this point in the history
It is better developing vmctl tool in VictoriaMetrics repository, so it could be released
together with the rest of vmutils tools such as vmalert, vmagent, vmbackup, vmrestore and vmauth.
  • Loading branch information
valyala committed Jan 31, 2021
1 parent 2a7b1cc commit d5c180e
Show file tree
Hide file tree
Showing 467 changed files with 97,073 additions and 12 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,16 +45,19 @@ jobs:
GOOS=freebsd go build -mod=vendor ./app/vmalert
GOOS=freebsd go build -mod=vendor ./app/vmbackup
GOOS=freebsd go build -mod=vendor ./app/vmrestore
GOOS=freebsd go build -mod=vendor ./app/vmctl
GOOS=openbsd go build -mod=vendor ./app/victoria-metrics
GOOS=openbsd go build -mod=vendor ./app/vmagent
GOOS=openbsd go build -mod=vendor ./app/vmalert
GOOS=openbsd go build -mod=vendor ./app/vmbackup
GOOS=openbsd go build -mod=vendor ./app/vmrestore
GOOS=openbsd go build -mod=vendor ./app/vmctl
GOOS=darwin go build -mod=vendor ./app/victoria-metrics
GOOS=darwin go build -mod=vendor ./app/vmagent
GOOS=darwin go build -mod=vendor ./app/vmalert
GOOS=darwin go build -mod=vendor ./app/vmbackup
GOOS=darwin go build -mod=vendor ./app/vmrestore
GOOS=darwin go build -mod=vendor ./app/vmctl
- name: Publish coverage
uses: codecov/[email protected]
with:
Expand Down
22 changes: 16 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ all: \
vmalert-prod \
vmauth-prod \
vmbackup-prod \
vmrestore-prod
vmrestore-prod \
vmctl-prod

include app/*/Makefile
include deployment/*/Makefile
Expand All @@ -32,29 +33,33 @@ publish: \
publish-vmalert \
publish-vmauth \
publish-vmbackup \
publish-vmrestore
publish-vmrestore \
publish-vmctl

package: \
package-victoria-metrics \
package-vmagent \
package-vmalert \
package-vmauth \
package-vmbackup \
package-vmrestore
package-vmrestore \
package-vmctl

vmutils: \
vmagent \
vmalert \
vmauth \
vmbackup \
vmrestore
vmrestore \
vmctl

vmutils-arm64: \
vmagent-arm64 \
vmalert-arm64 \
vmauth-arm64 \
vmbackup-arm64 \
vmrestore-arm64
vmrestore-arm64 \
vmctl-arm64

release-snap:
snapcraft
Expand Down Expand Up @@ -97,20 +102,23 @@ release-vmutils-generic: \
vmalert-$(GOARCH)-prod \
vmauth-$(GOARCH)-prod \
vmbackup-$(GOARCH)-prod \
vmrestore-$(GOARCH)-prod
vmrestore-$(GOARCH)-prod \
vmctl-$(GOARCH)-prod
cd bin && \
tar --transform="flags=r;s|-$(GOARCH)||" -czf vmutils-$(GOARCH)-$(PKG_TAG).tar.gz \
vmagent-$(GOARCH)-prod \
vmalert-$(GOARCH)-prod \
vmauth-$(GOARCH)-prod \
vmbackup-$(GOARCH)-prod \
vmrestore-$(GOARCH)-prod \
vmctl-$(GOARCH)-prod \
&& sha256sum vmutils-$(GOARCH)-$(PKG_TAG).tar.gz \
vmagent-$(GOARCH)-prod \
vmalert-$(GOARCH)-prod \
vmauth-$(GOARCH)-prod \
vmbackup-$(GOARCH)-prod \
vmrestore-$(GOARCH)-prod \
vmctl-$(GOARCH)-prod \
| sed s/-$(GOARCH)// > vmutils-$(GOARCH)-$(PKG_TAG)_checksums.txt

pprof-cpu:
Expand Down Expand Up @@ -141,6 +149,7 @@ errcheck: install-errcheck
errcheck -exclude=errcheck_excludes.txt ./app/vmauth/...
errcheck -exclude=errcheck_excludes.txt ./app/vmbackup/...
errcheck -exclude=errcheck_excludes.txt ./app/vmrestore/...
errcheck -exclude=errcheck_excludes.txt ./app/vmctl/...

install-errcheck:
which errcheck || go install github.com/kisielk/errcheck
Expand Down Expand Up @@ -204,4 +213,5 @@ docs-sync:
cp app/vmauth/README.md docs/vmauth.md
cp app/vmbackup/README.md docs/vmbackup.md
cp app/vmrestore/README.md docs/vmrestore.md
cp app/vmctl/README.md docs/vmctl.md
cp README.md docs/Single-server-VictoriaMetrics.md
13 changes: 12 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ Alphabetically sorted links to case studies:
* [Tuning](#tuning)
* [Monitoring](#monitoring)
* [Troubleshooting](#troubleshooting)
* [Data migration](#data-migration)
* [Backfilling](#backfilling)
* [Data updates](#data-updates)
* [Replication](#replication)
Expand Down Expand Up @@ -1353,6 +1354,17 @@ See the example of alerting rules for VM components [here](https://github.com/Vi
* VictoriaMetrics ignores `NaN` values during data ingestion.


## Data migration

Use [vmctl](https://victoriametrics.github.io/vmctl.html) for data migration. It supports the following data migration types:

* From Prometheus to VictoriaMetrics
* From InfluxDB to VictoriaMetrics
* From VictoriaMetrics to VictoriaMetrics

See [vmctl docs](https://victoriametrics.github.io/vmctl.html) for more details.


## Backfilling

VictoriaMetrics accepts historical data in arbitrary order of time via [any supported ingestion method](#how-to-import-time-series-data).
Expand Down Expand Up @@ -1420,7 +1432,6 @@ The collected profiles may be analyzed with [go tool pprof](https://github.com/g

* [Helm charts for single-node and cluster versions of VictoriaMetrics](https://github.com/VictoriaMetrics/helm-charts).
* [Kubernetes operator for VictoriaMetrics](https://github.com/VictoriaMetrics/operator).
* [vmctl tool for data migration to VictoriaMetrics](https://github.com/VictoriaMetrics/vmctl).
* [netdata](https://github.com/netdata/netdata) can push data into VictoriaMetrics via `Prometheus remote_write API`.
See [these docs](https://github.com/netdata/netdata#integrations).
* [go-graphite/carbonapi](https://github.com/go-graphite/carbonapi) can use VictoriaMetrics as time series backend.
Expand Down
73 changes: 73 additions & 0 deletions app/vmctl/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
# All these commands must run from repository root.

vmctl:
APP_NAME=vmctl $(MAKE) app-local

vmctl-race:
APP_NAME=vmctl RACE=-race $(MAKE) app-local

vmctl-prod:
APP_NAME=vmctl $(MAKE) app-via-docker

vmctl-pure-prod:
APP_NAME=vmctl $(MAKE) app-via-docker-pure

vmctl-amd64-prod:
APP_NAME=vmctl $(MAKE) app-via-docker-amd64

vmctl-arm-prod:
APP_NAME=vmctl $(MAKE) app-via-docker-arm

vmctl-arm64-prod:
APP_NAME=vmctl $(MAKE) app-via-docker-arm64

vmctl-ppc64le-prod:
APP_NAME=vmctl $(MAKE) app-via-docker-ppc64le

vmctl-386-prod:
APP_NAME=vmctl $(MAKE) app-via-docker-386

package-vmctl:
APP_NAME=vmctl $(MAKE) package-via-docker

package-vmctl-pure:
APP_NAME=vmctl $(MAKE) package-via-docker-pure

package-vmctl-amd64:
APP_NAME=vmctl $(MAKE) package-via-docker-amd64

package-vmctl-arm:
APP_NAME=vmctl $(MAKE) package-via-docker-arm

package-vmctl-arm64:
APP_NAME=vmctl $(MAKE) package-via-docker-arm64

package-vmctl-ppc64le:
APP_NAME=vmctl $(MAKE) package-via-docker-ppc64le

package-vmctl-386:
APP_NAME=vmctl $(MAKE) package-via-docker-386

publish-vmctl:
APP_NAME=vmctl $(MAKE) publish-via-docker

vmctl-amd64:
CGO_ENABLED=1 GOARCH=amd64 $(MAKE) vmctl-local-with-goarch

vmctl-arm:
CGO_ENABLED=0 GOARCH=arm $(MAKE) vmctl-local-with-goarch

vmctl-arm64:
CGO_ENABLED=0 GOARCH=arm64 $(MAKE) vmctl-local-with-goarch

vmctl-ppc64le:
CGO_ENABLED=0 GOARCH=ppc64le $(MAKE) vmctl-local-with-goarch

vmctl-386:
CGO_ENABLED=0 GOARCH=386 $(MAKE) vmctl-local-with-goarch

vmctl-local-with-goarch:
APP_NAME=vmctl $(MAKE) app-local-with-goarch

vmctl-pure:
APP_NAME=vmctl $(MAKE) app-local-pure
Loading

0 comments on commit d5c180e

Please sign in to comment.