MortalHappiness commented on a change in pull request #788:
URL: https://github.com/apache/submarine/pull/788#discussion_r743423861



##########
File path: submarine-cloud-v2/artifacts/submarine/submarine-database.yaml
##########
@@ -0,0 +1,77 @@
+---
+# Source: submarine/templates/submarine-database.yaml
+#
+# 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.
+#
+# Source: submarine/templates/submarine-database.yaml
+apiVersion: v1
+kind: PersistentVolumeClaim
+metadata:
+  name: submarine-database-pvc
+spec:
+  accessModes:
+    - ReadWriteOnce
+  storageClassName: submarine-storageclass
+  resources:
+    requests:
+      storage: 1Gi
+---
+# Source: submarine/templates/submarine-database.yaml
+apiVersion: v1
+kind: Service
+metadata:
+  name: "submarine-database"
+spec:
+  ports:
+    - name: "submarine-database"
+      port: 3306
+      targetPort: 3306
+  selector:
+    app: "submarine-database"
+---
+# Source: submarine/templates/submarine-database.yaml
+apiVersion: apps/v1
+kind: Deployment
+metadata:
+  name: "submarine-database"
+spec:
+  replicas: 1
+  selector:
+    matchLabels:
+      app: "submarine-database"
+  template:
+    metadata:
+      labels:
+        app: "submarine-database"
+
+    spec:
+      containers:
+        - name: "submarine-database"
+          image: "apache/submarine:database-0.7.0-SNAPSHOT"
+          imagePullPolicy: "IfNotPresent"
+          ports:
+            - containerPort: 3306
+          env:
+            - name: MYSQL_ROOT_PASSWORD
+              value: "password"
+          volumeMounts:
+            - mountPath: /var/lib/mysql
+              name: volume
+              subPath: submarine-database

Review comment:
       Can you add readiness probing for database?
   
   
https://github.com/apache/submarine/blob/0f1eefd70e73abf4ddbdf1ffc77d5238a98b4585/submarine-cloud-v2/pkg/controller/submarine_database.go?_pjax=%23js-repo-pjax-container%2C%20div%5Bitemtype%3D%22http%3A%2F%2Fschema.org%2FSoftwareSourceCode%22%5D%20main%2C%20%5Bdata-pjax-container%5D#L85-L116

##########
File path: submarine-cloud-v2/artifacts/submarine/submarine-mlflow.yaml
##########
@@ -0,0 +1,115 @@
+---
+# Source: submarine/templates/submarine-mlflow.yaml
+#
+# 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.
+#
+
+# Source: submarine/templates/submarine-mlflow.yaml
+apiVersion: v1
+kind: PersistentVolumeClaim
+metadata:
+  name: submarine-mlflow-pvc
+spec:
+  accessModes:
+    - ReadWriteOnce
+  storageClassName: "submarine-storageclass"
+  resources:
+    requests:
+      storage: "10Gi"
+---
+# Source: submarine/templates/submarine-mlflow.yaml
+apiVersion: v1
+kind: Service
+metadata:
+  name: submarine-mlflow-service
+spec:
+  type: ClusterIP
+  selector:
+    app: submarine-mlflow
+  ports:
+  - protocol: TCP
+    port: 5000
+    targetPort: 5000
+---
+# Source: submarine/templates/submarine-mlflow.yaml
+apiVersion: apps/v1
+kind: Deployment
+metadata:
+  name: submarine-mlflow
+spec:
+  selector:
+    matchLabels:
+      app: submarine-mlflow
+  template:
+    metadata:
+      labels:
+        app: submarine-mlflow
+    spec:
+      initContainers:
+      - name: submarine-mlflow-initcontainer
+        image: "minio/mc"
+        command: ["/bin/bash", "-c",
+        "cnt=0;
+        while ! /bin/bash -c 'mc config host add minio 
http://submarine-minio-service:9000
+        submarine_minio submarine_minio' 2>&1;
+        do
+          sleep 15;
+          ((cnt=cnt+1));
+          if [ $cnt -eq 80 ];then
+            echo 'ERROR: wait too long for minio pod';
+            exit 1;
+          fi;
+        done;
+        if /bin/bash -c 'mc ls minio/mlflow' >/dev/null 2>&1; then
+          echo 'Bucket minio/mlflow already exists, skipping creation.';
+        else
+          /bin/bash -c 'mc mb minio/mlflow';
+        fi;"]

Review comment:
       Can you add another InitContainer which is mainly used for checking 
database connectedness?
   
   
https://github.com/apache/submarine/blob/0f1eefd70e73abf4ddbdf1ffc77d5238a98b4585/submarine-cloud-v2/pkg/controller/submarine_mlflow.go?_pjax=%23js-repo-pjax-container%2C%20div%5Bitemtype%3D%22http%3A%2F%2Fschema.org%2FSoftwareSourceCode%22%5D%20main%2C%20%5Bdata-pjax-container%5D#L79-L89

##########
File path: submarine-cloud-v2/pkg/controller/parser.go
##########
@@ -0,0 +1,169 @@
+/*
+ * 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.
+ */
+
+package controller
+
+import (
+       "encoding/json"
+       "fmt"
+       "io"
+       "os"
+       "path/filepath"
+
+       "github.com/pkg/errors"
+       traefikv1alpha1 
"github.com/traefik/traefik/v2/pkg/provider/kubernetes/crd/traefik/v1alpha1"
+       appsv1 "k8s.io/api/apps/v1"
+       v1 "k8s.io/api/core/v1"
+       extensionsv1beta1 "k8s.io/api/extensions/v1beta1"
+       rbacv1 "k8s.io/api/rbac/v1"
+       "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
+       "k8s.io/apimachinery/pkg/util/yaml"
+)
+
+// PathToOSFile gets the absolute path from relative path.
+func pathToOSFile(relativePath string) (*os.File, error) {
+       path, err := filepath.Abs(relativePath)
+       if err != nil {
+               return nil, errors.Wrap(err, fmt.Sprintf("failed generate 
absolute file path of %s", relativePath))
+       }
+
+       manifest, err := os.Open(path)
+       if err != nil {
+               return nil, errors.Wrap(err, fmt.Sprintf("failed to open file 
%s", path))
+       }
+
+       return manifest, nil
+}

Review comment:
       The function name and the comment do different things from the function 
body. From the function name and the comment, we would expect this function 
will take a relative path string and returns an absolute path string. However, 
what this function actually does is open the file indicated by the relative 
path string and return the opened file.




-- 
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]


Reply via email to