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

all: update to use Go modules #811

Merged
merged 2 commits into from
Dec 21, 2020
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
43 changes: 15 additions & 28 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ version: 2.1
executors:
"previous":
docker:
- image: golang:1.12
- image: golang:1.14
"stable":
docker:
- image: golang:1.13
- image: golang:1.15

commands:
install:
Expand Down Expand Up @@ -43,44 +43,26 @@ commands:
name: protoc-gen-gogofaster
command: |
if ! [ -x $GOPATH/bin/protoc-gen-gogofaster ] ; then
go get -d -v github.com/gogo/protobuf/protoc-gen-gogofaster
cd $GOPATH/src/github.com/gogo/protobuf
git fetch
git reset --hard <<parameters.protoc_gen_gogofaster_tag>>
go install github.com/gogo/protobuf/protoc-gen-gogofaster
go get -u -v github.com/gogo/protobuf/protoc-gen-gogofaster@<<parameters.protoc_gen_gogofaster_tag>>
fi
- run:
name: gojson
command: |
if ! [ -x $GOPATH/bin/gojson ] ; then
go get -d -u github.com/ChimeraCoder/gojson/gojson
cd $GOPATH/src/github.com/ChimeraCoder/gojson
git fetch
git reset --hard <<parameters.gojson_tag>>
go install github.com/ChimeraCoder/gojson/gojson
fi
- run:
name: dep
command: |
if ! [ -x $GOPATH/bin/dep ] ; then
curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh
go get -u -v github.com/ChimeraCoder/gojson/gojson@<<parameters.gojson_tag>>
fi
- run:
name: stringer
command: |
if ! [ -x $GOPATH/bin/stringer ] ; then
go get -u -u golang.org/x/tools/cmd/stringer
cd $GOPATH/src/golang.org/x/tools/cmd/stringer
git reset --hard <<parameters.stringer_rev>>
go install
go get -u -v golang.org/x/tools/cmd/stringer
fi
- save_cache:
<<: *prereq_cache_key
paths:
- /opt/protoc
- /go/bin/protoc-gen-gogofaster
- /go/src/github.com/gogo/protobuf
- /go/bin/dep
- /go/pkg/mod/github.com/gogo/protobuf@<<parameters.protoc_gen_gogofaster_tag>>
- /go/bin/stringer
fetch_and_build_latest_go:
description: "Builds the latest version of go from source"
Expand Down Expand Up @@ -136,6 +118,8 @@ jobs:
executor:
name: stable
working_directory: /go/src/github.com/stripe/veneur
environment:
GO111MODULE: "on"
steps:
- install
- checkout
Expand All @@ -144,7 +128,6 @@ jobs:
command: |
export PATH=$PATH:/opt/protoc/bin
go generate -v
- run: "dep check"
- run:
name: "gofmt"
command: |
Expand All @@ -162,14 +145,18 @@ jobs:
executor:
name: stable
working_directory: /go/src/github.com/stripe/veneur
environment:
GO111MODULE: "on"
steps:
- checkout
- test
- checkout
- test

test_previous:
executor:
name: previous
working_directory: /go/src/github.com/stripe/veneur
environment:
GO111MODULE: "on"
steps:
- checkout
- test
Expand All @@ -179,7 +166,7 @@ jobs:
- image: golang:latest
working_directory: /go/src/github.com/stripe/veneur
environment:
GO111MODULE: auto
GO111MODULE: "on"
steps:
- fetch_and_build_latest_go
- checkout
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
* New Relic sink supporting Metrics, Events, Service Checks (as events) and Trace Spans. Thanks, [jthurman42](https://github.com/jthurman42)!

## Updated
* Migrated from dep to Go modules. Thanks, [andybons](https://github.com/andybons-stripe)!
* Updated the vendored version of DataDog/datadog-go which fixes parsing for abstract unix domain sockets in the statsd client. Thanks, [androohan](https://github.com/androohan)!
* Changed the certificates that veneur tests with to include SANs and no longer rely on Common Names, in order to comply with Go's [upcoming crackdown on CN certificate constraints](https://github.com/stripe/veneur/issues/791). Thanks, [antifuchs](https://github.com/antifuchs)!
* Disabled the dogstatsd client telemetry on the internal statsd client used by Veneur. Thanks, [prudhvi](https://github.com/prudhvi)!
Expand Down
26 changes: 8 additions & 18 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,33 +1,24 @@
# For running Veneur under Docker, you probably want either the pre-built images
# published at https://hub.docker.com/r/stripe/veneur/
# or the Dockerfiles in https://github.com/stripe/veneur/tree/master/public-docker-images
FROM golang:1.14
MAINTAINER The Stripe Observability Team <[email protected]>
FROM golang:1.15
LABEL maintainer="The Stripe Observability Team <[email protected]>"

RUN mkdir -p /build
ENV GOPATH=/go
ENV GO111MODULE=on
RUN apt-get update
RUN apt-get install -y zip
RUN go get -u -v github.com/ChimeraCoder/gojson/gojson
RUN go get -d -v github.com/gogo/protobuf/protoc-gen-gogofaster
WORKDIR /go/src/github.com/gogo/protobuf
RUN git fetch
RUN git checkout v1.2.1
RUN go install github.com/gogo/protobuf/protoc-gen-gogofaster
WORKDIR /go
RUN curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh
RUN go get -u -v github.com/gogo/protobuf/[email protected]
RUN go get -u -v golang.org/x/tools/cmd/stringer
WORKDIR /go/src/golang.org/x/tools/cmd/stringer
RUN git checkout d11f6ec946130207fd66b479a9a6def585b5110b
RUN go install
WORKDIR /go
WORKDIR /protoc
RUN wget https://github.com/google/protobuf/releases/download/v3.1.0/protoc-3.1.0-linux-x86_64.zip
RUN unzip protoc-3.1.0-linux-x86_64.zip
RUN cp bin/protoc /usr/bin/protoc
RUN chmod 777 /usr/bin/protoc

WORKDIR /go/src/github.com/stripe/veneur
ADD . /go/src/github.com/stripe/veneur
WORKDIR /veneur
ADD . /veneur

# If running locally, ignore any changes since
# the last commit
Expand All @@ -38,7 +29,6 @@ RUN git reset --hard HEAD && git status
# because we are guaranteed only one version of Go
# used to build protoc-gen-go
RUN go generate
RUN dep check
# Exclude vendor from gofmt checks.
RUN mv vendor ../ && gofmt -w . && mv ../vendor .

Expand All @@ -58,6 +48,6 @@ RUN git add .
RUN git diff --cached
RUN git diff-index --cached --exit-code HEAD


RUN mkdir -p /build
RUN go test -race -v -timeout 60s -ldflags "-X github.com/stripe/veneur.VERSION=$(git rev-parse HEAD) -X github.com/stripe/veneur.BUILD_DATE=$(date +%s)" ./...
CMD cp -r henson /build/ && env GOBIN=/build go install -a -v -ldflags "-X github.com/stripe/veneur.VERSION=$(git rev-parse HEAD) -X github.com/stripe/veneur.BUILD_DATE=$(date +%s)" ./cmd/...
Loading