Skip to content

Add support to use wolfi Elastic Agent image starting in 8.16.0-SNAPSHOT#2038

Merged
mrodm merged 13 commits intoelastic:mainfrom
mrodm:add-elastic-agent-wolfi
Aug 29, 2024
Merged

Add support to use wolfi Elastic Agent image starting in 8.16.0-SNAPSHOT#2038
mrodm merged 13 commits intoelastic:mainfrom
mrodm:add-elastic-agent-wolfi

Conversation

@mrodm
Copy link
Copy Markdown
Contributor

@mrodm mrodm commented Aug 26, 2024

Relates elastic/elastic-agent#5062

Use wolfi docker images for Elastic Agent starting with 8.16.0 stack version.

This behaviour could be disabled by defining the environment variable: ELASTIC_PACKAGE_DISABLE_ELASTIC_AGENT_WOLFI

Examples:

# Run 8.16.0-SNAPSHOT with wolfi images
elastic-package stack up -v -d --version 8.16.0-SNAPSHOT
ELASTIC_PACKAGE_DISABLE_ELASTIC_AGENT_WOLFI=false elastic-package stack up -v -d --version 8.16.0-SNAPSHOT

# Run 8.16.0-SNAPSHTO with ubuntu images
ELASTIC_PACKAGE_DISABLE_ELASTIC_AGENT_WOLFI=true elastic-package stack up -v -d --version 8.16.0-SNAPSHOT

# Previous stack versions would keep using the same docker images as before
elastic-package stack up -v -d --version 8.15.0
elastic-package stack up -v -d --version 7.15.0

Build using wolfi images (failing since that docker image is not available yet):

Build disabling wolfi images:

@mrodm mrodm self-assigned this Aug 26, 2024
stackVersion820 = "8.2.0-SNAPSHOT"
stackVersion715 = "7.15.0-SNAPSHOT"
stackVersion820 = "8.2.0-SNAPSHOT"
stackVersion8160 = "8.16.0-00000000-SNAPSHOT"
Copy link
Copy Markdown
Contributor Author

@mrodm mrodm Aug 26, 2024

Choose a reason for hiding this comment

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

Using 8.16.0-SNAPSHOT here as version did not change the docker image used for 8.16.0-21bba6f5-SNAPSHOT. So, this change is also applied for the Makefile target stack-command-8x.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Maybe we can add a comment mentioning this. Or set it to 8.15.999.

I guess we didn't have the same problem with the snapshots above because we were not using tagged versions, right?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Exactly, previously tests were using SNAPSHOT versions without the commit in the prerelease tag.

I'll add a comment 👍

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Added comment in 094f898

@mrodm mrodm requested a review from a team August 27, 2024 08:37
Copy link
Copy Markdown
Member

@jsoriano jsoriano left a comment

Choose a reason for hiding this comment

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

LGTM, but before merging this, we need the overrides for the packages that need the complete images, right?

And maybe we need also an environment variable, or some way to disable wolfi images in case it breaks something in CI before it is GA.

stackVersion820 = "8.2.0-SNAPSHOT"
stackVersion715 = "7.15.0-SNAPSHOT"
stackVersion820 = "8.2.0-SNAPSHOT"
stackVersion8160 = "8.16.0-00000000-SNAPSHOT"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Maybe we can add a comment mentioning this. Or set it to 8.15.999.

I guess we didn't have the same problem with the snapshots above because we were not using tagged versions, right?

@mrodm
Copy link
Copy Markdown
Contributor Author

mrodm commented Aug 27, 2024

And maybe we need also an environment variable, or some way to disable wolfi images in case it breaks something in CI before it is GA.

Maybe it could be used the support added here to use another docker image: elastic/integrations#10885

But, packages that are tested with stack versions older than 8.2.0 would require a different docker image 🤔

I'll check to add a new environment variable to skip this wolfi image and update also the integrations PR.

@mrodm mrodm changed the title Use wolfi image from 8.16.0-SNAPSHOT Use wolfi Elastic Agent image starting in 8.16.0-SNAPSHOT Aug 27, 2024
@mrodm mrodm marked this pull request as ready for review August 27, 2024 16:20
@mrodm mrodm requested a review from jsoriano August 27, 2024 16:20
Copy link
Copy Markdown
Member

@jsoriano jsoriano left a comment

Choose a reason for hiding this comment

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

LGTM, but we need to wait for the image to be available, or disable this by default by now.


disableWolfiImages := false
valueEnv, ok := os.LookupEnv(disableElasticAgentWolfiEnvVar)
if ok && strings.ToLower(valueEnv) != "false" {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Perhaps we should default to true till the image is available if we want to merge this. Wdyt?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Ok, I'll push the changes to revert the condition.
Once the image is available I'll create a follow-up PR.

@mrodm
Copy link
Copy Markdown
Contributor Author

mrodm commented Aug 28, 2024

/test

@mrodm mrodm changed the title Use wolfi Elastic Agent image starting in 8.16.0-SNAPSHOT Add support to use wolfi Elastic Agent image starting in 8.16.0-SNAPSHOT Aug 28, 2024
@elasticmachine
Copy link
Copy Markdown
Collaborator

💚 Build Succeeded

History

cc @mrodm

@mrodm mrodm merged commit 3131065 into elastic:main Aug 29, 2024
@mrodm mrodm deleted the add-elastic-agent-wolfi branch August 29, 2024 09:34
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.

3 participants