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

Upgrade test Docker images to latest versions #9198

Merged
merged 13 commits into from
Dec 21, 2018

Conversation

ycombinator
Copy link
Contributor

@ycombinator ycombinator commented Nov 21, 2018

This PR upgrades the Elasticsearch and Kibana Docker images to their latest versions in their respective Metricbeat module tests.

In addition to the actual version upgrade changes, this PR also contains several changes necessary to get the integration and system tests for the elasticsearch/ccr metricset passing. These tests existed before this PR but were skipped because:

  • the CCR feature only exists in Elasticsearch 6.5.0 onwards,
  • the tests had a check to skip if the version of Elasticsearch being used in the tests was < 6.5.0, and
  • we were using Elasticsearch 6.4.3 until this PR came along and upgraded it.

@ycombinator
Copy link
Contributor Author

I think the CI test failure is legitimate and should be fixed once #9179 is merged.

@ycombinator
Copy link
Contributor Author

jenkins, test this

1 similar comment
@ycombinator
Copy link
Contributor Author

jenkins, test this

@ycombinator
Copy link
Contributor Author

ycombinator commented Nov 22, 2018

@ruflin @jsoriano As you can see from the evolution of this PR, upgrading the ES docker image to 6.5.1 caused the elasticsearch/ccr integration and system tests to start failing. So this PR ended up having a lot of fixes to these tests — mostly around getting ES to generate valid CCR stats before running the tests — in addition to the actual version upgrade changes.

Would you like me to pull out the CCR test-related fixes into their own PR(s) and keep this PR just for the actual version upgrade changes?

@jsoriano
Copy link
Member

I am fine with leaving the upgrade of the image in the same PR, this way we know what was needed to support it. I'd add some explanation about why CCR tests existed for previous versions but weren't failing.

Also I don't like so much to have the implementation of CCR setup in both python and Go, but I guess we'd have to live with that while we have system testing in python.

@ycombinator
Copy link
Contributor Author

Thanks @jsoriano. Added the note about why these tests were not failing before this PR in the PR description.

Agreed about the duplication of code.

@jsoriano
Copy link
Member

Could you update the branch after #9179 to see if tests pass in CI?

@ycombinator
Copy link
Contributor Author

Hmmmm, now the ES module system tests are all failing because the GET http://elasticsearch:9200/_xpack/license API is returning a 404.

However, when I run the exact same Docker image and make the same API call against it locally, it works:

$ docker ps
CONTAINER ID        IMAGE                                                 COMMAND                  CREATED             STATUS              PORTS                              NAMES
7dc94dc45d22        docker.elastic.co/elasticsearch/elasticsearch:6.5.1   "/usr/local/bin/dock…"   2 seconds ago       Up 1 second         0.0.0.0:9200->9200/tcp, 9300/tcp   quirky_poincare
$ curl 'http://localhost:9200/_xpack/license'
{
  "license" : {
    "status" : "active",
    "uid" : "78324d0b-da61-44ff-98e8-399df1f82063",
    "type" : "basic",
    "issue_date" : "2018-11-22T15:43:54.207Z",
    "issue_date_in_millis" : 1542901434207,
    "max_nodes" : 1000,
    "issued_to" : "docker-cluster",
    "issuer" : "elasticsearch",
    "start_date_in_millis" : -1
  }
}

I'm investigating further but if something jumps out to you, @jsoriano or @ruflin, please let me know. Thanks!

@ruflin
Copy link
Member

ruflin commented Nov 22, 2018

Did the code work for the ml test only with 6.5.1? Or did it also break? The reason I'm asking is because it seems the trial activation breaks the tests. So if the trial activation works with the old code for ML, then the problem is likely in the code, if it didn't work, my assumption is that something changed in 6.5.1 docker containers?

@ycombinator
Copy link
Contributor Author

Good thinking, @ruflin. Let me put up a "test" PR (so CI can run on it) with just the 6.5.1 version upgrade and no changes to the tests code. Let's see what happens to that one.

@ycombinator ycombinator added in progress Pull request is currently in progress. and removed review labels Nov 28, 2018
@ycombinator
Copy link
Contributor Author

ycombinator commented Nov 28, 2018

@jsoriano @ruflin This PR is ready for review again.

I did a bunch of testing and eventually found the fix to be changing this line: https://github.com/elastic/beats/pull/9198/files#diff-5a5de1a556d9b66b8140e73286c014aeR2. Before this change I believe we were hitting a race condition between the new code in this PR calling the GET _xpack/license ES API endpoint before the x-pack code in ES actually registered that API route (or something to that effect).

@ycombinator ycombinator added review and removed in progress Pull request is currently in progress. labels Nov 28, 2018
FROM docker.elastic.co/elasticsearch/elasticsearch:6.4.3
HEALTHCHECK --interval=1s --retries=300 CMD curl -f http://localhost:9200
FROM docker.elastic.co/elasticsearch/elasticsearch:6.5.1
HEALTHCHECK --interval=1s --retries=300 CMD curl -f http://localhost:9200/_xpack/license
Copy link
Member

Choose a reason for hiding this comment

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

Would it also work with a more generic health check like /_cluster/health?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Let me try this and see.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't think it works reliably with _cluster/health. Jenkins CI passed but Travis CI failed with the same 404 error on GET _xpack/license that we were seeing earlier.

I think it's okay to base the health check on the URL we expect to call, i.e. GET _xpack/license, no?

Copy link
Member

Choose a reason for hiding this comment

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

Yeah, it's fine, lets leave it with _xpack/license then.

Copy link
Member

Choose a reason for hiding this comment

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

But lets take this into account elastic/elasticsearch#35959 :(

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm going to fix all deprecated _xpack endpoints across the codebase in #9656.

@ycombinator ycombinator merged commit ecc09cc into elastic:master Dec 21, 2018
@ycombinator ycombinator added needs_backport PR is waiting to be backported to other branches. v7.0.0 v6.7.0 labels Dec 21, 2018
ycombinator added a commit to ycombinator/beats that referenced this pull request Dec 21, 2018
* Upgrade to latest versions

* Fixing integration test by setting up CCR stats

* Adding test fixtures

* Renaming per hound suggestion

* Start trial for all metricsets

* Create CCR stats first!

* Fix formatting issues

* Refactoring to reuse ES client

* [WIP] Testing if this is a timing issue

* Fixing formatting

* WIP: Make container health check use GET /_xpack/license

* Removing test sleep

* Trying a more generic health check

(cherry picked from commit ecc09cc)
@ycombinator ycombinator removed the needs_backport PR is waiting to be backported to other branches. label Dec 21, 2018
ycombinator added a commit that referenced this pull request Dec 21, 2018
…ns (#9734)

* Upgrade test Docker images to latest versions (#9198)

* Upgrade to latest versions

* Fixing integration test by setting up CCR stats

* Adding test fixtures

* Renaming per hound suggestion

* Start trial for all metricsets

* Create CCR stats first!

* Fix formatting issues

* Refactoring to reuse ES client

* [WIP] Testing if this is a timing issue

* Fixing formatting

* WIP: Make container health check use GET /_xpack/license

* Removing test sleep

* Trying a more generic health check

(cherry picked from commit ecc09cc)

* Updating healthcheck (#9749)
@ycombinator ycombinator deleted the latest-651 branch December 25, 2019 11:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants