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

feat: add oceanbase-ce module

Open whhe opened this issue 2 years ago • 15 comments

OceanBase is a distributed relational database developed by Ant Group, and its community edition is open sourced at https://github.com/oceanbase/oceanbase.

There is a docker image maintained by the official team, and in this pull request I add OceanBaseContainer and OceanBaseContainerProvider for a new oceanbase-ce module based on the docker image. https://github.com/oceanbase/oceanbase/tree/master/tools/docker/standalone.

whhe avatar Sep 06 '23 06:09 whhe

Thanks for your contribution! I have left some suggestions. Please, also take a look at at the build which just failed.

Thank you for your review, I have addressed the comments in the latest commit.

For the CI failure, it seems the container start failed, and I guess the reason may be the memory is not enought. To start the docker container of OceanBase, at least 2 cpu and 8g memory are required.

whhe avatar Sep 07 '23 03:09 whhe

To start the docker container of OceanBase, at least 2 cpu and 8g memory are required.

I think this is a concern due to IIRC Docker Desktop provides a default of 4g or 8g so it will be at limit all the time not even allowing running other test in parallel. Is there any way to consume less resources. So far, I've seen DB2 consuming ~1.75g

eddumelendez avatar Sep 07 '23 05:09 eddumelendez

To start the docker container of OceanBase, at least 2 cpu and 8g memory are required.

I think this is a concern due to IIRC Docker Desktop provides a default of 4g or 8g so it will be at limit all the time not even allowing running other test in parallel. Is there any way to consume less resources. So far, I've seen DB2 consuming ~1.75g

We have a plan to achieve lightweight deployment, but it may be difficult to achieve it in the near future.

Now we can't deploy the container on a free GitHub agent. For reference, we use the docker image through testcontainers on a self-hosted CI service in flink cdc.

whhe avatar Sep 07 '23 05:09 whhe

Now we can't deploy the container on a free GitHub agent.

TBH, I think for now it will keep on hold if that the case 😕

Another option is to self-host the module as others do.

eddumelendez avatar Sep 07 '23 05:09 eddumelendez

Now we can't deploy the container on a free GitHub agent.

TBH, I think for now it will keep on hold if that the case 😕

Another option is to self-host the module as others do.

OK, I understand. I would convert this pull request to a draft, and we can continue the process after https://github.com/oceanbase/oceanbase/issues/1557 is basically completed.

whhe avatar Sep 07 '23 06:09 whhe

great! Thanks for your understanding! I'll be following the issue in order to get updates

eddumelendez avatar Sep 07 '23 06:09 eddumelendez

I updated the container class with the new image oceanbase/oceanbase-ce:4.2.0.0 which can be deployed on GitHub Action now https://hub.docker.com/r/oceanbase/oceanbase-ce.

Currently the startup time is still more than 1 minute, I think we can use 3 min in this version and update it when https://github.com/oceanbase/oceanbase/issues/1573 is released. WDYT? @eddumelendez

whhe avatar Sep 20 '23 08:09 whhe

Hi @whhe, great to see the improvements. Currently, 1 min is the maximum value we are setting. I would say reaching that limit would produce a not good experience when running tests, of course, it depends how those are set too. IMO, we can wait a little bit more and provide the best experience possible when the other issue is fixed.

eddumelendez avatar Sep 25 '23 14:09 eddumelendez

Hi @whhe, great to see the improvements. Currently, 1 min is the maximum value we are setting. I would say reaching that limit would produce a not good experience when running tests, of course, it depends how those are set too. IMO, we can wait a little bit more and provide the best experience possible when the other issue is fixed.

Thanks for the suggestion, I think it makes perfect sense, will update this PR with the new image later.

whhe avatar Sep 26 '23 03:09 whhe

Hi @eddumelendez, I updated this PR with our latest docker image, which can start in less than 30s with FASTBOOT enabled. I think we can go back to the review process now.

whhe avatar Jan 05 '24 09:01 whhe

@eddumelendez PTAL if you are available.

whhe avatar Jan 24 '24 06:01 whhe

Hi @eddumelendez, is there any plan for this pr?

whhe avatar Feb 01 '24 03:02 whhe

Thanks for your contribution, @whhe ! and sorry for the late reply. I have left some comments and some more general:

  1. Rename the module to oceanbase. Is it ok for you?
  2. Package should be org.testcontainers.oceanbase
  3. Run ./gradlew spotlessApply

Thanks for your review and sorry for the late reply, I just came back from the Chinese new year holiday.

I will address the comments soon, but for the module name, I used 'oceanbase-ce' because the community will most likely release a 'oceanbase-xe' docker image in the future for the OceanBase Enterprise Edition. So I think we'd better keep it here.

whhe avatar Feb 18 '24 02:02 whhe

I think in that case the module can still be oceanbase and contain two implementations OceanbaseCEContainer and OceanbaseXEContainer, it depends in how much difference there is between both of them.

eddumelendez avatar Feb 18 '24 04:02 eddumelendez

@eddumelendez PR updated, PTAL.

whhe avatar Feb 22 '24 06:02 whhe

@eddumelendez Look forward to your feedback.

whhe avatar Feb 26 '24 03:02 whhe

One last change, can we add an entry for oceanbase here, please?

eddumelendez avatar Feb 27 '24 23:02 eddumelendez

Thanks for your contribution, @whhe !

eddumelendez avatar Feb 28 '24 23:02 eddumelendez