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

PWX-27450 Migrate gomod release #2123

Closed
Closed
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
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion Dockerfile.osd-dev
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM quay.io/openstorage/osd-dev-base:1.14
FROM docker.io/openstorage/osd-dev-base:1.16
MAINTAINER [email protected]

EXPOSE 9005
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile.osd-dev-base
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.14
FROM golang:1.17
MAINTAINER [email protected]

EXPOSE 9005
Expand All @@ -13,7 +13,7 @@ RUN \
curl -sSL https://get.docker.com/builds/Linux/x86_64/docker-1.10.3 -o /bin/docker && \
chmod +x /bin/docker

RUN go get -u \
RUN GO111MODULE=off go get -u \
golang.org/x/lint/golint \
github.com/kisielk/errcheck \
github.com/golang/protobuf/protoc-gen-go \
Expand Down
12 changes: 6 additions & 6 deletions Dockerfile.proto
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ RUN apt-get -y -qq install \
git
RUN pip3 install virtualenv
RUN gem install grpc && gem install grpc-tools
RUN go get -u github.com/golang/protobuf/protoc-gen-go && \
RUN GO111MODULE=off go get -u github.com/golang/protobuf/protoc-gen-go && \
go get -u github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger && \
go get -u github.com/grpc-ecosystem/grpc-gateway/protoc-gen-grpc-gateway
GO111MODULE=off go get -u github.com/grpc-ecosystem/grpc-gateway/protoc-gen-grpc-gateway

# Lock protoc-gen-go version to v1.1.0.
#
Expand All @@ -37,7 +37,7 @@ RUN go get -u github.com/golang/protobuf/protoc-gen-go && \
# Which may apply to project depending on OpenStorage.
#
WORKDIR /go/src/github.com/golang/protobuf
RUN git checkout v1.1.0 && go install github.com/golang/protobuf/protoc-gen-go
RUN git checkout v1.5.2 && go install github.com/golang/protobuf/protoc-gen-go@v1.5.2


# Lock protoc-gen-swagger to v1.4.1
Expand All @@ -46,11 +46,11 @@ RUN git checkout v1.1.0 && go install github.com/golang/protobuf/protoc-gen-go
#
WORKDIR /go/src/github.com/grpc-ecosystem/grpc-gateway
RUN git checkout v1.4.1 && \
go install github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger && \
go install github.com/grpc-ecosystem/grpc-gateway/protoc-gen-grpc-gateway
go install github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger@v1.16.0 && \
go install github.com/grpc-ecosystem/grpc-gateway/protoc-gen-grpc-gateway@v1.16.0

# Install swagger 2.0 to OpenApi 3.0 converter
RUN npm install -g swagger2openapi
# Finally, set working directory to the openstorage project
RUN mkdir -p /go/src/github.com/libopenstorage/openstorage
WORKDIR /go/src/github.com/libopenstorage/openstorage
WORKDIR /go/src/github.com/libopenstorage/openstorage
56 changes: 20 additions & 36 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,6 @@ OSDSANITY:=cmd/osd-sanity/osd-sanity
update-deps \
test-deps \
update-test-deps \
vendor-update \
vendor-without-update \
vendor \
build \
install \
Expand Down Expand Up @@ -99,67 +97,54 @@ all: build $(OSDSANITY)
#
$(GOPATH)/bin/golint:
@echo "Installing missing $@ ..."
go get -u github.com/golang/lint/golint
GO111MODULE=off go get -u github.com/golang/lint/golint

$(GOPATH)/bin/errcheck:
@echo "Installing missing $@ ..."
go get -u github.com/kisielk/errcheck
GO111MODULE=off go get -u github.com/kisielk/errcheck

$(GOPATH)/bin/protoc-gen-go:
@echo "Installing missing $@ ..."
go get -u github.com/golang/protobuf/protoc-gen-go
GO111MODULE=off go get -u github.com/golang/protobuf/protoc-gen-go

$(GOPATH)/bin/protoc-gen-grpc-gateway:
@echo "Installing missing $@ ..."
go get -u github.com/grpc-ecosystem/grpc-gateway/protoc-gen-grpc-gateway
GO111MODULE=off go get -u github.com/grpc-ecosystem/grpc-gateway/protoc-gen-grpc-gateway

$(GOPATH)/bin/protoc-gen-swagger:
@echo "Installing missing $@ ..."
go get -u github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger

$(GOPATH)/bin/govendor:
@echo "Installing missing $@ ..."
go get -u github.com/kardianos/govendor
GO111MODULE=off go get -u github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger

$(GOPATH)/bin/packr2:
@echo "Installing missing $@ ..."
go get -u github.com/gobuffalo/packr/...
GO111MODULE=off go get -u github.com/gobuffalo/packr/...

$(GOPATH)/bin/cover:
@echo "Installing missing $@ ..."
go get -u golang.org/x/tools/cmd/cover
GO111MODULE=off go get -u golang.org/x/tools/cmd/cover

$(GOPATH)/bin/gotestcover:
@echo "Installing missing $@ ..."
go get -u github.com/pierrre/gotestcover
GO111MODULE=off go get -u github.com/pierrre/gotestcover

# DEPS build rules
#

deps:
go get -d -v $(PKGS)
GO111MODULE=off go get -d -v $(PKGS)

update-deps:
go get -d -v -u -f $(PKGS)
GO111MODULE=off go get -d -v -u -f $(PKGS)

test-deps:
go get -d -v -t $(PKGS)
GO111MODULE=off go get -d -v -t $(PKGS)

update-test-deps:
go get -tags "$(TAGS)" -d -v -t -u -f $(PKGS)

vendor-update:
GOOS=linux GOARCH=amd64 go get -tags "daemon btrfs_noversion have_btrfs have_chainfs" -d -v -t -u -f $(PKGS)

vendor-without-update: $(GOPATH)/bin/govendor
rm -rf vendor
govendor init
GOOS=linux GOARCH=amd64 govendor add +external
GOOS=linux GOARCH=amd64 govendor update +vendor
GOOS=linux GOARCH=amd64 govendor add +external
GOOS=linux GOARCH=amd64 govendor update +vendor
GO111MODULE=off go get -tags "$(TAGS)" -d -v -t -u -f $(PKGS)

vendor: vendor-update vendor-without-update
vendor:
GOOS=linux GOARCH=amd64 go mod tidy
GOOS=linux GOARCH=amd64 go mod vendor

build: packr
go build -tags "$(TAGS)" $(BUILDFLAGS) $(PKGS)
Expand All @@ -181,14 +166,14 @@ docker-build-proto:
docker build -t quay.io/openstorage/osd-proto -f Dockerfile.proto .

docker-proto: $(GOPATH)/bin/protoc-gen-go
docker pull quay.io/openstorage/osd-proto:pre-gomodules
docker pull quay.io/openstorage/osd-proto
docker run \
--privileged --rm \
-v $(shell pwd):/go/src/github.com/libopenstorage/openstorage \
-e "GOPATH=/go" \
-e "DOCKER_PROTO=yes" \
-e "PATH=/bin:/usr/bin:/usr/local/bin:/go/bin:/usr/local/go/bin" \
quay.io/openstorage/osd-proto:pre-gomodules \
quay.io/openstorage/osd-proto \
make proto mockgen

proto: $(GOPATH)/bin/protoc-gen-go $(GOPATH)/bin/protoc-gen-grpc-gateway $(GOPATH)/bin/protoc-gen-swagger
Expand Down Expand Up @@ -244,7 +229,7 @@ pretest: lint vet errcheck
install-sdk-test:
ifndef HAS_SDKTEST
@echo "Installing sdk-test"
@-go get -d -u github.com/libopenstorage/sdk-test 1>/dev/null 2>&1
@-GO111MODULE=off go get -d -u github.com/libopenstorage/sdk-test 1>/dev/null 2>&1
@(cd $(GOPATH)/src/github.com/libopenstorage/sdk-test/cmd/sdk-test && make install )
endif

Expand Down Expand Up @@ -424,9 +409,8 @@ sdk-check-version:
go run tools/sdkver/sdkver.go --check-major=0 --check-minor=101

mockgen:
go get github.com/golang/mock/gomock
go get github.com/golang/mock/mockgen || echo "ignoring go get build error"
cd ${GOPATH}/src/github.com/golang/mock/mockgen && git checkout v1.2.0 && go install github.com/golang/mock/mockgen
GO111MODULE=off go get github.com/golang/mock/gomock
GO111MODULE=off go get github.com/golang/mock/mockgen
mockgen -destination=api/mock/mock_storagepool.go -package=mock github.com/libopenstorage/openstorage/api OpenStoragePoolServer,OpenStoragePoolClient
mockgen -destination=api/mock/mock_cluster.go -package=mock github.com/libopenstorage/openstorage/api OpenStorageClusterServer,OpenStorageClusterClient
mockgen -destination=api/mock/mock_node.go -package=mock github.com/libopenstorage/openstorage/api OpenStorageNodeServer,OpenStorageNodeClient
Expand Down
Loading