Skip to content

Commit

Permalink
compose: Automate loki version bumps with updatecli
Browse files Browse the repository at this point in the history
Signed-off-by: Weifeng Wang <[email protected]>

Update update-docker-image.yaml
  • Loading branch information
qclaogui committed Jan 16, 2025
1 parent f9b0994 commit ab10887
Show file tree
Hide file tree
Showing 6 changed files with 110 additions and 50 deletions.
81 changes: 71 additions & 10 deletions .github/updatecli.d/update-docker-image.yaml
Original file line number Diff line number Diff line change
@@ -1,41 +1,102 @@
name: Bump up image version
name: Update Docker Compose image versions

sources:
alloy-version:
name: Check Alloy image tag in DockerHub
kind: dockerimage
spec:
image: docker.io/grafana/alloy
versionfilter:
kind: semver
pattern: "~1.x"

loki-version:
kind: dockerimage
spec:
image: docker.io/grafana/loki
versionfilter:
kind: semver
pattern: "~3.x"

conditions:
alloy-image:
name: Check latest image tag for alloy/alloy
check-alloy-image:
kind: dockerimage
disablesourceinput: true
spec:
image: docker.io/grafana/alloy
tag: '{{ source "alloy-version" }}'

check-loki-image:
kind: dockerimage
disablesourceinput: true
spec:
image: docker.io/grafana/loki
tag: '{{ source "loki-version" }}'

targets:
alloy-yaml:
name: "Update Alloy image version in docker-compose/common/compose-include/alloy.yaml"
update-alloy-image-version-in-compose-include:
kind: yaml
sourceid: alloy-version
transformers:
- addprefix: "${ALLOY_IMAGE:-docker.io/grafana/alloy:"
- addsuffix: "}"
spec:
file: docker-compose/common/compose-include/alloy.yaml
key: services.alloy.image
key: $.services.alloy.image

alloy-env:
name: "Update Alloy image version in docker-compose/common/config/.env"
update-alloy-image-version-in-env:
kind: "file"
disablesourceinput: true
sourceid: alloy-version
spec:
files:
- docker-compose/common/config/.env
matchpattern: 'ALLOY_IMAGE=grafana/alloy:.*'
replacepattern: 'ALLOY_IMAGE=grafana/alloy:{{ source "alloy-version" }}'

update-loki-image-version-in-compose-include:
kind: yaml
sourceid: loki-version
transformers:
- addprefix: "${LOKI_IMAGE:-docker.io/grafana/loki:"
- addsuffix: "}"
spec:
file: docker-compose/common/compose-include/loki.yaml
key: $.services.loki.image

update-loki-image-version-in-all-in-one-mode-logs:
kind: yaml
sourceid: loki-version
transformers:
- addprefix: "${LOKI_IMAGE:-docker.io/grafana/loki:"
- addsuffix: "}"
spec:
file: docker-compose/monolithic-mode/all-in-one/compose.yaml
key: $.services.loki.image

update-loki-image-version-in-read-write-mode-logs:
kind: yaml
sourceid: loki-version
transformers:
- addprefix: "&lokiImage ${LOKI_IMAGE:-docker.io/grafana/loki:"
- addsuffix: "}"
spec:
file: docker-compose/read-write-mode/logs/compose.yaml
key: $.services.loki-read.image

update-loki-image-version-in-microservices-mode-logs:
kind: yaml
sourceid: loki-version
transformers:
- addprefix: "&lokiImage ${LOKI_IMAGE:-docker.io/grafana/loki:"
- addsuffix: "}"
spec:
file: docker-compose/microservices-mode/logs/compose.yaml
key: $.services.distributor.image

update-loki-image-version-in-env:
kind: "file"
sourceid: loki-version
spec:
files:
- docker-compose/common/config/.env
matchpattern: 'LOKI_IMAGE=grafana/loki:.*'
replacepattern: 'LOKI_IMAGE=grafana/loki:{{ source "loki-version" }}'
7 changes: 3 additions & 4 deletions docker-compose/common/compose-include/loki.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

services:
# Loki is a horizontally scalable, highly available, multi-tenant log aggregation system inspired
# by Prometheus. It is designed to be very cost effective and easy to operate. It does not index
Expand All @@ -8,8 +7,8 @@ services:
loki:
labels:
metrics.grafana.com/scrape: false
depends_on: { minio: { condition: service_healthy } }
image: ${LOKI_IMAGE:-docker.io/grafana/loki:3.3.0}
depends_on: {minio: {condition: service_healthy}}
image: ${LOKI_IMAGE:-docker.io/grafana/loki:3.3.2}
configs:
- source: loki_config_file
target: /etc/loki/config.yaml
Expand All @@ -20,7 +19,7 @@ services:
- -target=all
- -config.expand-env=true
healthcheck:
test: [ "CMD", "/usr/bin/wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:3100/ready" ]
test: ["CMD", "/usr/bin/wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:3100/ready"]
interval: 3s
timeout: 1s
retries: 15
Expand Down
2 changes: 1 addition & 1 deletion docker-compose/common/config/.env
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
ALLOY_IMAGE=grafana/alloy:v1.5.1
LOKI_IMAGE=grafana/loki:3.3.0
LOKI_IMAGE=grafana/loki:3.3.2
GRAFANA_IMAGE=grafana/grafana:11.4.0
TEMPO_IMAGE=grafana/tempo:2.6.0
MIMIR_IMAGE=grafana/mimir-alpine:2.14.0
Expand Down
28 changes: 14 additions & 14 deletions docker-compose/microservices-mode/logs/compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ services:
labels:
metrics.grafana.com/scrape: false
logs.grafana.com/log-format: nginx
depends_on: { distributor: { condition: service_healthy } }
depends_on: {distributor: {condition: service_healthy}}
image: ${NGINX_IMAGE:-docker.io/nginxinc/nginx-unprivileged:1.27-alpine}
volumes:
- ../../common/config/nginx/10-default-lgtmp.envsh:/docker-entrypoint.d/10-default-lgtmp.envsh
Expand All @@ -52,7 +52,7 @@ services:
- LOKI_QUERIER_HOST=querier
- LOKI_COMPACTOR_HOST=compactor
healthcheck:
test: [ "CMD", "/usr/bin/wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:3100/" ]
test: ["CMD", "/usr/bin/wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:3100/"]
interval: 3s
timeout: 1s
retries: 20
Expand All @@ -61,8 +61,8 @@ services:

distributor:
labels: *loki-labels
depends_on: { ingester: { condition: service_healthy } }
image: &lokiImage ${LOKI_IMAGE:-docker.io/grafana/loki:3.3.0}
depends_on: {ingester: {condition: service_healthy}}
image: &lokiImage ${LOKI_IMAGE:-docker.io/grafana/loki:3.3.2}
configs:
- source: loki_config_file
target: /etc/loki/config.yaml
Expand All @@ -73,7 +73,7 @@ services:
- -target=distributor
- -config.expand-env=true
healthcheck:
test: [ "CMD", "/usr/bin/wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:3100/ready" ]
test: ["CMD", "/usr/bin/wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:3100/ready"]
<<: *status-healthcheck
deploy:
replicas: 2
Expand All @@ -84,7 +84,7 @@ services:

ingester:
labels: *loki-labels
depends_on: { minio: { condition: service_healthy } }
depends_on: {minio: {condition: service_healthy}}
image: *lokiImage
configs:
- source: loki_config_file
Expand All @@ -96,7 +96,7 @@ services:
- -target=ingester
- -config.expand-env=true
healthcheck:
test: [ "CMD", "/usr/bin/wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:3100/ready" ]
test: ["CMD", "/usr/bin/wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:3100/ready"]
<<: *status-healthcheck
deploy:
replicas: 3
Expand All @@ -107,7 +107,7 @@ services:

pattern-ingester:
labels: *loki-labels
depends_on: { minio: { condition: service_healthy } }
depends_on: {minio: {condition: service_healthy}}
image: *lokiImage
configs:
- source: loki_config_file
Expand All @@ -119,7 +119,7 @@ services:
- -target=pattern-ingester
- -config.expand-env=true
healthcheck:
test: [ "CMD", "/usr/bin/wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:3100/ready" ]
test: ["CMD", "/usr/bin/wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:3100/ready"]
<<: *status-healthcheck
deploy:
replicas: 1
Expand All @@ -130,7 +130,7 @@ services:

index-gateway:
labels: *loki-labels
depends_on: { query-scheduler: { condition: service_healthy } }
depends_on: {query-scheduler: {condition: service_healthy}}
image: *lokiImage
configs:
- source: loki_config_file
Expand All @@ -144,7 +144,7 @@ services:

query-frontend:
labels: *loki-labels
depends_on: { query-scheduler: { condition: service_healthy } }
depends_on: {query-scheduler: {condition: service_healthy}}
image: *lokiImage
configs:
- source: loki_config_file
Expand All @@ -169,7 +169,7 @@ services:
- -target=query-scheduler
- -config.expand-env=true
healthcheck:
test: [ "CMD", "/usr/bin/wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:3100/ready" ]
test: ["CMD", "/usr/bin/wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:3100/ready"]
<<: *status-healthcheck
deploy:
replicas: 2
Expand All @@ -180,7 +180,7 @@ services:

querier:
labels: *loki-labels
depends_on: { query-scheduler: { condition: service_healthy } }
depends_on: {query-scheduler: {condition: service_healthy}}
image: *lokiImage
configs:
- source: loki_config_file
Expand All @@ -194,7 +194,7 @@ services:

ruler:
labels: *loki-labels
depends_on: { minio: { condition: service_healthy } }
depends_on: {minio: {condition: service_healthy}}
image: *lokiImage
configs:
- source: loki_config_file
Expand Down
24 changes: 12 additions & 12 deletions docker-compose/monolithic-mode/all-in-one/compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ services:
gateway:
labels:
metrics.grafana.com/scrape: false
depends_on: { tempo: { condition: service_healthy }, mimir: { condition: service_healthy }, pyroscope: { condition: service_healthy } }
depends_on: {tempo: {condition: service_healthy}, mimir: {condition: service_healthy}, pyroscope: {condition: service_healthy}}
image: ${NGINX_IMAGE:-docker.io/nginxinc/nginx-unprivileged:1.27-alpine}
restart: always
volumes:
Expand All @@ -57,7 +57,7 @@ services:
- ../../common/config/mimir/gateway_mimir.conf:/etc/nginx/templates/gateway_mimir.conf.template
- ../../common/config/pyroscope/gateway_pyroscope.conf:/etc/nginx/templates/gateway_pyroscope.conf.template
healthcheck:
test: [ "CMD", "/usr/bin/wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:8080/" ]
test: ["CMD", "/usr/bin/wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:8080/"]
interval: 3s
timeout: 1s
retries: 20
Expand All @@ -67,8 +67,8 @@ services:
<<: *profiles-labels
metrics.grafana.com/scrape: false
profiles.grafana.com/service_name: loki
depends_on: { minio: { condition: service_healthy } }
image: ${LOKI_IMAGE:-docker.io/grafana/loki:3.3.0}
depends_on: {minio: {condition: service_healthy}}
image: ${LOKI_IMAGE:-docker.io/grafana/loki:3.3.2}
configs:
- source: loki_config_file
target: /etc/loki/config.yaml
Expand All @@ -82,7 +82,7 @@ services:
<<: *jaeger-environment
JAEGER_TAGS: app=loki
healthcheck:
test: [ "CMD", "/usr/bin/wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:3100/ready" ]
test: ["CMD", "/usr/bin/wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:3100/ready"]
<<: *status-healthcheck
# expose 33100 port so we can directly access loki inside container
ports:
Expand All @@ -97,7 +97,7 @@ services:
<<: *profiles-labels
metrics.grafana.com/scrape: false
profiles.grafana.com/service_name: tempo
depends_on: { minio: { condition: service_healthy }, mimir: { condition: service_healthy } }
depends_on: {minio: {condition: service_healthy}, mimir: {condition: service_healthy}}
image: ${TEMPO_IMAGE:-docker.io/grafana/tempo:2.6.0}
configs:
- source: tempo_config_file
Expand All @@ -112,7 +112,7 @@ services:
<<: *jaeger-environment
JAEGER_TAGS: app=tempo
healthcheck:
test: [ "CMD", "/usr/bin/wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:3200/ready" ]
test: ["CMD", "/usr/bin/wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:3200/ready"]
<<: *status-healthcheck
start_period: 10s
# expose 33200 port so we can directly access tempo inside container
Expand All @@ -124,7 +124,7 @@ services:
<<: *profiles-labels
metrics.grafana.com/scrape: false
profiles.grafana.com/service_name: mimir
depends_on: { minio: { condition: service_healthy } }
depends_on: {minio: {condition: service_healthy}}
image: ${MIMIR_IMAGE:-docker.io/grafana/mimir-alpine:2.14.0}
configs:
- source: mimir_config_file
Expand All @@ -140,7 +140,7 @@ services:
<<: *jaeger-environment
JAEGER_TAGS: app=mimir
healthcheck:
test: [ "CMD", "/usr/bin/wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:8080/ready" ]
test: ["CMD", "/usr/bin/wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:8080/ready"]
<<: *status-healthcheck
# expose 38080 port so we can directly access mimir inside container
ports:
Expand Down Expand Up @@ -168,7 +168,7 @@ services:
labels:
metrics.grafana.com/scrape: false
profiles.grafana.com/service_name: pyroscope
depends_on: { minio: { condition: service_healthy } }
depends_on: {minio: {condition: service_healthy}}
image: ${PYROSCOPE_IMAGE:-docker.io/grafana/pyroscope:1.10.0}
configs:
- source: pyroscope_config_file
Expand All @@ -185,11 +185,11 @@ services:
<<: *jaeger-environment
JAEGER_TAGS: app=pyroscope
healthcheck:
test: [ "CMD", "profilecli", "ready" ]
test: ["CMD", "profilecli", "ready"]
<<: *status-healthcheck
# expose 34040 port so we can directly access pyroscope inside container
ports:
- "34040:4040"

volumes:
pyroscope_data:
pyroscope_data: {}
Loading

0 comments on commit ab10887

Please sign in to comment.