-
Notifications
You must be signed in to change notification settings - Fork 761
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 modules] migrating to go modules #1052
Conversation
99593a8
to
ecbaf46
Compare
.travis.yml
Outdated
@@ -1,20 +1,13 @@ | |||
language: go | |||
|
|||
go: | |||
- '1.11.1' | |||
- '1.11.13' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why did you change the Go 1.11.x version?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't commented it, but because of golang/go#30446
1.11.4 would probably have fixed it but well, latest version cannot hurt.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Gotcha. I was taking this change to mean that the lowest version of Go now supported is 1.11.13.
What do you think of including '1.11.4' as the first build target and mentioning in the docs that's it the minimum supported version? Then adding '1.11.x' and '1.12.x' for the latest version of both of those?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, let's use > 1.11.4.
1.11 will be removed soon I guess since PBS supports only the last 2 Go versions (your PR is on its way for 1.13 #1058 :))
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, that's a very good point.
Makefile
Outdated
install: | ||
export DEP_RELEASE_TAG=v0.4.1 | ||
curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh | ||
|
||
# deps will clean out the vendor directory and use dep for a fresh install |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please update comment to reference go modules
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oups, Sure !
ENV CGO_ENABLED 0 | ||
COPY ./ ./ | ||
RUN dep ensure && \ | ||
go build . | ||
RUN go build -mod=vendor . |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do you recommend using the vendor directory versus the default $GOPATH\pkg\mod directory?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No preferences, but IMO modules allowing to work outside of the GOPATH is one of the best features, so just wanted to take this opportunity :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not opposed :), was just curious if you ran into an issue specific to building the Docker container. I like that it allows for a more targeted cache clean by the deps command.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So it's ok for you this way? Also, I might introduce in another PR later a GOPROXY for modules to speed up the build.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. I don't see a problem with it.
The proxy sounds interesting. I'm curious to see what that looks like.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @SyntaxNode , here you go for the proxy: #1079 :)
ecbaf46
to
7692413
Compare
7692413
to
fbafacb
Compare
Thanks @SyntaxNode :) |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
@@ -18,20 +18,15 @@ For more information, see: | |||
|
|||
## Installation | |||
|
|||
First install [Go 1.11](https://golang.org/doc/install) or later and [dep](https://golang.github.io/dep/docs/installation.html). Note that dep requires an explicit GOPATH to be set. | |||
First install [Go 1.11](https://golang.org/doc/install) latest version (1.11.4) or later. | |||
Note that prebid-server is using [Go modules](https://blog.golang.org/using-go-modules). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should probably add a note here to set GO111MODULE=on
if you're using Go version <1.13 and are inside GOPATH
. We can remove that after we stop supporting Go versions <1.13
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes ! I'll do :)
@echo " test: test prebid-server (via validate.sh)" | ||
@echo " build: build prebid-server" | ||
@echo " image: build docker image" | ||
@echo "" | ||
|
||
.PHONY: install deps test build image |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any reason for removing the PHONY
targets? Generally, it is recommended that any target in the makefile
that doesn't result into an actual file with the same name should be listed as a PHONY
target.
More info about PHONY
targets: https://www.gnu.org/software/make/manual/html_node/Phony-Targets.html
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, you are right, I just wanted to remove the deps part :)
0260fee
to
88be9cf
Compare
Dockerfile
Outdated
COPY static static/ | ||
COPY stored_requests/data stored_requests/data | ||
RUN apt-get update && \ | ||
apt-get install -y ca-certificates mtr && \ | ||
apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, I didn't catch this earlier but any reason to remove the ca-certificates
and mtr
package installation? I am not a 100% sure if we even need it in the first place. Likely not and therefore this should be fine but I just wanna confirm. Also, we should still at least keep the apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
clean up command.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM otherwise. Thanks @benjaminch :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No worries, let's keep it all then, no real reasons here :)
88be9cf
to
012f7f8
Compare
This CL migrates prebid-server to Go Modules getting rid of `dep`. Issue: prebid#998
012f7f8
to
9e5aa39
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for this @benjaminch :)
Thanks a lot @mansinahar and @SyntaxNode :) |
This CL migrates prebid-server to Go Modules getting rid of
dep
.Issue: #998