Skip to content

Commit 691cc8b

Browse files
committed
Merge remote-tracking branch 'upstream/main' into update-documentation-llm
2 parents 2040d34 + ab2f056 commit 691cc8b

File tree

152 files changed

+24854
-1012
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

152 files changed

+24854
-1012
lines changed

.buildkite/pipeline.cloud-cleanup.yml

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,6 @@ steps:
1919
- label: "False"
2020
value: "false"
2121
default: "true"
22-
- select: "DRY_RUN (Deprecated step)"
23-
key: "DRY_RUN_DEPRECATED"
24-
options:
25-
- label: "True"
26-
value: "true"
27-
- label: "False"
28-
value: "false"
29-
default: "true"
30-
if: "build.source == 'ui'"
3122

3223
- wait: ~
3324
if: "build.source == 'ui'"

.buildkite/pipeline.serverless.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
env:
22
NOTIFY_TO: "[email protected]"
3-
SETUP_GVM_VERSION: 'v0.5.2' # https://github.com/andrewkroh/gvm/issues/44#issuecomment-1013231151
3+
SETUP_GVM_VERSION: 'v0.6.0' # https://github.com/andrewkroh/gvm/issues/44#issuecomment-1013231151
44
DOCKER_COMPOSE_VERSION: "v2.24.1"
55
DOCKER_VERSION: "26.1.2"
66
KIND_VERSION: 'v0.27.0'

.buildkite/pipeline.test-with-integrations-repo.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
env:
2-
SETUP_GVM_VERSION: 'v0.5.1' # https://github.com/andrewkroh/gvm/issues/44#issuecomment-1013231151
2+
SETUP_GVM_VERSION: 'v0.6.0' # https://github.com/andrewkroh/gvm/issues/44#issuecomment-1013231151
33
GH_CLI_VERSION: "2.29.0"
44
JQ_VERSION: "1.7"
55
# Agent images used in pipeline steps

.buildkite/pipeline.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
env:
2-
SETUP_GVM_VERSION: 'v0.5.2' # https://github.com/andrewkroh/gvm/issues/44#issuecomment-1013231151
2+
SETUP_GVM_VERSION: 'v0.6.0' # https://github.com/andrewkroh/gvm/issues/44#issuecomment-1013231151
33
DOCKER_COMPOSE_VERSION: "v2.24.1"
44
DOCKER_VERSION: "26.1.2"
55
KIND_VERSION: 'v0.27.0'

.github/workflows/bump-elastic-stack-version.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ jobs:
3535
echo "UPDATECLI_ACTION=apply" >> $GITHUB_ENV
3636
3737
- name: Install Updatecli in the runner
38-
uses: updatecli/updatecli-action@57aa8966d4d775cb1420b90c270ba97a4b5abe47 #v2.93.0
38+
uses: updatecli/updatecli-action@9c04c99c508b3ac7851020724a912adde546f64b #v2.95.0
3939

4040
- name: Update default stack version
4141
# --experimental needed for commitusingapi option.

.go-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.24.2
1+
1.25.3

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,10 +73,10 @@ test-stack-command-86:
7373
./scripts/test-stack-command.sh 8.6.2
7474

7575
test-stack-command-8x:
76-
./scripts/test-stack-command.sh 8.19.5-12d7b56d-SNAPSHOT
76+
./scripts/test-stack-command.sh 8.19.7-d893c2bd-SNAPSHOT
7777

7878
test-stack-command-9x:
79-
./scripts/test-stack-command.sh 9.2.0-dd4147ff-SNAPSHOT
79+
./scripts/test-stack-command.sh 9.3.0-6f40f4f1-SNAPSHOT
8080

8181
test-stack-command-with-apm-server:
8282
APM_SERVER_ENABLED=true ./scripts/test-stack-command.sh

README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ Run the `help` command and see available commands:
3939
elastic-package help
4040
```
4141

42+
Some sub-commands are Docker-based, check you also have Docker installed. In case you are using Podman Desktop, check [this guide](./docs/howto/use_podman.md) to make it compatible.
43+
4244
## Development
4345

4446
Even though the project is "go-gettable", there is the [`Makefile`](./Makefile) present, which can be used to build,
@@ -490,6 +492,8 @@ You can run your own custom images for Elasticsearch, Kibana or Elastic Agent, s
490492

491493
Be aware that a common issue while trying to boot up the stack is that your Docker environments settings are too low in terms of memory threshold.
492494

495+
You can use Podman Desktop instead of Docker, see [this document](./docs/howto/use_podman.md)
496+
493497
For details on how to connect the service with the Elastic stack, see the [service command](https://github.com/elastic/elastic-package/blob/main/README.md#elastic-package-service).
494498

495499
### `elastic-package stack down`
@@ -542,6 +546,8 @@ You can run your own custom images for Elasticsearch, Kibana or Elastic Agent, s
542546

543547
Be aware that a common issue while trying to boot up the stack is that your Docker environments settings are too low in terms of memory threshold.
544548

549+
You can use Podman Desktop instead of Docker, see [this document](./docs/howto/use_podman.md)
550+
545551
To expose local packages in the Package Registry, build them first and boot up the stack from inside of the Git repository containing the package (e.g. elastic/integrations). They will be copied to the development stack (~/.elastic-package/stack/development) and used to build a custom Docker image of the Package Registry. Starting with Elastic stack version >= 8.7.0, it is not mandatory to be available local packages in the Package Registry to run the tests.
546552

547553
For details on how to connect the service with the Elastic stack, see the [service command](https://github.com/elastic/elastic-package/blob/main/README.md#elastic-package-service).
@@ -850,7 +856,7 @@ There are available some environment variables that could be used to change some
850856
- `ELASTIC_PACKAGE_DATA_HOME`: Custom path to be used for `elastic-package` data directory. By default this is `~/.elastic-package`.
851857

852858
- Related to the build process:
853-
- `ELASTIC_PACKAGE_REPOSITORY_LICENSE`: Path to the default repository license.
859+
- `ELASTIC_PACKAGE_REPOSITORY_LICENSE`: Path to the default repository license. This path should be relative to the repository root.
854860
- `ELASTIC_PACKAGE_LINKS_FILE_PATH`: Path to the links table file (e.g. `links_table.yml`) with the link definitions to be used in the build process of a package.
855861

856862
- Related to signing packages:

cmd/benchmark.go

Lines changed: 22 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ import (
2525
"github.com/elastic/elastic-package/internal/cobraext"
2626
"github.com/elastic/elastic-package/internal/common"
2727
"github.com/elastic/elastic-package/internal/elasticsearch"
28+
"github.com/elastic/elastic-package/internal/files"
2829
"github.com/elastic/elastic-package/internal/install"
2930
"github.com/elastic/elastic-package/internal/logger"
3031
"github.com/elastic/elastic-package/internal/packages"
@@ -136,10 +137,12 @@ func pipelineCommandAction(cmd *cobra.Command, args []string) error {
136137
return cobraext.FlagParsingError(err, cobraext.BenchNumTopProcsFlagName)
137138
}
138139

139-
packageRootPath, found, err := packages.FindPackageRoot()
140-
if !found {
141-
return errors.New("package root not found")
140+
repositoryRoot, err := files.FindRepositoryRoot()
141+
if err != nil {
142+
return fmt.Errorf("locating repository root failed: %w", err)
142143
}
144+
145+
packageRootPath, err := packages.FindPackageRoot()
143146
if err != nil {
144147
return fmt.Errorf("locating package root failed: %w", err)
145148
}
@@ -203,6 +206,7 @@ func pipelineCommandAction(cmd *cobra.Command, args []string) error {
203206
pipeline.WithESAPI(esClient.API),
204207
pipeline.WithNumTopProcs(numTopProcs),
205208
pipeline.WithFormat(reportFormat),
209+
pipeline.WithRepositoryRoot(repositoryRoot),
206210
)
207211
runner := pipeline.NewPipelineBenchmark(opts)
208212

@@ -291,17 +295,18 @@ func rallyCommandAction(cmd *cobra.Command, args []string) error {
291295
}
292296

293297
var packageRootPath string
294-
var found bool
295298
if len(packageName) == 0 {
296-
packageRootPath, found, err = packages.FindPackageRoot()
297-
if !found {
298-
return errors.New("package root not found")
299-
}
299+
packageRootPath, err = packages.FindPackageRoot()
300300
if err != nil {
301301
return fmt.Errorf("locating package root failed: %w", err)
302302
}
303303
}
304304

305+
repositoryRoot, err := files.FindRepositoryRoot()
306+
if err != nil {
307+
return fmt.Errorf("locating repository root failed: %w", err)
308+
}
309+
305310
profile, err := cobraext.GetProfileFlag(cmd)
306311
if err != nil {
307312
return err
@@ -336,6 +341,7 @@ func rallyCommandAction(cmd *cobra.Command, args []string) error {
336341
rally.WithRallyDryRun(rallyDryRun),
337342
rally.WithRallyPackageFromRegistry(packageName, packageVersion),
338343
rally.WithRallyCorpusAtPath(corpusAtPath),
344+
rally.WithRepositoryRoot(repositoryRoot),
339345
}
340346

341347
esMetricsClient, err := initializeESMetricsClient(ctx)
@@ -465,14 +471,16 @@ func streamCommandAction(cmd *cobra.Command, args []string) error {
465471
return cobraext.FlagParsingError(err, cobraext.BenchStreamTimestampFieldFlagName)
466472
}
467473

468-
packageRootPath, found, err := packages.FindPackageRoot()
469-
if !found {
470-
return errors.New("package root not found")
471-
}
474+
packageRootPath, err := packages.FindPackageRoot()
472475
if err != nil {
473476
return fmt.Errorf("locating package root failed: %w", err)
474477
}
475478

479+
repositoryRoot, err := files.FindRepositoryRoot()
480+
if err != nil {
481+
return fmt.Errorf("locating repository root failed: %w", err)
482+
}
483+
476484
profile, err := cobraext.GetProfileFlag(cmd)
477485
if err != nil {
478486
return err
@@ -507,6 +515,7 @@ func streamCommandAction(cmd *cobra.Command, args []string) error {
507515
stream.WithESAPI(esClient.API),
508516
stream.WithKibanaClient(kc),
509517
stream.WithProfile(profile),
518+
stream.WithRepositoryRoot(repositoryRoot),
510519
}
511520

512521
runner := stream.NewStreamBenchmark(stream.NewOptions(withOpts...))
@@ -572,10 +581,7 @@ func systemCommandAction(cmd *cobra.Command, args []string) error {
572581
return cobraext.FlagParsingError(err, cobraext.BenchReindexToMetricstoreFlagName)
573582
}
574583

575-
packageRootPath, found, err := packages.FindPackageRoot()
576-
if !found {
577-
return errors.New("package root not found")
578-
}
584+
packageRootPath, err := packages.FindPackageRoot()
579585
if err != nil {
580586
return fmt.Errorf("locating package root failed: %w", err)
581587
}

cmd/build.go

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -61,18 +61,38 @@ func buildCommandAction(cmd *cobra.Command, args []string) error {
6161
}
6262
}
6363

64+
repositoryRoot, err := files.FindRepositoryRoot()
65+
if err != nil {
66+
return fmt.Errorf("locating repository root failed: %w", err)
67+
}
68+
defer repositoryRoot.Close()
69+
6470
packageRoot, err := packages.MustFindPackageRoot()
6571
if err != nil {
6672
return fmt.Errorf("locating package root failed: %w", err)
6773
}
6874

75+
// Currently the build directory is placed inside the repository build/ folder.
76+
// In the future we might want to make this configurable.
6977
buildDir, err := builder.BuildDirectory()
7078
if err != nil {
7179
return fmt.Errorf("can't prepare build directory: %w", err)
7280
}
7381
logger.Debugf("Use build directory: %s", buildDir)
7482

75-
targets, err := docs.UpdateReadmes(packageRoot, buildDir)
83+
target, err := builder.BuildPackage(cmd.Context(), builder.BuildOptions{
84+
PackageRootPath: packageRoot,
85+
BuildDir: buildDir,
86+
CreateZip: createZip,
87+
SignPackage: signPackage,
88+
SkipValidation: skipValidation,
89+
RepositoryRoot: repositoryRoot,
90+
})
91+
if err != nil {
92+
return fmt.Errorf("building package failed: %w", err)
93+
}
94+
95+
targets, err := docs.UpdateReadmes(repositoryRoot, packageRoot, buildDir)
7696
if err != nil {
7797
return fmt.Errorf("updating files failed: %w", err)
7898
}
@@ -82,16 +102,6 @@ func buildCommandAction(cmd *cobra.Command, args []string) error {
82102
cmd.Printf("%s file rendered: %s\n", fileName, target)
83103
}
84104

85-
target, err := builder.BuildPackage(cmd.Context(), builder.BuildOptions{
86-
PackageRoot: packageRoot,
87-
BuildDir: buildDir,
88-
CreateZip: createZip,
89-
SignPackage: signPackage,
90-
SkipValidation: skipValidation,
91-
})
92-
if err != nil {
93-
return fmt.Errorf("building package failed: %w", err)
94-
}
95105
cmd.Printf("Package built: %s\n", target)
96106

97107
cmd.Println("Done")

0 commit comments

Comments
 (0)