You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@submarine.apache.org by pi...@apache.org on 2021/12/14 04:34:26 UTC

[submarine] 01/01: Persist kind cluster data

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

pingsutw pushed a commit to branch kind-config
in repository https://gitbox.apache.org/repos/asf/submarine.git

commit da0cf7dd06f9c1f3c35d715989a163cccf31fc04
Author: Kevin Su <pi...@apache.org>
AuthorDate: Tue Dec 14 12:23:20 2021 +0800

    Persist kind cluster data
    
    Signed-off-by: Kevin Su <pi...@apache.org>
---
 dev-support/cicd/entry.sh               |   9 +++
 dev-support/kind-config.yaml            |  22 +++++++
 helm-charts/submarine/kinds-values.yaml |  32 ++++++++++
 helm-charts/submarine/templates/pv.yaml | 100 ++++++++++++++++++++++++++++++++
 submarine-cloud-v2/pv-volume.yaml       |  97 +++++++++++++++++++++++++++++++
 5 files changed, 260 insertions(+)

diff --git a/dev-support/cicd/entry.sh b/dev-support/cicd/entry.sh
index 4ccdb43..138b3e1 100755
--- a/dev-support/cicd/entry.sh
+++ b/dev-support/cicd/entry.sh
@@ -23,6 +23,7 @@ function merge_pr(){
   jira_name="n"
   jira_pwd="p"
   apache_id="id"
+  apache_pwd="p"
   apache_name="name"
 
   if [ -z "${JIRA_USERNAME:-}" ]; then
@@ -46,6 +47,13 @@ function merge_pr(){
   fi
   echo "Got Apache ID: ${apache_id}"
 
+  if [ -z "${APACHE_PASSWORD:-}" ]; then
+    printf "\n"
+    read -p "Enter Your Apache password: "  apache_pwd
+  else
+    apache_pwd=$APACHE_PASSWORD
+  fi
+
   if [ -z "${APACHE_NAME:-}" ]; then
     read -p "Enter Your Apache committer name: "  apache_name
   else
@@ -58,6 +66,7 @@ function merge_pr(){
   git pull
   git config user.name "${apache_name}"
   git config user.email "${apache_id}@apache.org"
+  git config credential.helper "!f() { echo \"username=${apache_id}\\npassword=${apache_pwd}\"; }; f"
   export JIRA_USERNAME=${jira_name}
   export JIRA_PASSWORD=${jira_pwd}
   python dev-support/cicd/merge_submarine_pr.py
diff --git a/dev-support/kind-config.yaml b/dev-support/kind-config.yaml
new file mode 100644
index 0000000..132fd1f
--- /dev/null
+++ b/dev-support/kind-config.yaml
@@ -0,0 +1,22 @@
+kind: Cluster
+apiVersion: kind.x-k8s.io/v1alpha4
+nodes:
+- role: control-plane
+  kubeadmConfigPatches:
+  - |
+    kind: InitConfiguration
+    nodeRegistration:
+      kubeletExtraArgs:
+        node-labels: "ingress-ready=true"
+        authorization-mode: "AlwaysAllow"
+  extraPortMappings:
+  - containerPort: 32080
+    hostPort: 80
+    protocol: TCP
+  - containerPort: 443
+    hostPort: 443
+    protocol: TCP
+  extraMounts:
+    - hostPath: /mnt/data
+      containerPath: /submarine
+
diff --git a/helm-charts/submarine/kinds-values.yaml b/helm-charts/submarine/kinds-values.yaml
new file mode 100644
index 0000000..6adcff5
--- /dev/null
+++ b/helm-charts/submarine/kinds-values.yaml
@@ -0,0 +1,32 @@
+#
+# 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.
+#
+
+name: submarine-operator
+replicas: 1
+image: apache/submarine:operator-0.7.0-SNAPSHOT
+# dev is to tell helm to install submarine-operator or not
+dev: false
+# storageClass is for dynamically creating persistent volumes
+storageClass:
+  # reclaimPolicy is to determine the action after the persistent volume is released
+  reclaimPolicy: Delete
+  # volumeBindingMode controls when volume binding and dynamically provisioning should occur
+  volumeBindingMode: WaitForFirstConsumer
+  # provisioner is to determine what volume plugin is used for provisioning PVs
+  provisioner: kubernetes.io/no-provisioner
+  # parameters describe volumes belonging to the storage class
+  parameters:
diff --git a/helm-charts/submarine/templates/pv.yaml b/helm-charts/submarine/templates/pv.yaml
new file mode 100644
index 0000000..1826f05
--- /dev/null
+++ b/helm-charts/submarine/templates/pv.yaml
@@ -0,0 +1,100 @@
+{{- if eq .Values.storageClass.provisioner "kubernetes.io/no-provisioner"}}
+apiVersion: v1
+kind: PersistentVolume
+metadata:
+  name: database-pv
+  labels:
+    type: local
+spec:
+  storageClassName: submarine-storageclass
+  capacity:
+    storage: 10Gi
+  accessModes:
+    - ReadWriteOnce
+  local:
+    path: /submarine
+  nodeAffinity:
+    required:
+      nodeSelectorTerms:
+      - matchExpressions:
+        - key: kubernetes.io/hostname
+          operator: In
+          values:
+          - kind-control-plane
+
+---
+
+apiVersion: v1
+kind: PersistentVolume
+metadata:
+  name: minio-pv
+  labels:
+    type: local
+spec:
+  storageClassName: submarine-storageclass
+  capacity:
+    storage: 10Gi
+  accessModes:
+    - ReadWriteOnce
+  local:
+    path: /submarine
+  nodeAffinity:
+    required:
+      nodeSelectorTerms:
+      - matchExpressions:
+        - key: kubernetes.io/hostname
+          operator: In
+          values:
+          - kind-control-plane
+
+---
+
+apiVersion: v1
+kind: PersistentVolume
+metadata:
+  name: mlflow-pv
+  labels:
+    type: local
+spec:
+  storageClassName: submarine-storageclass
+  capacity:
+    storage: 10Gi
+  accessModes:
+    - ReadWriteOnce
+  local:
+    path: /submarine
+  nodeAffinity:
+    required:
+      nodeSelectorTerms:
+      - matchExpressions:
+        - key: kubernetes.io/hostname
+          operator: In
+          values:
+          - kind-control-plane
+
+---
+
+apiVersion: v1
+kind: PersistentVolume
+metadata:
+  name: tensorboard-pv
+  labels:
+    type: local
+spec:
+  storageClassName: submarine-storageclass
+  capacity:
+    storage: 10Gi
+  accessModes:
+    - ReadWriteOnce
+  local:
+    path: /submarine
+  nodeAffinity:
+    required:
+      nodeSelectorTerms:
+      - matchExpressions:
+        - key: kubernetes.io/hostname
+          operator: In
+          values:
+          - kind-control-plane
+
+{- end }}
diff --git a/submarine-cloud-v2/pv-volume.yaml b/submarine-cloud-v2/pv-volume.yaml
new file mode 100644
index 0000000..0c8954a
--- /dev/null
+++ b/submarine-cloud-v2/pv-volume.yaml
@@ -0,0 +1,97 @@
+apiVersion: v1
+kind: PersistentVolume
+metadata:
+  name: database-pv
+  labels:
+    type: local
+spec:
+  storageClassName: submarine-storageclass
+  capacity:
+    storage: 30Gi
+  accessModes:
+    - ReadWriteOnce
+  local:
+    path: /submarine
+  nodeAffinity:
+    required:
+      nodeSelectorTerms:
+      - matchExpressions:
+        - key: kubernetes.io/hostname
+          operator: In
+          values:
+          - kind-control-plane
+
+---
+
+apiVersion: v1
+kind: PersistentVolume
+metadata:
+  name: minio-pv
+  labels:
+    type: local
+spec:
+  storageClassName: submarine-storageclass
+  capacity:
+    storage: 30Gi
+  accessModes:
+    - ReadWriteOnce
+  local:
+    path: /submarine
+  nodeAffinity:
+    required:
+      nodeSelectorTerms:
+      - matchExpressions:
+        - key: kubernetes.io/hostname
+          operator: In
+          values:
+          - kind-control-plane
+
+---
+
+apiVersion: v1
+kind: PersistentVolume
+metadata:
+  name: mlflow-pv
+  labels:
+    type: local
+spec:
+  storageClassName: submarine-storageclass
+  capacity:
+    storage: 30Gi
+  accessModes:
+    - ReadWriteOnce
+  local:
+    path: /submarine
+  nodeAffinity:
+    required:
+      nodeSelectorTerms:
+      - matchExpressions:
+        - key: kubernetes.io/hostname
+          operator: In
+          values:
+          - kind-control-plane
+
+---
+
+apiVersion: v1
+kind: PersistentVolume
+metadata:
+  name: tensorboard-pv
+  labels:
+    type: local
+spec:
+  storageClassName: submarine-storageclass
+  capacity:
+    storage: 30Gi
+  accessModes:
+    - ReadWriteOnce
+  local:
+    path: /submarine
+  nodeAffinity:
+    required:
+      nodeSelectorTerms:
+      - matchExpressions:
+        - key: kubernetes.io/hostname
+          operator: In
+          values:
+          - kind-control-plane

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