Skip to content
This repository has been archived by the owner on Sep 17, 2024. It is now read-only.

chore: split stack configuration and start into two tasks #2044

Merged

Conversation

mdelapenya
Copy link
Contributor

What does this PR do?

It separates the configuration of the files and the start of the stack into two Ansible task

Why is it important?

We are seeing the following error:

CI Build: https://beats-ci.elastic.co/blue/organizations/jenkins/e2e-tests%2Fe2e-testing-mbp/detail/PR-2043/1/pipeline/

[2022-01-19T05:28:42.603Z] fatal: [18.221.0.131]: FAILED! => {"changed": true, "cmd": "sed -i '' -e 's,http://elasticsearch,http://18.221.0.131,g' /home/admin/e2e-testing/cli/config/compose/profiles/fleet/default/kibana.config.yml\nsed -i '' -e 's,http://fleet-server,http://18.221.0.131,g' /home/admin/e2e-testing/cli/config/compose/profiles/fleet/default/kibana.config.yml\nsed -i '' -e 's,http://package-registry:8080,https://epr-staging.elastic.co,g' /home/admin/e2e-testing/cli/config/compose/profiles/fleet/default/kibana.config.yml\nsudo docker-compose -f /home/admin/e2e-testing/cli/config/compose/profiles/fleet/docker-compose.yml up -d\n", "delta": "0:00:10.095906", "end": "2022-01-19 05:28:41.011431", "msg": "non-zero return code", "rc": 1, "start": "2022-01-19 05:28:30.915525", "stderr": "sed: can't read : No such file or directory\nsed: can't read : No such file or directory\nsed: can't read : No such file or directory\nfleet_elasticsearch_1 is up-to-date\nStarting fleet_kibana_1 ... \r\n\u001b[1A\u001b[2K\rStarting fleet_kibana_1 ... \u001b[32mdone\u001b[0m\r\u001b[1B\nERROR: for fleet-server Container "fafceed4afe9" is unhealthy.\nEncountered errors while bringing up the project.", "stderr_lines": ["sed: can't read : No such file or directory", "sed: can't read : No such file or directory", "sed: can't read : No such file or directory", "fleet_elasticsearch_1 is up-to-date", "Starting fleet_kibana_1 ... ", "\u001b[1A\u001b[2K", "Starting fleet_kibana_1 ... \u001b[32mdone\u001b[0m", "\u001b[1B", "ERROR: for fleet-server Container "fafceed4afe9" is unhealthy.", "Encountered errors while bringing up the project."], "stdout": "", "stdout_lines": []}

Even though the error relates to sed, I was able to SSH into the running machine and checked that the kibana config file was indeed modified:

$ cat /home/admin/e2e-testing/cli/config/compose/profiles/fleet/default/kibana.config.yml 
---
server.name: kibana
server.host: "0.0.0.0"

telemetry.enabled: false

elasticsearch.hosts: [ "http://3.145.95.35:9200" ]
elasticsearch.username: elastic
elasticsearch.password: changeme
xpack.monitoring.ui.container.elasticsearch.enabled: true

xpack.fleet.registryUrl: "https://epr-staging.elastic.co"
xpack.fleet.agents.enabled: true
xpack.fleet.agents.elasticsearch.host: "http://3.145.95.35:9200"
xpack.fleet.agents.fleet_server.hosts: ["http://3.145.95.35:8220"]

xpack.encryptedSavedObjects.encryptionKey: "12345678901234567890123456789012"
xpack.fleet.agents.tlsCheckDisabled: true

So I'd like to separate the configuration of the files and the start into two separate Ansible tasks, to better troubleshoot the issue.

Checklist

  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have made corresponding change to the default configuration files
  • I have added tests that prove my fix is effective or that my feature works
  • I have run the Unit tests (make unit-test), and they are passing locally
  • I have run the End-2-End tests for the suite I'm working on, and they are passing locally
  • I have noticed new Go dependencies (run make notice in the proper directory)

Related issues

@mdelapenya mdelapenya added backport-v7.16.0 Automated backport with mergify backport-v7.17.0 Automated backport with mergify backport-v8.0.0 Automated backport with mergify labels Jan 24, 2022
@mdelapenya mdelapenya self-assigned this Jan 24, 2022
@mdelapenya mdelapenya requested review from adam-stokes and a team January 24, 2022 10:18
@elasticmachine
Copy link
Contributor

💚 Flaky test report

Tests succeeded.

🤖 GitHub comments

To re-run your PR in the CI, just comment with:

  • /test : Re-trigger the build.

@mdelapenya mdelapenya merged commit 6d13132 into elastic:main Jan 24, 2022
mergify bot pushed a commit that referenced this pull request Jan 24, 2022
mergify bot pushed a commit that referenced this pull request Jan 24, 2022
mergify bot pushed a commit that referenced this pull request Jan 24, 2022
(cherry picked from commit 6d13132)

# Conflicts:
#	.ci/ansible/playbook.yml
@mdelapenya mdelapenya deleted the separate-start-stack-from-config-files branch January 24, 2022 12:07
mdelapenya added a commit that referenced this pull request Jan 24, 2022
)

(cherry picked from commit 6d13132)

Co-authored-by: Manuel de la Peña <[email protected]>
mdelapenya added a commit that referenced this pull request Jan 24, 2022
)

(cherry picked from commit 6d13132)

Co-authored-by: Manuel de la Peña <[email protected]>
mdelapenya added a commit that referenced this pull request Jan 24, 2022
)

(cherry picked from commit 6d13132)

# Conflicts:
#	.ci/ansible/playbook.yml

Co-authored-by: Manuel de la Peña <[email protected]>
mdelapenya added a commit to mdelapenya/e2e-testing that referenced this pull request Jan 26, 2022
* main: (45 commits)
  feat: add CentOS 8 support (elastic#2034)
  fix: set default region for AWS cli (elastic#2053)
  chore: use Ansible's built-in replace instead of sed (elastic#2048)
  chore: split stack configuration and start into two tasks (elastic#2044)
  feat: enable SSH access to users for debugging cloud instances (elastic#2001)
  fix: use the right branch for 7.17 backports (elastic#2025)
  SLES15 enablement (elastic#2007)
  chore: bump stale agent for main (elastic#2014)
  Update `fetchBeatsBinary` to be reused in elastic-agent-poc (elastic#1984)
  chore: add resiliency when provisioning the stack (elastic#1990)
  chore: bump elastic-package to v0.32.1 (elastic#1959)
  feat: export Fetch&Download methods in the /pkg directory (elastic#1943)
  bump stack version 8.1.0-dbc834fd (elastic#1948)
  bump stack version 8.1.0-76902d39 (elastic#1946)
  chore: retire 7.15 adding 7.17 (elastic#1938)
  ci: use withAPMEnv (elastic#1917)
  Update main branch (elastic#1928)
  bump stack version 8.1.0-befff95a (elastic#1929)
  chore: properly evaluate how tests are skipped on CI when checking modified files (elastic#1924)
  bump stack version 8.1.0-60bffc32 (elastic#1921)
  ...
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
backport-v7.16.0 Automated backport with mergify backport-v7.17.0 Automated backport with mergify backport-v8.0.0 Automated backport with mergify
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants