You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@james.apache.org by GitBox <gi...@apache.org> on 2022/06/28 10:42:08 UTC

[GitHub] [james-project] vttranlina opened a new pull request, #1070: [Cleanup] - Testcontainer - The docker image of test dependencies (cassandra, s3...) should be one immutable

vttranlina opened a new pull request, #1070:
URL: https://github.com/apache/james-project/pull/1070

   - The container can be singleton or non-singleton, but the image should be created one time


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org
For additional commands, e-mail: notifications-help@james.apache.org


[GitHub] [james-project] quantranhong1999 commented on a diff in pull request #1070: [Cleanup] - Testcontainer - The docker image of test dependencies (cassandra, s3...) should be one immutable

Posted by GitBox <gi...@apache.org>.
quantranhong1999 commented on code in PR #1070:
URL: https://github.com/apache/james-project/pull/1070#discussion_r909444131


##########
backends-common/cassandra/src/test/java/org/apache/james/backends/cassandra/DockerCassandra.java:
##########
@@ -164,7 +165,7 @@ public void close() throws IOException {
         });
         boolean doNotDeleteImageAfterUsage = false;
         cassandraContainer = new GenericContainer<>(
-            new ImageFromDockerfile(imageName,doNotDeleteImageAfterUsage)
+            new ImageFromDockerfile("james-testing-cassandra", doNotDeleteImageAfterUsage)

Review Comment:
   I read our extension code and I don't think this help much, here is the reason why IMO:
   - I guess the idea here is to avoid creating duplicated images with different names. But if we utilize the SINGLETON properly, we already avoid this.
   - These image/container decleration is just their blueprint declaration. The actual image/container is not created until `container.start()` is called. So our singleton is likely just saving the blueprint declaration overhead. But we still should make sure we utilize that SINGLETON though (I make a commit for LDAP [here](https://github.com/quantranhong1999/james-project/commit/dc2c2c0a9a36a1f3fcc68ba0a4980ebc5231583d). I check other SINGLETON usage and we are good).
   
   Another finding related to this is our testing containers are already being cleaned up by calling `container.stop()`. I run a few tests and see the images are being cleaned up also (not dig where yet but must be somewhere).



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org
For additional commands, e-mail: notifications-help@james.apache.org


[GitHub] [james-project] vttranlina closed pull request #1070: [Cleanup] - Testcontainer - The docker image of test dependencies (cassandra, s3...) should be one immutable

Posted by GitBox <gi...@apache.org>.
vttranlina closed pull request #1070: [Cleanup] - Testcontainer - The docker image of test dependencies (cassandra, s3...) should be one immutable
URL: https://github.com/apache/james-project/pull/1070


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org
For additional commands, e-mail: notifications-help@james.apache.org


[GitHub] [james-project] chibenwa commented on a diff in pull request #1070: [Cleanup] - Testcontainer - The docker image of test dependencies (cassandra, s3...) should be one immutable

Posted by GitBox <gi...@apache.org>.
chibenwa commented on code in PR #1070:
URL: https://github.com/apache/james-project/pull/1070#discussion_r909527131


##########
backends-common/cassandra/src/test/java/org/apache/james/backends/cassandra/DockerCassandra.java:
##########
@@ -164,7 +165,7 @@ public void close() throws IOException {
         });
         boolean doNotDeleteImageAfterUsage = false;
         cassandraContainer = new GenericContainer<>(
-            new ImageFromDockerfile(imageName,doNotDeleteImageAfterUsage)
+            new ImageFromDockerfile("james-testing-cassandra", doNotDeleteImageAfterUsage)

Review Comment:
   > I guess the idea here is to avoid creating duplicated images with different names. But if we utilize the SINGLETON properly, we already avoid this.
   
   Not across maven modules. Surefires forks runs on their own JVM.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org
For additional commands, e-mail: notifications-help@james.apache.org


[GitHub] [james-project] Arsnael commented on a diff in pull request #1070: [Cleanup] - Testcontainer - The docker image of test dependencies (cassandra, s3...) should be one immutable

Posted by GitBox <gi...@apache.org>.
Arsnael commented on code in PR #1070:
URL: https://github.com/apache/james-project/pull/1070#discussion_r909660071


##########
backends-common/cassandra/src/test/java/org/apache/james/backends/cassandra/DockerCassandra.java:
##########
@@ -177,6 +178,7 @@ public void close() throws IOException {
                         .build()))
             .withTmpFs(ImmutableMap.of("/var/lib/cassandra", "rw,noexec,nosuid,size=200m"))
             .withExposedPorts(CASSANDRA_PORT)
+            .withCreateContainerCmdModifier(createContainerCmd -> createContainerCmd.withName(containerName))

Review Comment:
   Likely why you get the error message in your build, as you don't put a random uuid following the name for cassandra (while you seem to do it on others):
   
   ```
   Status 409: {"message":"Conflict. The container name \"/cassandra_3_11_10-e9b18f2d-9f3f-4eee-b090-2f6058d8654c\" is already in use by container \"03dcdd47a7c1e63c57cea23db20eb54df386249ed19dc2e60b06293b07afd2d1\". You have to remove (or rename) that container to be able to reuse that name."}
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org
For additional commands, e-mail: notifications-help@james.apache.org


[GitHub] [james-project] vttranlina commented on pull request #1070: [Cleanup] - Testcontainer - The docker image of test dependencies (cassandra, s3...) should be one immutable

Posted by GitBox <gi...@apache.org>.
vttranlina commented on PR #1070:
URL: https://github.com/apache/james-project/pull/1070#issuecomment-1200635166

   closed 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org
For additional commands, e-mail: notifications-help@james.apache.org


[GitHub] [james-project] vttranlina closed pull request #1070: [Cleanup] - Testcontainer - The docker image of test dependencies (cassandra, s3...) should be one immutable

Posted by GitBox <gi...@apache.org>.
vttranlina closed pull request #1070: [Cleanup] - Testcontainer - The docker image of test dependencies (cassandra, s3...) should be one immutable
URL: https://github.com/apache/james-project/pull/1070


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org
For additional commands, e-mail: notifications-help@james.apache.org


[GitHub] [james-project] quantranhong1999 commented on a diff in pull request #1070: [Cleanup] - Testcontainer - The docker image of test dependencies (cassandra, s3...) should be one immutable

Posted by GitBox <gi...@apache.org>.
quantranhong1999 commented on code in PR #1070:
URL: https://github.com/apache/james-project/pull/1070#discussion_r909543576


##########
backends-common/cassandra/src/test/java/org/apache/james/backends/cassandra/DockerCassandra.java:
##########
@@ -164,7 +165,7 @@ public void close() throws IOException {
         });
         boolean doNotDeleteImageAfterUsage = false;
         cassandraContainer = new GenericContainer<>(
-            new ImageFromDockerfile(imageName,doNotDeleteImageAfterUsage)
+            new ImageFromDockerfile("james-testing-cassandra", doNotDeleteImageAfterUsage)

Review Comment:
   With different JVM, even with the same image name we still create the images again. The thing we gain here is reducing the memory used to store the images but during only the testing phase, cause these images got cleaned up (somewhere/somehow).
   Not much better IMO, but it is still an improvement.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org
For additional commands, e-mail: notifications-help@james.apache.org


[GitHub] [james-project] vttranlina commented on pull request #1070: [Cleanup] - Testcontainer - The docker image of test dependencies (cassandra, s3...) should be one immutable

Posted by GitBox <gi...@apache.org>.
vttranlina commented on PR #1070:
URL: https://github.com/apache/james-project/pull/1070#issuecomment-1177335573

   > IMO we should put `james-testing-xxx-01` so that if I modify the docker file I can ensure I get the new image to be used...
   
   the image will be auto removed after the test (done by testcontainer). 
   
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org
For additional commands, e-mail: notifications-help@james.apache.org


[GitHub] [james-project] quantranhong1999 commented on a diff in pull request #1070: [Cleanup] - Testcontainer - The docker image of test dependencies (cassandra, s3...) should be one immutable

Posted by GitBox <gi...@apache.org>.
quantranhong1999 commented on code in PR #1070:
URL: https://github.com/apache/james-project/pull/1070#discussion_r909546652


##########
backends-common/cassandra/src/test/java/org/apache/james/backends/cassandra/DockerCassandra.java:
##########
@@ -164,7 +165,7 @@ public void close() throws IOException {
         });
         boolean doNotDeleteImageAfterUsage = false;
         cassandraContainer = new GenericContainer<>(
-            new ImageFromDockerfile(imageName,doNotDeleteImageAfterUsage)
+            new ImageFromDockerfile("james-testing-cassandra", doNotDeleteImageAfterUsage)

Review Comment:
   The interesting thing here maybe is how we cleaned up the images and make sure we clean them everywhere.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org
For additional commands, e-mail: notifications-help@james.apache.org


[GitHub] [james-project] vttranlina commented on pull request #1070: [Cleanup] - Testcontainer - The docker image of test dependencies (cassandra, s3...) should be one immutable

Posted by GitBox <gi...@apache.org>.
vttranlina commented on PR #1070:
URL: https://github.com/apache/james-project/pull/1070#issuecomment-1177337094

   The docker image already is a singleton for each JVM. 
   As @quantranhong1999  point, It not much benefits 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org
For additional commands, e-mail: notifications-help@james.apache.org


[GitHub] [james-project] vttranlina commented on pull request #1070: [Cleanup] - Testcontainer - The docker image of test dependencies (cassandra, s3...) should be one immutable

Posted by GitBox <gi...@apache.org>.
vttranlina commented on PR #1070:
URL: https://github.com/apache/james-project/pull/1070#issuecomment-1177342174

   Reopen to check other error from CI  (Will be closed later)
   
   ```
   - Build 1: https://ci-builds.apache.org/job/james/job/ApacheJames/job/PR-1070/1/testReport/junit/org.apache.james.blob.cassandra/CassandraBlobStoreClOneTest/saveShouldSaveEmptyByteSource_StoragePolicy__3_/
   
   Status 404: {"message":"No such image: james-testing-cassandra:latest"}
   
   - Build 9: https://ci-builds.apache.org/job/james/job/ApacheJames/job/PR-1070/9/testReport/junit/org.apache.james.blob.cassandra/CassandraBlobStoreClOneTest/org_apache_james_blob_cassandra_CassandraBlobStoreClOneTest/
   
   Status 404: {"message":"No such image: cassandra_3_11_10-cdd771a3-870c-4804-909b-0a52197cb6f0:latest"}
   ```
   
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org
For additional commands, e-mail: notifications-help@james.apache.org


[GitHub] [james-project] chibenwa commented on pull request #1070: [Cleanup] - Testcontainer - The docker image of test dependencies (cassandra, s3...) should be one immutable

Posted by GitBox <gi...@apache.org>.
chibenwa commented on PR #1070:
URL: https://github.com/apache/james-project/pull/1070#issuecomment-1200632373

   What to do with this stale PR @vttranlina ?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org
For additional commands, e-mail: notifications-help@james.apache.org