Skip to content
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

Go 1.13 #1089

Merged
merged 10 commits into from
Oct 1, 2019
Merged

Go 1.13 #1089

Show file tree
Hide file tree
Changes from 9 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
27 changes: 6 additions & 21 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,25 +20,24 @@ workflows:
jobs:
# publish jobs depend on this as well,
# thus tags need to be allowed for these
- lint: {filters: {<<: *tags}}
- test: {filters: {<<: *tags}}

- build/promtail-windows:
requires: [ lint, test ]
requires: [ test ]

- build/docker-driver:
requires: [ lint, test ]
requires: [ test ]
filters: {<<: *no-master}
- publish/docker-driver:
requires: [ lint, test ]
requires: [ test ]
filters: { <<: *tag-or-master }

- publish/binaries:
requires: [ lint, test ]
requires: [ test ]
filters: { <<: *only-tags }

- test-helm:
requires: [ lint, test ]
requires: [ test ]
filters: {<<: *tags}
- publish-helm:
requires: [ test-helm ]
Expand All @@ -48,7 +47,7 @@ workflows:
# https://circleci.com/blog/circleci-hacks-reuse-yaml-in-your-circleci-config-with-yaml/
.defaults: &defaults
docker:
- image: grafana/loki-build-image:0.6.0
- image: grafana/loki-build-image:0.7.1
working_directory: /src/loki

jobs:
Expand All @@ -60,20 +59,6 @@ jobs:
name: Unit Tests
command: make BUILD_IN_CONTAINER=false test

lint:
<<: *defaults
steps:
- checkout
- run:
name: Lint
command: make lint
- run:
name: Check Generated Files
command: make BUILD_IN_CONTAINER=false check-generated-files
- run:
name: Check Go Mod
command: make BUILD_IN_CONTAINER=false check-mod

# Promtail
build/promtail-windows:
<<: *defaults
Expand Down
10 changes: 5 additions & 5 deletions .drone/drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,27 +5,27 @@ steps:
- make BUILD_IN_CONTAINER=false test
depends_on:
- clone
image: grafana/loki-build-image:0.6.0
image: grafana/loki-build-image:0.7.1
name: test
- commands:
- make BUILD_IN_CONTAINER=false lint
depends_on:
- clone
image: grafana/loki-build-image:0.6.0
image: grafana/loki-build-image:0.7.1
name: lint
- commands:
- make BUILD_IN_CONTAINER=false check-generated-files
depends_on:
- clone
image: grafana/loki-build-image:0.6.0
image: grafana/loki-build-image:0.7.1
name: check-generated-files
- commands:
- make BUILD_IN_CONTAINER=false check-mod
depends_on:
- clone
- test
- lint
image: grafana/loki-build-image:0.6.0
image: grafana/loki-build-image:0.7.1
name: check-mod
workspace:
base: /src
Expand Down Expand Up @@ -492,7 +492,7 @@ steps:
environment:
CIRCLE_TOKEN:
from_secret: circle_token
image: grafana/loki-build-image:0.6.0
image: grafana/loki-build-image:0.7.1
name: trigger
trigger:
ref:
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Please follow the [Loki Helm Chart](./production/helm/README.md).
### Dependency management

We uses [Go modules](https://golang.org/cmd/go/#hdr-Modules__module_versions__and_more) to manage dependencies on external packages.
This requires a working Go environment with version 1.12 or greater and git installed.
This requires a working Go environment with version 1.13 or greater and git installed.

To add or update a new dependency, use the `go get` command:

Expand Down
17 changes: 16 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ IMAGE_NAMES := $(foreach dir,$(DOCKER_IMAGE_DIRS),$(patsubst %,$(IMAGE_PREFIX)%,
# make BUILD_IN_CONTAINER=false target
# or you can override this with an environment variable
BUILD_IN_CONTAINER ?= true
BUILD_IMAGE_VERSION := 0.6.0
BUILD_IMAGE_VERSION := 0.7.1

# Docker image info
IMAGE_PREFIX ?= grafana
Expand Down Expand Up @@ -474,8 +474,23 @@ drone:

# support go modules
check-mod:
ifeq ($(BUILD_IN_CONTAINER),true)
docker run \
--entrypoint "" \
-e "GO111MODULE=on" \
-e "GOPROXY=https://proxy.golang.org" \
-v ~/go/pkg/mod:/go/pkg/mod \
-v $(shell pwd):/src/loki \
$(IMAGE_PREFIX)/loki-build-image:$(BUILD_IMAGE_VERSION) \
bash -c "cd /src/loki; \
go mod download; \
go mod verify; \
go mod tidy; \
go mod vendor; "
rfratto marked this conversation as resolved.
Show resolved Hide resolved
else
GO111MODULE=on GOPROXY=https://proxy.golang.org go mod download
GO111MODULE=on GOPROXY=https://proxy.golang.org go mod verify
GO111MODULE=on GOPROXY=https://proxy.golang.org go mod tidy
GO111MODULE=on GOPROXY=https://proxy.golang.org go mod vendor
endif
@git diff --exit-code -- go.sum go.mod vendor/
2 changes: 1 addition & 1 deletion 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.6.0
ARG BUILD_IMAGE=grafana/loki-build-image:0.7.1
# Directories in this file are referenced from the root of the project not this folder
# This file is intented to be called from the root like so:
# docker build -t grafana/loki -f cmd/loki/Dockerfile .
Expand Down
2 changes: 1 addition & 1 deletion cmd/fluent-bit/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.12 as build
FROM golang:1.13 as build
COPY . /src/loki
WORKDIR /src/loki
RUN make clean && make BUILD_IN_CONTAINER=false fluent-bit-plugin
Expand Down
2 changes: 1 addition & 1 deletion cmd/loki-canary/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.12 as build
FROM golang:1.13 as build
COPY . /src/loki
WORKDIR /src/loki
RUN make clean && make BUILD_IN_CONTAINER=false loki-canary
Expand Down
2 changes: 1 addition & 1 deletion cmd/loki-canary/Dockerfile.cross
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ARG BUILD_IMAGE=grafana/loki-build-image:latest
ARG BUILD_IMAGE=grafana/loki-build-image:0.7.1
# Directories in this file are referenced from the root of the project not this folder
# This file is intented to be called from the root like so:
# docker build -t grafana/promtail -f cmd/promtail/Dockerfile .
Expand Down
2 changes: 1 addition & 1 deletion cmd/loki/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.12 as build
FROM golang:1.13 as build
COPY . /src/loki
WORKDIR /src/loki
RUN make clean && make BUILD_IN_CONTAINER=false loki
Expand Down
2 changes: 1 addition & 1 deletion cmd/loki/Dockerfile.cross
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ARG BUILD_IMAGE=grafana/loki-build-image:latest
ARG BUILD_IMAGE=grafana/loki-build-image:0.7.1
# Directories in this file are referenced from the root of the project not this folder
# This file is intented to be called from the root like so:
# docker build -t grafana/loki -f cmd/loki/Dockerfile .
Expand Down
2 changes: 1 addition & 1 deletion cmd/promtail/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.12 as build
FROM golang:1.13 as build
COPY . /src/loki
WORKDIR /src/loki
RUN apt-get update && apt-get install -qy libsystemd-dev
Expand Down
2 changes: 1 addition & 1 deletion cmd/promtail/Dockerfile.cross
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ARG BUILD_IMAGE=grafana/loki-build-image:latest
ARG BUILD_IMAGE=grafana/loki-build-image:0.7.1
# Directories in this file are referenced from the root of the project not this folder
# This file is intented to be called from the root like so:
# docker build -t grafana/promtail -f cmd/promtail/Dockerfile .
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/grafana/loki

go 1.12
go 1.13

require (
cloud.google.com/go/bigtable v1.0.0 // indirect
Expand Down
4 changes: 2 additions & 2 deletions loki-build-image/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ RUN apk add --no-cache curl && \
FROM alpine as golangci
RUN apk add --no-cache curl && \
cd / && \
curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s v1.17.1
curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s v1.19.1

FROM alpine:edge as docker
RUN apk add --no-cache docker-cli

FROM golang:1.12.9-stretch
FROM golang:1.13.1-stretch
RUN apt-get update && \
apt-get install -qy \
musl \
Expand Down
76 changes: 0 additions & 76 deletions vendor/github.com/google/btree/btree_mem.go

This file was deleted.

Loading