Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion internal/install/stack_version.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ package install

const (
// DefaultStackVersion is the default version of the stack
DefaultStackVersion = "8.5.1"
DefaultStackVersion = "8.6.1"
)
18 changes: 10 additions & 8 deletions internal/profile/_static/docker-compose-stack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ services:
image: "${ELASTICSEARCH_IMAGE_REF}"
healthcheck:
test: "curl -s --cacert /usr/share/elasticsearch/config/certs/ca-cert.pem -f -u elastic:changeme https://127.0.0.1:9200/_cat/health | cut -f4 -d' ' | grep -E '(green|yellow)'"
retries: 300
interval: 1s
start_period: 300s
interval: 5s
environment:
- "ES_JAVA_OPTS=-Xms1g -Xmx1g"
- "ELASTIC_PASSWORD=changeme"
Expand All @@ -32,8 +32,8 @@ services:
condition: service_healthy
healthcheck:
test: "sh /usr/share/kibana/healthcheck.sh"
retries: 600
interval: 1s
start_period: 600s
interval: 5s
env_file:
- "../certs/ca.env"
environment:
Expand All @@ -60,8 +60,8 @@ services:
PROFILE: "${PROFILE_NAME}"
healthcheck:
test: ["CMD", "curl", "--cacert", "/etc/ssl/package-registry/ca-cert.pem", "-f", "https://localhost:8080"]
retries: 300
interval: 1s
start_period: 300s
interval: 5s
environment:
- "EPR_LOG_LEVEL=debug"
- "EPR_ADDRESS=0.0.0.0:8080"
Expand Down Expand Up @@ -89,7 +89,7 @@ services:
condition: service_healthy
healthcheck:
test: "curl --cacert /etc/ssl/elastic-agent/ca-cert.pem -f https://localhost:8220/api/status | grep -i healthy 2>&1 >/dev/null"
retries: 60
start_period: 60s
interval: 5s
hostname: docker-fleet-server
environment:
Expand Down Expand Up @@ -124,8 +124,10 @@ services:
condition: service_healthy
healthcheck:
test: "elastic-agent status"
timeout: 2s
start_period: 360s
retries: 180
interval: 1s
interval: 5s
hostname: docker-fleet-agent
env_file: "./elastic-agent.${STACK_VERSION_VARIANT}.env"
volumes:
Expand Down
29 changes: 29 additions & 0 deletions internal/stack/boot.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,41 @@ func BootUp(options Options) error {

err = dockerComposeUp(options)
if err != nil {
// At least starting on 8.6.0, fleet-server may be reconfigured or
// restarted after being healthy. If elastic-agent tries to enroll at
// this moment, it fails inmediately, stopping and making `docker-compose up`
// to fail too.
// As a workaround, try to give another chance to docker-compose if only
// elastic-agent failed.
if onlyElasticAgentFailed() {
fmt.Println("Elastic Agent failed to start, trying again.")
err = dockerComposeUp(options)
}
Comment on lines +69 to +72
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

return errors.Wrap(err, "running docker-compose failed")
}

return nil
}

func onlyElasticAgentFailed() bool {
status, err := Status()
if err != nil {
fmt.Printf("Failed to check status of the stack after failure: %v\n", err)
return false
}

for _, service := range status {
if strings.Contains(service.Name, "elastic-agent") {
continue
}
if !strings.HasPrefix(service.Status, "running") {
return false
}
}

return true
}

// TearDown function takes down the testing stack.
func TearDown(options Options) error {
err := dockerComposeDown(options)
Expand Down
1 change: 0 additions & 1 deletion test/packages/benchmarks/pipeline_benchmark/manifest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ title: Pipeline benchmarks
version: 999.999.999
description: Test for pipeline test runner
categories: ["network"]
release: experimental
license: basic
type: integration
conditions:
Expand Down
1 change: 0 additions & 1 deletion test/packages/benchmarks/use_pipeline_tests/manifest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ title: Use pipeline tests for the benchmark
version: 999.999.999
description: Test for pipeline test runner
categories: ["network"]
release: experimental
license: basic
type: integration
conditions:
Expand Down
1 change: 0 additions & 1 deletion test/packages/other/multiinput/manifest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ title: Multi-input test
version: 999.999.999
description: Test for multiple input tests
categories: ["network"]
release: experimental
license: basic
type: integration
conditions:
Expand Down
1 change: 0 additions & 1 deletion test/packages/other/pipeline_tests/manifest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ title: Pipeline tests
version: 999.999.999
description: Test for pipeline test runner
categories: ["network"]
release: experimental
license: basic
type: integration
conditions:
Expand Down