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 2022/01/17 21:43:36 UTC
[GitHub] [submarine] atosystem opened a new pull request #871: SUBMARINE-1133. Connect API for CLI Notebooks
atosystem opened a new pull request #871:
URL: https://github.com/apache/submarine/pull/871
### What is this PR for?
Implement
```bash=
submarine list notebook
submarine get notebook <id>
submarine delete notebook <id>
```
### What type of PR is it?
[Feature]
### Todos
None
### What is the Jira issue?
https://issues.apache.org/jira/browse/SUBMARINE-1133
### How should this be tested?
python e2e tests are implemented
### Screenshots (if appropriate)
None
### Questions:
* Do the license files need updating? No
* Are there breaking changes for older versions? No
* Does this need new documentation? Yes
--
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.
To unsubscribe, e-mail: commits-unsubscribe@submarine.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [submarine] atosystem commented on a change in pull request #871: SUBMARINE-1133. Connect API for CLI Notebooks
Posted by GitBox <gi...@apache.org>.
atosystem commented on a change in pull request #871:
URL: https://github.com/apache/submarine/pull/871#discussion_r786409623
##########
File path: submarine-sdk/pysubmarine/submarine/cli/notebook/command.py
##########
@@ -15,24 +15,132 @@
under the License.
"""
+import json
+import time
+
import click
+from rich.console import Console
+from rich.json import JSON as richJSON
+from rich.panel import Panel
+from rich.table import Table
+
+from submarine.cli.config.config import loadConfig
+from submarine.client.api.notebook_client import NotebookClient
+from submarine.client.exceptions import ApiException
+
+submarineCliConfig = loadConfig()
+if submarineCliConfig is None:
+ exit(1)
Review comment:
@pingsutw I have already raised the error message in `loadConfig`
https://github.com/apache/submarine/blob/efb4e7c578f9ee5188414b2140ab7b4a9de1ec92/submarine-sdk/pysubmarine/submarine/cli/config/config.py#L103-L114
Do I have to change the place to raise the error?
--
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.
To unsubscribe, e-mail: commits-unsubscribe@submarine.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [submarine] atosystem commented on a change in pull request #871: SUBMARINE-1133. Connect API for CLI Notebooks
Posted by GitBox <gi...@apache.org>.
atosystem commented on a change in pull request #871:
URL: https://github.com/apache/submarine/pull/871#discussion_r786409709
##########
File path: submarine-sdk/pysubmarine/submarine/cli/notebook/command.py
##########
@@ -15,24 +15,132 @@
under the License.
"""
+import json
+import time
+
import click
+from rich.console import Console
+from rich.json import JSON as richJSON
+from rich.panel import Panel
+from rich.table import Table
+
+from submarine.cli.config.config import loadConfig
+from submarine.client.api.notebook_client import NotebookClient
+from submarine.client.exceptions import ApiException
+
+submarineCliConfig = loadConfig()
+if submarineCliConfig is None:
+ exit(1)
+notebookClient = NotebookClient(
+ host="http://{}:{}".format(
+ submarineCliConfig.connection.hostname, submarineCliConfig.connection.port
+ )
+)
+
+POLLING_INTERVAL = 1 # sec
+TIMEOUT = 30 # sec
@click.command("notebook")
def list_notebook():
"""List notebooks"""
- click.echo("list notebook!")
+ COLS_TO_SHOW = ["Name", "ID", "Environment", "Resources", "Status"]
+ console = Console()
+ # using user_id hard coded in SysUserRestApi.java
Review comment:
Got it
--
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.
To unsubscribe, e-mail: commits-unsubscribe@submarine.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [submarine] pingsutw commented on a change in pull request #871: SUBMARINE-1133. Connect API for CLI Notebooks
Posted by GitBox <gi...@apache.org>.
pingsutw commented on a change in pull request #871:
URL: https://github.com/apache/submarine/pull/871#discussion_r786398511
##########
File path: submarine-sdk/pysubmarine/submarine/cli/notebook/command.py
##########
@@ -15,24 +15,132 @@
under the License.
"""
+import json
+import time
+
import click
+from rich.console import Console
+from rich.json import JSON as richJSON
+from rich.panel import Panel
+from rich.table import Table
+
+from submarine.cli.config.config import loadConfig
+from submarine.client.api.notebook_client import NotebookClient
+from submarine.client.exceptions import ApiException
+
+submarineCliConfig = loadConfig()
+if submarineCliConfig is None:
+ exit(1)
+notebookClient = NotebookClient(
+ host="http://{}:{}".format(
+ submarineCliConfig.connection.hostname, submarineCliConfig.connection.port
+ )
+)
+
+POLLING_INTERVAL = 1 # sec
+TIMEOUT = 30 # sec
@click.command("notebook")
def list_notebook():
"""List notebooks"""
- click.echo("list notebook!")
+ COLS_TO_SHOW = ["Name", "ID", "Environment", "Resources", "Status"]
+ console = Console()
+ # using user_id hard coded in SysUserRestApi.java
Review comment:
add the link in the comment. https://github.com/apache/submarine/blob/5040068d7214a46c52ba87e10e9fa64411293cf7/submarine-server/server-core/src/main/java/org/apache/submarine/server/workbench/rest/SysUserRestApi.java#L228
--
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.
To unsubscribe, e-mail: commits-unsubscribe@submarine.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [submarine] pingsutw commented on a change in pull request #871: SUBMARINE-1133. Connect API for CLI Notebooks
Posted by GitBox <gi...@apache.org>.
pingsutw commented on a change in pull request #871:
URL: https://github.com/apache/submarine/pull/871#discussion_r786398238
##########
File path: submarine-sdk/pysubmarine/submarine/cli/notebook/command.py
##########
@@ -15,24 +15,132 @@
under the License.
"""
+import json
+import time
+
import click
+from rich.console import Console
+from rich.json import JSON as richJSON
+from rich.panel import Panel
+from rich.table import Table
+
+from submarine.cli.config.config import loadConfig
+from submarine.client.api.notebook_client import NotebookClient
+from submarine.client.exceptions import ApiException
+
+submarineCliConfig = loadConfig()
+if submarineCliConfig is None:
+ exit(1)
Review comment:
It's better to raise an exception with error messages here.
--
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.
To unsubscribe, e-mail: commits-unsubscribe@submarine.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [submarine] asfgit closed pull request #871: SUBMARINE-1133. Connect API for CLI Notebooks
Posted by GitBox <gi...@apache.org>.
asfgit closed pull request #871:
URL: https://github.com/apache/submarine/pull/871
--
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.
To unsubscribe, e-mail: commits-unsubscribe@submarine.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org