Skip to content

[CI] Add support to run system tests with different Elastic Agent docker images#10885

Closed
mrodm wants to merge 5 commits intoelastic:mainfrom
mrodm:add-support-test-docker-elastic-agent
Closed

[CI] Add support to run system tests with different Elastic Agent docker images#10885
mrodm wants to merge 5 commits intoelastic:mainfrom
mrodm:add-support-test-docker-elastic-agent

Conversation

@mrodm
Copy link
Copy Markdown
Collaborator

@mrodm mrodm commented Aug 26, 2024

Proposed commit message

Add support in the CI pipeline for Pull Requests to run system tests with different Elastic Agent docker images.

This is achieved by setting the ELASTIC_AGENT_IMAGE_REF_OVERRIDE environment variable, as mentioned in the docs: https://github.com/elastic/elastic-package/blob/main/docs/howto/custom_images.md#use-your-own-custom-images

Added temporarily a log message to show the base Elastic Agent docker image used in tests:

Base Elastic Agent image: docker.elastic.co/elastic-agent/elastic-agent:8.13.0
Base Elastic Agent image: docker.elastic.co/elastic-agent/elastic-agent:8.16.0-SNAPSHOT

Currently, by default elastic-package uses: docker.elastic.co/elastic-agent/elastic-agent-complete

Checklist

  • I have reviewed tips for building integrations and this pull request is aligned with them.
  • [ ] I have verified that all data streams collect metrics or logs.
  • [ ] I have added an entry to my package's changelog.yml file.
  • [ ] I have verified that Kibana version constraints are current according to guidelines.

Author's Checklist

  • Test Elastic Agent docker image override in stack and tests.

How to test this PR locally

The following steps will be performing the same changes as in this PR:

export ELASTIC_AGENT_IMAGE_REF_OVERRIDE=docker.elastic.co/elastic-agent/elastic-agent:8.16.0-SNAPSHOT

# This command should run Elastic Agent and Fleet Server with the docker image
# defined above instead of using the complete docker image
elastic-stack up -v -d --version 8.16.0-SNAPSHOT

# Check docker images
docker ps --format "{{.Names}} {{.Image}}" |grep "elastic-agent"

cd packages/nginx

# Run system tests to trigger new Elastic Agents
elastic-package test system -v 

# While running the system tests , check the docker images used by the Elastic Agent containers
docker ps --format "{{.Names}} {{.Image}}" |grep "elastic-agent"

Related issues

@elasticmachine
Copy link
Copy Markdown

elasticmachine commented Aug 26, 2024

🚀 Benchmarks report

To see the full report comment with /test benchmark fullreport

Comment on lines +522 to +527
if [[ "${ELASTIC_AGENT_DOCKER_IMAGE:-""}" != "" ]]; then
echo ""
echo "Images used for Elastic Agent:"
docker ps --format "{{.Names}} {{.Image}}" |grep "elastic-agent"
echo ""
fi
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Do you think this information would be helpful ?

These images are not the actual Elastic Agents running the system tests, they are the images from the stack (Fleet Server and Elastic Agent). It's also true that the agents would be using the same docker image as a base image.

@elasticmachine
Copy link
Copy Markdown

elasticmachine commented Aug 26, 2024

💔 Build Failed

Failed CI Steps

History

cc @mrodm

@mrodm mrodm marked this pull request as ready for review August 26, 2024 16:07
@mrodm mrodm requested a review from a team as a code owner August 26, 2024 16:07
@elastic-sonarqube
Copy link
Copy Markdown

Quality Gate passed Quality Gate passed

Issues
0 New issues
0 Fixed issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarQube

@mrodm
Copy link
Copy Markdown
Collaborator Author

mrodm commented Aug 27, 2024

Closing PR, the latest changes applied in elastic/elastic-package#2038 make not necessary to update the buildkite scripts.

@mrodm mrodm closed this Aug 27, 2024
@mrodm mrodm deleted the add-support-test-docker-elastic-agent branch August 27, 2024 15:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants