Skip to content

Commit b90a1a9

Browse files
committed
Merge branch 'main' into sample-data-docs
2 parents 1550989 + 7ce42ee commit b90a1a9

File tree

79 files changed

+10241
-7678
lines changed

Some content is hidden

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

79 files changed

+10241
-7678
lines changed

.buildkite/pipeline.trigger.integration.tests.sh

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
# exit immediately on failure, or if an undefined variable is used
44
set -eu
55

6+
67
# begin the pipeline.yml file
78
echo "steps:"
89
echo " - group: \":terminal: Integration test suite\""
@@ -110,14 +111,21 @@ echo " - build/elastic-stack-dump/install-zip-shellinit/logs/*.log"
110111

111112
echo " - label: \":go: Running integration test: test-profiles-command\""
112113
echo " command: ./.buildkite/scripts/integration_tests.sh -t test-profiles-command"
114+
echo " env:"
115+
echo " DOCKER_COMPOSE_VERSION: \"false\""
116+
echo " DOCKER_VERSION: \"false\""
113117
echo " agents:"
114-
echo " provider: \"gcp\""
118+
echo " image: \"${LINUX_AGENT_IMAGE}\""
119+
echo " cpu: \"8\""
120+
echo " memory: \"4G\""
115121

116122
echo " - label: \":go: Running integration test: test-check-update-version\""
117123
echo " command: ./.buildkite/scripts/integration_tests.sh -t test-check-update-version"
118124
echo " env:"
119125
echo " DEFAULT_VERSION_TAG: v0.80.0"
126+
echo " DOCKER_COMPOSE_VERSION: \"false\""
127+
echo " DOCKER_VERSION: \"false\""
120128
echo " agents:"
121129
echo " image: \"${LINUX_AGENT_IMAGE}\""
122130
echo " cpu: \"8\""
123-
echo " memory: \"4G\""
131+
echo " memory: \"4G\""

.buildkite/pipeline.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
env:
22
SETUP_GVM_VERSION: 'v0.5.1' # https://github.com/andrewkroh/gvm/issues/44#issuecomment-1013231151
3-
ELASTIC_PACKAGE_COMPOSE_DISABLE_ANSI: "true"
4-
ELASTIC_PACKAGE_COMPOSE_DISABLE_PULL_PROGRESS_INFORMATION: "true"
3+
ELASTIC_PACKAGE_COMPOSE_DISABLE_VERBOSE_OUTPUT: "true"
4+
DOCKER_COMPOSE_VERSION: "v2.24.1"
5+
DOCKER_VERSION: "24.0.7"
56
KIND_VERSION: 'v0.20.0'
67
K8S_VERSION: 'v1.29.0'
78
LINUX_AGENT_IMAGE: "golang:${GO_VERSION}"

.buildkite/scripts/install_deps.sh

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,44 @@ add_bin_path(){
3434
export PATH="${WORKSPACE}/bin:${PATH}"
3535
}
3636

37+
with_docker() {
38+
if [[ "${DOCKER_VERSION:-"false"}" == "false" ]]; then
39+
echo "Skip docker installation"
40+
return
41+
fi
42+
local ubuntu_version
43+
local ubuntu_codename
44+
local architecture
45+
ubuntu_version="$(lsb_release -rs)" # 20.04
46+
ubuntu_codename="$(lsb_release -sc)" # focal
47+
architecture=$(dpkg --print-architecture)
48+
local debian_version="5:${DOCKER_VERSION}-1~ubuntu.${ubuntu_version}~${ubuntu_codename}"
49+
50+
sudo sudo mkdir -p /etc/apt/keyrings
51+
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
52+
echo "deb [arch=${architecture} signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu ${ubuntu_codename} stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
53+
sudo apt-get update
54+
sudo DEBIAN_FRONTEND=noninteractive apt-get install --allow-downgrades -y "docker-ce=${debian_version}"
55+
sudo DEBIAN_FRONTEND=noninteractive apt-get install --allow-downgrades -y "docker-ce-cli=${debian_version}"
56+
sudo systemctl start docker
57+
}
58+
59+
with_docker_compose_plugin() {
60+
if [[ "${DOCKER_COMPOSE_VERSION:-"false"}" == "false" ]]; then
61+
echo "Skip docker compose installation (plugin)"
62+
return
63+
fi
64+
create_bin_folder
65+
check_platform_architecture
66+
67+
local DOCKER_CONFIG="$HOME/.docker/cli-plugins"
68+
mkdir -p "$DOCKER_CONFIG"
69+
70+
retry 5 curl -SL -o ${DOCKER_CONFIG}/docker-compose "https://github.com/docker/compose/releases/download/${DOCKER_COMPOSE_VERSION}/docker-compose-${platform_type_lowercase}-${hw_type}"
71+
chmod +x ${DOCKER_CONFIG}/docker-compose
72+
docker compose version
73+
}
74+
3775
with_kubernetes() {
3876
create_bin_folder
3977
check_platform_architecture

.buildkite/scripts/integration_tests.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,12 @@ add_bin_path
109109
echo "--- install go"
110110
with_go
111111

112+
echo "--- install docker"
113+
with_docker
114+
115+
echo "--- install docker-compose plugin"
116+
with_docker_compose_plugin
117+
112118
if [[ "${TARGET}" == "${KIND_TARGET}" ]]; then
113119
echo "--- install kubectl & kind"
114120
with_kubernetes

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ test-stack-command-86:
6666
./scripts/test-stack-command.sh 8.6.2
6767

6868
test-stack-command-8x:
69-
./scripts/test-stack-command.sh 8.11.0-SNAPSHOT
69+
./scripts/test-stack-command.sh 8.12-SNAPSHOT
7070

7171
test-stack-command-with-apm-server:
7272
APM_SERVER_ENABLED=true ./scripts/test-stack-command.sh

README.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -625,6 +625,48 @@ The following settings are available per profile:
625625
* `stack.serverless.region` can be used to select the region to use when starting
626626
serverless projects.
627627

628+
## Useful environment variables
629+
630+
There are available some environment variables that could be used to change some of the
631+
`elastic-package` settings:
632+
633+
- Related to `docker-compose` / `docker compose` commands:
634+
- `ELASTIC_PACKAGE_COMPOSE_DISABLE_VERBOSE_OUTPUT`: If set to `true`, it disables the progress output from `docker compose`/`docker-compose` commands.
635+
- For versions v2 `< 2.19.0`, it sets `--ansi never` flag.
636+
- For versions v2 `>= 2.19.0`, it sets `--progress plain` flag and `--quiet-pull` for `up` sub-command`.
637+
638+
639+
- Related to global `elastic-package` settings:
640+
- `ELASTIC_PACKAGE_CHECK_UPDATE_DISABLED`: if set to `true`, `elastic-package` is not going to check
641+
for newer versions.
642+
- `ELASTIC_PACKAGE_PROFILE`: Name of the profile to be using.
643+
- `ELASTIC_PACKAGE_DATA_HOME`: Custom path to be used for `elastic-package` data directory. By default this is `~/.elastic-package`.
644+
645+
- Related to the build process:
646+
- `ELASTIC_PACKAGE_REPOSITORY_LICENSE`: Path to the default repository license.
647+
- `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.
648+
649+
- Related to signing packages:
650+
- `ELASTIC_PACKAGE_SIGNER_PRIVATE_KEYFILE`: Path to the private key file to sign packages.
651+
- `ELASTIC_PACKAGE_SIGNER_PASSPHRASE`: Passphrase to use the private key file.
652+
653+
- Related to tests:
654+
- `ELASTIC_PACKAGE_SERVERLESS_PIPELINE_TEST_DISABLE_COMPARE_RESULTS`: If set to `true`, the results from pipeline tests are not compared to avoid errors from GeoIP.
655+
656+
- To configure the Elastic stack to be used by `elastic-package`:
657+
- `ELASTIC_PACKAGE_ELASTICSEARCH_HOST`: Host of the elasticsearch (e.g. https://127.0.0.1:9200)
658+
- `ELASTIC_PACKAGE_ELASTICSEARCH_USERNAME`: User name to connect to elasticsearch (e.g. elastic)
659+
- `ELASTIC_PACKAGE_ELASTICSEARCH_PASSWORD`: Password of that user.
660+
- `ELASTIC_PACKAGE_ELASTICSEARCH_KIBANA_HOST`: Kibana URL (e.g. https://127.0.0.1:5601)
661+
- `ELASTIC_PACKAGE_ELASTICSEARCH_CA_CERT`: Path to the CA certificate to connect to the Elastic stack services.
662+
663+
- To configure an external metricstore while running benchmarks (more info at [system benchmarking docs](https://github.com/elastic/elastic-package/blob/main/docs/howto/system_benchmarking.md#setting-up-an-external-metricstore) or [rally benchmarking docs](https://github.com/elastic/elastic-package/blob/main/docs/howto/rally_benchmarking.md#setting-up-an-external-metricstore)):
664+
- `ELASTIC_PACKAGE_ESMETRICSTORE_HOST`: Host of the elasticsearch (e.g. https://127.0.0.1:9200)
665+
- `ELASTIC_PACKAGE_ESMETRICSTORE_USERNAME`: Username to connect to elasticsearch (e.g. elastic)
666+
- `ELASTIC_PACKAGE_ESMETRICSTORE_PASSWORD`: Password for the user.
667+
- `ELASTIC_PACKAGE_ESMETRICSTORE_CA_CERT`: Path to the CA certificate to connect to the Elastic stack services.
668+
669+
628670
## Release process
629671

630672
This project uses [GoReleaser](https://goreleaser.com/) to release a new version of the application (semver). Release publishing

go.mod

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ require (
1616
github.com/elastic/go-licenser v0.4.1
1717
github.com/elastic/go-resource v0.1.1
1818
github.com/elastic/go-ucfg v0.8.6
19-
github.com/elastic/package-spec/v3 v3.0.3
19+
github.com/elastic/package-spec/v3 v3.0.4
2020
github.com/fatih/color v1.16.0
2121
github.com/go-git/go-billy/v5 v5.5.0
2222
github.com/go-git/go-git/v5 v5.11.0
@@ -68,11 +68,11 @@ require (
6868
github.com/dnephin/pflag v1.0.7 // indirect
6969
github.com/dsnet/compress v0.0.2-0.20210315054119-f66993602bf5 // indirect
7070
github.com/elastic/gojsonschema v1.2.1 // indirect
71-
github.com/elastic/kbncontent v0.1.1 // indirect
71+
github.com/elastic/kbncontent v0.1.3 // indirect
7272
github.com/emicklei/go-restful/v3 v3.11.0 // indirect
7373
github.com/emirpasic/gods v1.18.1 // indirect
7474
github.com/evanphx/json-patch v5.7.0+incompatible // indirect
75-
github.com/evanphx/json-patch/v5 v5.7.0 // indirect
75+
github.com/evanphx/json-patch/v5 v5.8.1 // indirect
7676
github.com/exponent-io/jsonpath v0.0.0-20210407135951-1de76d718b3f // indirect
7777
github.com/fsnotify/fsnotify v1.7.0 // indirect
7878
github.com/go-errors/errors v1.4.2 // indirect

go.sum

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -100,10 +100,10 @@ github.com/elastic/go-ucfg v0.8.6 h1:stUeyh2goTgGX+/wb9gzKvTv0YB0231LTpKUgCKj4U0
100100
github.com/elastic/go-ucfg v0.8.6/go.mod h1:4E8mPOLSUV9hQ7sgLEJ4bvt0KhMuDJa8joDT2QGAEKA=
101101
github.com/elastic/gojsonschema v1.2.1 h1:cUMbgsz0wyEB4x7xf3zUEvUVDl6WCz2RKcQPul8OsQc=
102102
github.com/elastic/gojsonschema v1.2.1/go.mod h1:biw5eBS2Z4T02wjATMRSfecfjCmwaDPvuaqf844gLrg=
103-
github.com/elastic/kbncontent v0.1.1 h1:X6ZXKPTW3MwFZPLMZcPAbpUIsKQhFImhBGKOd83+UFo=
104-
github.com/elastic/kbncontent v0.1.1/go.mod h1:kOPREITK9gSJsiw/WKe7QWSO+PRiZMyEFQCw+CMLAHI=
105-
github.com/elastic/package-spec/v3 v3.0.3 h1:dkYujRWPwnE77kYfMKQ1W2YkDSHwY0ej9HG8F5wT2zY=
106-
github.com/elastic/package-spec/v3 v3.0.3/go.mod h1:proxSLyZsrgNOnWMqg01ROXcnU8b8DRa0OiY4T/dN90=
103+
github.com/elastic/kbncontent v0.1.3 h1:qT0RkshRhiAgH51dDD983tJloeLLMCYE/qlRRtn3R8k=
104+
github.com/elastic/kbncontent v0.1.3/go.mod h1:kOPREITK9gSJsiw/WKe7QWSO+PRiZMyEFQCw+CMLAHI=
105+
github.com/elastic/package-spec/v3 v3.0.4 h1:IZDRpVoMPztSgONUGbTR6re0VxpkitMDR/HwcLQpt7g=
106+
github.com/elastic/package-spec/v3 v3.0.4/go.mod h1:zMVyksPTDFsWxxdbw3ahXBs6O0G2tULA7HXjFl8w8zA=
107107
github.com/elazarl/goproxy v0.0.0-20230808193330-2592e75ae04a h1:mATvB/9r/3gvcejNsXKSkQ6lcIaNec2nyfOdlTBR2lU=
108108
github.com/elazarl/goproxy v0.0.0-20230808193330-2592e75ae04a/go.mod h1:Ro8st/ElPeALwNFlcTpWmkr6IoMFfkjXAvTHpevnDsM=
109109
github.com/emicklei/go-restful/v3 v3.11.0 h1:rAQeMHw1c7zTmncogyy8VvRZwtkmkZ4FxERmMY4rD+g=
@@ -114,8 +114,8 @@ github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.m
114114
github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
115115
github.com/evanphx/json-patch v5.7.0+incompatible h1:vgGkfT/9f8zE6tvSCe74nfpAVDQ2tG6yudJd8LBksgI=
116116
github.com/evanphx/json-patch v5.7.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk=
117-
github.com/evanphx/json-patch/v5 v5.7.0 h1:nJqP7uwL84RJInrohHfW0Fx3awjbm8qZeFv0nW9SYGc=
118-
github.com/evanphx/json-patch/v5 v5.7.0/go.mod h1:VNkHZ/282BpEyt/tObQO8s5CMPmYYq14uClGH4abBuQ=
117+
github.com/evanphx/json-patch/v5 v5.8.1 h1:iPEdwg0XayoS+E7Mth9JxwUtOgyVxnDTXHtKhZPlZxA=
118+
github.com/evanphx/json-patch/v5 v5.8.1/go.mod h1:VNkHZ/282BpEyt/tObQO8s5CMPmYYq14uClGH4abBuQ=
119119
github.com/exponent-io/jsonpath v0.0.0-20210407135951-1de76d718b3f h1:Wl78ApPPB2Wvf/TIe2xdyJxTlb6obmF18d8QdkxNDu4=
120120
github.com/exponent-io/jsonpath v0.0.0-20210407135951-1de76d718b3f/go.mod h1:OSYXu++VVOHnXeitef/D8n/6y4QV8uLHSFXX4NeXMGc=
121121
github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk=

internal/compose/compose.go

Lines changed: 22 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,12 @@ const (
3333
)
3434

3535
var (
36-
DisableANSIComposeEnv = environment.WithElasticPackagePrefix("COMPOSE_DISABLE_ANSI")
37-
DisablePullProgressInformationEnv = environment.WithElasticPackagePrefix("COMPOSE_DISABLE_PULL_PROGRESS_INFORMATION")
38-
EnableComposeStandaloneEnv = environment.WithElasticPackagePrefix("COMPOSE_ENABLE_STANDALONE")
36+
EnableComposeStandaloneEnv = environment.WithElasticPackagePrefix("COMPOSE_ENABLE_STANDALONE")
37+
DisableVerboseOutputComposeEnv = environment.WithElasticPackagePrefix("COMPOSE_DISABLE_VERBOSE_OUTPUT")
38+
)
39+
40+
const (
41+
defaultComposeProgressOutput = "plain"
3942
)
4043

4144
// Project represents a Docker Compose project.
@@ -47,6 +50,8 @@ type Project struct {
4750
dockerComposeStandalone bool
4851
disableANSI bool
4952
disablePullProgressInformation bool
53+
progressOutput string
54+
composeVersion *semver.Version
5055
}
5156

5257
// Config represents a Docker Compose configuration file.
@@ -204,13 +209,16 @@ func NewProject(name string, paths ...string) (*Project, error) {
204209
}
205210
logger.Debug(versionMessage)
206211

207-
v, ok = os.LookupEnv(DisableANSIComposeEnv)
212+
v, ok = os.LookupEnv(DisableVerboseOutputComposeEnv)
208213
if !c.dockerComposeV1 && ok && strings.ToLower(v) != "false" {
209-
c.disableANSI = true
210-
}
211-
212-
v, ok = os.LookupEnv(DisablePullProgressInformationEnv)
213-
if ok && strings.ToLower(v) != "false" {
214+
if c.composeVersion.LessThan(semver.MustParse("2.19.0")) {
215+
c.disableANSI = true
216+
} else {
217+
// --ansi never looks is ignored by "docker compose" and latest versions of "docker-compose"
218+
// adding --progress plain is a similar result as --ansi never
219+
// if set to "--progress quiet", there is no output at all from docker compose commands
220+
c.progressOutput = defaultComposeProgressOutput
221+
}
214222
c.disablePullProgressInformation = true
215223
}
216224

@@ -442,6 +450,10 @@ func (p *Project) baseArgs() []string {
442450
args = append(args, "--ansi", "never")
443451
}
444452

453+
if p.progressOutput != "" {
454+
args = append(args, "--progress", p.progressOutput)
455+
}
456+
445457
args = append(args, "-p", p.name)
446458
return args
447459
}
@@ -504,6 +516,7 @@ func (p *Project) dockerComposeVersion() (*semver.Version, error) {
504516
if err != nil {
505517
return nil, fmt.Errorf("docker compose version is not a valid semver (value: %s): %w", dcVersion, err)
506518
}
519+
p.composeVersion = ver
507520
return ver, nil
508521
}
509522

internal/install/stack_version.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@ package install
66

77
const (
88
// DefaultStackVersion is the default version of the stack
9-
DefaultStackVersion = "8.10.1"
9+
DefaultStackVersion = "8.11.4"
1010
)

0 commit comments

Comments
 (0)