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

Convert to Go modules #1178

Merged
merged 2 commits into from
Nov 30, 2018
Merged

Convert to Go modules #1178

merged 2 commits into from
Nov 30, 2018

Conversation

SuperQ
Copy link
Member

@SuperQ SuperQ commented Nov 29, 2018

  • Update promu config.
  • Convert to Go modules.
  • Update vendoring.
  • Update Makefile.common.
  • Update circleci config.

Signed-off-by: Ben Kochie [email protected]

@SuperQ SuperQ requested a review from simonpasquier November 29, 2018 11:16
@SuperQ SuperQ force-pushed the bjk/go_mod branch 2 times, most recently from 9f069a6 to 329f84b Compare November 29, 2018 11:30
go.mod Outdated Show resolved Hide resolved
@simonpasquier
Copy link
Member

IIUC go get github.com/prometheus/prometheus/cmd/promtool fails because the promtool program is inside a subdirectory of a Go module. Not sure why exactly but I can reproduce the same locally. Also in a Go modules world, go get adds a dependency to go.mod. There are several reports about this upstream (golang/go#27643, golang/go#24250). Also go get ... can't be run outside of a module when in module mode (eg outside GOPATH). I see 2 options for now:

  • go get in a temporary directory like here.
  • extract promtool from a release tarball.

* Update promu config.
* Convert to Go modules.
* Update vendoring.
* Update Makefile.common.
* Update circleci config.
* Use Prometheus release tar for promtool.

Signed-off-by: Ben Kochie <[email protected]>
@SuperQ
Copy link
Member Author

SuperQ commented Nov 29, 2018

Looks like the buildkite setup is not upgraded to Go 1.11.

@SuperQ
Copy link
Member Author

SuperQ commented Nov 29, 2018

@derekmarcotte Any chance you can upgrade Go to the latest release?

@derekmarcotte
Copy link
Contributor

Running this now: prometheus-community/kitefactory@f7dd3ba

Will take a bit to apply to each of the hosts, ppc64le in particular.

@derekmarcotte
Copy link
Contributor

@SuperQ the builders are up and running on the latest release. ppc64le is still building the smoke-test build, but looks like it'll go. I'd advise reviewing the latest build against this branch output. The BSD failures can be fixed by changing your fetch command from:

curl -s -L https://github.com/prometheus/promu/releases/download/v0.2.0/promu-0.2.0.linux-ppc64le.tar.gz | tar -xvz -C /tmp

to:

curl -s -L https://github.com/prometheus/promu/releases/download/v0.2.0/promu-0.2.0.linux-ppc64le.tar.gz | tar -xvzf - -C /tmp

They are trying to use the tape device to unpack.

Additionally, it would seem that this will clobber parallel builds on the same machine too (namespace collision on /tmp/). mktemp -d should help there - but perhaps I'm missing something?

@SuperQ
Copy link
Member Author

SuperQ commented Nov 30, 2018

@derekmarcotte Yea, we should add a mktmp for safety.

@SuperQ
Copy link
Member Author

SuperQ commented Nov 30, 2018

@simonpasquier It looks like we have build issues on FreeBSD due to the go mod tidy check. Due to platform differences, it doesn't like the vendoring. Any ideas?

@SuperQ SuperQ force-pushed the bjk/go_mod branch 2 times, most recently from 941ef2d to f668a63 Compare November 30, 2018 08:19
* Use temp dir for unpacking tools.
* Use BSD compatible tar command.
* OpenBSD mkdir doesn't support `-v`.

Signed-off-by: Ben Kochie <[email protected]>
@SuperQ
Copy link
Member Author

SuperQ commented Nov 30, 2018

Ok, I fixed up FreeBSD by removing the unused step from the pipeline. OpenBSD still seems to be on an old Go version.

@derekmarcotte
Copy link
Contributor

It was a PATH thing on OpenBSD. I've added the PATH to the environment, and it's building now.

@derekmarcotte
Copy link
Contributor

It seems the ppc64le build errors are transient and network related. I've done a few make staticchecks on the 1290 build and sometimes they fail, sometimes they pass, e.g.:

go: golang.org/x/[email protected]: unrecognized import path "golang.org/x/crypto" (https fetch: Get https://golang.org/x/crypto?go-get=1: net/http: TLS handshake timeout)
go: golang.org/x/[email protected]: unrecognized import path "golang.org/x/net" (https fetch: Get https://golang.org/x/net?go-get=1: net/http: TLS handshake timeout)
go: gopkg.in/alecthomas/[email protected]: unrecognized import path "gopkg.in/alecthomas/kingpin.v2" (https fetch: Get https://gopkg.in/alecthomas/kingpin.v2?go-get=1: net/http: TLS handshake timeout)
...
go: golang.org/x/[email protected]: git fetch -f origin refs/heads/*:refs/heads/* refs/tags/*:refs/tags/* in /home/peon/go/pkg/mod/cache/vcs/76a8992ccba6d77c6bcf031ff2b6d821cf232e4ad8d1f2362404fbd0a798d846: exit status 128:
        fatal: unable to access 'https://go.googlesource.com/sys/': gnutls_handshake() failed: The TLS connection was non-properly terminated
...
go: error loading module requirements```

@SuperQ
Copy link
Member Author

SuperQ commented Nov 30, 2018

@derekmarcotte Thanks!

@SuperQ
Copy link
Member Author

SuperQ commented Nov 30, 2018

@derekmarcotte I still can't get Debian to pass :-(

@SuperQ
Copy link
Member Author

SuperQ commented Nov 30, 2018

I reduced the buildkite builds to only do preflight, build, and test. We do the other checks in CircleCI so there's no need to do the others in buildkite.

Copy link
Member

@simonpasquier simonpasquier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@SuperQ
Copy link
Member Author

SuperQ commented Nov 30, 2018

Ok, the buildkite is passing, but I was messing around with the settings and broke the callback.

@SuperQ SuperQ merged commit becca12 into master Nov 30, 2018
@SuperQ SuperQ deleted the bjk/go_mod branch November 30, 2018 13:01
SuperQ added a commit that referenced this pull request Nov 30, 2018
* Convert to Go modules

* Update promu config.
* Convert to Go modules.
* Update vendoring.
* Update Makefile.common.
* Update circleci config.
* Use Prometheus release tar for promtool.
* Fixup unpack

* Use temp dir for unpacking tools.
* Use BSD compatible tar command.
* OpenBSD mkdir doesn't support `-v`.

Signed-off-by: Ben Kochie <[email protected]>
SuperQ added a commit that referenced this pull request Nov 30, 2018
* Convert to Go modules

* Update promu config.
* Convert to Go modules.
* Update vendoring.
* Update Makefile.common.
* Update circleci config.
* Use Prometheus release tar for promtool.
* Fixup unpack

* Use temp dir for unpacking tools.
* Use BSD compatible tar command.
* OpenBSD mkdir doesn't support `-v`.

Signed-off-by: Ben Kochie <[email protected]>
oblitorum pushed a commit to shatteredsilicon/node_exporter that referenced this pull request Apr 9, 2024
* Convert to Go modules

* Update promu config.
* Convert to Go modules.
* Update vendoring.
* Update Makefile.common.
* Update circleci config.
* Use Prometheus release tar for promtool.
* Fixup unpack

* Use temp dir for unpacking tools.
* Use BSD compatible tar command.
* OpenBSD mkdir doesn't support `-v`.

Signed-off-by: Ben Kochie <[email protected]>
oblitorum pushed a commit to shatteredsilicon/node_exporter that referenced this pull request Apr 9, 2024
* Convert to Go modules

* Update promu config.
* Convert to Go modules.
* Update vendoring.
* Update Makefile.common.
* Update circleci config.
* Use Prometheus release tar for promtool.
* Fixup unpack

* Use temp dir for unpacking tools.
* Use BSD compatible tar command.
* OpenBSD mkdir doesn't support `-v`.

Signed-off-by: Ben Kochie <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants