You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@submarine.apache.org by GitBox <gi...@apache.org> on 2020/06/13 07:46:25 UTC

[GitHub] [submarine] jiwq edited a comment on pull request #305: SUBMARINE-499. Refactor job API to experiment API

jiwq edited a comment on pull request #305:
URL: https://github.com/apache/submarine/pull/305#issuecomment-643586176


   When I try to refactor this structure, I found the spec can't deserialize to Java Map. So I think we can do some modify. The experiment spec like:
   ```json
   {
     "meta": {
       "name": "mnist",
       "namespace": "submarine",
       "framework": "TensorFlow",
       "cmd": "python /var/tf_mnist/mnist_with_summaries.py --log_dir=/train/log --learning_rate=0.01 --batch_size=150"
     },
     "environment": {
       "dockerImage": "gcr.io/kubeflow-ci/tf-mnist-with-summaries:1.0"
     },
     "spec": {
       "Ps": {
         "replicas": 1,
         "resources": "cpu=4,memory=2048M"
       },
       "Worker": {
         "replicas": 2,
         "resources": "cpu=2,memory=1024M,nvidia.com/gpu=1"
       }
     }
   }
   ```
   Python client:
   ```python
   meta = Meta(name='mnist', namespace='submarine', framework='TensorFlow', 
              cmd: "python /var/tf_mnist/mnist_with_summaries.py --log_dir=/train/log --learning_rate=0.01 --batch_size=150")
   environment = Environment(docker-image='gcr.io/kubeflow-ci/tf-mnist-with-summaries:1.0')
   ps = Task(environment = None, cmd=None, env_vars=None,
              resources='cpu=2,memory=1024M', replicas=1)
   worker = TaskSpec(environment = None, cmd=None,  env_vars=None,
              resources='cpu=4,memory=2048M', replicas=2)
   body = ExperimentSpec(meta=meta, environment = environment,
              spec={"type":"tensorflow", "Ps": ps, "Worker": worker})
   client.create_experiment(body=body)
   ```
   or we only rename the the `job` to `experiment` and `librarySpec` to `meta`, so that we can release 0.4.0 ASAP and have more time to design the new spec. @wangdatan @tangzhankun 


----------------------------------------------------------------
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:
users@infra.apache.org