Skip to content

Conversation

@mrodm
Copy link
Contributor

@mrodm mrodm commented Aug 28, 2024

What does this PR do?

Add a new setting into the system test configuration file to indicate the Elastic Agent base image to be used for testing.

Why is it important?

This new setting allows developers to set the required Elastic Agent base image for their packages.

Checklist

Related issues

@mrodm mrodm self-assigned this Aug 28, 2024
Comment on lines 38 to 45
description: >
"Elastic Agent image to be used for testing. Setting default will be used the
same Elastic Agent image as the stack."
type: string
enum:
- default
- complete
default: "default"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Complete would mean to use elastic-agent-complete image for docker.
Default the same image as the Elastic Agent from the stack.

enum:
- docker
default: docker
type:
Copy link
Member

Choose a reason for hiding this comment

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

Nit. Maybe we can be more explicit on the name of this parameter. But I don't have a better idea for this, maybe base_image, or base_image_type?

Suggested change
type:
base_image:

We have to keep in mind that this should be runtime-agnostic, but I think "image" is agnostic enough.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I was thinking in that and I had the same doubts.
I was wondering what would mean if at some point it is supported as runtime VMs.
Would it be used docker image inside that VM too ?

Copy link
Member

Choose a reason for hiding this comment

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

I was wondering what would mean if at some point it is supported as runtime VMs.
Would it be used docker image inside that VM too ?

I don't think so. Ideally we would install the agent directly in the VMs, or use an image that has the agent installed as a package or from tar/zip.
For the case of "complete" maybe we need to provide a different base image that includes the dependencies.
In that sense base_image would be fine and agnostic enough. It would not refer specifically to a docker image, but to a image in the general sense.

Another approach we could follow is to define this as dependencies or dependency sets:

depends: - synthetic_testing 

This indicates the runtime that the test depends on the agent running on a system with capability to run synthetic tests. This is resolved in the docker runtime by using the complete image, but could be resolved in other systems in different ways.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In that sense base_image would be fine and agnostic enough. It would not refer specifically to a docker image, but to a image in the general sense.

Using base_image looks good for me.

It would be like defining which kind of elastic-agent artifact/tar/zip it is required for that system test in a given package.

Another approach we could follow is to define this as dependencies or dependency sets

This approach would allow developers to be more detailed to specify the requirements of each test. However, not sure if that could be too fine grained and therefore complicate the logic to select the required artifact/zip/docker.

Copy link
Member

Choose a reason for hiding this comment

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

Another approach we could follow is to define this as dependencies or dependency sets

This approach would allow developers to be more detailed to specify the requirements of each test. However, not sure if that could be too fine grained and therefore complicate the logic to select the required artifact/zip/docker.

Agree, so far we have only had two kinds of images and I don't think we are going to have many more cases.

mrodm and others added 2 commits August 28, 2024 12:40
Co-authored-by: Jaime Soriano Pastor <jaime.soriano@elastic.co>
@mrodm mrodm changed the title Add agent.type setting in system configuration file Add agent.base_image setting in system configuration file Aug 28, 2024
@mrodm mrodm marked this pull request as ready for review August 28, 2024 15:26
@mrodm mrodm requested a review from a team as a code owner August 28, 2024 15:26
@mrodm mrodm requested a review from jsoriano August 28, 2024 15:26
@elasticmachine
Copy link

💚 Build Succeeded

History

cc @mrodm

@mrodm mrodm merged commit cec11fc into elastic:main Aug 29, 2024
@mrodm mrodm deleted the agent-type-setting-system-config branch August 29, 2024 08:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants