-
Notifications
You must be signed in to change notification settings - Fork 35
BaseURL Configuration for MarvinAI Notebook #32
base: develop
Are you sure you want to change the base?
Conversation
Added base url configuration for MarvinAI Notebook ex: marvin notebook --base-url=/marvin-notebook
Added test code fix
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice feature! some simple fixs needed in unit test for Travis CI approval
@@ -29,15 +29,15 @@ def cli(): | |||
|
|||
@cli.command('notebook', help='Start the Jupyter notebook server.') | |||
@click.option('--port', '-p', default=8888, help='Jupyter server port') | |||
@click.option('--base-url', '-p', default='/', help='Jupyter server base url') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The short parameter for base url could be something else than '-p' that conflicts with Port´s short parameter.
@@ -69,7 +69,7 @@ def test_jupyter_lab(system_mocked, sys_mocked): | |||
spark_conf = '/opt/spark/conf' | |||
system_mocked.return_value = 1 | |||
|
|||
lab(ctx, port, enable_security, spark_conf) | |||
lab(ctx, port, '/', enable_security, spark_conf) | |||
|
|||
system_mocked.assert_called_once_with('SPARK_CONF_DIR=/opt/spark/conf YARN_CONF_DIR=/opt/spark/conf jupyter-lab --notebook-dir /tmp/notebooks --ip 0.0.0.0 --port 8888 --no-browser --NotebookApp.token=') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding '--NotebookApp.base_url=/' for assertion error fix.
@@ -83,6 +83,6 @@ def test_jupyter_lab_with_security(system_mocked, sys_mocked): | |||
spark_conf = '/opt/spark/conf' | |||
system_mocked.return_value = 1 | |||
|
|||
lab(ctx, port, enable_security, spark_conf) | |||
lab(ctx, port, '/', enable_security, spark_conf) | |||
|
|||
system_mocked.assert_called_once_with('SPARK_CONF_DIR=/opt/spark/conf YARN_CONF_DIR=/opt/spark/conf jupyter-lab --notebook-dir /tmp/notebooks --ip 0.0.0.0 --port 8888 --no-browser') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding '--NotebookApp.base_url=/' for assertion error fix.
@@ -40,7 +40,7 @@ def test_notebook(system_mocked, sys_mocked): | |||
spark_conf = '/opt/spark/conf' | |||
system_mocked.return_value = 1 | |||
|
|||
notebook(ctx, port, enable_security, spark_conf, allow_root) | |||
notebook(ctx, port, '/', enable_security, spark_conf, allow_root) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it is better to still create a variable called base_url
instead of directly put a '/'
in the code.
Removed port conflict (-p) for base_url
Added base url configuration for MarvinAI Notebook
ex: marvin notebook --base-url=/marvin-notebook