tangzhankun commented on a change in pull request #143: SUBMARINE-333. Docs of submarine server deployment URL: https://github.com/apache/submarine/pull/143#discussion_r365664937
########## File path: docs/ops/server/README.md ########## @@ -0,0 +1,102 @@ +<!-- +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 Guide +This guide covers the deploy and running the training job by submarine server. + +## Prepare environment +Submarine runs on **Linux** and **macOS**, requires the Java 1.8.x or higher. We provide the learning and production environment tutorial. For more deployment info see [kubernetes](./kubernetes.md). + +## Training +We designed the general job spec for training job, suggest to read the the job spec before submit job. + +### Job Spec +Job Spec as the DSL for submarine server, it consists of library, submitter and tasks. For example: +```yaml +name: "mnist" +librarySpec: + name: "TensorFlow" + version: "2.1.0" + image: "gcr.io/kubeflow-ci/tf-mnist-with-summaries:1.0" + cmd: "python /var/tf_mnist/mnist_with_summaries.py --log_dir=/train/log --learning_rate=0.01 --batch_size=150" + envVars: + ENV_1: "ENV1" +submitterSpec: + type: "k8s" + configPath: + namespace: "submarine" + kind: "TFJob" + apiVersion: "kubeflow.org/v1" +taskSpecs: + Ps: + name: tensorflow + replicas: 2 + resources: "cpu=4,memory=2048M,nvidia.com/gpu=1" + Worker: + name: tensorflow + replicas: 2 + resources: "cpu=4,memory=2048M,nvidia.com/gpu=1" +``` +or +```json +{ + "name": "mnist", + "librarySpec": { + "name": "TensorFlow", + "version": "2.1.0", + "image": "gcr.io/kubeflow-ci/tf-mnist-with-summaries:1.0", + "cmd": "python /var/tf_mnist/mnist_with_summaries.py --log_dir=/train/log --learning_rate=0.01 --batch_size=150", + "envVars": { + "ENV_1": "ENV1" + } + }, + "submitterSpec": { + "type": "k8s", + "configPath": null, + "namespace": "submarine", + "kind": "TFJob", + "apiVersion": "kubeflow.org/v1" + }, + "taskSpecs": { + "Ps": { + "name": "tensorflow", + "replicas": 2, + "resources": "cpu=4,memory=2048M,nvidia.com/gpu=1" + }, + "Worker": { + "name": "tensorflow", + "replicas": 2, + "resources": "cpu=4,memory=2048M,nvidia.com/gpu=1" + } + } +} +``` + +For more info see [here](../../design/submarine-server/jobspec.md). + +### Submit Job +You can use the Postman post the job to server or use `curl` run following command: +``` +curl -H "Content-Type: application/json" --request POST \ +--data `{"name":"mnist","librarySpec":{"name":"TensorFlow","version":"2.1.0","image":"gcr.io/kubeflow-ci/tf-mnist-with-summaries:1.0","cmd":"python /var/tf_mnist/mnist_with_summaries.py --log_dir=/train/log --learning_rate=0.01 --batch_size=150","envVars":{"ENV_1":"ENV1"}},"submitterSpec":{"type":"k8s","configPath":null,"namespace":"submarine","kind":"TFJob","apiVersion":"kubeflow.org/v1"},"taskSpecs":{"Ps":{"name":"tensorflow","replicas":2,"resources":"cpu=4,memory=2048M,nvidia.com/gpu=1"},"Worker":{"name":"tensorflow","replicas":2,"resources":"cpu=4,memory=2048M,nvidia.com/gpu=1"}}}` \ Review comment: Did we test the job with GPU resource? If we don't, please remove the "nvidia.com/gpu". ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@submarine.apache.org For additional commands, e-mail: dev-h...@submarine.apache.org