-
Notifications
You must be signed in to change notification settings - Fork 141
bundle templates of required input packages #3329
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
Closed
teresaromero
wants to merge
48
commits into
elastic:main
from
teresaromero:3278-bundle-templates-required-input-packages
Closed
Changes from 38 commits
Commits
Show all changes
48 commits
Select commit
Hold shift + click to select a range
4f25ab8
chore: update package-spec to pre-release version
teresaromero adf728b
feat: extend manifest types for required input packages
teresaromero 3ecf9d6
feat: implement input package template bundling
teresaromero eba23df
feat: wire registry client and requires overrides into build and test…
teresaromero b43bf5b
docs: document composable integrations and local registry usage
teresaromero 5da820b
chore: update with latests package-spec. this commit should be revert…
teresaromero 09fdab8
Merge branch 'main' of github.com:elastic/elastic-package into 3278-b…
teresaromero 7468026
use profile epr url on install command. update readme
teresaromero 50c3b2b
Revert "update readme"
teresaromero a690ef0
Merge branch 'main' of github.com:elastic/elastic-package into 3278-b…
teresaromero d76ffad
Update dependency management documentation to clarify package depende…
teresaromero ad98db8
Add TLS support to registry client
teresaromero 5d69e4b
Add bundle policy templates input package handling and tests
teresaromero 1d8e4dd
Add bundle data stream templates handling and tests
teresaromero 11fe9df
Add YAML utility functions for mapping and formatting
teresaromero 22047e8
Add function to read and unpack data stream manifest bytes
teresaromero 2cd96e7
refactor bundle templates for builder
teresaromero 9f6ade8
Merge branch 'main' of github.com:elastic/elastic-package into 3278-b…
teresaromero e490bb3
remove overrides implementation
teresaromero c91a537
Merge branch 'main' of github.com:elastic/elastic-package into 3278-b…
teresaromero d9a438d
Update manifest.yml to replace sql_input with test_input_pkg and adju…
teresaromero 39c787c
refactor and fixing injection into installer and builder. naming refa…
teresaromero 6d40f8e
remove default empty template option
teresaromero 85990e2
Merge branch 'main' of github.com:elastic/elastic-package into 3278-b…
teresaromero 0ba7f63
Remove FindPackageInRepo function from packages.go
teresaromero dbe671b
rename PackageRef
teresaromero 8337f12
Refactor YAML utility functions to use slices.IndexFunc for improved …
teresaromero 9c3301f
Merge branch 'main' of github.com:elastic/elastic-package into 3278-b…
teresaromero cabe0a3
feat: gate data stream template bundling on explicit data_streams ass…
teresaromero 3dc281d
chore: update package-spec dependency to v3.5.8 in go.mod and go.sum
teresaromero df6a557
revert: remove data_streams gating for template bundling
teresaromero 42ad433
docs: update howto guide
teresaromero 1366c46
fix: prevent nil panic and Windows path failures in required inputs r…
teresaromero f4d026b
test: ensure proper resource cleanup in policy templates and streams …
teresaromero 86557d8
tests: update test script to include test package into stack registry
teresaromero 0f962e7
Move required_inputs fixtures to test/manual_packages
teresaromero 32c11ae
Revert "tests: update test script to include test package into stack …
teresaromero 32a2ff5
Merge branch 'main' of github.com:elastic/elastic-package into 3278-b…
teresaromero 6cf85da
requiredinputs: open directory packages with os.Root for fs.FS
teresaromero 3e850ca
Improve requiredinputs error messages with consistent wording
teresaromero 4c381ed
docs: fix standalone package registry Docker image in HOWTO
teresaromero f0eebb2
Align docs with package-registry and elastic-package
teresaromero 7ce8e8f
Export requiredinputs.Resolver and remove duplicate interfaces
teresaromero 95c83df
Merge branch 'main' of github.com:elastic/elastic-package into 3278-b…
teresaromero 07c2995
Merge branch 'main' of github.com:elastic/elastic-package into 3278-b…
teresaromero e1245f4
Remove unused download.go file from the internal registry package
teresaromero 4de860d
Use profile-aware package registry URL for test, benchmark, script
teresaromero 2e52d58
Nil-safe required inputs resolver and simplify NewRequiredInputsResolver
teresaromero File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,114 @@ | ||
| # HOWTO: Use a local or custom package registry for composable integrations | ||
|
|
||
| ## Overview | ||
|
|
||
| Composable (integration) packages can declare required input packages in their `manifest.yml` | ||
| under `requires.input`. When you run `elastic-package build` or `elastic-package install`, | ||
| elastic-package resolves those dependencies by downloading them from the **package registry**. | ||
| By default it uses the production registry at `https://epr.elastic.co`. | ||
|
|
||
| This guide explains how to point elastic-package at a local or custom registry, which is | ||
| useful when the required input packages are still under development and not yet published to | ||
| the production registry. | ||
|
|
||
| For field-level build-time dependencies (ECS, `_dev/build/build.yml`), see | ||
| [HOWTO: Enable dependency management](./dependency_management.md). | ||
|
|
||
| ## Prerequisites | ||
|
|
||
| - An integration package that declares `requires.input` in its `manifest.yml`, for example: | ||
|
|
||
| ```yaml | ||
| requires: | ||
| input: | ||
| - package: sql_input | ||
| version: "0.2.0" | ||
| ``` | ||
|
|
||
| - Optionally, a running local package registry that serves the required input packages. | ||
|
|
||
| ## Option 1: Use the built-in stack registry (recommended) | ||
|
|
||
| `elastic-package stack up` (with the default compose provider) automatically starts a local | ||
| package registry that serves all packages found under the `build/packages/` directory. You can | ||
| use this registry to serve locally-built input packages without running any additional | ||
| infrastructure. | ||
|
|
||
| ```shell | ||
| # 1. Build the required input package — this places the built package under build/packages/ | ||
| cd /path/to/sql_input | ||
| elastic-package build | ||
|
|
||
| # 2. Start the Elastic Stack from anywhere inside the repository. | ||
| # elastic-package resolves the repository root automatically and the bundled | ||
| # registry picks up build/packages/ from there. | ||
| elastic-package stack up -v -d | ||
| ``` | ||
|
|
||
| Then configure `~/.elastic-package/config.yml` to use the stack's local registry for | ||
| `elastic-package build` and `elastic-package install`: | ||
|
|
||
| ```yaml | ||
| package_registry: | ||
| base_url: http://localhost:8080 | ||
| ``` | ||
|
|
||
| This setting is read by `elastic-package build`, `elastic-package install`, and | ||
| `elastic-package status` when they need to contact the registry. It defaults to | ||
| `https://epr.elastic.co` when not set. | ||
|
|
||
| > **Note:** This setting does not change the package registry container that the Elastic Stack | ||
| > itself uses (served by `elastic-package stack`). To also redirect the stack, see | ||
| > [Option 2](#option-2-configure-the-registry-url-per-profile) below. | ||
|
|
||
| ### Alternative: standalone package registry container | ||
|
|
||
| If you are not running `elastic-package stack`, you can start a standalone registry container. | ||
| Use a port other than `8080` to avoid conflicting with the stack's built-in registry: | ||
|
|
||
| ```shell | ||
| # Build your input package first | ||
| cd /path/to/sql_input | ||
| elastic-package build | ||
|
|
||
| # Start a standalone registry on port 8081 | ||
| docker run --rm -p 8081:8080 \ | ||
| -v /path/to/build/packages:/packages/package \ | ||
| docker.elastic.co/package-registry/distribution:latest \ | ||
|
teresaromero marked this conversation as resolved.
Outdated
|
||
| /package-registry serve --packages-path /packages | ||
| ``` | ||
|
|
||
| Then point `package_registry.base_url` at `http://localhost:8081` and run | ||
| `elastic-package build` from your integration package directory. | ||
|
|
||
| ## Option 2: Configure the registry URL per profile | ||
|
|
||
| If you run `elastic-package stack` and want both the **build tools** and the **stack's Fleet** | ||
| to use the same custom registry, configure the active profile | ||
| (e.g. `~/.elastic-package/profiles/default/config.yml`): | ||
|
|
||
| ```yaml | ||
| # URL for the stack's package registry container to proxy requests to | ||
| stack.epr.proxy_to: http://host.docker.internal:8080 | ||
|
|
||
| # URL for the stack's package registry base endpoint | ||
| stack.epr.base_url: http://localhost:8080 | ||
| ``` | ||
|
|
||
| Profile settings take precedence over the global `package_registry.base_url` for | ||
| stack-related behavior. The priority order is: | ||
|
|
||
| 1. `stack.epr.proxy_to` (profile) — used as the proxy target for the local registry container | ||
| 2. `stack.epr.base_url` (profile) — used as the registry base URL | ||
| 3. `package_registry.base_url` (global `~/.elastic-package/config.yml`) | ||
| 4. `https://epr.elastic.co` (production fallback) | ||
|
|
||
| For more details on profiles, see the | ||
| [Elastic Package profiles section of the README](../../README.md#elastic-package-profiles). | ||
|
|
||
| ## Summary | ||
|
|
||
| | Goal | Configuration | | ||
| |------|--------------| | ||
| | Override registry for `build` / `install` | `package_registry.base_url` in `~/.elastic-package/config.yml` | | ||
| | Override registry for `stack` (Fleet) | `stack.epr.base_url` / `stack.epr.proxy_to` in the active profile `config.yml` | | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
elastic-package stack upwith the compose provider (the default), starts a local package registry, that serves the packages underbuild/packages. This can be used to serve local packages. You only need to remember building the ones you need.This mechanism would even be improved after your change in elastic/package-registry#1482, what would allow reloading the packages without needing to restart the registry.
In the documentation here we are adding another method to serve local packages. We should probably converge both methods in a single one.