Skip to content

Commit

Permalink
Snap docs change (#986)
Browse files Browse the repository at this point in the history
* adds snap docs,
adds release information for snap package,
adds docs notes about configuration management with snap package.

* adds release page mention

* version fix for snap, its awful

* revert version

* Apply suggestions from code review

Co-authored-by: Aliaksandr Valialkin <valyala@gmail.com>
  • Loading branch information
f41gh7 and valyala committed Dec 29, 2020
1 parent f6ca776 commit 85962b4
Show file tree
Hide file tree
Showing 5 changed files with 60 additions and 11 deletions.
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ vmutils: \
vmbackup \
vmrestore

release-snap:
snapcraft
snapcraft upload "victoriametrics_$(PKG_TAG)_multi.snap" --release beta,edge,candidate

release: \
release-victoria-metrics \
release-vmutils
Expand Down
21 changes: 21 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ Alphabetically sorted links to case studies:

* [How to start VictoriaMetrics](#how-to-start-victoriametrics)
* [Environment variables](#environment-variables)
* [Configuration with snap package](#configuration-with-snap-package)
* [Prometheus setup](#prometheus-setup)
* [Grafana setup](#grafana-setup)
* [How to upgrade VictoriaMetrics](#how-to-upgrade-victoriametrics)
Expand Down Expand Up @@ -197,6 +198,26 @@ Each flag value can be set via environment variables according to these rules:
* For repeating flags an alternative syntax can be used by joining the different values into one using `,` char as separator (for example `-storageNode <nodeA> -storageNode <nodeB>` will translate to `storageNode=<nodeA>,<nodeB>`)
* It is possible setting prefix for environment vars with `-envflag.prefix`. For instance, if `-envflag.prefix=VM_`, then env vars must be prepended with `VM_`

### Configuration with snap package


Command-line flags can be changed with following command:

```text
echo 'FLAGS="-selfScrapeInterval=10s -search.logSlowQueryDuration=20s"' > $SNAP_DATA/var/snap/victoriametrics/current/extra_flags
snap restart victoriametrics
```
Or add needed command-line flags to the file `$SNAP_DATA/var/snap/victoriametrics/current/extra_flags`.

Note you cannot change value for `-storageDataPath` flag, for safety snap package has limited access to host system.


Changing scrape configuration is possible with text editor:
```text
vi $SNAP_DATA/var/snap/victoriametrics/current/etc/victoriametrics-scrape-config.yaml
```
After changes was made, trigger config re-read with command `curl 127.0.0.1:8248/-/reload`.


## Prometheus setup

Expand Down
13 changes: 13 additions & 0 deletions docs/Release-Guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,19 @@ Release process guidance
5. Push release tag to https://github.com/VictoriaMetrics/VictoriaMetrics : `git push origin v1.xx.y`.
6. Go to https://github.com/VictoriaMetrics/VictoriaMetrics/releases , create new release from the pushed tag on step 5 and upload `*.tar.gz` archive with the corresponding `_checksums.txt` from step 2.

## Building snap package.

pre-requirements:
- snapcraft binary, can be installed with commands:
for MacOS `brew install snapcraft` and [install mutipass](https://discourse.ubuntu.com/t/installing-multipass-on-macos/8329),
for Ubuntu - `sudo snap install snapcraft --classic`
- login with `snapcraft login`
- already created release at github (it operates `git describe` version, so git tag must be annotated).

0. checkout to the latest git tag for single-node version.
1. execute `make release-snap` - it must build and upload snap package.
2. promote release to current, if needed manually at release page [snapcraft-releases](https://snapcraft.io/victoriametrics/releases)

### Public Announcement

1. Publish message in slack (victoriametrics.slack.com, general channel)
Expand Down
21 changes: 21 additions & 0 deletions docs/Single-server-VictoriaMetrics.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ Alphabetically sorted links to case studies:

* [How to start VictoriaMetrics](#how-to-start-victoriametrics)
* [Environment variables](#environment-variables)
* [Configuration with snap package](#configuration-with-snap-package)
* [Prometheus setup](#prometheus-setup)
* [Grafana setup](#grafana-setup)
* [How to upgrade VictoriaMetrics](#how-to-upgrade-victoriametrics)
Expand Down Expand Up @@ -197,6 +198,26 @@ Each flag value can be set via environment variables according to these rules:
* For repeating flags an alternative syntax can be used by joining the different values into one using `,` char as separator (for example `-storageNode <nodeA> -storageNode <nodeB>` will translate to `storageNode=<nodeA>,<nodeB>`)
* It is possible setting prefix for environment vars with `-envflag.prefix`. For instance, if `-envflag.prefix=VM_`, then env vars must be prepended with `VM_`

### Configuration with snap package


Command-line flags can be changed with following command:

```text
echo 'FLAGS="-selfScrapeInterval=10s -search.logSlowQueryDuration=20s"' > $SNAP_DATA/var/snap/victoriametrics/current/extra_flags
snap restart victoriametrics
```
Or add needed command-line flags to the file `$SNAP_DATA/var/snap/victoriametrics/current/extra_flags`.

Note you cannot change value for `-storageDataPath` flag, for safety snap package has limited access to host system.


Changing scrape configuration is possible with text editor:
```text
vi $SNAP_DATA/var/snap/victoriametrics/current/etc/victoriametrics-scrape-config.yaml
```
After changes was made, trigger config re-read with command `curl 127.0.0.1:8248/-/reload`.


## Prometheus setup

Expand Down
12 changes: 1 addition & 11 deletions snap/local/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,13 @@ snap link: https://snapcraft.io/victoriametrics

Install snapcraft and multipass:
```text
snap install snapcraft
snap install multipass
sudo snap install snapcraft --classic
```

build victoria-metrics prod binary and run snapcraft ```snapcraft --debug```.
It produces snap package with current git version - `victoriametrics_v1.46.0+git1.1bebd021a-dirty_all.snap`.
You can install it with command: `snap install victoriametrics_v1.46.0+git1.1bebd021a-dirty_all.snap --dangerous`

package and publish:

```text
make victoria-metrics-package-snap
snap login
snap_file=$(ls | grep -e '_multi.snap$')
snapcraft upload --release=latest/edge "$snap_file"
rm "$snap_file"
```

#### usage

Expand Down

0 comments on commit 85962b4

Please sign in to comment.