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

Migrate to Go modules #3418

Merged
merged 15 commits into from
Mar 10, 2020
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ update-beats: update-beats-module update
.PHONY: update-beats-module
update-beats-module:
go get -d -u $(BEATS_MODULE)@$(BEATS_VERSION)
rsync -crpv --delete $(shell go list -m -f {{.Dir}} $(BEATS_MODULE))/testing/environments testing/

##############################################################################
# Kibana synchronisation.
Expand Down
20 changes: 3 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,16 +108,7 @@ Govendor will automatically pick the files needed.

### Beats Framework Update

To update the beats framework run `make update-beats`. This will fetch the most recent version of beats from master and copy
the files which are needed for the framework part to the `_beats` directory. These are files like libbeat config files and
scripts which are used for testing or packaging.

It is recommended to keep the version of the beats framework and libbeat in sync.
To make an update of both, run:

```
make update-beats
```
To update the beats framework run `make update-beats`. This will update the Go module to the the most recent version of beats from the master branch.

To update the dependency to a specific commit or branch run command as following:

Expand All @@ -127,13 +118,8 @@ BEATS_VERSION=f240148065af94d55c5149e444482b9635801f27 make update-beats
### Go-elasticsearch client Update

It is important to keep the used [go-elasticsearch client](https://github.com/elastic/go-elasticsearch) in sync with the according major version.
We also recommend to use the latest available client for minor versions.
Since APM Server does not yet support go modules, you can update the dependency using govendor, e.g. by running:
```
git clone --branch v7.4.1 https://github.com/elastic/go-elasticsearch.git $GOPATH/src/github.com/elastic/go-elasticsearch/v7
govendor add github.com/elastic/go-elasticsearch/v7/^
mv ./vendor/github.com/elastic/go-elasticsearch/v7/LICENSE ./vendor/github.com/elastic/go-elasticsearch/
```
We also recommend to use the latest available client for minor versions. You can use
`go get -u -m github.com/elastic/go-elasticsearch/v7@7.x` to update to the latest commit on the 7.x branch.

## Packaging

Expand Down
12 changes: 7 additions & 5 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
version: '2.3'
services:
beat:
build: tests
build:
context: .
dockerfile: tests/Dockerfile
depends_on:
- proxy_dep
volumes:
- .:/go/src/github.com/elastic/apm-server/
working_dir: /go/src/github.com/elastic/apm-server
- .:/src/apm-server/
working_dir: /src/apm-server
command: make
environment:
BEAT_STRICT_PERMS: "${BEAT_STRICT_PERMS:-false}"
Expand All @@ -33,7 +35,7 @@ services:
ports:
- 9200:9200
extends:
file: ./_beats/testing/environments/${TESTING_ENVIRONMENT:-snapshot}.yml
file: ./testing/environments/${TESTING_ENVIRONMENT:-snapshot}.yml
service: elasticsearch
environment:
- "cluster.routing.allocation.disk.threshold_enabled=false"
Expand All @@ -55,7 +57,7 @@ services:
ports:
- 5601:5601
extends:
file: ./_beats/testing/environments/${TESTING_ENVIRONMENT:-snapshot}.yml
file: ./testing/environments/${TESTING_ENVIRONMENT:-snapshot}.yml
service: kibana
environment:
STATUS_ALLOWANONYMOUS: "true"
Expand Down
33 changes: 33 additions & 0 deletions testing/environments/5.x.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# This is the latest stable 5x release environment.
axw marked this conversation as resolved.
Show resolved Hide resolved

version: '2.3'
services:
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:5.6.9
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:9200"]
retries: 300
interval: 1s
environment:
- "ES_JAVA_OPTS=-Xms512m -Xmx512m"
- "network.host="
- "transport.host=127.0.0.1"
- "http.host=0.0.0.0"
- "xpack.security.enabled=false"

logstash:
image: docker.elastic.co/logstash/logstash:5.6.9
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:9600/_node/stats"]
retries: 300
interval: 1s
volumes:
- ./docker/logstash/pipeline:/usr/share/logstash/pipeline:ro
- ./docker/logstash/pki:/etc/pki:ro

kibana:
image: docker.elastic.co/kibana/kibana:5.6.9
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:5601"]
retries: 300
interval: 1s
33 changes: 33 additions & 0 deletions testing/environments/6.0.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# This is the latest 6.0 environment.

version: '2.3'
services:
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch-platinum:6.0.1
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:9200"]
retries: 300
interval: 1s
environment:
- "ES_JAVA_OPTS=-Xms512m -Xmx512m"
- "network.host="
- "transport.host=127.0.0.1"
- "http.host=0.0.0.0"
- "xpack.security.enabled=false"

logstash:
image: docker.elastic.co/logstash/logstash:6.0.1
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:9600/_node/stats"]
retries: 300
interval: 1s
volumes:
- ./docker/logstash/pipeline:/usr/share/logstash/pipeline:ro
- ./docker/logstash/pki:/etc/pki:ro

kibana:
image: docker.elastic.co/kibana/kibana:6.0.1
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:5601"]
retries: 300
interval: 1s
8 changes: 8 additions & 0 deletions testing/environments/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Basic debian file with curl, wget and nano installed to fetch files
# an update config files
FROM debian:latest
MAINTAINER Nicolas Ruflin <ruflin@elastic.co>

RUN apt-get update && \
apt-get install -y curl nano wget zip && \
apt-get clean
28 changes: 28 additions & 0 deletions testing/environments/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
ENV?=snapshot.yml
BASE_COMMAND=docker-compose -f ${ENV} -f local.yml

start:
# This is run every time to make sure the environment is up-to-date
${BASE_COMMAND} build --pull --force-rm
${BASE_COMMAND} run beat bash

stop:
${BASE_COMMAND} down -v


up:
${BASE_COMMAND} build
${BASE_COMMAND} up

up-%:
${BASE_COMMAND} build $*
${BASE_COMMAND} up $*

# Be careful using this command, as it will remove all containers and volumes of your docker-machine
clean:
docker stop $(shell docker ps -a -q)
docker rm -v $(shell docker ps -a -q)

# Tails the environment log files
logs:
${BASE_COMMAND} logs -f
85 changes: 85 additions & 0 deletions testing/environments/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
# Testing environments

These environments are intended for manual and automated testing. The docker-compose files can be combined to create the different environment.


# Manual testing

The different environments can be started with the following commands for manual testing. These environments expose ports of Elasticsearch, Logstash and Kibana on the Docker-Machine ip.

Running the environment chains the following docker-compose files together

* local.yml: Definition of ports which have to be exposed for local testing including kibana
* latest.yml: Latest version of elasticsearch, logstash, kibana
* snapshot.yml: Snapshot version of elasticsearch, logstash, kibana


## Start / Stop environment

```
make start ENV=es17-ls15-kb41.yml
```

This will start the environment and log you into the debian machine. This machine is intended for manual testing of the beats. Download the beats package or snapshot you want to test. Elasticsearch can be reached under the host `elasticsearch`, logstash under `logstash`. Make sure to update the configuration file of the beat with the specific host.

To stop an clean up the environment afterwards, make sure to run:

```
make stop ENV=es17-ls15-kb41.yml
```


## Update containers

As for testing, some default installation must be changed, access to the containers is needed. Each container has a unique name which corresponds with the service name. To access a running container of elasticsearch, run:

```
docker exec -it elasticsearch bash
```

## Access machines from external

It is useful to sometimes access the containers from a browser, especially for Kibana. Elasticsearch exposes port 9200 and Kibana 5601. Make sure no other services on your machine are already assigned to these ports. To access Kibana for example, go to the following url:

```
http://docker-machine-ip:5601/
```

Often the default address is `localhost`.


## Cleanup
In case your environment is messed up because of multiple instances still running and conflicting with each other, use the following commands to clean up. Please be aware that this will stop ALL docker containers ony our docker-machine.

```
make clean
```


## Notes

Every container has a name corresponding with the service. This requires to shut down an environment and clean it up before starting an other environment. This is intentional to prevent conflicts.


# Automated Testing

These environments are also used for integration testing in the different beats. For this, `make testsuite` by default uses the snapshot environment. To select a different environment during testing, run the following command to use the latest environment:

```
TESTING_ENVIRONMENT=latest make testsuite
```

This will run the full testsuite but with latest environments instead of snapshot.


## Defaults

By default, elasticsearch, logstash and kibana are started. These are available at all time that these environments are used. Running the environment, chains the following docker-compose flies together:

* snapshot.yml: Snapshot version of elasticsearch, logstash, kibana
* docker-compose.yml: Local beat docker-compose file


## Updating environments

If the snapshot environment is updated with a new build, all beats will automatically build with the most recent version.
20 changes: 20 additions & 0 deletions testing/environments/docker/elasticsearch/pki/ca/ca.crt
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
-----BEGIN CERTIFICATE-----
MIIDSjCCAjKgAwIBAgIVAOshUH7Va8Kh1QeA4KgLw8dI29M4MA0GCSqGSIb3DQEB
CwUAMDQxMjAwBgNVBAMTKUVsYXN0aWMgQ2VydGlmaWNhdGUgVG9vbCBBdXRvZ2Vu
ZXJhdGVkIENBMB4XDTIwMDIwNzE2MzUzMFoXDTIzMDIwNjE2MzUzMFowNDEyMDAG
A1UEAxMpRWxhc3RpYyBDZXJ0aWZpY2F0ZSBUb29sIEF1dG9nZW5lcmF0ZWQgQ0Ew
ggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCv7Oq3uE0kO5Ij41U9M7ee
xOtprdA3joR68B32/SQ1FW9Igk3f/DTn8MqlAFexwzGAONPNIcj44W9KhVeT9aFA
qCKfS2no+V9aKds6wyEHY3sAmYICEHBMDor9KhPnIc8m/gl3TcGMKmouoHqFPNKE
irilBDUO7rs5w46lcbxJrHTlEA6xyQLT7+sJ4DswO/xeoemPTBa7vzkoVUyZ50/D
VSUulY4XtmQvmbe4Aa0p8sgLNzFAJRl3XqZMECwO2iJ9jFwKCUT4EbFW4aTQtylI
CBax+Cn79vKpp3gO1WVu1cdcQW3+ciAJyUydTsCA2zjGYZyzL84z7eCHW946WQWD
AgMBAAGjUzBRMB0GA1UdDgQWBBQZKfuW0o2yabRo9tosWldK43GDbjAfBgNVHSME
GDAWgBQZKfuW0o2yabRo9tosWldK43GDbjAPBgNVHRMBAf8EBTADAQH/MA0GCSqG
SIb3DQEBCwUAA4IBAQAHeIJPwxvHTismlbFJKcCM3kr/ZblXguiFTmhqylqa8wFI
ke1xpTUrdfTAkD0ohmtPAUMPBkHeyHKzvxK7Blh230/lxybJNVSpfp7FQvj1EsmW
7FbIsKoj9MwJ2Lg5h6rnFA4t0bL3q74HV+vqpMoJDe92uX0GaSH/iYb+BfZ2El8m
QfANac0O+TE70i0++v/BzUAkqhJB3pG/3ziPzdFWlXf4iUG0YhMG4Ig5P/SvGz/V
MNc+uq3bh9xsNrtcm2S/pVdt/gdsujg9MTaoOr+maJPB/+LBrkZWtZcbUe++1+Z7
32exp0eKNA0i90cc/Ayr79MOFDxdgI7baBnLPPa8
-----END CERTIFICATE-----
27 changes: 27 additions & 0 deletions testing/environments/docker/elasticsearch/pki/ca/ca.key
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
-----BEGIN RSA PRIVATE KEY-----
MIIEpQIBAAKCAQEAr+zqt7hNJDuSI+NVPTO3nsTraa3QN46EevAd9v0kNRVvSIJN
3/w05/DKpQBXscMxgDjTzSHI+OFvSoVXk/WhQKgin0tp6PlfWinbOsMhB2N7AJmC
AhBwTA6K/SoT5yHPJv4Jd03BjCpqLqB6hTzShIq4pQQ1Du67OcOOpXG8Sax05RAO
sckC0+/rCeA7MDv8XqHpj0wWu785KFVMmedPw1UlLpWOF7ZkL5m3uAGtKfLICzcx
QCUZd16mTBAsDtoifYxcCglE+BGxVuGk0LcpSAgWsfgp+/byqad4DtVlbtXHXEFt
/nIgCclMnU7AgNs4xmGcsy/OM+3gh1veOlkFgwIDAQABAoIBAALZzfvoKqfZp0aZ
mnoBaopSGpZ90I/16UOsvG+SLpIFpOYB5o0ooxrXFhGSbdldlmHDifsa/wy5anpE
quSk6FYJ43W9XRv/XoIxh3HuU4yxGf8qfabW6VryKWJs2iG2tIqnNzQNuIMy9MGI
rDOYhrjLHq7d4JY7XCFVf+xCaZCwCb3yvZwVnrAqmPoeg2FrXmCVzqr1IpmwzJ0B
OfGWzi5THLm4/aGVUBfkvGURxsmwo3jGn0myr9oUkKczOKGEqvnlVuT9+ShURZp2
tDU8zVRF0ksUNogUSfSNgWwpCYNBIqPOdxr7nT0+NEJ7b4R7/3LXEh/tRcuRNX+d
mjUMwbECgYEA/1MWpTdB9+9M7wyQasd29m1b0mkw+Jebdw+CuIK3XdPPGOfD17WO
sKZek3uK24DFGzRQf8tzHqzGvHncykAhb3oePVbfuhE5jt9bfgAOX8Naz6AK6Dmj
6+pJgXFTTNGL8JDojsIlabq4QH7oB02HoQ87GTr8IF4CjlJCHcyVB98CgYEAsGQO
uz0A1HdeuzbOP0+E86Ip03gcq66mVibXpy2qdMwEluxARW52XPKc8LKKI0QS4Qxk
giHHTQwPTLXJW9gM8v9/SQupQ/Vx8Zi3KjQ2ZAQoj6bGyDJ1P278GePJC4b0h/vG
F0sSUsmoEUGrLtq8Ofv3hDF6Ik247MQFi7i+Bt0CgYEAgP0kAqGw9SXzEw2g5CET
C5nh+qHj+KL3CqZOXxLCumcoSCfGe/KgPMRAIXgXhZ8/dOfwBy/sX8HfwRY7of3W
JnBmWIzMCD9tea2DlltG58BU33G2MO31z1iUfA2ZjMSMUyOSKZURu6F2Njcm15Gm
hIqiS7PN7jgwSGBsQIu7ercCgYEAh/nKJWrkbeVLgLTCD6okSpAzABLyvyJWlclB
q12Xrovr6dBbx2pdEk/wzdhEhuUeTKB6Bps1gV6PmMn2XLfTW6u8GrpDlODsIptg
b8dqOnW+MucVDBVhrzHGY8rmG93AOefMD/7ONEXCKvNdnDQAsA5eA2kExtb1fIer
4sbarn0CgYEAl1av+NOVduN1KrJXuZnNeN4KeNoYqJOS4s14Wk37GIujsrcE/m18
BhZk0Al/oKZIDSuya5GGRhT+ndD8OWc4DEMWk2JnJdWKh20FfeM6UXVI46Sq3Won
vPDB6GYr45uRgtLvYeitLpXE5s9GmH8GyIV9om3TvDiceMXd/LbCodY=
-----END RSA PRIVATE KEY-----
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
-----BEGIN CERTIFICATE-----
MIIDKjCCAhKgAwIBAgIUZWu3nanhrFaNe6kMhtsPM4neUCYwDQYJKoZIhvcNAQEL
BQAwNDEyMDAGA1UEAxMpRWxhc3RpYyBDZXJ0aW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IZGQ3DyKQC0tCMu+LnPxYYcpUCgYEAi9E2nfLgAVjheqR0k1GG
M8z5KRjyI+PtASqXkDiaH49DYIUe6LaNGkifC+EDN0MptwqlW3YGXwvi+8kiaB4i
OLyOiKTu11JOUaQYM7hvkBssMPHX/O8rtuz0U78+FvysO9zSXq85RILvW5mgKBz8
qyAE632sv+TXYXuEJa8VrBECgYEAmAmh6aSh7aDPPc90NJ6R7pMgAjKy1Z4a48JN
qBBNYazWkfNx3Cq/GDIb+9R3Tc3D9KD2LNNzPqMpyvevkI1BboSWdQ0i9l3s/w3l
zJnYGvQk0DAhlKu1i22icac4NpDsreWWbZZ34Jliq5CZEXgo2pBDPhVTDc2iHLmw
uWZCLA0CgYAG99zukAD9iq2MyGiyuJ8dYU0dDvyaKcSkM3pfsgA4TpSlZljDKnAH
1VVPGB3pOHUYbcxsD2/1AJBlplvq8OVcrURuSXYl9PtwczJBgfSNNtSkHvMirWzo
q7eEeYCCs/VZUr9mY0nuzysq3ltiBW6tsdCn6d89ogs2WvseTlHZLg==
-----END RSA PRIVATE KEY-----
4 changes: 4 additions & 0 deletions testing/environments/docker/elasticsearch/pki/generate_pki.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
# Take the certificates and create a DER format and create a sha256 of it and encode it to base 64
# https://www.openssl.org/docs/manmaster/man1/dgst.html
openssl x509 -in ca/ca.crt -pubkey -noout | openssl pkey -pubin -outform der | openssl dgst -sha256 -binary | openssl enc -base64
26 changes: 26 additions & 0 deletions testing/environments/docker/kafka/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
FROM debian:stretch

ENV KAFKA_HOME /kafka
# The advertised host is kafka. This means it will not work if container is started locally and connected from localhost to it
ENV KAFKA_ADVERTISED_HOST kafka
ENV KAFKA_LOGS_DIR="/kafka-logs"
ENV KAFKA_VERSION 2.1.1
ENV _JAVA_OPTIONS "-Djava.net.preferIPv4Stack=true"
ENV TERM=linux

RUN apt-get update && apt-get install -y curl openjdk-8-jre-headless netcat

RUN mkdir -p ${KAFKA_LOGS_DIR} && mkdir -p ${KAFKA_HOME} && curl -s -o $INSTALL_DIR/kafka.tgz \
"http://mirror.easyname.ch/apache/kafka/${KAFKA_VERSION}/kafka_2.11-${KAFKA_VERSION}.tgz" && \
tar xzf ${INSTALL_DIR}/kafka.tgz -C ${KAFKA_HOME} --strip-components 1

ADD run.sh /run.sh
ADD healthcheck.sh /healthcheck.sh

EXPOSE 9092
EXPOSE 2181

# Healthcheck creates an empty topic foo. As soon as a topic is created, it assumes broke is available
HEALTHCHECK --interval=1s --retries=600 CMD /healthcheck.sh

ENTRYPOINT ["/run.sh"]
Loading