From f635b52df326ee3e6f7dbc19fa95afe8945d5df1 Mon Sep 17 00:00:00 2001 From: Jaime Soriano Pastor Date: Mon, 27 Jan 2020 19:25:23 +0100 Subject: [PATCH 1/5] Check HTTP response code in appsearch healthcheck --- x-pack/metricbeat/module/appsearch/_meta/Dockerfile | 5 +++-- x-pack/metricbeat/module/appsearch/docker-compose.yml | 5 ++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/x-pack/metricbeat/module/appsearch/_meta/Dockerfile b/x-pack/metricbeat/module/appsearch/_meta/Dockerfile index 88d80d0bde8..c7e12eedd18 100644 --- a/x-pack/metricbeat/module/appsearch/_meta/Dockerfile +++ b/x-pack/metricbeat/module/appsearch/_meta/Dockerfile @@ -1,6 +1,7 @@ -FROM docker.elastic.co/app-search/app-search:7.5.0 +ARG APPSEARCH_VERSION +FROM docker.elastic.co/app-search/app-search:${APPSEARCH_VERSION} COPY docker-entrypoint-dependencies.sh /usr/local/bin/ ENTRYPOINT /usr/local/bin/docker-entrypoint-dependencies.sh -HEALTHCHECK --interval=1s --retries=300 --start-period=60s CMD python -c 'import urllib, json; response = urllib.urlopen("http://myelastic:changeme@localhost:3002/swiftype-app-version"); data = json.loads(response.read()); exit(0);' +HEALTHCHECK --interval=1s --retries=300 --start-period=60s CMD python -c 'import urllib, json; response = urllib.urlopen("http://myelastic:changeme@localhost:3002/api/as/v1/internal/health"); response.getcode() == 200 or exit(1); data = json.loads(response.read()); exit(0);' diff --git a/x-pack/metricbeat/module/appsearch/docker-compose.yml b/x-pack/metricbeat/module/appsearch/docker-compose.yml index ad17feafe44..d9f8ac149d3 100644 --- a/x-pack/metricbeat/module/appsearch/docker-compose.yml +++ b/x-pack/metricbeat/module/appsearch/docker-compose.yml @@ -2,14 +2,17 @@ version: '2.3' services: appsearch: + image: docker.elastic.co/integrations-ci/beats-appsearch:${APPSEARCH_VERSION:-7.5.0}-1 build: context: ./_meta + args: + APPSEARCH_VERSION: ${APPSEARCH_VERSION:-7.5.0} depends_on: - elasticsearch environment: - "elasticsearch.host=http://elasticsearch:9200" - "allow_es_settings_modification=true" - - "JAVA_OPTS=-Xms2g -Xmx2g" + - "JAVA_OPTS=-Xms1g -Xmx1g" ports: - 3002 command: --process app-server From ed16cc9693bc5ffb243e4b5d6e83aed6a3dde199 Mon Sep 17 00:00:00 2001 From: Jaime Soriano Pastor Date: Mon, 27 Jan 2020 23:37:34 +0100 Subject: [PATCH 2/5] Rever change in allocatable memory --- x-pack/metricbeat/module/appsearch/docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x-pack/metricbeat/module/appsearch/docker-compose.yml b/x-pack/metricbeat/module/appsearch/docker-compose.yml index d9f8ac149d3..f112e45eed6 100644 --- a/x-pack/metricbeat/module/appsearch/docker-compose.yml +++ b/x-pack/metricbeat/module/appsearch/docker-compose.yml @@ -12,7 +12,7 @@ services: environment: - "elasticsearch.host=http://elasticsearch:9200" - "allow_es_settings_modification=true" - - "JAVA_OPTS=-Xms1g -Xmx1g" + - "JAVA_OPTS=-Xms2g -Xmx2g" ports: - 3002 command: --process app-server From d3f3fe00cd78d5a616a45c53869530228c107cbb Mon Sep 17 00:00:00 2001 From: Jaime Soriano Pastor Date: Mon, 27 Jan 2020 23:56:27 +0100 Subject: [PATCH 3/5] To revert: Enable verbosity --- x-pack/metricbeat/magefile.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/x-pack/metricbeat/magefile.go b/x-pack/metricbeat/magefile.go index 25441b598a7..f1ac388cd4f 100644 --- a/x-pack/metricbeat/magefile.go +++ b/x-pack/metricbeat/magefile.go @@ -33,6 +33,9 @@ func init() { devtools.BeatDescription = "Metricbeat is a lightweight shipper for metrics." devtools.BeatLicense = "Elastic License" + + // XXX: Remove this + os.Setenv("MAGEFILE_VERBOSE", "true") } // Aliases provides compatibility with CI while we transition all Beats From a825ebcfdb50155da3b8d077835c7c4f919acb43 Mon Sep 17 00:00:00 2001 From: Jaime Soriano Pastor Date: Tue, 28 Jan 2020 00:26:21 +0100 Subject: [PATCH 4/5] Always print standard output in nosetests --- dev-tools/mage/pytest.go | 3 ++- x-pack/metricbeat/magefile.go | 3 --- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/dev-tools/mage/pytest.go b/dev-tools/mage/pytest.go index a49d42e2e6f..061c32181b0 100644 --- a/dev-tools/mage/pytest.go +++ b/dev-tools/mage/pytest.go @@ -160,7 +160,8 @@ func PythonNoseTest(params PythonTestArgs) error { } defer fmt.Println(">> python test:", params.TestName, "Testing Complete") - return sh.RunWith(nosetestsEnv, nosetestsPath, append(nosetestsOptions, testFiles...)...) + _, err := sh.Exec(nosetestsEnv, os.Stdout, os.Stderr, nosetestsPath, append(nosetestsOptions, testFiles...)...) + return err // TODO: Aggregate all the individual code coverage reports and generate // and HTML report. diff --git a/x-pack/metricbeat/magefile.go b/x-pack/metricbeat/magefile.go index f1ac388cd4f..25441b598a7 100644 --- a/x-pack/metricbeat/magefile.go +++ b/x-pack/metricbeat/magefile.go @@ -33,9 +33,6 @@ func init() { devtools.BeatDescription = "Metricbeat is a lightweight shipper for metrics." devtools.BeatLicense = "Elastic License" - - // XXX: Remove this - os.Setenv("MAGEFILE_VERBOSE", "true") } // Aliases provides compatibility with CI while we transition all Beats From f20cbf0ae521f26636651700d1e223cf8b6f32e5 Mon Sep 17 00:00:00 2001 From: Jaime Soriano Pastor Date: Tue, 28 Jan 2020 01:41:32 +0100 Subject: [PATCH 5/5] Fix typo --- dev-tools/mage/pytest.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev-tools/mage/pytest.go b/dev-tools/mage/pytest.go index 061c32181b0..1b5bdeae0c8 100644 --- a/dev-tools/mage/pytest.go +++ b/dev-tools/mage/pytest.go @@ -160,7 +160,7 @@ func PythonNoseTest(params PythonTestArgs) error { } defer fmt.Println(">> python test:", params.TestName, "Testing Complete") - _, err := sh.Exec(nosetestsEnv, os.Stdout, os.Stderr, nosetestsPath, append(nosetestsOptions, testFiles...)...) + _, err = sh.Exec(nosetestsEnv, os.Stdout, os.Stderr, nosetestsPath, append(nosetestsOptions, testFiles...)...) return err // TODO: Aggregate all the individual code coverage reports and generate