-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
Fix CDN task assets discovery #177985
Fix CDN task assets discovery #177985
Conversation
Pinging @elastic/kibana-operations (Team:Operations) |
resolve(pluginRoot, 'assets'), | ||
]; | ||
// packages/core/apps/core-apps-server-internal/src/core_app.ts | ||
const assetsDest = resolve(assets, buildSha, 'plugins', manifest.plugin.id, 'assets'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added assets
and buildSha
as this was copying into <kibana_root>/plugins
resolve(pluginRoot, 'public', 'assets'), | ||
resolve(pluginRoot, 'assets'), | ||
]; | ||
// packages/core/apps/core-apps-server-internal/src/core_app.ts |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is this comment intending to communicate?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the source of where the paths come from... There is a bit of "weak" reference here because these paths are created by Kibana core server-side code at runtime and we are mirroring that code here.
I just followed the pattern in the rest of the file (eg).
Ideally we could share these values by importing some consts or something, but I guess these paths really don't change often so this has been an "OK" way.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm happy to open a follow up issue!
💚 Build Succeeded
Metrics [docs]
To update your PR or re-run it, just comment with: cc @jloleysens |
@jloleysens should we fix the location of the assets on those 2 plugins in this PR as well?
|
@mistic Yeah, I'm not sure these work given that we only expose assets from OK I checked and in both cases assets are either being bundled directly with code (in case of |
Summary
Plugin static assets were not being included in the CDN bundle due to the task looking in
<plugin_root>/assets
. This fix updates the task to look in<plugin_root>/public/assets
.Output structure
tree
Test
node scripts/build.js
to get CDN assets./target/kibana-8.14.0-SNAPSHOT-cdn-assets.tar.gz
/etc/hosts
to resolve to127.0.0.1
cd
into the untarred folder and serve the assets, I usednpx http-server -p 1772 --cors --gzip --brotli
server.cdn.url: "http://my.cdn.test:1772"
to your Kibana config