Skip to content

Commit

Permalink
Update patch versions in docs and YAML files to v2.8.8 (#11761)
Browse files Browse the repository at this point in the history
This fixes the docs and some config examples to use the latest patch version. This hadn't been done for a while, so I also added the script to do it from #10646
  • Loading branch information
na-- authored Jan 24, 2024
1 parent ae52e34 commit 126e6d3
Show file tree
Hide file tree
Showing 9 changed files with 59 additions and 23 deletions.
4 changes: 2 additions & 2 deletions docs/sources/clients/docker-driver/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ The Docker plugin must be installed on each Docker host that will be running con
Run the following command to install the plugin, updating the release version if needed:

```bash
docker plugin install grafana/loki-docker-driver:2.8.5 --alias loki --grant-all-permissions
docker plugin install grafana/loki-docker-driver:2.8.8 --alias loki --grant-all-permissions
```

To check installed plugins, use the `docker plugin ls` command. Plugins that
Expand All @@ -49,7 +49,7 @@ re-enabling and restarting Docker:

```bash
docker plugin disable loki --force
docker plugin upgrade loki grafana/loki-docker-driver:2.8.5 --grant-all-permissions
docker plugin upgrade loki grafana/loki-docker-driver:2.8.8 --grant-all-permissions
docker plugin enable loki
systemctl restart docker
```
Expand Down
18 changes: 9 additions & 9 deletions docs/sources/installation/docker.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ The configuration acquired with these installation instructions run Loki as a si
Copy and paste the commands below into your command line.

```bash
wget https://raw.githubusercontent.com/grafana/loki/v2.8.0/cmd/loki/loki-local-config.yaml -O loki-config.yaml
docker run --name loki -d -v $(pwd):/mnt/config -p 3100:3100 grafana/loki:2.8.0 -config.file=/mnt/config/loki-config.yaml
wget https://raw.githubusercontent.com/grafana/loki/v2.8.0/clients/cmd/promtail/promtail-docker-config.yaml -O promtail-config.yaml
docker run --name promtail -d -v $(pwd):/mnt/config -v /var/log:/var/log --link loki grafana/promtail:2.8.0 -config.file=/mnt/config/promtail-config.yaml
wget https://raw.githubusercontent.com/grafana/loki/v2.8.8/cmd/loki/loki-local-config.yaml -O loki-config.yaml
docker run --name loki -d -v $(pwd):/mnt/config -p 3100:3100 grafana/loki:2.8.8 -config.file=/mnt/config/loki-config.yaml
wget https://raw.githubusercontent.com/grafana/loki/v2.8.8/clients/cmd/promtail/promtail-docker-config.yaml -O promtail-config.yaml
docker run --name promtail -d -v $(pwd):/mnt/config -v /var/log:/var/log --link loki grafana/promtail:2.8.8 -config.file=/mnt/config/promtail-config.yaml
```

When finished, `loki-config.yaml` and `promtail-config.yaml` are downloaded in the directory you chose. Docker containers are running Loki and Promtail using those config files.
Expand All @@ -40,10 +40,10 @@ Copy and paste the commands below into your terminal. Note that you will need to

```bash
cd "<local-path>"
wget https://raw.githubusercontent.com/grafana/loki/v2.8.0/cmd/loki/loki-local-config.yaml -O loki-config.yaml
docker run --name loki -v <local-path>:/mnt/config -p 3100:3100 grafana/loki:2.8.0 --config.file=/mnt/config/loki-config.yaml
wget https://raw.githubusercontent.com/grafana/loki/v2.8.0/clients/cmd/promtail/promtail-docker-config.yaml -O promtail-config.yaml
docker run -v <local-path>:/mnt/config -v /var/log:/var/log --link loki grafana/promtail:2.8.0 --config.file=/mnt/config/promtail-config.yaml
wget https://raw.githubusercontent.com/grafana/loki/v2.8.8/cmd/loki/loki-local-config.yaml -O loki-config.yaml
docker run --name loki -v <local-path>:/mnt/config -p 3100:3100 grafana/loki:2.8.8 --config.file=/mnt/config/loki-config.yaml
wget https://raw.githubusercontent.com/grafana/loki/v2.8.8/clients/cmd/promtail/promtail-docker-config.yaml -O promtail-config.yaml
docker run -v <local-path>:/mnt/config -v /var/log:/var/log --link loki grafana/promtail:2.8.8 --config.file=/mnt/config/promtail-config.yaml
```

When finished, `loki-config.yaml` and `promtail-config.yaml` are downloaded in the directory you chose. Docker containers are running Loki and Promtail using those config files.
Expand All @@ -55,6 +55,6 @@ Navigate to http://localhost:3100/metrics to view the output.
Run the following commands in your command line. They work for Windows or Linux systems.

```bash
wget https://raw.githubusercontent.com/grafana/loki/v2.8.0/production/docker-compose.yaml -O docker-compose.yaml
wget https://raw.githubusercontent.com/grafana/loki/v2.8.8/production/docker-compose.yaml -O docker-compose.yaml
docker-compose -f docker-compose.yaml up
```
6 changes: 3 additions & 3 deletions examples/getting-started/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ networks:

services:
read:
image: grafana/loki:2.8.5
image: grafana/loki:2.8.8
command: "-config.file=/etc/loki/config.yaml -target=read"
ports:
- 3101:3100
Expand All @@ -27,7 +27,7 @@ services:
- loki

write:
image: grafana/loki:2.8.5
image: grafana/loki:2.8.8
command: "-config.file=/etc/loki/config.yaml -target=write"
ports:
- 3102:3100
Expand All @@ -46,7 +46,7 @@ services:
<<: *loki-dns

promtail:
image: grafana/promtail:2.8.5
image: grafana/promtail:2.8.8
volumes:
- ./promtail-local-config.yaml:/etc/promtail/config.yaml:ro
- /var/run/docker.sock:/var/run/docker.sock
Expand Down
4 changes: 2 additions & 2 deletions production/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ networks:

services:
loki:
image: grafana/loki:2.8.5
image: grafana/loki:2.8.8
ports:
- "3100:3100"
command: -config.file=/etc/loki/local-config.yaml
networks:
- loki

promtail:
image: grafana/promtail:2.8.5
image: grafana/promtail:2.8.8
volumes:
- /var/log:/var/log
command: -config.file=/etc/promtail/config.yml
Expand Down
8 changes: 4 additions & 4 deletions production/docker/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ services:
# Loki would not have permissions to create the directories.
# Therefore the init container changes permissions of the mounted directory.
init:
image: grafana/loki:2.8.5
image: grafana/loki:2.8.8
user: root
entrypoint:
- "chown"
Expand Down Expand Up @@ -72,7 +72,7 @@ services:
- ./loki/:/var/log/

promtail:
image: grafana/promtail:2.8.5
image: grafana/promtail:2.8.8
volumes:
- ./loki/:/var/log/
- ./config:/etc/promtail/
Expand Down Expand Up @@ -114,7 +114,7 @@ services:
- loki

loki-read:
image: grafana/loki:2.8.5
image: grafana/loki:2.8.8
volumes:
- ./config:/etc/loki/
ports:
Expand All @@ -136,7 +136,7 @@ services:
# only needed for interactive debugging with dlv

loki-write:
image: grafana/loki:2.8.5
image: grafana/loki:2.8.8
volumes:
- ./config:/etc/loki/
ports:
Expand Down
2 changes: 1 addition & 1 deletion production/ksonnet/loki-canary/config.libsonnet
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
_images+:: {
loki_canary: 'grafana/loki-canary:2.8.5',
loki_canary: 'grafana/loki-canary:2.8.8',
},
}
2 changes: 1 addition & 1 deletion production/ksonnet/loki/images.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
memcached: 'memcached:1.5.17-alpine',
memcachedExporter: 'prom/memcached-exporter:v0.6.0',

loki: 'grafana/loki:2.8.5',
loki: 'grafana/loki:2.8.8',

distributor:: self.loki,
ingester:: self.loki,
Expand Down
2 changes: 1 addition & 1 deletion production/ksonnet/promtail/config.libsonnet
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
_images+:: {
promtail: 'grafana/promtail:2.8.5',
promtail: 'grafana/promtail:2.8.8',
},

_config+:: {
Expand Down
36 changes: 36 additions & 0 deletions tools/release_update_tags.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#!/bin/bash

set -euo pipefail

OLD_VERSION=${LOKI_OLD_VERSION:-}
NEW_VERSION=${LOKI_NEW_VERSION:-}

if [[ -z "${OLD_VERSION}" ]]
then
OLD_VERSION="[0-9]+\.[0-9]+\.[0-9]+"
fi

if [[ -z "${NEW_VERSION}" ]]
then
read -rp "Enter new release version (eg 2.9.2): " NEW_VERSION
fi


LOKI_DOCKER_DRIVER_TAG="grafana\/loki-docker-driver:"
LOKI_DOCUMENTS_TAG="loki\/v"
LOKI_DOCKER_TAG="grafana\/loki:"
LOKI_PROMTAIL_DOCKER_TAG="grafana\/promtail:"
LOKI_CANARY_DOCKER_TAG="grafana\/loki-canary:"
LOKI_LOGCLI_DOCKER_TAG="grafana\/logcli:"

echo "Updating version references to ${NEW_VERSION}"

# grep -Iq is to ignore non-binary files.
find . -type f -not -path "./.git/*" -not -path "./vendor/*" -not -path "./operator/*" -not -path "./CHANGELOG.md" -not -path "./docs/sources/setup/upgrade/*" -exec grep -Iq . {} \; -print0\
| xargs -0 sed -i '' -E \
-e "s/(${LOKI_DOCKER_DRIVER_TAG})(${OLD_VERSION})/\1${NEW_VERSION}/g" \
-e "s/(${LOKI_DOCUMENTS_TAG})(${OLD_VERSION})/\1${NEW_VERSION}/g" \
-e "s/(${LOKI_DOCKER_TAG})(${OLD_VERSION})/\1${NEW_VERSION}/g" \
-e "s/(${LOKI_PROMTAIL_DOCKER_TAG})(${OLD_VERSION})/\1${NEW_VERSION}/g" \
-e "s/(${LOKI_CANARY_DOCKER_TAG})(${OLD_VERSION})/\1${NEW_VERSION}/g" \
-e "s/(${LOKI_LOGCLI_DOCKER_TAG})(${OLD_VERSION})/\1${NEW_VERSION}/g" \

0 comments on commit 126e6d3

Please sign in to comment.