testcontainers-dotnet icon indicating copy to clipboard operation
testcontainers-dotnet copied to clipboard

Add pre-configured container for a single-node Elastic deployment

Open Xitric opened this issue 2 years ago • 7 comments

Is your feature request related to a problem? Please describe.

No problem, except we are in the process of creating our own custom Elasticsearch node configuration for testcontainers-dotnet, so I figured we might as well get it integrated upstream.

Describe the solution you'd like

Similarly to how testcontainers-java has an ElasticsearchContainer, it would be great to have an ElasticsearchTestcontainer in this repository. I would be happy to contribute this.

A few things I would like to have clarified before doing this:

Support for multiple major versions

The Java implementation has a single ElasticsearchContainer intended for use across all versions of Elastic, including the OSS distribution. It already has logic tailored to version 8 (isAtLeastMajorVersion8) and the OSS distribution (withPassword()), which could get ugly in the long term. Would you prefer a single container and configuration object, with support for multiple versions, or separate ones for each major version?

Single vs. multi-node

The java version currently only supports single-node operation. I think we should limit the ElasticsearchTestcontainer for this repository to single-node operation as well, and refer people to Docker Compose (once supported) if they need a multi-node cluster.

Describe alternatives you've considered

Keeping the configuration to ourselves in our private test helper projects. But where is the fun in that?

Additional context

I think it makes sense to do this as part of testcontainers#493 right away.

Xitric avatar Jul 02 '22 10:07 Xitric

I think it makes sense to do this as part of #493 right away.

Yes, it does 😀.

HofmeisterAn avatar Jul 02 '22 17:07 HofmeisterAn

Dunno if we should close this yet, but we have an MVP using the classic module implementation.

HofmeisterAn avatar Jul 27 '22 14:07 HofmeisterAn

Just to know...any eta for 2.2.0? we need ElasticSearch integration and I have to decide if add custom configuration to our projects or wait for a new library release.

So thanks.

meriturva avatar Sep 16 '22 10:09 meriturva

I would like to include the TLS feature in the next release. Most parts are done, but I think it will take another couple of days until we are ready for a release.

You can use the latest snapshot release in the meantime: 2.2.0-beta.2835065501, this includes #523.

HofmeisterAn avatar Sep 16 '22 10:09 HofmeisterAn

@HofmeisterAn i'm testing 2.2.0-beta.2835065501 version and i have problem to pull testimage:

Docker.DotNet.DockerImageNotFoundException : Docker API responded with status code=NotFound, response={"message":"No such image: testcontainers/ryuk:0.3.4"}

On command line docker pull testcontainers/ryuk:0.3.4 works like a charm.

Any advice?

meriturva avatar Sep 16 '22 13:09 meriturva

Did you remove the image and try it again? I know some devs have temporary issues pulling images. If you still have problems, please create another issue. Do you use a private registry? How does your Docker config look? Any custom configurations? Does docker images --filter=reference='testcontainers/ryuk:0.3.4' --all return something?

HofmeisterAn avatar Sep 16 '22 13:09 HofmeisterAn

Strange issue.... removed images and ran again and again without success...what I found is that elasticsearch image is pulled correctly using ElasticsearchTestcontainer class but not testcontainers/ryuk:0.3.4, If i run docker pull testcontainers/ryuk:0.3.4 everything is correct. I presume .net library uses the same approach for both images so really strange. @HofmeisterAn on your side everything run correctly? If the next days I will have the same problem I will create a new issue for sure!

meriturva avatar Sep 16 '22 14:09 meriturva

Since we now have the new release that includes the Elasticsearch module, I will close this issue. While it does not currently contain all the great features of the Java implementation, we can create an issue and add them over time if anything is missing.

HofmeisterAn avatar Mar 08 '23 10:03 HofmeisterAn