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

docs: refactor docs to enable the local development#2454

Merged
mdelapenya merged 50 commits intoelastic:mainfrom
mdelapenya:ansible-deployments
May 5, 2022
Merged

docs: refactor docs to enable the local development#2454
mdelapenya merged 50 commits intoelastic:mainfrom
mdelapenya:ansible-deployments

Conversation

@mdelapenya
Copy link
Copy Markdown
Contributor

@mdelapenya mdelapenya commented Apr 30, 2022

What does this PR do?

This PR adds a guide to create and setup AWS instance using the same deployment mechanism of the CI. For that we are adding make goals to:

  • setup your local machine to have python, ansible and all runtime dependencies, using a virtual env.
  • use ansible to create and configure AWS instances.
  • create and configure a stack node for the elastic-stack
  • destroy the elastic-stack
  • recreate the fleet-server
  • destroy the stack node
  • create and configure a test node
  • destroy the test node
  • ssh into both nodes
  • run the tests for a suite and/or for specific tags

Besides, we have added docs to improve the experience of running this from the local machine. The user will only need to export their AWS credentials, and the automation will create and configure everything.

Why is it important?

Local experience must be as close to the CI as possible, if not equals. With this, we are executing the same commands as the CI to create and configure AWS instances, and run the test scenarios, with the ability to filter the execution using tags.

We honestly expect this change makes an impact in how the developers reproduce errors, or even test their stuff.

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)

Author's Checklist

  • I would need to test this on Windows / Linux

How to test this PR locally

Read the .ci/README.md file, and follow the instructions 😃

For example:

  1. Add your github username to the github-ssh-keys file (could be done without committing the file)
  2. export AWS settings and the SSH_KEY="$HOME/.ssh/my-github-key" used on Github, to enable SSH access to the machines
  3. make -C .ci setup-env to prepare Ansible
  4. make -C .ci create-stack to create and run the VM running the elastic-stack
  5. make -C .ci create-node to create the VM to run the tests (default is Debian AMD)
  6. make -C .ci run-tests TAGS="fleet_mode_agent && install" to run only the install scenario.
  7. make -C .ci run-tests TAGS="system_integration && deploy-system_integration-with-core" ELASTIC_AGENT_VERSION=8.2-SNAPSHOT BEAT_VERSION=8.2-SNAPSHOT to run only the system integration scenarios for core metrics only, having the agent and any other beat in 8.2-SNAPSHOT versions

Follow-ups

Next steps would be having the CI pipeline using these new make goals

mdelapenya and others added 7 commits May 2, 2022 15:57
Co-authored-by: Anderson Queiroz <me@andersonq.me>
Co-authored-by: Mike Place <mike.place@elastic.co>
This will allow setting the agent version in lower ones:

ELASTIC_AGENT_VERSION=8.1.3-SNAPSHOT make -C .ci create-node
@mdelapenya mdelapenya merged commit 0995a83 into elastic:main May 5, 2022
mergify bot pushed a commit that referenced this pull request May 5, 2022
* docs: update stack creation

* fix: add default value for gitSha

* docs: nodeUser too

* chore: always use .venv

* docs: make snippets copiable

* docs: do not hardcode path to repo, use current dir

* chore: add nodeUser to test nodes

* chore: update nodeLabel to debian AMD

* chore: consistency provisioning node tags

* chore: use current dir for workspace

* fix: check that suite is defined

* chore: automate the creation of cloud VMs

* chore: add runID as a tag in the VMs

* chore: make exporting variables explicit

* chore: reference the sshhosts files to get the IP addresses

* fix: remove variable name from runID file

* chore: store IP addresses in file

They will be used in the automation to locate the stack and node

* chore: support configuring the suite

* chore: support destroying the stack and nodes

* chore: remove node files

* chore: remove wait for strategy on fleet-server

* chore: command to recreate the stack

* chore: simplify creation of the nodes in one single command

* chore: support running the tests remotely

* chore: pass TAGS as a variable

* chore: configure tags for running the tests

* docs: document how to run the tests in the VMs

* chore: add goals to SSH into the machines

* chore: add a command to destroy the stack

* fix: typo

* fix: conflicts in goal name

* docs: document how to recreate the stack

* docs: refactor docs

* fix: pass bootstrap tag to the stack creation

* fix: set the tags in the ansible code

* fix: pass bootstrap tag to the stack creation

* chore: apply suggestions from code review

Co-authored-by: Anderson Queiroz <me@andersonq.me>
Co-authored-by: Mike Place <mike.place@elastic.co>

* fix: use proper hidden file name

* docs: explain how to locate the feature files and tags

* chore: check for runID where needed

* chore: adds commands to inspect the nodes

* fix: proper goal name

* fix: lookup env

This will allow setting the agent version in lower ones:

ELASTIC_AGENT_VERSION=8.1.3-SNAPSHOT make -C .ci create-node

* fix: close double quote

* fix: goal name was incorrect

* fix: bootstrap elastic stack properly

* docs: reference to the environment variables affecting the build

* chore: support configuring the remote

It will allow to run those scenarios that do not need a remote stack, such as dockerised ones

See apm-server feature file

* chore: use the stack VM to enroll the stand-alone agent

Co-authored-by: Anderson Queiroz <me@andersonq.me>
Co-authored-by: Mike Place <mike.place@elastic.co>
(cherry picked from commit 0995a83)
mergify bot pushed a commit that referenced this pull request May 5, 2022
* docs: update stack creation

* fix: add default value for gitSha

* docs: nodeUser too

* chore: always use .venv

* docs: make snippets copiable

* docs: do not hardcode path to repo, use current dir

* chore: add nodeUser to test nodes

* chore: update nodeLabel to debian AMD

* chore: consistency provisioning node tags

* chore: use current dir for workspace

* fix: check that suite is defined

* chore: automate the creation of cloud VMs

* chore: add runID as a tag in the VMs

* chore: make exporting variables explicit

* chore: reference the sshhosts files to get the IP addresses

* fix: remove variable name from runID file

* chore: store IP addresses in file

They will be used in the automation to locate the stack and node

* chore: support configuring the suite

* chore: support destroying the stack and nodes

* chore: remove node files

* chore: remove wait for strategy on fleet-server

* chore: command to recreate the stack

* chore: simplify creation of the nodes in one single command

* chore: support running the tests remotely

* chore: pass TAGS as a variable

* chore: configure tags for running the tests

* docs: document how to run the tests in the VMs

* chore: add goals to SSH into the machines

* chore: add a command to destroy the stack

* fix: typo

* fix: conflicts in goal name

* docs: document how to recreate the stack

* docs: refactor docs

* fix: pass bootstrap tag to the stack creation

* fix: set the tags in the ansible code

* fix: pass bootstrap tag to the stack creation

* chore: apply suggestions from code review

Co-authored-by: Anderson Queiroz <me@andersonq.me>
Co-authored-by: Mike Place <mike.place@elastic.co>

* fix: use proper hidden file name

* docs: explain how to locate the feature files and tags

* chore: check for runID where needed

* chore: adds commands to inspect the nodes

* fix: proper goal name

* fix: lookup env

This will allow setting the agent version in lower ones:

ELASTIC_AGENT_VERSION=8.1.3-SNAPSHOT make -C .ci create-node

* fix: close double quote

* fix: goal name was incorrect

* fix: bootstrap elastic stack properly

* docs: reference to the environment variables affecting the build

* chore: support configuring the remote

It will allow to run those scenarios that do not need a remote stack, such as dockerised ones

See apm-server feature file

* chore: use the stack VM to enroll the stand-alone agent

Co-authored-by: Anderson Queiroz <me@andersonq.me>
Co-authored-by: Mike Place <mike.place@elastic.co>
(cherry picked from commit 0995a83)
mergify bot pushed a commit that referenced this pull request May 5, 2022
* docs: update stack creation

* fix: add default value for gitSha

* docs: nodeUser too

* chore: always use .venv

* docs: make snippets copiable

* docs: do not hardcode path to repo, use current dir

* chore: add nodeUser to test nodes

* chore: update nodeLabel to debian AMD

* chore: consistency provisioning node tags

* chore: use current dir for workspace

* fix: check that suite is defined

* chore: automate the creation of cloud VMs

* chore: add runID as a tag in the VMs

* chore: make exporting variables explicit

* chore: reference the sshhosts files to get the IP addresses

* fix: remove variable name from runID file

* chore: store IP addresses in file

They will be used in the automation to locate the stack and node

* chore: support configuring the suite

* chore: support destroying the stack and nodes

* chore: remove node files

* chore: remove wait for strategy on fleet-server

* chore: command to recreate the stack

* chore: simplify creation of the nodes in one single command

* chore: support running the tests remotely

* chore: pass TAGS as a variable

* chore: configure tags for running the tests

* docs: document how to run the tests in the VMs

* chore: add goals to SSH into the machines

* chore: add a command to destroy the stack

* fix: typo

* fix: conflicts in goal name

* docs: document how to recreate the stack

* docs: refactor docs

* fix: pass bootstrap tag to the stack creation

* fix: set the tags in the ansible code

* fix: pass bootstrap tag to the stack creation

* chore: apply suggestions from code review

Co-authored-by: Anderson Queiroz <me@andersonq.me>
Co-authored-by: Mike Place <mike.place@elastic.co>

* fix: use proper hidden file name

* docs: explain how to locate the feature files and tags

* chore: check for runID where needed

* chore: adds commands to inspect the nodes

* fix: proper goal name

* fix: lookup env

This will allow setting the agent version in lower ones:

ELASTIC_AGENT_VERSION=8.1.3-SNAPSHOT make -C .ci create-node

* fix: close double quote

* fix: goal name was incorrect

* fix: bootstrap elastic stack properly

* docs: reference to the environment variables affecting the build

* chore: support configuring the remote

It will allow to run those scenarios that do not need a remote stack, such as dockerised ones

See apm-server feature file

* chore: use the stack VM to enroll the stand-alone agent

Co-authored-by: Anderson Queiroz <me@andersonq.me>
Co-authored-by: Mike Place <mike.place@elastic.co>
(cherry picked from commit 0995a83)

# Conflicts:
#	e2e/_suites/fleet/fleet.go
@mdelapenya mdelapenya deleted the ansible-deployments branch May 5, 2022 14:00
mdelapenya added a commit to mdelapenya/e2e-testing that referenced this pull request May 5, 2022
* main:
  docs: refactor docs to enable the local development (elastic#2454)
mdelapenya added a commit to mdelapenya/e2e-testing that referenced this pull request May 5, 2022
* main:
  docs: refactor docs to enable the local development (elastic#2454)
  bump stack version 8.3.0-a1c5cfff (elastic#2474)
  bump stack version 8.3.0-7f585873 (elastic#2469)
mdelapenya added a commit that referenced this pull request May 5, 2022
* docs: update stack creation

* fix: add default value for gitSha

* docs: nodeUser too

* chore: always use .venv

* docs: make snippets copiable

* docs: do not hardcode path to repo, use current dir

* chore: add nodeUser to test nodes

* chore: update nodeLabel to debian AMD

* chore: consistency provisioning node tags

* chore: use current dir for workspace

* fix: check that suite is defined

* chore: automate the creation of cloud VMs

* chore: add runID as a tag in the VMs

* chore: make exporting variables explicit

* chore: reference the sshhosts files to get the IP addresses

* fix: remove variable name from runID file

* chore: store IP addresses in file

They will be used in the automation to locate the stack and node

* chore: support configuring the suite

* chore: support destroying the stack and nodes

* chore: remove node files

* chore: remove wait for strategy on fleet-server

* chore: command to recreate the stack

* chore: simplify creation of the nodes in one single command

* chore: support running the tests remotely

* chore: pass TAGS as a variable

* chore: configure tags for running the tests

* docs: document how to run the tests in the VMs

* chore: add goals to SSH into the machines

* chore: add a command to destroy the stack

* fix: typo

* fix: conflicts in goal name

* docs: document how to recreate the stack

* docs: refactor docs

* fix: pass bootstrap tag to the stack creation

* fix: set the tags in the ansible code

* fix: pass bootstrap tag to the stack creation

* chore: apply suggestions from code review

Co-authored-by: Anderson Queiroz <me@andersonq.me>
Co-authored-by: Mike Place <mike.place@elastic.co>

* fix: use proper hidden file name

* docs: explain how to locate the feature files and tags

* chore: check for runID where needed

* chore: adds commands to inspect the nodes

* fix: proper goal name

* fix: lookup env

This will allow setting the agent version in lower ones:

ELASTIC_AGENT_VERSION=8.1.3-SNAPSHOT make -C .ci create-node

* fix: close double quote

* fix: goal name was incorrect

* fix: bootstrap elastic stack properly

* docs: reference to the environment variables affecting the build

* chore: support configuring the remote

It will allow to run those scenarios that do not need a remote stack, such as dockerised ones

See apm-server feature file

* chore: use the stack VM to enroll the stand-alone agent

Co-authored-by: Anderson Queiroz <me@andersonq.me>
Co-authored-by: Mike Place <mike.place@elastic.co>
(cherry picked from commit 0995a83)

Co-authored-by: Manuel de la Peña <mdelapenya@gmail.com>
mdelapenya added a commit that referenced this pull request May 5, 2022
…pment (#2480)

* docs: refactor docs to enable the local development (#2454)

* docs: update stack creation

* fix: add default value for gitSha

* docs: nodeUser too

* chore: always use .venv

* docs: make snippets copiable

* docs: do not hardcode path to repo, use current dir

* chore: add nodeUser to test nodes

* chore: update nodeLabel to debian AMD

* chore: consistency provisioning node tags

* chore: use current dir for workspace

* fix: check that suite is defined

* chore: automate the creation of cloud VMs

* chore: add runID as a tag in the VMs

* chore: make exporting variables explicit

* chore: reference the sshhosts files to get the IP addresses

* fix: remove variable name from runID file

* chore: store IP addresses in file

They will be used in the automation to locate the stack and node

* chore: support configuring the suite

* chore: support destroying the stack and nodes

* chore: remove node files

* chore: remove wait for strategy on fleet-server

* chore: command to recreate the stack

* chore: simplify creation of the nodes in one single command

* chore: support running the tests remotely

* chore: pass TAGS as a variable

* chore: configure tags for running the tests

* docs: document how to run the tests in the VMs

* chore: add goals to SSH into the machines

* chore: add a command to destroy the stack

* fix: typo

* fix: conflicts in goal name

* docs: document how to recreate the stack

* docs: refactor docs

* fix: pass bootstrap tag to the stack creation

* fix: set the tags in the ansible code

* fix: pass bootstrap tag to the stack creation

* chore: apply suggestions from code review

Co-authored-by: Anderson Queiroz <me@andersonq.me>
Co-authored-by: Mike Place <mike.place@elastic.co>

* fix: use proper hidden file name

* docs: explain how to locate the feature files and tags

* chore: check for runID where needed

* chore: adds commands to inspect the nodes

* fix: proper goal name

* fix: lookup env

This will allow setting the agent version in lower ones:

ELASTIC_AGENT_VERSION=8.1.3-SNAPSHOT make -C .ci create-node

* fix: close double quote

* fix: goal name was incorrect

* fix: bootstrap elastic stack properly

* docs: reference to the environment variables affecting the build

* chore: support configuring the remote

It will allow to run those scenarios that do not need a remote stack, such as dockerised ones

See apm-server feature file

* chore: use the stack VM to enroll the stand-alone agent

Co-authored-by: Anderson Queiroz <me@andersonq.me>
Co-authored-by: Mike Place <mike.place@elastic.co>
(cherry picked from commit 0995a83)

# Conflicts:
#	e2e/_suites/fleet/fleet.go

* fix: resolve conflicts

Co-authored-by: Manuel de la Peña <mdelapenya@gmail.com>
mdelapenya added a commit that referenced this pull request May 9, 2022
* docs: update stack creation

* fix: add default value for gitSha

* docs: nodeUser too

* chore: always use .venv

* docs: make snippets copiable

* docs: do not hardcode path to repo, use current dir

* chore: add nodeUser to test nodes

* chore: update nodeLabel to debian AMD

* chore: consistency provisioning node tags

* chore: use current dir for workspace

* fix: check that suite is defined

* chore: automate the creation of cloud VMs

* chore: add runID as a tag in the VMs

* chore: make exporting variables explicit

* chore: reference the sshhosts files to get the IP addresses

* fix: remove variable name from runID file

* chore: store IP addresses in file

They will be used in the automation to locate the stack and node

* chore: support configuring the suite

* chore: support destroying the stack and nodes

* chore: remove node files

* chore: remove wait for strategy on fleet-server

* chore: command to recreate the stack

* chore: simplify creation of the nodes in one single command

* chore: support running the tests remotely

* chore: pass TAGS as a variable

* chore: configure tags for running the tests

* docs: document how to run the tests in the VMs

* chore: add goals to SSH into the machines

* chore: add a command to destroy the stack

* fix: typo

* fix: conflicts in goal name

* docs: document how to recreate the stack

* docs: refactor docs

* fix: pass bootstrap tag to the stack creation

* fix: set the tags in the ansible code

* fix: pass bootstrap tag to the stack creation

* chore: apply suggestions from code review

Co-authored-by: Anderson Queiroz <me@andersonq.me>
Co-authored-by: Mike Place <mike.place@elastic.co>

* fix: use proper hidden file name

* docs: explain how to locate the feature files and tags

* chore: check for runID where needed

* chore: adds commands to inspect the nodes

* fix: proper goal name

* fix: lookup env

This will allow setting the agent version in lower ones:

ELASTIC_AGENT_VERSION=8.1.3-SNAPSHOT make -C .ci create-node

* fix: close double quote

* fix: goal name was incorrect

* fix: bootstrap elastic stack properly

* docs: reference to the environment variables affecting the build

* chore: support configuring the remote

It will allow to run those scenarios that do not need a remote stack, such as dockerised ones

See apm-server feature file

* chore: use the stack VM to enroll the stand-alone agent

Co-authored-by: Anderson Queiroz <me@andersonq.me>
Co-authored-by: Mike Place <mike.place@elastic.co>
(cherry picked from commit 0995a83)

Co-authored-by: Manuel de la Peña <mdelapenya@gmail.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area:ci Anything related to the CI area:documentation Anything related to the Observability Robots documentation area:test Anything related to the Test automation backport-v7.17.0 Automated backport with mergify backport-v8.1.0 Automated backport with mergify backport-v8.2.0 Automated backport with mergify Team:Automation Label for the Observability productivity team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants