Skip to content
This repository has been archived by the owner on Aug 31, 2022. It is now read-only.

Dashboard support for ES7 / Pbench server 0.71 #114

Merged
merged 1 commit into from
Jan 14, 2021

Conversation

dbutenhof
Copy link
Member

@dbutenhof dbutenhof commented Dec 18, 2020

Revise dashboard Elasticsearch queries to be compatible with Elasticsearch 7 syntax in order to work with 0.71 Pbench server, which now indexes to Elasticsearch 7.

Of special note: this also switches the dashboard over to use the two Pbench server "native query" APIs I've implemented, replacing both the query services and the fetch model effect transformations for queryControllers/fetchControllers and queryMonthIndices/fetchMonthIndices.

Also, during testing I found inconsistencies in the search behavior that seem to have been pre-existing bugs; e.g., the search state passed on to fetchIterationSamples didn't contain the id property required by that code to construct the queries. (Pay special attention to these changes.)

The dashboard actually runs on my 0.71 server VM and the RDU2 elasticsearch instance. The yarn test passes, with a warning for the SiderMenu test which apparently isn't including a key prop in a component list: not my change, and I decided not to mess with it. The e2e test script passes locally; hopefully will also on TravisCI.

The new endpoints.js should look something like this:

window.endpoints = {
  elasticsearch: 'http://elasticsearch.intlab.perf-infra.lab.eng.rdu2.redhat.com',
  results: 'http://dhcp31-170.perf.lab.eng.bos.redhat.com:8901',
  graphql: 'http://graphql.perf.lab.eng.bos.redhat.com:9466',
  prefix: 'drb.',
  result_index: 'v5.result-data-sample.',
  result_data_index: 'v5.result-data.',
  run_index: 'v6.run-data.',
  run_toc_index: 'v6.run-toc.',
  pbench_server: 'http://dhcp31-170.perf.lab.eng.bos.redhat.com:8001/api/v1',
};

Note that I changed the placeholders for the index strings to be a bit more useful. Ideally, we'll be able to convert the dashboard over to a server-driven configuration like my #2024 endpoint configuration API, which would remove all of this complexity.

Also of note is my Server API Architecture document, which has before/after payload samples and additional notes.

@dbutenhof dbutenhof self-assigned this Dec 18, 2020
@dbutenhof dbutenhof added bug Something isn't working enhancement New feature or request labels Dec 18, 2020
@dbutenhof dbutenhof force-pushed the api branch 2 times, most recently from 4e89c20 to a8c21fb Compare January 4, 2021 21:17
src/services/dashboard.js Outdated Show resolved Hide resolved
@dbutenhof dbutenhof changed the title Preliminary Dashboard support for ES7 Dashboard support for ES7 / Pbench server 0.71 Jan 6, 2021
@dbutenhof
Copy link
Member Author

dbutenhof commented Jan 6, 2021

So Travis failed at yarn install ... this is clearly a Travis environmental difference that doesn't appear to have anything to do with my changes. Any ideas?

warning file-loader@2.0.0: Invalid bin field for "file-loader".
warning umi-url-pnp-loader@1.1.2: Invalid bin field for "umi-url-pnp-loader".
info fsevents@2.3.1: The platform "linux" is incompatible with this module.
info "fsevents@2.3.1" is an optional dependency and failed compatibility check. Excluding it from installation.
info fsevents@1.2.13: The platform "linux" is incompatible with this module.
info "fsevents@1.2.13" is an optional dependency and failed compatibility check. Excluding it from installation.
error postcss@8.2.2: The engine "node" is incompatible with this module. Expected version "^10 || ^12 || >=14". Got "13.14.0"
error Found incompatible module.
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
yarn install failed!

@dbutenhof dbutenhof marked this pull request as ready for review January 6, 2021 16:44
@dbutenhof dbutenhof assigned gurbirkalsi and unassigned gurbirkalsi Jan 6, 2021
src/models/search.js Outdated Show resolved Hide resolved
run_index: 'vn.run-data.',
run_toc_index: 'vn.run-toc.',
result_index: 'vn.result-data-sample.',
result_data_index: 'vn.result-data.',
Copy link
Member

Choose a reason for hiding this comment

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

These five above don't seem like end points. This seems like what we want the initial server load to give the dashboard.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, "endpoints" might be better termed "server configuration". More obvious now that I split the two main indices. In my configuration API I put these in a "metadata" section separate from the "endpoints" (URI) section.

Copy link
Collaborator

@aquibbaig aquibbaig Jan 7, 2021

Choose a reason for hiding this comment

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

Hey @dbutenhof, I suppose this file is in .gitignore

Copy link
Member Author

Choose a reason for hiding this comment

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

Hey @dbutenhof, I suppose this file is in .gitignore

Yes, it is; although for some reason that pattern isn't working for me. Which in this case is fine as I had to add additional configuration keys.

Copy link
Member

Choose a reason for hiding this comment

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

Wait, if public/endpoints.js is in .gitignore, why are we not removing it instead of changing it in the PR?

Copy link
Member Author

Choose a reason for hiding this comment

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

Actually, that's a good point; .gitignore is only for untracked files. Maybe we should really have a public/endpoints.example.js that's tracked and updated, with the build looking for an untracked public/endpoints.js that's in .gitignore.

Copy link
Member Author

Choose a reason for hiding this comment

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

Hmm; that, unfortunately, breaks the current end-to-end testing because the search test requires endpoints.js placeholders that match the internal test framework placeholders. (This is actually a problem if you run the tests with a "real" endpoints.js, too.) It's probably possible to get npm/yarn/umi to "build" the example file as the endpoints.js to use, but I don't know enough about the capabilities and structure of package.json to do that.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I'll take a look into possibly using a mocked endpoint file for enabling e2e testing without the requirement of endpoints.js. @dbutenhof we should update the fields present in the README.md file at the root of the project directory.

run_index: 'vn.run-data.',
run_toc_index: 'vn.run-toc.',
result_index: 'vn.result-data-sample.',
result_data_index: 'vn.result-data.',
Copy link
Member

Choose a reason for hiding this comment

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

Wait, if public/endpoints.js is in .gitignore, why are we not removing it instead of changing it in the PR?

Copy link
Collaborator

@gurbirkalsi gurbirkalsi left a comment

Choose a reason for hiding this comment

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

Travis CI is failing due to an incompatible version of node running the test environment.

error postcss@8.2.3: The engine "node" is incompatible with this module. Expected version "^10 || ^12 || >=14". Got "13.14.0"

We should consider upgrading the node environment to >=14 in .travis.yml to resolve this issue.

run_index: 'vn.run-data.',
run_toc_index: 'vn.run-toc.',
result_index: 'vn.result-data-sample.',
result_data_index: 'vn.result-data.',
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'll take a look into possibly using a mocked endpoint file for enabling e2e testing without the requirement of endpoints.js. @dbutenhof we should update the fields present in the README.md file at the root of the project directory.

@@ -55,18 +55,37 @@ export default {
searchResults.resultCount = response.hits.total;
Copy link
Collaborator

Choose a reason for hiding this comment

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

It seems resultCount is being assigned an object opposed to an integer specified from the total field. This is causing [Object] [object] to be rendered in the Search page component once a search query has been made.

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks. Somehow I missed that, both visually and comparing my Postman ES7 output... hits.total is an object {value: 1, relation: 'eq'} ... I want response.hits.total.value here.

Copy link
Member Author

Choose a reason for hiding this comment

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

image

Copy link
Collaborator

@gurbirkalsi gurbirkalsi left a comment

Choose a reason for hiding this comment

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

LGTM, just needs a rebase to resolve TravisCI issues!

@dbutenhof
Copy link
Member Author

Well, this is interesting. I had done some brief experimentation with renaming endpoints.js to work with the intent of the .gitignore. And apparently when I pushed my rebase, I ended up actually deleting it... not just from github but from my local repo. Which, of course, breaks the e2e tests.

So now I've got to restore it to match the internal mocking. It'll be a minute...

@dbutenhof
Copy link
Member Author

I suppose it's worth a note here that when this PR is merged, the dashboard master will no longer work with Pbench server code earlier than master ... the current production and staging servers are 0.69 and run with Elasticsearch V1.

Should we cut a dashboard branch before merging this? And possibly even updating it to bump the dashboard version?

@dbutenhof
Copy link
Member Author

I suppose it's worth a note here that when this PR is merged, the dashboard master will no longer work with Pbench server code earlier than master ... the current production and staging servers are 0.69 and run with Elasticsearch V1.

Should we cut a dashboard branch before merging this? And possibly even updating it to bump the dashboard version?

FYI: After consulting with Gurbir, I've updated the dashboard version to 3.0.0 for this change.

@gurbirkalsi gurbirkalsi merged commit f78ef01 into distributed-system-analysis:master Jan 14, 2021
@dbutenhof dbutenhof deleted the api branch January 15, 2021 12:37
@dbutenhof dbutenhof linked an issue Jul 26, 2021 that may be closed by this pull request
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Upgrade Elasticsearch to v7
4 participants