-
Notifications
You must be signed in to change notification settings - Fork 40.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add DB2 support for Docker Compose #42395
Conversation
ba97968
to
e7b437f
Compare
|
...st/resources/org/springframework/boot/docker/compose/service/connection/db2/db2-compose.yaml
Outdated
Show resolved
Hide resolved
Need more disk space to run tests. |
c7bbd7d
to
99e6757
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR, @quaff . I've left some comments for your consideration.
...t-support-docker/src/main/java/org/springframework/boot/testsupport/container/TestImage.java
Outdated
Show resolved
Hide resolved
image: '{imageName}' | ||
ports: | ||
- '50000' | ||
privileged: true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think you can run privileged
containers on the CI. Why is that needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Otherwise Connection reset
exception always be thrown, that's why testcontainers Db2Container
need that also.
https://github.com/testcontainers/testcontainers-java/blob/04206d9dff440e875906f01151f09ad04da3c68f/modules/db2/src/main/java/org/testcontainers/containers/Db2Container.java#L60
...st/resources/org/springframework/boot/docker/compose/service/connection/db2/db2-compose.yaml
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've added some comment, please have a look when you get a chance.
...t-support-docker/src/main/java/org/springframework/boot/testsupport/container/TestImage.java
Outdated
Show resolved
Hide resolved
...t-support-docker/src/main/java/org/springframework/boot/testsupport/container/TestImage.java
Outdated
Show resolved
Hide resolved
spring-boot-project/spring-boot-tools/spring-boot-test-support-docker/build.gradle
Outdated
Show resolved
Hide resolved
- '50000' | ||
privileged: true | ||
environment: | ||
- 'LICENSE=accept' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does this mean in practice?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Which part?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The LICENSE=accept
bit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's required by starting DB2 instance, testcontainers' DB2Container
need this also. see https://github.com/testcontainers/testcontainers-java/blob/04206d9dff440e875906f01151f09ad04da3c68f/modules/db2/src/main/java/org/testcontainers/containers/Db2Container.java#L104
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I understand that it's required, I am asking what it means in practice that our project starts accepting that license.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not for production use, I guess.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this is resolved as we haven't determined if we can legally accept the license for testing purposes. Knowing that Testcontainers has support for accepting the license is useful but it's opt-in and doesn't tell us if we can do the same automatically on CI and dev machines for testing purposes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not opt-in, Testcontainers accept the license by default.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
License is not accepted by default in Testcontainers. User must call acceptLicense()
, which sets the env var, when defining Db2Container
. See https://github.com/testcontainers/testcontainers-java/blob/main/modules/db2/src/test/java/org/testcontainers/junit/db2/SimpleDb2Test.java#L17
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My mistake, I forgot I added container-license-acceptance.txt
.
...t-support-docker/src/main/java/org/springframework/boot/testsupport/container/TestImage.java
Outdated
Show resolved
Hide resolved
...t-support-docker/src/main/java/org/springframework/boot/testsupport/container/TestImage.java
Outdated
Show resolved
Hide resolved
...t-support-docker/src/main/java/org/springframework/boot/testsupport/container/TestImage.java
Outdated
Show resolved
Hide resolved
...ct/spring-boot-docs/src/docs/antora/modules/appendix/pages/application-properties/index.adoc
Outdated
Show resolved
Hide resolved
I've force-pushed this having rebased it on the latest main. That should mean the PR picks up some recent changes to the runner preparation that will make more free disk space available. |
This is blocked until the questions regarding the licence acceptance have been resolved. |
I looks like DB2 is also being removed from Docker Hub (see https://community.ibm.com/community/user/datamanagement/blogs/vijaya-katikireddy/2023/02/04/db2-community). Given that and the license issues, I'm not sure that we should try to support this. |
This PR use new |
I believe that this is the relevant license. It contains the following usage restriction:
I think we could comply with the license by setting some CPU and memory limits in the compose files used for testing. Whether or not it's worth the trouble is another question. |
I think unfortunately the usage restrictions, combined with the fact that the image isn't in Docker Hub means we probably shouldn't add support for this. Thanks anyway for the PR @quaff! |
No description provided.