Skip to content

Use 0.28.1 build image and update go and alpine versions #8583

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 19 commits into from
Feb 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 20 additions & 20 deletions .drone/drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,14 +93,14 @@ steps:
depends_on:
- clone
environment: {}
image: grafana/loki-build-image:0.27.1
image: grafana/loki-build-image:0.28.1
name: check-drone-drift
- commands:
- make BUILD_IN_CONTAINER=false check-generated-files
depends_on:
- clone
environment: {}
image: grafana/loki-build-image:0.27.1
image: grafana/loki-build-image:0.28.1
name: check-generated-files
- commands:
- cd ..
Expand All @@ -110,7 +110,7 @@ steps:
depends_on:
- clone
environment: {}
image: grafana/loki-build-image:0.27.1
image: grafana/loki-build-image:0.28.1
name: clone-target-branch
when:
event:
Expand All @@ -121,15 +121,15 @@ steps:
- clone-target-branch
- check-generated-files
environment: {}
image: grafana/loki-build-image:0.27.1
image: grafana/loki-build-image:0.28.1
name: test
- commands:
- cd ../loki-target-branch
- BUILD_IN_CONTAINER=false make test
depends_on:
- clone-target-branch
environment: {}
image: grafana/loki-build-image:0.27.1
image: grafana/loki-build-image:0.28.1
name: test-target-branch
when:
event:
Expand All @@ -142,7 +142,7 @@ steps:
- test
- test-target-branch
environment: {}
image: grafana/loki-build-image:0.27.1
image: grafana/loki-build-image:0.28.1
name: compare-coverage
when:
event:
Expand All @@ -160,7 +160,7 @@ steps:
TOKEN:
from_secret: github_token
USER: grafanabot
image: grafana/loki-build-image:0.27.1
image: grafana/loki-build-image:0.28.1
name: report-coverage
when:
event:
Expand All @@ -170,15 +170,15 @@ steps:
depends_on:
- check-generated-files
environment: {}
image: grafana/loki-build-image:0.27.1
image: grafana/loki-build-image:0.28.1
name: lint
- commands:
- make BUILD_IN_CONTAINER=false check-mod
depends_on:
- test
- lint
environment: {}
image: grafana/loki-build-image:0.27.1
image: grafana/loki-build-image:0.28.1
name: check-mod
- commands:
- apk add make bash && make lint-scripts
Expand All @@ -189,28 +189,28 @@ steps:
depends_on:
- check-generated-files
environment: {}
image: grafana/loki-build-image:0.27.1
image: grafana/loki-build-image:0.28.1
name: loki
- commands:
- make BUILD_IN_CONTAINER=false check-doc
depends_on:
- loki
environment: {}
image: grafana/loki-build-image:0.27.1
image: grafana/loki-build-image:0.28.1
name: check-doc
- commands:
- make BUILD_IN_CONTAINER=false validate-example-configs
depends_on:
- loki
environment: {}
image: grafana/loki-build-image:0.27.1
image: grafana/loki-build-image:0.28.1
name: validate-example-configs
- commands:
- make BUILD_IN_CONTAINER=false check-example-config-doc
depends_on:
- clone
environment: {}
image: grafana/loki-build-image:0.27.1
image: grafana/loki-build-image:0.28.1
name: check-example-config-doc
- commands:
- mkdir -p /hugo/content/docs/loki/latest
Expand Down Expand Up @@ -243,7 +243,7 @@ steps:
depends_on:
- clone
environment: {}
image: grafana/loki-build-image:0.27.1
image: grafana/loki-build-image:0.28.1
name: loki-mixin-check
when:
event:
Expand All @@ -268,7 +268,7 @@ steps:
depends_on:
- clone
environment: {}
image: grafana/loki-build-image:0.27.1
image: grafana/loki-build-image:0.28.1
name: documentation-helm-reference-check
trigger:
ref:
Expand Down Expand Up @@ -1370,15 +1370,15 @@ steps:
NFPM_SIGNING_KEY:
from_secret: gpg_private_key
NFPM_SIGNING_KEY_FILE: /drone/src/private-key.key
image: grafana/loki-build-image:0.27.1
image: grafana/loki-build-image:0.28.1
name: write-key
- commands:
- make BUILD_IN_CONTAINER=false packages
environment:
NFPM_PASSPHRASE:
from_secret: gpg_passphrase
NFPM_SIGNING_KEY_FILE: /drone/src/private-key.key
image: grafana/loki-build-image:0.27.1
image: grafana/loki-build-image:0.28.1
name: test packaging
- commands:
- ./tools/packaging/verify-deb-install.sh
Expand All @@ -1404,7 +1404,7 @@ steps:
NFPM_PASSPHRASE:
from_secret: gpg_passphrase
NFPM_SIGNING_KEY_FILE: /drone/src/private-key.key
image: grafana/loki-build-image:0.27.1
image: grafana/loki-build-image:0.28.1
name: publish
when:
event:
Expand Down Expand Up @@ -1438,7 +1438,7 @@ steps:
from_secret: docker_password
DOCKER_USERNAME:
from_secret: docker_username
image: grafana/loki-build-image:0.27.1
image: grafana/loki-build-image:0.28.1
name: build and push
privileged: true
volumes:
Expand Down Expand Up @@ -1675,6 +1675,6 @@ kind: secret
name: gpg_private_key
---
kind: signature
hmac: e5f127d71d3dcb4ae93d348ff2641c9639bf0372640fd398328cff25eda62a9d
hmac: 13b906ad666c4711a677e511e67a8bbfde8def0a73bc23a1dc3799953f986485

...
2 changes: 1 addition & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# options for analysis running
run:
# define go version
go: "1.19"
go: "1.20"

# default concurrency is a available CPU number
concurrency: 16
Expand Down
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,11 @@

* [8315](https://github.com/grafana/loki/pull/8315) **thepalbi** Relicense and export `pkg/ingester` WAL code to be used in Promtail's WAL.

##### Build

* [8575](https://github.com/grafana/loki/pull/8575) **MichelHollands** Update build image to go 1.20.1 and alpine 3.16.4.
* [8583](https://github.com/grafana/loki/pull/8583) **MichelHollands** Use 0.28.1 build image and update go and alpine versions.

#### Promtail

##### Enhancements
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ DOCKER_IMAGE_DIRS := $(patsubst %/Dockerfile,%,$(DOCKERFILES))
BUILD_IN_CONTAINER ?= true

# ensure you run `make drone` after changing this
BUILD_IMAGE_VERSION := 0.27.1
BUILD_IMAGE_VERSION := 0.28.1

# Docker image info
IMAGE_PREFIX ?= grafana
Expand Down
4 changes: 2 additions & 2 deletions clients/cmd/docker-driver/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ARG BUILD_IMAGE=grafana/loki-build-image:0.27.1
ARG BUILD_IMAGE=grafana/loki-build-image:0.28.1
# Directories in this file are referenced from the root of the project not this folder
# This file is intended to be called from the root like so:
# docker build -t grafana/loki -f cmd/loki/Dockerfile .
Expand All @@ -9,7 +9,7 @@ COPY . /src/loki
WORKDIR /src/loki
RUN make clean && make BUILD_IN_CONTAINER=false clients/cmd/docker-driver/docker-driver

FROM alpine:3.16.2
FROM alpine:3.16.4
RUN apk add --update --no-cache ca-certificates tzdata
COPY --from=build /src/loki/clients/cmd/docker-driver/docker-driver /bin/docker-driver
WORKDIR /bin/
Expand Down
2 changes: 1 addition & 1 deletion clients/cmd/promtail/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.19.5-bullseye as build
FROM golang:1.20.1-bullseye as build

COPY . /src/loki
WORKDIR /src/loki
Expand Down
2 changes: 1 addition & 1 deletion clients/cmd/promtail/Dockerfile.arm32
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.19.5-bullseye as build
FROM golang:1.20.1-bullseye as build

COPY . /src/loki
WORKDIR /src/loki
Expand Down
4 changes: 2 additions & 2 deletions clients/cmd/promtail/Dockerfile.cross
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
ARG BUILD_IMAGE=grafana/loki-build-image:0.27.1
ARG BUILD_IMAGE=grafana/loki-build-image:0.28.1
# Directories in this file are referenced from the root of the project not this folder
# This file is intended to be called from the root like so:
# docker build -t grafana/promtail -f clients/cmd/promtail/Dockerfile .
FROM golang:1.19.5-alpine as goenv
FROM golang:1.20.1-alpine as goenv
RUN go env GOARCH > /goarch && \
go env GOARM > /goarm

Expand Down
4 changes: 2 additions & 2 deletions clients/cmd/promtail/Dockerfile.debug
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
# This file is intended to be called from the root like so:
# docker build -t grafana/promtail -f clients/cmd/promtail/Dockerfile.debug .

FROM grafana/loki-build-image:0.27.1 as build
FROM grafana/loki-build-image:0.28.1 as build
ARG GOARCH="amd64"
COPY . /src/loki
WORKDIR /src/loki
RUN make clean && make BUILD_IN_CONTAINER=false PROMTAIL_JOURNAL_ENABLED=true promtail-debug


FROM alpine:3.16.2
FROM alpine:3.16.4
RUN apk add --update --no-cache ca-certificates tzdata
COPY --from=build /src/loki/clients/cmd/promtail/promtail-debug /usr/bin/promtail-debug
COPY --from=build /usr/bin/dlv /usr/bin/dlv
Expand Down
6 changes: 4 additions & 2 deletions clients/pkg/promtail/targets/testutils/testutils.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,18 @@ import (
"time"
)

var randomGenerator *rand.Rand

func InitRandom() {
rand.Seed(time.Now().UnixNano())
randomGenerator = rand.New(rand.NewSource(time.Now().UnixNano()))
}

var letters = []rune("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ")

func RandName() string {
b := make([]rune, 10)
for i := range b {
b[i] = letters[rand.Intn(len(letters))]
b[i] = letters[randomGenerator.Intn(len(letters))]
}
return string(b)
}
4 changes: 2 additions & 2 deletions cmd/logcli/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
FROM golang:1.19.5 as build
FROM golang:1.20.1 as build

COPY . /src/loki
WORKDIR /src/loki
RUN make clean && make BUILD_IN_CONTAINER=false logcli

FROM alpine:3.16.2
FROM alpine:3.16.4

RUN apk add --no-cache ca-certificates

Expand Down
6 changes: 3 additions & 3 deletions cmd/logql-analyzer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
FROM golang:1.19.5 as build
FROM golang:1.20.1 as build

COPY . /src/loki
WORKDIR /src/loki
RUN make clean && CGO_ENABLED=0 go build ./cmd/logql-analyzer/

FROM alpine:3.15.4
FROM alpine:3.16.4

RUN apk add --no-cache ca-certificates

COPY --from=build /src/loki/logql-analyzer /usr/bin/logql-analyzer

ENTRYPOINT [ "/usr/bin/logql-analyzer" ]
ENTRYPOINT [ "/usr/bin/logql-analyzer" ]
4 changes: 2 additions & 2 deletions cmd/loki-canary/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
FROM golang:1.19.5 as build
FROM golang:1.20.1 as build

COPY . /src/loki
WORKDIR /src/loki
RUN make clean && make BUILD_IN_CONTAINER=false loki-canary

FROM alpine:3.16.2
FROM alpine:3.16.4
RUN apk add --update --no-cache ca-certificates
COPY --from=build /src/loki/cmd/loki-canary/loki-canary /usr/bin/loki-canary
ENTRYPOINT [ "/usr/bin/loki-canary" ]
6 changes: 3 additions & 3 deletions cmd/loki-canary/Dockerfile.cross
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
ARG BUILD_IMAGE=grafana/loki-build-image:0.27.1
ARG BUILD_IMAGE=grafana/loki-build-image:0.28.1
# Directories in this file are referenced from the root of the project not this folder
# This file is intended to be called from the root like so:
# docker build -t grafana/promtail -f cmd/promtail/Dockerfile .
FROM golang:1.19.5-alpine as goenv
FROM golang:1.20.1-alpine as goenv
RUN go env GOARCH > /goarch && \
go env GOARM > /goarm

Expand All @@ -12,7 +12,7 @@ COPY . /src/loki
WORKDIR /src/loki
RUN make clean && GOARCH=$(cat /goarch) GOARM=$(cat /goarm) make BUILD_IN_CONTAINER=false loki-canary

FROM alpine:3.16.2
FROM alpine:3.16.4
RUN apk add --update --no-cache ca-certificates
COPY --from=build /src/loki/cmd/loki-canary/loki-canary /usr/bin/loki-canary
ENTRYPOINT [ "/usr/bin/loki-canary" ]
7 changes: 2 additions & 5 deletions cmd/loki/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
FROM golang:1.19.5 as build
FROM golang:1.20.1 as build

COPY . /src/loki
WORKDIR /src/loki
RUN make clean && make BUILD_IN_CONTAINER=false loki

FROM alpine:3.16.2
FROM alpine:3.16.4

RUN apk add --no-cache ca-certificates libcap

Expand All @@ -17,9 +17,6 @@ RUN mkdir -p /loki/rules && \
mkdir -p /loki/rules-temp && \
chown -R loki:loki /etc/loki /loki

# See https://github.com/grafana/loki/issues/1928
RUN [ ! -e /etc/nsswitch.conf ] && echo 'hosts: files dns' > /etc/nsswitch.conf

USER 10001
EXPOSE 3100
ENTRYPOINT [ "/usr/bin/loki" ]
Expand Down
9 changes: 3 additions & 6 deletions cmd/loki/Dockerfile.cross
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
ARG BUILD_IMAGE=grafana/loki-build-image:0.27.1
ARG BUILD_IMAGE=grafana/loki-build-image:0.28.1
# Directories in this file are referenced from the root of the project not this folder
# This file is intended to be called from the root like so:
# docker build -t grafana/loki -f cmd/loki/Dockerfile .
FROM golang:1.19.5-alpine as goenv
FROM golang:1.20.1-alpine as goenv
RUN go env GOARCH > /goarch && \
go env GOARM > /goarm

Expand All @@ -12,7 +12,7 @@ COPY . /src/loki
WORKDIR /src/loki
RUN make clean && GOARCH=$(cat /goarch) GOARM=$(cat /goarm) make BUILD_IN_CONTAINER=false loki

FROM alpine:3.16.2
FROM alpine:3.16.4

RUN apk add --no-cache ca-certificates

Expand All @@ -24,9 +24,6 @@ RUN addgroup -g 10001 -S loki && \
RUN mkdir -p /loki && \
chown -R loki:loki /etc/loki /loki

# See https://github.com/grafana/loki/issues/1928
RUN [ ! -e /etc/nsswitch.conf ] && echo 'hosts: files dns' > /etc/nsswitch.conf

USER 10001
EXPOSE 3100
ENTRYPOINT [ "/usr/bin/loki" ]
Expand Down
Loading