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

pingsutw 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 514fa33  SUBMARINE-678. add pytorch template to mysql
514fa33 is described below

commit 514fa33e0c6143cde51c965aa1f0427f16829b67
Author: JohnTing <[email protected]>
AuthorDate: Mon Nov 30 02:18:29 2020 +0800

    SUBMARINE-678. add pytorch template to mysql
    
    ### What is this PR for?
    The only predefined template currently in the database is tf-mnist
    I add the pytorch template into the database
    
    The following is the content
    `
    {
      "name": "pytorch-mnist",
      "author": "author",
      "description": "This is a template to run pytorch-mnist\n",
      "parameters": [
        {
          "name": "experiment_name",
          "required": "true",
          "description": "experiment name",
          "value": null
        }
      ],
      "experimentSpec": {
        "meta": {
          "name": "{{experiment_name}}",
          "namespace": "default",
          "framework": "PyTorch",
          "cmd": "python /var/mnist.py --backend gloo",
          "envVars": {
            "ENV_1": "ENV1"
          }
        },
        "environment": {
          "image": "apache/submarine:pytorch-dist-mnist-1.0"
        },
        "spec": {
          "Master": {
            "replicas": 1,
            "resources": "cpu=1,memory=1024M"
          },
          "Worker": {
            "replicas": 1,
            "resources": "cpu=1,memory=1024M"
          }
        }
      }
    }
    `
    
    ### What type of PR is it?
    Improvement
    
    ### Todos
    * [O] - add pytorch-mnist to database
    
    ### What is the Jira issue?
    https://issues.apache.org/jira/projects/SUBMARINE/issues/SUBMARINE-678
    
    ### How should this be tested?
    
    `
    curl -X POST -H "Content-Type: application/json" -d '
    {
        "params": {
            "experiment_name":"new-pytorch-mnist"
        }
    }
    ' http://127.0.0.1:8080/api/v1/experiment/pytorch-mnist
    `
    
    ### Screenshots (if appropriate)
    
![image](https://user-images.githubusercontent.com/19265751/100550083-6d0bf600-32b2-11eb-87f2-95d7aadd66a9.png)
    
    ### Questions:
    * Does the licenses files need update? No
    * Is there breaking changes for older versions? No
    * Does this needs documentation? No
    
    Author: JohnTing <[email protected]>
    
    Closes #466 from JohnTing/SUBMARINE-678 and squashes the following commits:
    
    4c173b3 [JohnTing] add doc
    65c0dd1 [JohnTing] Fix typo: pytprch->pytorch
    9946e32 [JohnTing] add pytprch-mnist template to database
---
 docs/database/submarine-data.sql                  |  2 ++
 docs/userdocs/k8s/run-experiment-template-rest.md | 11 +++++++++++
 2 files changed, 13 insertions(+)

diff --git a/docs/database/submarine-data.sql b/docs/database/submarine-data.sql
index e54322f..93ed13d 100644
--- a/docs/database/submarine-data.sql
+++ b/docs/database/submarine-data.sql
@@ -92,3 +92,5 @@ INSERT INTO `environment` VALUES
 -- ----------------------------
 INSERT INTO `experiment_template` (`id`, `experimentTemplate_name`, 
`experimentTemplate_spec`, `create_by`, `create_time`, `update_by`, 
`update_time`) VALUES
 ('experimentTemplate_1599498007985_0013', 'tf-mnist', '{\"name\": 
\"tf-mnist\", \"author\": \"author\", \"parameters\": [{\"name\": 
\"learning_rate\", \"value\": \"0.2\", \"required\": \"false\", 
\"description\": \"The parameter of train mnist.\"}, {\"name\": \"batch_size\", 
\"value\": \"150\", \"required\": \"false\", \"description\": \"The parameter 
of train mnist.\"}, {\"name\": \"experiment_name\", \"required\": \"true\", 
\"description\": \"experiment name, you should change it to av [...]
+
+INSERT INTO `experiment_template` (`id`, `experimentTemplate_name`, 
`experimentTemplate_spec`, `create_by`, `create_time`, `update_by`, 
`update_time`) VALUES('experimentTemplate_1606489231336_0014', 'pytorch-mnist', 
'{\"name\": \"pytorch-mnist\", \"author\": \"author\", \"parameters\": 
[{\"name\": \"experiment_name\", \"required\": \"true\", \"description\": 
\"experiment name\"}, {\"name\": \"spec.Master.replicas\", \"value\": \"1\", 
\"required\": \"false\", \"description\": \"\"}, {\"na [...]
diff --git a/docs/userdocs/k8s/run-experiment-template-rest.md 
b/docs/userdocs/k8s/run-experiment-template-rest.md
index 0550090..183f760 100644
--- a/docs/userdocs/k8s/run-experiment-template-rest.md
+++ b/docs/userdocs/k8s/run-experiment-template-rest.md
@@ -40,4 +40,15 @@ curl -X POST -H "Content-Type: application/json" -d '
 ' http://127.0.0.1:8080/api/v1/experiment/my-tf-mnist-template
 ```
 
+**Example Request:**
+```sh
+curl -X POST -H "Content-Type: application/json" -d '
+{
+    "params": {
+        "experiment_name":"new-pytorch-mnist"
+    }
+}
+' http://127.0.0.1:8080/api/v1/experiment/pytorch-mnist
+```
+
 Register experiment template and more info see [Experiment Template API 
Reference](api/experiment-template.md).


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to