You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@submarine.apache.org by li...@apache.org on 2020/05/28 12:03:56 UTC

[submarine] branch master updated: SUBMARINE-462. Submarine server should support helm charts

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

liuxun 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 29bc4fb  SUBMARINE-462. Submarine server should support helm charts
29bc4fb is described below

commit 29bc4fbc5c2fd47d3dc6844bf82cc72cb2c1b37e
Author: JohnTing <jo...@gmail.com>
AuthorDate: Thu May 28 16:08:59 2020 +0800

    SUBMARINE-462. Submarine server should support helm charts
    
    ### What is this PR for?
    Currently, there are no tools to install submarine on k8s in one command.
    
    Helm chart is a perfect tool we can choose. In order to do this:
    
    Create helm charts supporting deployments of tensorflow operator, pytorch operator, and submarine server, MySQL.
    Create Dockerfiles used to build submarine components' docker images and create tools to handle the required version push to docker hub.
    Setup proxy using kubectl to access the submarine server locally
    Verify that sample job spec can be submitted to the submarine server successfully.
    Verify that workbench can be accessed in a local browser.
    After this, if the user has a k8s cluster. The below command will get the installation done.
    
    helm install <submarine dir>/charts
    
    ### What type of PR is it?
    Feature
    
    ### Todos
    * [x] - Create helm charts supporting deployments of tensorflow operator, pytorch operator, and submarine server, MySQL.
    * [x] - Create Dockerfiles used to build submarine components' docker images and create tools to handle the required version push to docker hub.
    * [x] - Setup proxy using kubectl to access the submarine server locally
    * [x] - Verify that sample job spec can be submitted to the submarine server successfully.
    * [x] - Verify that workbench can be accessed in a local browser.
    * [x] - documentation
    
    ### What is the Jira issue?
    https://issues.apache.org/jira/projects/SUBMARINE/issues/SUBMARINE-462
    
    ### How should this be tested?
    
    ### Screenshots (if appropriate)
    ![image](https://user-images.githubusercontent.com/19265751/82640393-13f54280-9c3d-11ea-9477-1a40282bc304.png)
    ![image](https://user-images.githubusercontent.com/19265751/82640422-24a5b880-9c3d-11ea-8a29-f37ae590d15a.png)
    ![image](https://user-images.githubusercontent.com/19265751/82640493-41da8700-9c3d-11ea-8cae-4c25345c8ec8.png)
    ![image](https://user-images.githubusercontent.com/19265751/82640368-0c359e00-9c3d-11ea-8c1f-1118c516c92e.png)
    
    ### Questions:
    * Does the licenses files need update? No
    * Is there breaking changes for older versions? No
    * Does this needs documentation? No
    
    Author: JohnTing <jo...@gmail.com>
    
    Closes #270 from JohnTing/SUBMARINE-462 and squashes the following commits:
    
    05e40ef [JohnTing] add build image doc in setup-kubernetes.md
    3997dcd [JohnTing] add build image doc in setup-kubernetes.md
    0b8bc24 [JohnTing] change submarine charts apiVersion
    e2ad8e7 [JohnTing] change doc
    feda1fe [JohnTing] change appVersion
    7b0a2b0 [JohnTing] Remove the file: dependency and use charts folder
    baa4e89 [JohnTing] add charts
    2b25ca1 [JohnTing] dependencies
    e24936c [JohnTing] rename tf&pytouch name in setup-kubernetes.md
    a3b045d [JohnTing] rename tensorflow to tfjob & pytorch to pytorchjob
    e927577 [JohnTing] add License, change readme.md, delete submarine-operator
    7c11d1d [JohnTing] change
    0b9ce02 [JohnTing] git add
    3072b58 [JohnTing] SUBMARINE-462
---
 docs/submarine-server/setup-kubernetes.md          |  33 ++++++
 helm-charts/submarine/.helmignore                  |  42 ++++++++
 helm-charts/submarine/Chart.yaml                   |  24 +++++
 .../submarine/charts/pytorchjob/.helmignore        |  40 ++++++++
 helm-charts/submarine/charts/pytorchjob/Chart.yaml |  38 +++++++
 .../submarine/charts/pytorchjob/crds/crd.yaml      |  59 +++++++++++
 .../charts/pytorchjob/templates/deployment.yaml    |  49 +++++++++
 .../charts/pytorchjob/templates/podgroup.yaml      |  56 +++++++++++
 .../charts/pytorchjob/templates/rbac.yaml          |  69 +++++++++++++
 .../charts/pytorchjob/templates/service.yaml       |  35 +++++++
 .../submarine/charts/pytorchjob/values.yaml        |  17 ++++
 helm-charts/submarine/charts/tfjob/.helmignore     |  40 ++++++++
 helm-charts/submarine/charts/tfjob/Chart.yaml      |  38 +++++++
 helm-charts/submarine/charts/tfjob/crds/crd.yaml   |  64 ++++++++++++
 .../tfjob/templates/cluster-role-binding.yaml      |  31 ++++++
 .../charts/tfjob/templates/cluster-role.yaml       | 111 +++++++++++++++++++++
 .../charts/tfjob/templates/deployment.yaml         |  54 ++++++++++
 .../charts/tfjob/templates/service-account.yaml    |  30 ++++++
 .../submarine/charts/tfjob/templates/service.yaml  |  35 +++++++
 helm-charts/submarine/charts/tfjob/values.yaml     |  16 +++
 helm-charts/submarine/templates/rbac.yaml          |  52 ++++++++++
 .../submarine/templates/submarine-database.yaml    |  53 ++++++++++
 .../submarine/templates/submarine-server.yaml      |  69 +++++++++++++
 helm-charts/submarine/values.yaml                  |  32 ++++++
 24 files changed, 1087 insertions(+)

diff --git a/docs/submarine-server/setup-kubernetes.md b/docs/submarine-server/setup-kubernetes.md
index 9da3bda..3eb8ed2 100644
--- a/docs/submarine-server/setup-kubernetes.md
+++ b/docs/submarine-server/setup-kubernetes.md
@@ -98,6 +98,39 @@ cd <submarine_code_path_root>/dev-support/k8s/pytorchjob
 
 ```
 
+
+### Use Helm Chart to deploy
+
+#### Create images
+submarine server
+```bash
+./dev-support/docker-images/submarine/build.sh
+```
+
+submarine database
+```bash
+./dev-support/docker-images/database/build.sh
+```
+
+#### install helm
+For more info see https://helm.sh/docs/intro/install/
+
+#### Deploy submarine server, mysql
+You can modify some settings in ./helm-charts/submarine/values.yaml
+```bash
+helm install submarine ./helm-charts/submarine
+```
+
+#### Delete deployment
+```bash
+helm delete submarine 
+```
+
+#### port-forward {host port}:{container port}
+```bash
+kubectl port-forward svc/submarine-server 8080:8080 --address 0.0.0.0
+```
+
 ## Production environment
 
 ### Setup Kubernetes
diff --git a/helm-charts/submarine/.helmignore b/helm-charts/submarine/.helmignore
new file mode 100644
index 0000000..b92c4a4
--- /dev/null
+++ b/helm-charts/submarine/.helmignore
@@ -0,0 +1,42 @@
+#
+# 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.
+#
+
+# Patterns to ignore when building packages.
+# This supports shell glob matching, relative path matching, and
+# negation (prefixed with !). Only one pattern per line.
+.DS_Store
+# Common VCS dirs
+.git/
+.gitignore
+.bzr/
+.bzrignore
+.hg/
+.hgignore
+.svn/
+# Common backup files
+*.swp
+*.bak
+*.tmp
+*~
+# Various IDEs
+.project
+.idea/
+*.tmproj
+.vscode/
+# ignore dolder
+ignore/*
+
diff --git a/helm-charts/submarine/Chart.yaml b/helm-charts/submarine/Chart.yaml
new file mode 100644
index 0000000..46e4730
--- /dev/null
+++ b/helm-charts/submarine/Chart.yaml
@@ -0,0 +1,24 @@
+#
+# 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.
+#
+
+apiVersion: v2
+appVersion: "0.4.0-SNAPSHOT"
+description: Submarine is Cloud Native Machine Learning Platform.
+name: submarine
+version: 0.4.0
+icon: https://submarine.apache.org/assets/themes/submarine/img/submarine_white_logo.png
+
diff --git a/helm-charts/submarine/charts/pytorchjob/.helmignore b/helm-charts/submarine/charts/pytorchjob/.helmignore
new file mode 100644
index 0000000..cab781a
--- /dev/null
+++ b/helm-charts/submarine/charts/pytorchjob/.helmignore
@@ -0,0 +1,40 @@
+#
+# 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.
+#
+
+# Patterns to ignore when building packages.
+# This supports shell glob matching, relative path matching, and
+# negation (prefixed with !). Only one pattern per line.
+.DS_Store
+# Common VCS dirs
+.git/
+.gitignore
+.bzr/
+.bzrignore
+.hg/
+.hgignore
+.svn/
+# Common backup files
+*.swp
+*.bak
+*.tmp
+*.orig
+*~
+# Various IDEs
+.project
+.idea/
+*.tmproj
+.vscode/
diff --git a/helm-charts/submarine/charts/pytorchjob/Chart.yaml b/helm-charts/submarine/charts/pytorchjob/Chart.yaml
new file mode 100644
index 0000000..2c4b80b
--- /dev/null
+++ b/helm-charts/submarine/charts/pytorchjob/Chart.yaml
@@ -0,0 +1,38 @@
+#
+# 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.
+#
+
+apiVersion: v2
+name: pytorchjob
+description: pytorchjob
+
+# A chart can be either an 'application' or a 'library' chart.
+#
+# Application charts are a collection of templates that can be packaged into versioned archives
+# to be deployed.
+#
+# Library charts provide useful utilities or functions for the chart developer. They're included as
+# a dependency of application charts to inject those utilities and functions into the rendering
+# pipeline. Library charts do not define any templates and therefore cannot be deployed.
+type: application
+
+# This is the chart version. This version number should be incremented each time you make changes
+# to the chart and its templates, including the app version.
+version: 0.1.0
+
+# This is the version number of the application being deployed. This version number should be
+# incremented each time you make changes to the application.
+appVersion: 1.0.0
diff --git a/helm-charts/submarine/charts/pytorchjob/crds/crd.yaml b/helm-charts/submarine/charts/pytorchjob/crds/crd.yaml
new file mode 100644
index 0000000..5804ccd
--- /dev/null
+++ b/helm-charts/submarine/charts/pytorchjob/crds/crd.yaml
@@ -0,0 +1,59 @@
+#
+# 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.
+#
+
+apiVersion: apiextensions.k8s.io/v1beta1
+kind: CustomResourceDefinition
+metadata:
+  name: pytorchjobs.kubeflow.org
+spec:
+  additionalPrinterColumns:
+  - JSONPath: .status.conditions[-1:].type
+    name: State
+    type: string
+  - JSONPath: .metadata.creationTimestamp
+    name: Age
+    type: date
+  group: kubeflow.org
+  names:
+    kind: PyTorchJob
+    plural: pytorchjobs
+    singular: pytorchjob
+  scope: Namespaced
+  subresources:
+    status: {}
+  validation:
+    openAPIV3Schema:
+      properties:
+        spec:
+          properties:
+            pytorchReplicaSpecs:
+              properties:
+                Master:
+                  properties:
+                    replicas:
+                      maximum: 1
+                      minimum: 1
+                      type: integer
+                Worker:
+                  properties:
+                    replicas:
+                      minimum: 1
+                      type: integer
+  versions:
+  - name: v1
+    served: true
+    storage: true
diff --git a/helm-charts/submarine/charts/pytorchjob/templates/deployment.yaml b/helm-charts/submarine/charts/pytorchjob/templates/deployment.yaml
new file mode 100644
index 0000000..a63632d
--- /dev/null
+++ b/helm-charts/submarine/charts/pytorchjob/templates/deployment.yaml
@@ -0,0 +1,49 @@
+#
+# 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.
+#
+
+apiVersion: apps/v1
+kind: Deployment
+metadata:
+  name: pytorch-operator
+spec:
+  replicas: 1
+  selector:
+    matchLabels:
+      name: pytorch-operator
+  template:
+    metadata:
+      labels:
+        name: pytorch-operator
+    spec:
+      containers:
+      - command:
+        - /pytorch-operator.v1
+        - --alsologtostderr
+        - -v=1
+        - --monitoring-port=8443
+        env:
+        - name: MY_POD_NAMESPACE
+          valueFrom:
+            fieldRef:
+              fieldPath: metadata.namespace
+        - name: MY_POD_NAME
+          valueFrom:
+            fieldRef:
+              fieldPath: metadata.name
+        image: gcr.io/kubeflow-images-public/pytorch-operator:v1.0.0-g047cf0f
+        name: pytorch-operator
+      serviceAccountName: pytorch-operator
diff --git a/helm-charts/submarine/charts/pytorchjob/templates/podgroup.yaml b/helm-charts/submarine/charts/pytorchjob/templates/podgroup.yaml
new file mode 100644
index 0000000..109d9a3
--- /dev/null
+++ b/helm-charts/submarine/charts/pytorchjob/templates/podgroup.yaml
@@ -0,0 +1,56 @@
+#
+# 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.
+#
+
+apiVersion: apiextensions.k8s.io/v1beta1
+kind: CustomResourceDefinition
+metadata:
+  name: podgroups.scheduling.incubator.k8s.io
+spec:
+  group: scheduling.incubator.k8s.io
+  names:
+    kind: PodGroup
+    plural: podgroups
+  scope: Namespaced
+  validation:
+    openAPIV3Schema:
+      properties:
+        apiVersion:
+          type: string
+        kind:
+          type: string
+        metadata:
+          type: object
+        spec:
+          properties:
+            minMember:
+              format: int32
+              type: integer
+          type: object
+        status:
+          properties:
+            succeeded:
+              format: int32
+              type: integer
+            failed:
+              format: int32
+              type: integer
+            running:
+              format: int32
+              type: integer
+          type: object
+      type: object
+  version: v1alpha1
diff --git a/helm-charts/submarine/charts/pytorchjob/templates/rbac.yaml b/helm-charts/submarine/charts/pytorchjob/templates/rbac.yaml
new file mode 100644
index 0000000..0917040
--- /dev/null
+++ b/helm-charts/submarine/charts/pytorchjob/templates/rbac.yaml
@@ -0,0 +1,69 @@
+#
+# 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.
+#
+
+apiVersion: v1
+kind: ServiceAccount
+metadata:
+  labels:
+    app: pytorch-operator
+  name: pytorch-operator
+---
+apiVersion: rbac.authorization.k8s.io/v1beta1
+kind: ClusterRole
+metadata:
+  labels:
+    app: pytorch-operator
+  name: pytorch-operator
+rules:
+- apiGroups:
+  - kubeflow.org
+  resources:
+  - pytorchjobs
+  - pytorchjobs/status
+  verbs:
+  - '*'
+- apiGroups:
+  - apiextensions.k8s.io
+  resources:
+  - customresourcedefinitions
+  verbs:
+  - '*'
+- apiGroups:
+  - ""
+  resources:
+  - pods
+  - services
+  - endpoints
+  - events
+  verbs:
+  - '*'
+---
+apiVersion: rbac.authorization.k8s.io/v1beta1
+kind: ClusterRoleBinding
+metadata:
+  labels:
+    app: pytorch-operator
+  name: pytorch-operator
+roleRef:
+  apiGroup: rbac.authorization.k8s.io
+  kind: ClusterRole
+  name: pytorch-operator
+subjects:
+- kind: ServiceAccount
+  name: pytorch-operator
+  namespace: {{ .Release.Namespace }}
+---
diff --git a/helm-charts/submarine/charts/pytorchjob/templates/service.yaml b/helm-charts/submarine/charts/pytorchjob/templates/service.yaml
new file mode 100644
index 0000000..c0580f0
--- /dev/null
+++ b/helm-charts/submarine/charts/pytorchjob/templates/service.yaml
@@ -0,0 +1,35 @@
+#
+# 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.
+#
+
+apiVersion: v1
+kind: Service
+metadata:
+  annotations:
+    prometheus.io/path: /metrics
+    prometheus.io/port: "8443"
+    prometheus.io/scrape: "true"
+  labels:
+    app: pytorch-operator
+  name: pytorch-operator
+spec:
+  ports:
+  - name: monitoring-port
+    port: 8443
+    targetPort: 8443
+  selector:
+    name: pytorch-operator
+  type: ClusterIP
diff --git a/helm-charts/submarine/charts/pytorchjob/values.yaml b/helm-charts/submarine/charts/pytorchjob/values.yaml
new file mode 100644
index 0000000..555eccf
--- /dev/null
+++ b/helm-charts/submarine/charts/pytorchjob/values.yaml
@@ -0,0 +1,17 @@
+#
+# 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.
+#
+
diff --git a/helm-charts/submarine/charts/tfjob/.helmignore b/helm-charts/submarine/charts/tfjob/.helmignore
new file mode 100644
index 0000000..cab781a
--- /dev/null
+++ b/helm-charts/submarine/charts/tfjob/.helmignore
@@ -0,0 +1,40 @@
+#
+# 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.
+#
+
+# Patterns to ignore when building packages.
+# This supports shell glob matching, relative path matching, and
+# negation (prefixed with !). Only one pattern per line.
+.DS_Store
+# Common VCS dirs
+.git/
+.gitignore
+.bzr/
+.bzrignore
+.hg/
+.hgignore
+.svn/
+# Common backup files
+*.swp
+*.bak
+*.tmp
+*.orig
+*~
+# Various IDEs
+.project
+.idea/
+*.tmproj
+.vscode/
diff --git a/helm-charts/submarine/charts/tfjob/Chart.yaml b/helm-charts/submarine/charts/tfjob/Chart.yaml
new file mode 100644
index 0000000..adffae8
--- /dev/null
+++ b/helm-charts/submarine/charts/tfjob/Chart.yaml
@@ -0,0 +1,38 @@
+#
+# 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.
+#
+
+apiVersion: v2
+name: tfjob
+description: tfjob
+
+# A chart can be either an 'application' or a 'library' chart.
+#
+# Application charts are a collection of templates that can be packaged into versioned archives
+# to be deployed.
+#
+# Library charts provide useful utilities or functions for the chart developer. They're included as
+# a dependency of application charts to inject those utilities and functions into the rendering
+# pipeline. Library charts do not define any templates and therefore cannot be deployed.
+type: application
+
+# This is the chart version. This version number should be incremented each time you make changes
+# to the chart and its templates, including the app version.
+version: 0.1.0
+
+# This is the version number of the application being deployed. This version number should be
+# incremented each time you make changes to the application.
+appVersion: 1.0.0
diff --git a/helm-charts/submarine/charts/tfjob/crds/crd.yaml b/helm-charts/submarine/charts/tfjob/crds/crd.yaml
new file mode 100644
index 0000000..1064757
--- /dev/null
+++ b/helm-charts/submarine/charts/tfjob/crds/crd.yaml
@@ -0,0 +1,64 @@
+#
+# 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.
+#
+
+apiVersion: apiextensions.k8s.io/v1beta1
+kind: CustomResourceDefinition
+metadata:
+  name: tfjobs.kubeflow.org
+spec:
+  additionalPrinterColumns:
+  - JSONPath: .status.conditions[-1:].type
+    name: State
+    type: string
+  - JSONPath: .metadata.creationTimestamp
+    name: Age
+    type: date
+  group: kubeflow.org
+  names:
+    kind: TFJob
+    plural: tfjobs
+    singular: tfjob
+  scope: Namespaced
+  subresources:
+    status: {}
+  validation:
+    openAPIV3Schema:
+      properties:
+        spec:
+          properties:
+            tfReplicaSpecs:
+              properties:
+                Chief:
+                  properties:
+                    replicas:
+                      maximum: 1
+                      minimum: 1
+                      type: integer
+                PS:
+                  properties:
+                    replicas:
+                      minimum: 1
+                      type: integer
+                Worker:
+                  properties:
+                    replicas:
+                      minimum: 1
+                      type: integer
+  versions:
+  - name: v1
+    served: true
+    storage: true
diff --git a/helm-charts/submarine/charts/tfjob/templates/cluster-role-binding.yaml b/helm-charts/submarine/charts/tfjob/templates/cluster-role-binding.yaml
new file mode 100644
index 0000000..3f14839
--- /dev/null
+++ b/helm-charts/submarine/charts/tfjob/templates/cluster-role-binding.yaml
@@ -0,0 +1,31 @@
+#
+# 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.
+#
+---
+apiVersion: rbac.authorization.k8s.io/v1beta1
+kind: ClusterRoleBinding
+metadata:
+  labels:
+    app: tf-job-operator
+  name: tf-job-operator
+roleRef:
+  apiGroup: rbac.authorization.k8s.io
+  kind: ClusterRole
+  name: tf-job-operator
+subjects:
+- kind: ServiceAccount
+  name: tf-job-operator
+  namespace: {{ .Release.Namespace }}
diff --git a/helm-charts/submarine/charts/tfjob/templates/cluster-role.yaml b/helm-charts/submarine/charts/tfjob/templates/cluster-role.yaml
new file mode 100644
index 0000000..2620ca9
--- /dev/null
+++ b/helm-charts/submarine/charts/tfjob/templates/cluster-role.yaml
@@ -0,0 +1,111 @@
+#
+# 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.
+#
+---
+apiVersion: rbac.authorization.k8s.io/v1beta1
+kind: ClusterRole
+metadata:
+  labels:
+    app: tf-job-operator
+  name: tf-job-operator
+rules:
+- apiGroups:
+  - kubeflow.org
+  resources:
+  - tfjobs
+  - tfjobs/status
+  verbs:
+  - '*'
+- apiGroups:
+  - apiextensions.k8s.io
+  resources:
+  - customresourcedefinitions
+  verbs:
+  - '*'
+- apiGroups:
+  - ""
+  resources:
+  - pods
+  - services
+  - endpoints
+  - events
+  verbs:
+  - '*'
+- apiGroups:
+  - apps
+  - extensions
+  resources:
+  - deployments
+  verbs:
+  - '*'
+
+---
+
+apiVersion: rbac.authorization.k8s.io/v1
+kind: ClusterRole
+metadata:
+  name: kubeflow-tfjobs-admin
+  labels:
+    rbac.authorization.kubeflow.org/aggregate-to-kubeflow-admin: "true"
+aggregationRule:
+  clusterRoleSelectors:
+  - matchLabels:
+      rbac.authorization.kubeflow.org/aggregate-to-kubeflow-tfjobs-admin: "true"
+rules: []
+
+---
+
+apiVersion: rbac.authorization.k8s.io/v1
+kind: ClusterRole
+metadata:
+  name: kubeflow-tfjobs-edit
+  labels:
+    rbac.authorization.kubeflow.org/aggregate-to-kubeflow-edit: "true"
+    rbac.authorization.kubeflow.org/aggregate-to-kubeflow-tfjobs-admin: "true"
+rules:
+- apiGroups:
+  - kubeflow.org
+  resources:
+  - tfjobs
+  - tfjobs/status
+  verbs:
+  - get
+  - list
+  - watch
+  - create
+  - delete
+  - deletecollection
+  - patch
+  - update
+
+---
+
+apiVersion: rbac.authorization.k8s.io/v1
+kind: ClusterRole
+metadata:
+  name: kubeflow-tfjobs-view
+  labels:
+    rbac.authorization.kubeflow.org/aggregate-to-kubeflow-view: "true"
+rules:
+- apiGroups:
+  - kubeflow.org
+  resources:
+  - tfjobs
+  - tfjobs/status
+  verbs:
+  - get
+  - list
+  - watch
diff --git a/helm-charts/submarine/charts/tfjob/templates/deployment.yaml b/helm-charts/submarine/charts/tfjob/templates/deployment.yaml
new file mode 100644
index 0000000..b9e26eb
--- /dev/null
+++ b/helm-charts/submarine/charts/tfjob/templates/deployment.yaml
@@ -0,0 +1,54 @@
+#
+# 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.
+#
+---
+apiVersion: apps/v1
+kind: Deployment
+metadata:
+  name: tf-job-operator
+  labels:
+    app: tf-job-operator
+    name: tf-job-operator
+spec:
+  replicas: 1
+  selector:
+    matchLabels:
+      app: tf-job-operator
+      name: tf-job-operator
+  template:
+    metadata:
+      labels:
+        app: tf-job-operator
+        name: tf-job-operator
+    spec:
+      containers:
+      - command:
+        - /opt/kubeflow/tf-operator.v1
+        - --alsologtostderr
+        - -v=1
+        - --monitoring-port=8443
+        env:
+        - name: MY_POD_NAMESPACE
+          valueFrom:
+            fieldRef:
+              fieldPath: metadata.namespace
+        - name: MY_POD_NAME
+          valueFrom:
+            fieldRef:
+              fieldPath: metadata.name
+        image: gcr.io/kubeflow-images-public/tf_operator:kubeflow-tf-operator-postsubmit-v1-5adee6f-6109-a25c
+        name: tf-job-operator
+      serviceAccountName: tf-job-operator
diff --git a/helm-charts/submarine/charts/tfjob/templates/service-account.yaml b/helm-charts/submarine/charts/tfjob/templates/service-account.yaml
new file mode 100644
index 0000000..217e05b
--- /dev/null
+++ b/helm-charts/submarine/charts/tfjob/templates/service-account.yaml
@@ -0,0 +1,30 @@
+#
+# 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.
+#
+---
+apiVersion: v1
+kind: ServiceAccount
+metadata:
+  labels:
+    app: tf-job-dashboard
+  name: tf-job-dashboard
+---
+apiVersion: v1
+kind: ServiceAccount
+metadata:
+  labels:
+    app: tf-job-operator
+  name: tf-job-operator
diff --git a/helm-charts/submarine/charts/tfjob/templates/service.yaml b/helm-charts/submarine/charts/tfjob/templates/service.yaml
new file mode 100644
index 0000000..e84ad6d
--- /dev/null
+++ b/helm-charts/submarine/charts/tfjob/templates/service.yaml
@@ -0,0 +1,35 @@
+#
+# 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.
+#
+---
+apiVersion: v1
+kind: Service
+metadata:
+  annotations:
+    prometheus.io/path: /metrics
+    prometheus.io/scrape: "true"
+    prometheus.io/port: "8443"
+  labels:
+    app: tf-job-operator
+  name: tf-job-operator
+spec:
+  ports:
+  - name: monitoring-port
+    port: 8443
+    targetPort: 8443
+  selector:
+    name: tf-job-operator
+  type: ClusterIP
diff --git a/helm-charts/submarine/charts/tfjob/values.yaml b/helm-charts/submarine/charts/tfjob/values.yaml
new file mode 100644
index 0000000..cce3aca
--- /dev/null
+++ b/helm-charts/submarine/charts/tfjob/values.yaml
@@ -0,0 +1,16 @@
+#
+# 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.
+#
diff --git a/helm-charts/submarine/templates/rbac.yaml b/helm-charts/submarine/templates/rbac.yaml
new file mode 100644
index 0000000..fe0f5a5
--- /dev/null
+++ b/helm-charts/submarine/templates/rbac.yaml
@@ -0,0 +1,52 @@
+#
+# 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.
+#
+
+apiVersion: rbac.authorization.k8s.io/v1
+kind: ClusterRole
+metadata:
+  name: "{{ .Values.submarine.server.name }}"
+rules:
+- apiGroups:
+  - kubeflow.org
+  resources:
+  - tfjobs
+  - tfjobs/status
+  - pytorchjobs
+  - pytorchjobs/status
+  verbs:
+  - get
+  - list
+  - watch
+  - create
+  - delete
+  - deletecollection
+  - patch
+  - update
+  
+---
+kind: ClusterRoleBinding
+apiVersion: rbac.authorization.k8s.io/v1
+metadata:
+  name: "{{ .Values.submarine.server.name }}"
+subjects:
+- kind: ServiceAccount
+  namespace: {{ .Release.Namespace }}
+  name: "{{ .Values.submarine.server.name }}"
+roleRef:
+  kind: ClusterRole
+  name: "{{ .Values.submarine.server.name }}"
+  apiGroup: ""
diff --git a/helm-charts/submarine/templates/submarine-database.yaml b/helm-charts/submarine/templates/submarine-database.yaml
new file mode 100644
index 0000000..b7b5d27
--- /dev/null
+++ b/helm-charts/submarine/templates/submarine-database.yaml
@@ -0,0 +1,53 @@
+#
+# 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.
+#
+
+apiVersion: apps/v1beta1
+kind: Deployment
+metadata:
+  name: "{{ .Values.submarine.database.name }}"
+spec:
+  replicas: {{ .Values.submarine.database.replicas }}
+  selector:
+    matchLabels:
+      app: "{{ .Values.submarine.database.name }}"
+  template:
+    metadata:
+      labels:
+        app: "{{ .Values.submarine.database.name }}"
+    spec:
+      containers:
+        - name: "{{ .Values.submarine.database.name }}"
+          image: "{{ .Values.submarine.database.image }}"
+          imagePullPolicy: {{ .Values.submarine.database.imagePullPolicy }}
+          ports:
+            - containerPort: 3306
+          env:
+            - name: MYSQL_ROOT_PASSWORD
+              value: "{{ .Values.submarine.database.mysqlRootPassword }}"
+
+---
+apiVersion: v1
+kind: Service
+metadata:
+  name: "{{ .Values.submarine.database.name }}"
+spec:
+  ports:
+    - name: "{{ .Values.submarine.database.name }}"
+      port: 3306
+      targetPort: {{ .Values.submarine.database.servicePort }}
+  selector:
+    app: "{{ .Values.submarine.database.name }}"
diff --git a/helm-charts/submarine/templates/submarine-server.yaml b/helm-charts/submarine/templates/submarine-server.yaml
new file mode 100644
index 0000000..2b22e3a
--- /dev/null
+++ b/helm-charts/submarine/templates/submarine-server.yaml
@@ -0,0 +1,69 @@
+#
+# 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.
+#
+
+apiVersion: v1
+kind: Service
+metadata:
+  name: "{{ .Values.submarine.server.name }}"
+  labels:
+    run: "{{ .Values.submarine.server.name }}"
+spec:
+  ports:
+  - port: 8080
+    targetPort: {{ .Values.submarine.server.servicePort }}
+    protocol: TCP
+  selector:
+    run: "{{ .Values.submarine.server.name }}"
+
+---
+apiVersion: v1
+kind: ServiceAccount
+metadata:
+  name: "{{ .Values.submarine.server.name }}"
+---
+apiVersion: apps/v1
+kind: Deployment
+metadata:
+  name: "{{ .Values.submarine.server.name }}"
+spec:
+  selector:
+    matchLabels:
+      run: "{{ .Values.submarine.server.name }}"
+  replicas: {{ .Values.submarine.server.replicas }}
+  template:
+    metadata:
+      labels:
+        run: "{{ .Values.submarine.server.name }}"
+    spec:
+      serviceAccountName: "{{ .Values.submarine.server.name }}"
+      containers:
+      - name: "{{ .Values.submarine.server.name }}"
+        env:
+        - name: SUBMARINE_SERVER_PORT
+          value: "8080"
+        - name: SUBMARINE_SERVER_PORT_8080_TCP
+          value: "8080"
+        - name: K8S_APISERVER_URL
+          value: "kubernetes.default.svc"
+          
+        image: "{{ .Values.submarine.server.image }}"
+        imagePullPolicy: {{ .Values.submarine.server.imagePullPolicy }}
+        command: ["/bin/bash", "-c"]
+        args: ["/opt/submarine-current/bin/submarine.sh start getMysqlJar"]
+        ports:
+        - containerPort: 8080
+        
diff --git a/helm-charts/submarine/values.yaml b/helm-charts/submarine/values.yaml
new file mode 100644
index 0000000..edb2202
--- /dev/null
+++ b/helm-charts/submarine/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.
+#
+
+submarine:
+  server:
+    imagePullPolicy: IfNotPresent
+    replicas: 1
+    name: submarine-server
+    image: apache/submarine:server-0.4.0-SNAPSHOT
+    servicePort: 8080
+  database:
+    imagePullPolicy: IfNotPresent
+    replicas: 1
+    name: submarine-database
+    image: apache/submarine:database-0.4.0-SNAPSHOT
+    servicePort: 3306
+    mysqlRootPassword: password
+


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