-
Notifications
You must be signed in to change notification settings - Fork 524
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
Migrate to Go modules #3418
Migrate to Go modules #3418
Conversation
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.
This is amazing work!
I tested the most important make cmds and they worked fine, except for running into the same issues as CI does for make docker-system-tests
. Will do a final review once this is solved.
@simitt thanks for taking a look. I'm working through CI issues one-by-one, I'll let you know when I think it's stable enough for reviewing again. |
crossbuild is failing to locate the
This is because in the fresh container, the module cache hasn't yet been populated. We'll need to either share the module cache from the host (might be a bit dangerous?), or otherwise seed the container's module cache before calling mage. |
elastic/beats#16837 is up to address the above issue. I went for mounting the module cache in, but made it read-only. Before starting the crossbuild containers, we run |
I lost the race with elastic/beats#16150. Will need to update to the latest API in this PR. |
- Add go.mod - Add tools.go for tracking build/test tools in go.mod - Update Makefile to use go.mod, instead of vendor - Update beats imports to use "beats/v7" - Update cespare/xxhash to use "xxhash/v2" - Copy reviewdog.yml from beats - Copy build scripts from beats/dev-tools
- Modify "update-beats" target to rsync libbeat/testing/environments into apm-server/testing/environments. We could alternatively just go our own way, but this is fairly easy to maintain for now. - Update tests/Dockerfile to remove GOPATH, and prime the container with the module dependencies by copying in "go.mod" and running "go mod download".
Handle libbeat/common/transport moves. Closes elastic#3416
Crossbuild fixes.
@simitt sorry for the force push. I should have been clearer before, that I didn't intend for anyone to look at it while it was WIP. It was non-draft so that CI would run. Should be good to review now, CI is passing. Every commit other than the first should be reviewable ;) |
TODO:
|
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.
Worked as expected locally.
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.
Great to have this!
- Add go.mod - Add tools.go for tracking build/test tools in go.mod - Update Makefile to use go.mod, instead of vendor - Update beats imports to use "beats/v7" - Update cespare/xxhash to use "xxhash/v2" - Copy reviewdog.yml from beats - Copy build scripts from beats/dev-tools - Remove vendor and _beats - Fork generate_notice.py -- needed because we do not (can not) use vendoring - Update beats framework to bbf9d6697f4a; adapt to several breaking changes in libbeat - tests/system: use "go list" to find libbeat - Modify "update-beats" target to rsync libbeat/testing/environments into apm-server/testing/environments. We could alternatively just go our own way, but this is fairly easy to maintain for now. - Update tests/Dockerfile to remove GOPATH, and prime the container with the module dependencies by copying in "go.mod" and running "go mod download".
* Migrate to Go modules (#3418) - Add go.mod - Add tools.go for tracking build/test tools in go.mod - Update Makefile to use go.mod, instead of vendor - Update beats imports to use "beats/v7" - Update cespare/xxhash to use "xxhash/v2" - Copy reviewdog.yml from beats - Copy build scripts from beats/dev-tools - Remove vendor and _beats - Fork generate_notice.py -- needed because we do not (can not) use vendoring - Update beats framework to bbf9d6697f4a; adapt to several breaking changes in libbeat - tests/system: use "go list" to find libbeat - Modify "update-beats" target to rsync libbeat/testing/environments into apm-server/testing/environments. We could alternatively just go our own way, but this is fairly easy to maintain for now. - Update tests/Dockerfile to remove GOPATH, and prime the container with the module dependencies by copying in "go.mod" and running "go mod download". * Update to elastic/beats@9735c6d51540 The eslegclient changes have not been backported to 7.x (yet?), so this commit reverts those changes.
Motivation/summary
Use Go modules instead of vendoring. Modules are the future.
There are a bunch of changes here:
vendor
and_beats
directories are removed. A couple of minor bash scripts, and the reviewdog.yml file, have been copied into our tree. They haven't been changed in a couple of years.generate_notice.py
has been forked to stop assuming vendoring. It now only considers modules that are used in the apm-server binary, and not those used for build/test purposes.Checklist
make check-full
for static code checks and linting)- [ ] I have added tests that prove my fix is effective or that my feature works- [ ] New and existing unit tests pass locally with my changes- [ ] I have updated CHANGELOG.asciidoc(no user-facing changes)How to test these changes
make
make docker-system-tests
make update-beats
Related issues