You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@submarine.apache.org by ka...@apache.org on 2021/07/15 15:22:47 UTC

[submarine] branch master updated: SUBMARINE-935. Support test-k8s on both KinD and minikube

This is an automated email from the ASF dual-hosted git repository.

kaihsun pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/submarine.git


The following commit(s) were added to refs/heads/master by this push:
     new 65b785e  SUBMARINE-935. Support test-k8s on both KinD and minikube
65b785e is described below

commit 65b785e4fe0a11a9ccd0b787b85ffe886c6854e5
Author: KUAN-HSUN-LI <b0...@ntu.edu.tw>
AuthorDate: Thu Jul 15 20:50:24 2021 +0800

    SUBMARINE-935. Support test-k8s on both KinD and minikube
    
    ### What is this PR for?
    Support running the test-k8s on both KinD and minikube
    ![image](https://user-images.githubusercontent.com/38066413/125789932-e8992f64-cb1a-49bd-a5a7-1af296232ffb.png)
    
    ### What type of PR is it?
    [Improvement]
    
    ### Todos
    
    ### What is the Jira issue?
    https://issues.apache.org/jira/browse/SUBMARINE-935
    
    ### How should this be tested?
    KinD is tested in CI.
    minikube should be tested following the document
    
    ### Screenshots (if appropriate)
    
    ### Questions:
    * Do the license files need updating? No
    * Are there breaking changes for older versions? No
    * Does this need new documentation? No
    
    Author: KUAN-HSUN-LI <b0...@ntu.edu.tw>
    
    Signed-off-by: Kai-Hsun Chen <ka...@apache.org>
    
    Closes #668 from KUAN-HSUN-LI/SUBMARINE-935 and squashes the following commits:
    
    c4dba22c [KUAN-HSUN-LI] SUBMARINE-935. Add test k8s result image
    d69e5ea1 [KUAN-HSUN-LI] SUBMARINE-935. Support test-k8s on both KinD and minikube
---
 .github/workflows/master.yml                           |   5 -----
 .../org/apache/submarine/rest/ExperimentRestApiIT.java |   4 ++--
 .../org/apache/submarine/rest/NotebookRestApiIT.java   |   4 ++--
 website/docs/assets/test-k8s-result.png                | Bin 0 -> 194837 bytes
 website/docs/devDocs/IntegrationTestK8s.md             |   2 ++
 5 files changed, 6 insertions(+), 9 deletions(-)

diff --git a/.github/workflows/master.yml b/.github/workflows/master.yml
index e6c2aa5..c011c37 100644
--- a/.github/workflows/master.yml
+++ b/.github/workflows/master.yml
@@ -157,11 +157,6 @@ jobs:
           kubectl cluster-info
           kubectl version
           kubectl get pods -n kube-system
-
-          # test-k8s require this config
-          export KUBECONFIG=~/.kube/kind-config-kind
-          kind export kubeconfig --kubeconfig ${KUBECONFIG}
-
           echo "current-context:" $(kubectl config current-context)
           echo "environment-kubeconfig:" ${KUBECONFIG}
       - name: Download compiled Submarine binaries
diff --git a/submarine-test/test-k8s/src/test/java/org/apache/submarine/rest/ExperimentRestApiIT.java b/submarine-test/test-k8s/src/test/java/org/apache/submarine/rest/ExperimentRestApiIT.java
index 44b7c68..4f247d3 100644
--- a/submarine-test/test-k8s/src/test/java/org/apache/submarine/rest/ExperimentRestApiIT.java
+++ b/submarine-test/test-k8s/src/test/java/org/apache/submarine/rest/ExperimentRestApiIT.java
@@ -91,8 +91,8 @@ public class ExperimentRestApiIT extends AbstractSubmarineServerTest {
   public static void startUp() throws IOException {
     Assert.assertTrue(checkIfServerIsRunning());
 
-    // The kube config path defined by kind-cluster-build.sh
-    String confPath = System.getProperty("user.home") + "/.kube/kind-config-kind";
+    // The kube config is created when the cluster builds
+    String confPath = System.getProperty("user.home") + "/.kube/config";
     KubeConfig config = KubeConfig.loadKubeConfig(new FileReader(confPath));
     ApiClient client = ClientBuilder.kubeconfig(config).build();
     Configuration.setDefaultApiClient(client);
diff --git a/submarine-test/test-k8s/src/test/java/org/apache/submarine/rest/NotebookRestApiIT.java b/submarine-test/test-k8s/src/test/java/org/apache/submarine/rest/NotebookRestApiIT.java
index e956477..ada557f 100644
--- a/submarine-test/test-k8s/src/test/java/org/apache/submarine/rest/NotebookRestApiIT.java
+++ b/submarine-test/test-k8s/src/test/java/org/apache/submarine/rest/NotebookRestApiIT.java
@@ -81,8 +81,8 @@ public class NotebookRestApiIT extends AbstractSubmarineServerTest {
   public static void startUp() throws IOException {
     Assert.assertTrue(checkIfServerIsRunning());
 
-    // The kube config path defined by kind-cluster-build.sh
-    String confPath = System.getProperty("user.home") + "/.kube/kind-config-kind";
+    // The kube config is created when the cluster builds
+    String confPath = System.getProperty("user.home") + "/.kube/config";
     KubeConfig config = KubeConfig.loadKubeConfig(new FileReader(confPath));
     ApiClient client = ClientBuilder.kubeconfig(config).build();
     Configuration.setDefaultApiClient(client);
diff --git a/website/docs/assets/test-k8s-result.png b/website/docs/assets/test-k8s-result.png
new file mode 100644
index 0000000..bcb38bf
Binary files /dev/null and b/website/docs/assets/test-k8s-result.png differ
diff --git a/website/docs/devDocs/IntegrationTestK8s.md b/website/docs/devDocs/IntegrationTestK8s.md
index 8f98e3f..d486a74 100644
--- a/website/docs/devDocs/IntegrationTestK8s.md
+++ b/website/docs/devDocs/IntegrationTestK8s.md
@@ -43,5 +43,7 @@ title: How to Run Integration K8s Test
   mvn verify -DskipRat -pl :submarine-test-k8s -Phadoop-2.9 -B
   ```
 
+![](../assets/test-k8s-result.png)
+
 ## Run k8s test in GitHub Actions
 * Each time a code is submitted, GitHub Actions is triggered automatically.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@submarine.apache.org
For additional commands, e-mail: dev-help@submarine.apache.org