Skip to content

Use relative URLs in v7.6 manifest#143

Merged
nickpeihl merged 3 commits intoelastic:masterfrom
nickpeihl:7.6/relative-urls
Jan 10, 2020
Merged

Use relative URLs in v7.6 manifest#143
nickpeihl merged 3 commits intoelastic:masterfrom
nickpeihl:7.6/relative-urls

Conversation

@nickpeihl
Copy link
Copy Markdown
Contributor

@nickpeihl nickpeihl commented Nov 20, 2019

Fixes #141. To make it easier to reverse proxy and deploy locally, we are changing the URLs in the v7.6 manifest from absolute to relative. Additionally, the ?elastic_tile_service_tos=agree query string is no longer hard-coded in the manfiest. Clients using the v7.6 API will need to accept the EMS Terms of Service by appending the querystring ?elastic_tile_service_tos=agree to all requests.

@elasticmachine
Copy link
Copy Markdown
Collaborator

💚 Build Succeeded

@thomasneirynck
Copy link
Copy Markdown
Contributor

thomasneirynck commented Nov 20, 2019

Not sure if I have this 100% right, so bear with me ;)

The relative-path is from the root.

If the client is configured to the manifest (which is host/version/manifest), the client would need knowledge about this relationship. So this would complicate if users put EMS behind a proxy like so:

reverseproxy.corp.org:5401/tiles/* -> tiles.maps.elastic.co/v7.6
reverseproxy.corp.org:5401/files/* -> vector.maps.elastic.co/v7.6

Unless we somehow bake this knowledge into Kibana/user-docs that the sub-path of the manifest is not the top-level (and imho, I think we actively want to avoid such a situation since this is the situation today to a certain extent).

We could update the EMS-client it needs a double config:

emsFileConfig:
     host: reverseproxy.org:5401/file
     version: v7.6

With the understanding on the back-end that EMS always needs to serve the manifest from <host>/<version>/manifest. Then the actual files have their relationship from <host>/<relative-url-from-manifest>.

Note that EMS diverges significantly from other geo-server products (e.g. ArcGIS Server, GeoServer, ...). Most of these platforms generate their manifests dynamically, based on user-config of the host. Mapbox-tile-spec are an example of this as well.

Another approach would be more along the lines of organizing resources hierarchically. (e.g. https://sampleserver6.arcgisonline.com/arcgis/rest/services/). The above is counter to how EMS was designed (no duplication of files for efficient content etc...).

Thoughts?

@nickpeihl
Copy link
Copy Markdown
Contributor Author

We could update the EMS-client it needs a double config:

emsFileConfig:
     host: reverseproxy.org:5401/file
     version: v7.6

ems-client already accepts a kbnVersion parameter that gets passed as a query parameter in requests for tiles and files. We could parse this parameter to get the matching EMS version. Although, this requires us to publish the next major and minor releases of EMS for development. However, these future EMS releases would be subject to change until stack release.

Another approach would be more along the lines of organizing resources hierarchically. (e.g. https://sampleserver6.arcgisonline.com/arcgis/rest/services/). The above is counter to how EMS was designed (no duplication of files for efficient content etc...).

I would prefer to keep the current convention to avoid duplicating vector files. Especially as we move to syncing EMS releases with the stack and also if we start to release higher resolution (much larger) datasets.

@nickpeihl
Copy link
Copy Markdown
Contributor Author

nickpeihl commented Nov 22, 2019

ems-client already accepts a kbnVersion parameter that gets passed as a query parameter in requests for tiles and files. We could parse this parameter to get the matching EMS version. Although, this requires us to publish the next major and minor releases of EMS for development. However, these future EMS releases would be subject to change until stack release.

One concern I have with this is handling breaking changes in future releases and functional tests downstream. For example, we might make a change to the v8.0 manifest while still in development that could require functional test changes in Kibana. The CI on the master branch and other PRs would fail until the functional test changes are fixed. We may be able to minimize the effect with parallel PRs, but I do not see how we could avoid it completely.

So perhaps it is better to hard-code the EMS version in the ems-client library instead and upgrade the ems-client dependency in Kibana after the API and client library are in sync.

@jsanz jsanz mentioned this pull request Nov 26, 2019
@elasticmachine
Copy link
Copy Markdown
Collaborator

💚 Build Succeeded

Copy link
Copy Markdown
Contributor

@jsanz jsanz left a comment

Choose a reason for hiding this comment

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

Left a couple of comments, I don't see anything problematic here but I understand this has effects outside this code. Anything else I can take a look or test?

@kibanamachine
Copy link
Copy Markdown

💚 Build Succeeded

@nickpeihl nickpeihl merged commit 183b185 into elastic:master Jan 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[7.6] Urls in manifest should be relative

5 participants