SUBMARINE-516. Automatically generate python API from swagger#314
SUBMARINE-516. Automatically generate python API from swagger#314pingsutw wants to merge 13 commits intoapache:masterfrom
Conversation
xunliu
left a comment
There was a problem hiding this comment.
@pingsutw Thank you contribution this feature.
I have a problem. Now I have made a lot of changes to pysubmarine and swagger, but I have not seen the corresponding test cases.
If necessary, I think it is possible to add PR and increase test coverage in travis. I am worried that the changes are frequent and will cause problems.
dev-support/pysubmarine/gen-sdk.sh
Outdated
| '1i# 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.\ | ||
| '\ | ||
| "$filename" |
There was a problem hiding this comment.
I think it would be better to put the license header in a license-header.txt file and then add this license-header.txt file context to the generated file.
tangzhankun
left a comment
There was a problem hiding this comment.
Thanks for your contribution! @pingsutw
| @@ -0,0 +1,363 @@ | |||
| { | |||
There was a problem hiding this comment.
I'm wondering do we need to maintain this openapi.json file since we have the automation script to generate it?
There was a problem hiding this comment.
should we remove it?
Maybe someone will want to check openapi.json structure, and they don't want to build the project by themself. (currently, if we want to generate openapi.json, we need to build project firstly)
| " spec={\"Worker\": worker_spec}) \n" | ||
| ] | ||
| }, | ||
| { |
There was a problem hiding this comment.
The response is outdated and needs an update.
" 'spec': {'librarySpec': {'cmd': 'python '\n",
" '/var/tf_mnist/mnist_with_summaries.py '\n",
" '--log_dir=/train/log '\n",
" '--learning_rate=0.01 '\n",
" '--batch_size=150',\n",
" 'envVars': {'ENV1': 'ENV1'},\n",
" 'image': 'gcr.io/kubeflow-ci/tf-mnist-with-summaries:1.0',\n",
" 'name': 'tensorflow',\n",
" 'version': '2.1.0'},\n",
There was a problem hiding this comment.
Thanks, I've updated it
|
@liuxunorg @tangzhankun Thanks for the review.
Make sense |
|
LGTM. Will commit it if no more comments |
|
Thanks for the review. |
What is this PR for?
Generate Python SDK in one command
/dev-support/pysubmarine/gen-sdk.shHere is a Jupyter example
What type of PR is it?
[Improvement]
Todos
What is the Jira issue?
https://issues.apache.org/jira/browse/SUBMARINE-516
How should this be tested?
https://travis-ci.org/github/pingsutw/hadoop-submarine/builds/699154337
Screenshots (if appropriate)
Questions: