Skip to content

Commit

Permalink
Merge branch 'main' into otel-collector-example
Browse files Browse the repository at this point in the history
  • Loading branch information
JStickler authored Oct 3, 2024
2 parents 771eee7 + 3beb8ff commit e096f38
Show file tree
Hide file tree
Showing 60 changed files with 140 additions and 681 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"check":
"uses": "grafana/loki-release/.github/workflows/check.yml@main"
"with":
"build_image": "grafana/loki-build-image:0.34.0"
"build_image": "grafana/loki-build-image:0.34.1"
"golang_ci_lint_version": "v1.60.3"
"release_lib_ref": "main"
"skip_validation": false
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"check":
"uses": "grafana/loki-release/.github/workflows/check.yml@main"
"with":
"build_image": "grafana/loki-build-image:0.34.0"
"build_image": "grafana/loki-build-image:0.34.1"
"golang_ci_lint_version": "v1.60.3"
"release_lib_ref": "main"
"skip_validation": false
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/minor-release-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
check:
uses: "grafana/loki-release/.github/workflows/check.yml@main"
with:
build_image: "grafana/loki-build-image:0.34.0"
build_image: "grafana/loki-build-image:0.34.1"
golang_ci_lint_version: "v1.60.3"
release_lib_ref: "main"
skip_validation: false
Expand Down Expand Up @@ -143,7 +143,7 @@ jobs:
--env SKIP_ARM \
--volume .:/src/loki \
--workdir /src/loki \
--entrypoint /bin/sh "grafana/loki-build-image:0.34.0"
--entrypoint /bin/sh "grafana/loki-build-image:0.34.1"
git config --global --add safe.directory /src/loki
echo "${NFPM_SIGNING_KEY}" > $NFPM_SIGNING_KEY_FILE
make dist packages
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/patch-release-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
check:
uses: "grafana/loki-release/.github/workflows/check.yml@main"
with:
build_image: "grafana/loki-build-image:0.34.0"
build_image: "grafana/loki-build-image:0.34.1"
golang_ci_lint_version: "v1.60.3"
release_lib_ref: "main"
skip_validation: false
Expand Down Expand Up @@ -143,7 +143,7 @@ jobs:
--env SKIP_ARM \
--volume .:/src/loki \
--workdir /src/loki \
--entrypoint /bin/sh "grafana/loki-build-image:0.34.0"
--entrypoint /bin/sh "grafana/loki-build-image:0.34.1"
git config --global --add safe.directory /src/loki
echo "${NFPM_SIGNING_KEY}" > $NFPM_SIGNING_KEY_FILE
make dist packages
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -219,4 +219,4 @@ name: "create release"
permissions:
contents: "write"
id-token: "write"
pull-requests: "write"
pull-requests: "write"
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ DOCKER_IMAGE_DIRS := $(patsubst %/Dockerfile,%,$(DOCKERFILES))
BUILD_IN_CONTAINER ?= true

# ensure you run `make release-workflows` after changing this
BUILD_IMAGE_VERSION ?= 0.34.0
BUILD_IMAGE_VERSION ?= 0.34.1
GO_VERSION := 1.23.1

# Docker image info
Expand Down Expand Up @@ -664,7 +664,7 @@ else
endif

build-image: ensure-buildx-builder
$(SUDO) $(BUILD_OCI) --build-arg=GO_VERSION=$(GO_VERSION) -t $(IMAGE_PREFIX)/loki-build-image:$(IMAGE_TAG) ./loki-build-image
$(SUDO) $(BUILD_OCI) --build-arg=GO_VERSION=$(GO_VERSION) -t $(IMAGE_PREFIX)/loki-build-image:$(BUILD_IMAGE_VERSION) ./loki-build-image
build-image-push: build-image ## push the docker build image
ifneq (,$(findstring WIP,$(IMAGE_TAG)))
@echo "Cannot push a WIP image, commit changes first"; \
Expand Down
28 changes: 8 additions & 20 deletions docs/sources/community/maintaining/release-loki-build-image.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,23 +14,11 @@ if any changes were made in the folder `./loki-build-image/`.

**To build and use the `loki-build-image`:**

## Step 1

1. Create a branch with the desired changes to the Dockerfile.
2. Update the version tag of the `loki-build-image` pipeline defined in `.drone/drone.jsonnet` (search for `pipeline('loki-build-image')`) to a new version number (try to follow semver).
3. Run `DRONE_SERVER=https://drone.grafana.net/ DRONE_TOKEN=<token> make drone` and commit the changes to the same branch.
1. The `<token>` is your personal drone token, which can be found by navigating to https://drone.grafana.net/account.
4. Create a PR.
5. Once approved and merged to `main`, the image with the new version is built and published.
{{% admonition type="note" %}}
Keep an eye on https://drone.grafana.net/grafana/loki for the build after merging ([example](https://drone.grafana.net/grafana/loki/17760/1/2)).
{{% /admonition %}}

## Step 2

1. Create a branch.
2. Update the `BUILD_IMAGE_VERSION` variable in the `Makefile`.
3. Run `loki-build-image/version-updater.sh <new-version>` to update all the references.
4. Run `DRONE_SERVER=https://drone.grafana.net/ DRONE_TOKEN=<token> make drone` to update the Drone config to use the new build image.
5. Create a new PR.

1. Create a branch with the desired changes to the `./loki-build-image/Dockerfile`.
1. Update the `BUILD_IMAGE_VERSION` variable in the `Makefile`.
1. Commit your changes.
1. Run `make build-image-push` to build and publish the new version of the build image.
1. Run `make release-workflows` to update the Github workflows.
1. Commit your changes.
1. Push your changes to the remote branch.
1. Open a PR against the `main` branch.
1 change: 1 addition & 0 deletions docs/sources/setup/install/helm/reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -6186,6 +6186,7 @@ null
"azure": {
"accountKey": null,
"accountName": null,
"chunkDelimiter": null,
"connectionString": null,
"endpointSuffix": null,
"requestTimeout": null,
Expand Down
8 changes: 5 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
module github.com/grafana/loki/v3

go 1.21.8
go 1.22

toolchain go1.23.2

require (
cloud.google.com/go/bigtable v1.29.0
Expand Down Expand Up @@ -49,7 +51,7 @@ require (
github.com/gorilla/mux v1.8.1
github.com/gorilla/websocket v1.5.3
github.com/grafana/cloudflare-go v0.0.0-20230110200409-c627cf6792f2
github.com/grafana/dskit v0.0.0-20240930165212-f52de24af9bc
github.com/grafana/dskit v0.0.0-20241002104024-b69ac1b95024
github.com/grafana/go-gelf/v2 v2.0.1
github.com/grafana/gomemcache v0.0.0-20240229205252-cd6a66d6fb56
github.com/grafana/regexp v0.0.0-20240518133315-a468a5bfb3bc
Expand Down Expand Up @@ -93,7 +95,7 @@ require (
github.com/stretchr/testify v1.9.0
github.com/uber/jaeger-client-go v2.30.0+incompatible
github.com/xdg-go/scram v1.1.2
go.etcd.io/bbolt v1.3.10
go.etcd.io/bbolt v1.3.11
go.uber.org/atomic v1.11.0
go.uber.org/goleak v1.3.0
golang.org/x/crypto v0.27.0
Expand Down
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1044,8 +1044,8 @@ github.com/gorilla/websocket v1.5.3 h1:saDtZ6Pbx/0u+bgYQ3q96pZgCzfhKXGPqt7kZ72aN
github.com/gorilla/websocket v1.5.3/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
github.com/grafana/cloudflare-go v0.0.0-20230110200409-c627cf6792f2 h1:qhugDMdQ4Vp68H0tp/0iN17DM2ehRo1rLEdOFe/gB8I=
github.com/grafana/cloudflare-go v0.0.0-20230110200409-c627cf6792f2/go.mod h1:w/aiO1POVIeXUQyl0VQSZjl5OAGDTL5aX+4v0RA1tcw=
github.com/grafana/dskit v0.0.0-20240930165212-f52de24af9bc h1:OLRT3mpHjvTjq4Km7L36lipZ+hTOX1U3jct0DFMADdo=
github.com/grafana/dskit v0.0.0-20240930165212-f52de24af9bc/go.mod h1:SPLNCARd4xdjCkue0O6hvuoveuS1dGJjDnfxYe405YQ=
github.com/grafana/dskit v0.0.0-20241002104024-b69ac1b95024 h1:RflXv1xMlnqP0zr1apM3lJ0BK5SwvEOGLv980V+oGJ0=
github.com/grafana/dskit v0.0.0-20241002104024-b69ac1b95024/go.mod h1:SPLNCARd4xdjCkue0O6hvuoveuS1dGJjDnfxYe405YQ=
github.com/grafana/go-gelf/v2 v2.0.1 h1:BOChP0h/jLeD+7F9mL7tq10xVkDG15he3T1zHuQaWak=
github.com/grafana/go-gelf/v2 v2.0.1/go.mod h1:lexHie0xzYGwCgiRGcvZ723bSNyNI8ZRD4s0CLobh90=
github.com/grafana/gocql v0.0.0-20200605141915-ba5dc39ece85 h1:xLuzPoOzdfNb/RF/IENCw+oLVdZB4G21VPhkHBgwSHY=
Expand Down Expand Up @@ -1889,8 +1889,8 @@ go.einride.tech/aip v0.67.1/go.mod h1:ZGX4/zKw8dcgzdLsrvpOOGxfxI2QSk12SlP7d6c0/X
go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU=
go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU=
go.etcd.io/bbolt v1.3.5/go.mod h1:G5EMThwa9y8QZGBClrRx5EY+Yw9kAhnjy3bSjsnlVTQ=
go.etcd.io/bbolt v1.3.10 h1:+BqfJTcCzTItrop8mq/lbzL8wSGtj94UO/3U31shqG0=
go.etcd.io/bbolt v1.3.10/go.mod h1:bK3UQLPJZly7IlNmV7uVHJDxfe5aK9Ll93e/74Y9oEQ=
go.etcd.io/bbolt v1.3.11 h1:yGEzV1wPz2yVCLsD8ZAiGHhHVlczyC9d1rP43/VCRJ0=
go.etcd.io/bbolt v1.3.11/go.mod h1:dksAq7YMXoljX0xu6VF5DMZGbhYYoLUalEiSySYAS4I=
go.etcd.io/etcd v0.0.0-20191023171146-3cf2f69b5738/go.mod h1:dnLIgRNXwCJa5e+c6mIZCrds/GIG4ncV9HhK5PX7jPg=
go.etcd.io/etcd v0.5.0-alpha.5.0.20190917205325-a14579fbfb1a/go.mod h1:dnLIgRNXwCJa5e+c6mIZCrds/GIG4ncV9HhK5PX7jPg=
go.etcd.io/etcd/api/v3 v3.5.4 h1:OHVyt3TopwtUQ2GKdd5wu3PmmipR4FTwCqoEjSyRdIc=
Expand Down
20 changes: 11 additions & 9 deletions loki-build-image/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@
# See ../docs/sources/community/maintaining/release-loki-build-image.md for instructions
# on how to publish a new build image.
ARG GO_VERSION=1.23
ARG GOLANG_BASE_IMAGE=golang:${GO_VERSION}-bullseye

# Install helm (https://helm.sh/) and helm-docs (https://github.com/norwoodj/helm-docs) for generating Helm Chart reference.
FROM golang:${GO_VERSION}-bookworm AS helm
FROM ${GOLANG_BASE_IMAGE} AS helm
ARG TARGETARCH
ARG HELM_VER="v3.2.3"
RUN curl -L "https://get.helm.sh/helm-${HELM_VER}-linux-$TARGETARCH.tar.gz" | tar zx && \
Expand Down Expand Up @@ -38,7 +40,7 @@ RUN apk add --no-cache curl && \
FROM alpine:3.20.3 AS docker
RUN apk add --no-cache docker-cli docker-cli-buildx

FROM golang:${GO_VERSION}-bookworm AS drone
FROM ${GOLANG_BASE_IMAGE} AS drone
ARG TARGETARCH
RUN curl -L "https://github.com/drone/drone-cli/releases/download/v1.7.0/drone_linux_$TARGETARCH".tar.gz | tar zx && \
install -t /usr/local/bin drone
Expand All @@ -48,35 +50,35 @@ RUN curl -L "https://github.com/drone/drone-cli/releases/download/v1.7.0/drone_l
# Error:
# github.com/fatih/faillint@v1.5.0 requires golang.org/x/tools@v0.0.0-20200207224406-61798d64f025
# (not golang.org/x/tools@v0.0.0-20190918214920-58d531046acd from golang.org/x/tools/cmd/goyacc@58d531046acdc757f177387bc1725bfa79895d69)
FROM golang:${GO_VERSION}-bookworm AS faillint
FROM ${GOLANG_BASE_IMAGE} AS faillint
RUN GO111MODULE=on go install github.com/fatih/faillint@v1.12.0
RUN GO111MODULE=on go install golang.org/x/tools/cmd/goimports@v0.7.0

FROM golang:${GO_VERSION}-bookworm AS delve
FROM ${GOLANG_BASE_IMAGE} AS delve
RUN GO111MODULE=on go install github.com/go-delve/delve/cmd/dlv@latest

# Install ghr used to push binaries and template the release
# This collides with the version of go tools used in the base image, thus we install it in its own image and copy it over.
FROM golang:${GO_VERSION}-bookworm AS ghr
FROM ${GOLANG_BASE_IMAGE} AS ghr
RUN GO111MODULE=on go install github.com/tcnksm/ghr@9349474

# Install nfpm (https://nfpm.goreleaser.com) for creating .deb and .rpm packages.
FROM golang:${GO_VERSION}-bookworm AS nfpm
FROM ${GOLANG_BASE_IMAGE} AS nfpm
RUN GO111MODULE=on go install github.com/goreleaser/nfpm/v2/cmd/nfpm@v2.11.3

# Install gotestsum
FROM golang:${GO_VERSION}-bookworm AS gotestsum
FROM ${GOLANG_BASE_IMAGE} AS gotestsum
RUN GO111MODULE=on go install gotest.tools/gotestsum@v1.8.2

# Install tools used to compile jsonnet.
FROM golang:${GO_VERSION}-bookworm AS jsonnet
FROM ${GOLANG_BASE_IMAGE} AS jsonnet
RUN GO111MODULE=on go install github.com/jsonnet-bundler/jsonnet-bundler/cmd/jb@v0.5.1
RUN GO111MODULE=on go install github.com/monitoring-mixins/mixtool/cmd/mixtool@16dc166166d91e93475b86b9355a4faed2400c18
RUN GO111MODULE=on go install github.com/google/go-jsonnet/cmd/jsonnet@v0.20.0

FROM aquasec/trivy AS trivy

FROM golang:${GO_VERSION}-bookworm
FROM ${GOLANG_BASE_IMAGE}
RUN apt-get update && \
apt-get install -qy \
musl gnupg ragel \
Expand Down
4 changes: 2 additions & 2 deletions pkg/querier/queryrange/queryrangebase/queryrange.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions pkg/querier/stats/stats.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions pkg/ruler/base/ruler.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions pkg/ruler/rulespb/rules.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit e096f38

Please sign in to comment.