-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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
[Fleet] Support bundling packages as zip archives with Kibana source #122297
[Fleet] Support bundling packages as zip archives with Kibana source #122297
Conversation
This should be blocked by #121628, and we'll likely want to bundle the Fleet Server and Elastic Agent packages with the Kibana source as part of this PR. |
@elasticmachine merge upstream |
@elasticmachine merge upstream |
@elasticmachine merge upstream |
@elasticmachine merge upstream |
|
||
import { Task, read, downloadToDisk } from '../lib'; | ||
|
||
const EPR_URL = 'https://epr-snapshot.elastic.co'; |
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.
Why is it https://epr-snapshot.elastic.co, which is considered to be unstable, rather than production endpoint https://epr.elastic.co?
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.
Per @simitt, we're using the snapshot registry here to support bundling "in progress" development builds of packages like APM during development/testing, and because the APM package specifically isn't usually published ahead of time.
Maybe it'd be a better idea to pass a CLI flag here to control the EPR environment? yarn build --use-snapshot-epr
or something along those lines to support development needs, but otherwise preferring the production environment. I'm not sure if this is suitable for APM's use case, though, so I'll let @simitt correct me if not.
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.
Changing default to fetch from production, but supporting a parameter to fetch from staging or snapshot SGTM. I believe it is important to be able to package non-production dev packages during the dev cycle, but I also see why people are hesitant to always fetch from a non-production stage.
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've implemented this in 61b8178 and included a note for a caveat as well that I'll reiterate here.
When using the snapshot registry, all checksums provided in fleet_package.json
will no longer be considered valid because of differences in the package stored on the snapshot registry and those in production. It's also possible that a version that exists in production does not exist in snapshot - e.g. apm-8.0.0
. Because of this, it's necessary to remove other bundled packages when using --use-snapshot-registry
to test bundling of development packages to prevent build failures.
I think this should be fine to support use cases like local development/testing, and we'll leave the production versions and checksums (updated in the same commit above) checked in to the Kibana repo. Just wanted to make it clear that simply opting in via that CLI flag will cause the build to fail without manual updates to fleet_packages.json
.
We're punting on checksums in this PR for now due to concerns around their consistency with regards to EPR builds. See #124273 for info. |
💚 Build SucceededMetrics [docs]Public APIs missing comments
Page load bundle
History
To update your PR or re-run it, just comment with: cc @kpollich |
💔 Backport failedThe pull request could not be backported due to the following error: How to fixRe-run the backport manually:
Questions ?Please refer to the Backport tool documentation |
Summary
Ref #112095
Adds baseline support for bundling packages as
.zip
archives in the Kibana source code and installing them during setup.In this first pass implementation, we're looking to satisfy a few requirements:
This PR does the following in pursuit of the goals above:
fleet/server/bundled_packages
directorybulkInstallPackages
method that allows us to prefer installation from bundled packages on disk for preconfigured packages during setupTesting Instructions
Before testing, run a
yarn build
to fetch bundled packages. You can isolate this task by commenting out other tasks insrc/dev/build/build_distributables.ts
.To test, preconfigure an agent policy in your
kibana.yml
file that containspackage_policies
for each of the bundled packages, e.g.With the above setup, you should see log output along the lines of the following:
Checklist