From 0b3a5d6bd8ba48825eccebf4494e30bcec0fac7e Mon Sep 17 00:00:00 2001 From: Stefano Borini Date: Mon, 18 Jul 2016 09:16:42 +0100 Subject: [PATCH 1/8] Documentation update --- doc/source/deployment.rst | 43 ++++++++++++++++++++------------------- doc/source/utilities.rst | 2 ++ 2 files changed, 24 insertions(+), 21 deletions(-) diff --git a/doc/source/deployment.rst b/doc/source/deployment.rst index 13fbf396a..7f82bec0e 100644 --- a/doc/source/deployment.rst +++ b/doc/source/deployment.rst @@ -11,27 +11,14 @@ Deployment of the complete system in a single machine/VM. The following instructions assume a clean up-to-date ubuntu 14.04 system. -#. Install dependencies:: - - sudo apt-get install npm nodejs-legacy python3-pip python3.4-venv - sudo npm install -g configurable-http-proxy - -#. Install the single user session manager:: +#. Retrieve the single user session manager:: git clone https://github.com/simphony/simphony-remote -#. Create a venv, activate it:: - - cd simphony-remote - python3 -mvenv venv - . venv/bin/activate - pip3 install docker-py - python3 setup.py install (or develop) +#. Install dependencies. This will install the dependencies and create + a virtual environment for additional deployment:: - - .. note:: - Install docker-py with pip due to - incorrect setup.py not handling python > 3.3 + make deps #. Generate the SSL certificates if you do not already have them. The resulting certificates will have names test.* because they are @@ -43,13 +30,11 @@ Deployment of the complete system in a single machine/VM. Once created the certificates, copy them to the jupyterhub directory:: - cd ../scripts - sh generate_certificate.sh - cp test.* ../jupyterhub/ + make certs #. Create the database. By default, this is a sqlite file:: - remoteappdb --db=~/remoteappmanager.db init + make db #. Change dir into jupyterhub:: @@ -65,6 +50,10 @@ Compatible docker containers can be found in DockerHub. Refer to the documentati of `simphony-remote-docker `_ repository to deploy the images. +Once installed, use the `remoteappdb` program to create users, applications, +and authorize users to start applications. Refer to the :ref:`utilities` +section for details on the use of this program. + Start JupyterHub ---------------- @@ -76,4 +65,16 @@ Start JupyterHub If you want to keep the application running, use screen to start a detachable terminal. + .. note:: + Running on OSX or with a separate docker machine requires that the + appropriate environment variables are set before starting jupyterhub. + refer to the command `docker-machine env` to setup the appropriate + environment. In general, invoking:: + + eval `docker-machine env` + + will enable the appropriate environment. + On Linux, by default the host machine and the docker machine coincide, + so this step is not needed. + #. JupyterHub is now running at https://localhost:8000 diff --git a/doc/source/utilities.rst b/doc/source/utilities.rst index a768d8e64..88f99d849 100644 --- a/doc/source/utilities.rst +++ b/doc/source/utilities.rst @@ -1,3 +1,5 @@ +.. _utilities: + Utilities ========= From 690d59b1c8a17e1e33a11c5c535c20a67dbed68f Mon Sep 17 00:00:00 2001 From: Stefano Borini Date: Mon, 18 Jul 2016 09:26:13 +0100 Subject: [PATCH 2/8] Added new apidoc --- .../remoteappmanager.cli.remoteapprest.rst | 10 ++++ doc/source/api/remoteappmanager.cli.rst | 1 + doc/source/api/remoteappmanager.db.rst | 16 +++--- doc/source/api/remoteappmanager.rest.rst | 54 +++++++++++++++++++ .../api/remoteappmanager.restresources.rst | 30 +++++++++++ doc/source/api/remoteappmanager.rst | 3 ++ doc/source/api/remoteappmanager.services.rst | 30 +++++++++++ doc/source/developer.rst | 5 ++ 8 files changed, 141 insertions(+), 8 deletions(-) create mode 100644 doc/source/api/remoteappmanager.cli.remoteapprest.rst create mode 100644 doc/source/api/remoteappmanager.rest.rst create mode 100644 doc/source/api/remoteappmanager.restresources.rst create mode 100644 doc/source/api/remoteappmanager.services.rst diff --git a/doc/source/api/remoteappmanager.cli.remoteapprest.rst b/doc/source/api/remoteappmanager.cli.remoteapprest.rst new file mode 100644 index 000000000..736b8c8d4 --- /dev/null +++ b/doc/source/api/remoteappmanager.cli.remoteapprest.rst @@ -0,0 +1,10 @@ +remoteappmanager.cli.remoteapprest package +========================================== + +Module contents +--------------- + +.. automodule:: remoteappmanager.cli.remoteapprest + :members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/remoteappmanager.cli.rst b/doc/source/api/remoteappmanager.cli.rst index 17c59b5d5..86d1cd916 100644 --- a/doc/source/api/remoteappmanager.cli.rst +++ b/doc/source/api/remoteappmanager.cli.rst @@ -7,6 +7,7 @@ Subpackages .. toctree:: remoteappmanager.cli.remoteappdb + remoteappmanager.cli.remoteapprest Module contents --------------- diff --git a/doc/source/api/remoteappmanager.db.rst b/doc/source/api/remoteappmanager.db.rst index 4ed9cbf29..411898e03 100644 --- a/doc/source/api/remoteappmanager.db.rst +++ b/doc/source/api/remoteappmanager.db.rst @@ -4,6 +4,14 @@ remoteappmanager.db package Submodules ---------- +remoteappmanager.db.csv_db module +--------------------------------- + +.. automodule:: remoteappmanager.db.csv_db + :members: + :undoc-members: + :show-inheritance: + remoteappmanager.db.interfaces module ------------------------------------- @@ -20,14 +28,6 @@ remoteappmanager.db.orm module :undoc-members: :show-inheritance: -remoteappmanager.db.csv_db module ---------------------------------- - -.. automodule:: remoteappmanager.db.csv_db - :members: - :undoc-members: - :show-inheritance: - Module contents --------------- diff --git a/doc/source/api/remoteappmanager.rest.rst b/doc/source/api/remoteappmanager.rest.rst new file mode 100644 index 000000000..a84fc0292 --- /dev/null +++ b/doc/source/api/remoteappmanager.rest.rst @@ -0,0 +1,54 @@ +remoteappmanager.rest package +============================= + +Submodules +---------- + +remoteappmanager.rest.exceptions module +--------------------------------------- + +.. automodule:: remoteappmanager.rest.exceptions + :members: + :undoc-members: + :show-inheritance: + +remoteappmanager.rest.httpstatus module +--------------------------------------- + +.. automodule:: remoteappmanager.rest.httpstatus + :members: + :undoc-members: + :show-inheritance: + +remoteappmanager.rest.registry module +------------------------------------- + +.. automodule:: remoteappmanager.rest.registry + :members: + :undoc-members: + :show-inheritance: + +remoteappmanager.rest.resource module +------------------------------------- + +.. automodule:: remoteappmanager.rest.resource + :members: + :undoc-members: + :show-inheritance: + +remoteappmanager.rest.rest_handler module +----------------------------------------- + +.. automodule:: remoteappmanager.rest.rest_handler + :members: + :undoc-members: + :show-inheritance: + + +Module contents +--------------- + +.. automodule:: remoteappmanager.rest + :members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/remoteappmanager.restresources.rst b/doc/source/api/remoteappmanager.restresources.rst new file mode 100644 index 000000000..ead031892 --- /dev/null +++ b/doc/source/api/remoteappmanager.restresources.rst @@ -0,0 +1,30 @@ +remoteappmanager.restresources package +====================================== + +Submodules +---------- + +remoteappmanager.restresources.application module +------------------------------------------------- + +.. automodule:: remoteappmanager.restresources.application + :members: + :undoc-members: + :show-inheritance: + +remoteappmanager.restresources.container module +----------------------------------------------- + +.. automodule:: remoteappmanager.restresources.container + :members: + :undoc-members: + :show-inheritance: + + +Module contents +--------------- + +.. automodule:: remoteappmanager.restresources + :members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/remoteappmanager.rst b/doc/source/api/remoteappmanager.rst index 0b6670c58..84edd771f 100644 --- a/doc/source/api/remoteappmanager.rst +++ b/doc/source/api/remoteappmanager.rst @@ -11,6 +11,9 @@ Subpackages remoteappmanager.docker remoteappmanager.handlers remoteappmanager.logging + remoteappmanager.rest + remoteappmanager.restresources + remoteappmanager.services Submodules ---------- diff --git a/doc/source/api/remoteappmanager.services.rst b/doc/source/api/remoteappmanager.services.rst new file mode 100644 index 000000000..d3ef14ea8 --- /dev/null +++ b/doc/source/api/remoteappmanager.services.rst @@ -0,0 +1,30 @@ +remoteappmanager.services package +================================= + +Submodules +---------- + +remoteappmanager.services.hub module +------------------------------------ + +.. automodule:: remoteappmanager.services.hub + :members: + :undoc-members: + :show-inheritance: + +remoteappmanager.services.reverse_proxy module +---------------------------------------------- + +.. automodule:: remoteappmanager.services.reverse_proxy + :members: + :undoc-members: + :show-inheritance: + + +Module contents +--------------- + +.. automodule:: remoteappmanager.services + :members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/developer.rst b/doc/source/developer.rst index 6ef6bd261..9fadf573d 100644 --- a/doc/source/developer.rst +++ b/doc/source/developer.rst @@ -1,2 +1,7 @@ Developer documentation ======================= + +.. toctree:: + :maxdepth: 1 + + api From 49dcd16158f9e4bcb7f27d519227751c29768d77 Mon Sep 17 00:00:00 2001 From: Stefano Borini Date: Mon, 18 Jul 2016 09:27:44 +0100 Subject: [PATCH 3/8] Fixed incorrect formatting --- doc/source/utilities.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/source/utilities.rst b/doc/source/utilities.rst index 88f99d849..92cbb5e07 100644 --- a/doc/source/utilities.rst +++ b/doc/source/utilities.rst @@ -3,7 +3,7 @@ Utilities ========= -Simphony remote comes with two utility scripts:: +Simphony remote comes with two utility scripts: - *remoteappdb*: Allows to add new applications, create new users, and specify permissions between users and applications in a database. From 428eb926acd5dc5b5fd657d1629cea710cda63b6 Mon Sep 17 00:00:00 2001 From: Stefano Borini Date: Mon, 18 Jul 2016 09:34:22 +0100 Subject: [PATCH 4/8] Fixing documentation error --- remoteappmanager/docker/container.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/remoteappmanager/docker/container.py b/remoteappmanager/docker/container.py index d55603c18..4977f9d5c 100644 --- a/remoteappmanager/docker/container.py +++ b/remoteappmanager/docker/container.py @@ -67,7 +67,7 @@ def from_docker_containers_dict(cls, docker_dict): Returns ------- - container : Container + container : docker.container.Container Examples -------- From d1adae9d9706f31b7374fe4adaad8d2690edca44 Mon Sep 17 00:00:00 2001 From: Stefano Borini Date: Mon, 18 Jul 2016 09:43:17 +0100 Subject: [PATCH 5/8] Fixed another namespace collision --- remoteappmanager/services/reverse_proxy.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/remoteappmanager/services/reverse_proxy.py b/remoteappmanager/services/reverse_proxy.py index 3ac46b650..64807c3cd 100644 --- a/remoteappmanager/services/reverse_proxy.py +++ b/remoteappmanager/services/reverse_proxy.py @@ -42,7 +42,7 @@ def remove_container(self, container): Parameters ---------- - container : Container + container : remoteappmanager.docker.container.Container A container object. """ proxy = self._reverse_proxy @@ -70,7 +70,7 @@ def add_container(self, container): Parameters ---------- - container : Container + container : remoteappmanager.docker.container.Container A container object. Returns From be9b8d8ad03f6fd88fc243e04bde8d39c6acaaf7 Mon Sep 17 00:00:00 2001 From: Stefano Borini Date: Mon, 18 Jul 2016 10:19:10 +0100 Subject: [PATCH 6/8] Changelog --- CHANGES.rst | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/CHANGES.rst b/CHANGES.rst index 5ed79defe..c0b7fb9ea 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -1,6 +1,31 @@ SimPhoNy Remote CHANGELOG ========================= +What's new in SimPhoNy Remote 0.4.0 +----------------------------------- + +Summary +~~~~~~~ + +- Experimental REST API and CLI program to control containers from the + command line (#7) +- Support for arbitrary database implementations (#66) +- Added remoteappdb `--verify` option to check against the docker repo for + matching images (#58) +- Enabled Foreign Key and on cascade delete for sqlite database (#56) +- Introduced makefile for basic deployment tasks (#68) +- User.orm_user is now User.account (#67) +- Asynchronous user verification with the jupyter hub is now in place (#37) +- Consistently differentiate between url and urlpath in parameters, where + possible (#54) +- Container.host_url now checks for None port (#63) +- Isolated sqlalchemy sessions for the base handler (#71) +- verify_token now returns a dictionary with user details. (#77) +- Bug: ui_names no longer appearing (#64) +- Bug: test error for sqlalchemy usage with multiple threads. (#99) +- Bug: fixed test error message relative to unclosed files. (#60) + + What's new in SimPhoNy Remote 0.3.0 ----------------------------------- From fcf02e61282b2cf1bacae7beb0b359fb47a2d958 Mon Sep 17 00:00:00 2001 From: Stefano Borini Date: Mon, 18 Jul 2016 10:29:03 +0100 Subject: [PATCH 7/8] Added version to the docs. Bumped up release marker --- doc/source/conf.py | 6 ++++-- remoteappmanager/__init__.py | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/doc/source/conf.py b/doc/source/conf.py index 4cdd6c214..f162fec3d 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -21,6 +21,8 @@ import sys sys.path.append(os.path.abspath('../../remoteappmanager')) +from remoteappmanager import __version__, MAJOR, MINOR + # -- General configuration ------------------------------------------------ # If your documentation needs a minimal Sphinx version, state it here. @@ -65,9 +67,9 @@ # built documents. # # The short X.Y version. -version = '0.4' +version = '{}.{}'.format(MAJOR, MINOR) # The full version, including alpha/beta/rc tags. -release = '0.4.0dev0' +release = __version__ # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff --git a/remoteappmanager/__init__.py b/remoteappmanager/__init__.py index cfdc622e5..4516c39db 100644 --- a/remoteappmanager/__init__.py +++ b/remoteappmanager/__init__.py @@ -1,7 +1,7 @@ MAJOR = 0 MINOR = 4 MICRO = 0 -IS_RELEASED = False +IS_RELEASED = True __version__ = '%d.%d.%d' % (MAJOR, MINOR, MICRO) From 8a43a9011778001dca17dd6de2819fabe93ef6c4 Mon Sep 17 00:00:00 2001 From: Stefano Borini Date: Mon, 18 Jul 2016 11:00:43 +0100 Subject: [PATCH 8/8] Update container.py --- remoteappmanager/docker/container.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/remoteappmanager/docker/container.py b/remoteappmanager/docker/container.py index 4977f9d5c..cb484b072 100644 --- a/remoteappmanager/docker/container.py +++ b/remoteappmanager/docker/container.py @@ -67,7 +67,7 @@ def from_docker_containers_dict(cls, docker_dict): Returns ------- - container : docker.container.Container + container : remoteappmanager.docker.container.Container Examples --------