Document/improve Tilt setup with local version of apm-data
- Dominant language
- Go
- Stars
- 1.3k
- Forks
- 543
- Avg merge
- 1d 18h
- Merged PRs (30d)
- 109
Description
When working on a local version of apm-data, as documented in the [apm-data documentation](https://github.com/elastic/apm-data/blob/main/dev_docs/HOW_TO.md#2-make-changes-in-apm-server), we need to make the build use a local copy of apm-data with a command similar to:
```
go mod edit -replace=github.com/elastic/apm-data=/path/to/your/apm-data
```
While this works well for a local build of `apm-server`, this won't work with Tilt setup which provides a very convenient end-to-end setup and makes every agent developer a "10x engineer".
Because the `apm-data` build happens within Docker, we need to have `/path/to/your/apm-data` to be within a subfolder of the `apm-server` repository.
In order to make this work, I had to do the following:
- within `apm-server` root folder, clone a copy of `apm-data`
- add `replace github.com/elastic/apm-data => ./apm-data` to `go.mod` (equivalent to the `go mod edit -replace` above)
- add `COPY apm-data/ /src/apm-data` just after `COPY go.mod go.sum /src/` within `packaging/docker/Dockerfile`
I think we should attempt to address the following points, and fallback to document this
- the `apm-data` repository is often cloned next to `apm-server`, not as a direct subfolder (minor, but could be annoying)
- we need to modify the Dockerfile to make this work, otherwise the build will fail as the dockerized build can't access a folder above `apm-server`
Contributor guide
Research direction
Read the apm-data HOW_TO.md section linked in the issue, then inspect go.mod and packaging/docker/Dockerfile alongside the local Tilt setup. Compare support for an apm-data checkout nested under apm-server with the documented sibling checkout, and verify the end-to-end Dockerized build. Done means either the local setup works without manual Dockerfile changes or the fallback procedure is documented clearly.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker, go
- Domain
- build-system, devops, documentation
- Issue type
- Documentation
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100