ostinru commented on code in PR #91:
URL: https://github.com/apache/cloudberry-pxf/pull/91#discussion_r3021640687


##########
automation/src/main/java/org/apache/cloudberry/pxf/automation/testcontainers/PXFCloudberryContainer.java:
##########
@@ -0,0 +1,245 @@
+package org.apache.cloudberry.pxf.automation.testcontainers;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import com.github.dockerjava.api.DockerClient;
+import com.github.dockerjava.api.async.ResultCallback;
+import com.github.dockerjava.api.command.ExecCreateCmdResponse;
+import com.github.dockerjava.api.model.Frame;
+import org.testcontainers.DockerClientFactory;
+import org.testcontainers.containers.BindMode;
+import org.testcontainers.containers.GenericContainer;
+import org.testcontainers.containers.Network;
+import org.testcontainers.containers.wait.strategy.AbstractWaitStrategy;
+import org.testcontainers.containers.wait.strategy.Wait;
+import org.testcontainers.utility.DockerImageName;
+import org.testcontainers.utility.MountableFile;
+
+import java.io.File;
+import java.io.IOException;
+import java.nio.charset.StandardCharsets;
+import java.nio.file.Files;
+import java.nio.file.LinkOption;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.time.Duration;
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * PXF + Cloudberry colocated testcontainer.
+ *
+ * Cloudberry is built during image creation.
+ * Demo cluster and PXF are initialised at runtime via {@code entrypoint.sh}.
+ *
+ * Use {@link #getInstance()} to get a singleton that is started once per
+ * automation JVM. The container shares a Docker {@link Network} with other
+ * test containers so they can communicate by hostname.
+ */
+public class PXFCloudberryContainer extends 
GenericContainer<PXFCloudberryContainer> {
+
+    private static final Map<String, String> BASE_IMAGES = new HashMap<>();
+    static {
+        BASE_IMAGES.put("ubuntu", 
"apache/incubator-cloudberry:cbdb-build-ubuntu22.04-latest");
+        BASE_IMAGES.put("rocky9", 
"apache/incubator-cloudberry:cbdb-build-rocky9-latest");
+    }
+
+    public static final int CLOUDBERRY_PORT = 7000;
+    public static final int PXF_PORT = 5888;
+    public static final String CLOUDBERRY_USER = "gpadmin";
+
+    private static final String CONTAINER_GRADLE_RO_CACHE = 
"/home/gpadmin/.gradle-host-cache";
+    private static final String CONTAINER_REPO_DIR = 
"/home/gpadmin/workspace/cloudberry-pxf";

Review Comment:
   
   Full paths easier to search in codebase.
   Relative paths easier to maintain.
   
   And, I would prefer full paths if there are few of them.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to