From 695d0f2f6eac6cb8fcda4e6b8dc1ba2e3ad0171f Mon Sep 17 00:00:00 2001 From: popaula937 Date: Mon, 30 Mar 2020 22:28:55 +0300 Subject: [PATCH] Prepare release for version 2.0.3a1 of tvb-rest-client and 2.0.3 of tvb-library. --- dev_resources/docs/ReleaseProcedure | 20 ++++++++++++++++- framework_tvb/README_rest_client.rst | 33 ++++++++++++++++++---------- framework_tvb/setup.py | 2 +- framework_tvb/setup_rest_client.py | 5 ++--- scientific_library/setup.py | 2 +- 5 files changed, 44 insertions(+), 18 deletions(-) diff --git a/dev_resources/docs/ReleaseProcedure b/dev_resources/docs/ReleaseProcedure index 59bde4527e..d2d92f4c72 100644 --- a/dev_resources/docs/ReleaseProcedure +++ b/dev_resources/docs/ReleaseProcedure @@ -58,4 +58,22 @@ When creating a new TVB set of release packages you should: - \ No newline at end of file + TVB REST CLIENT release procedure: + Usually, we need to: + 1. Release the tvb-rest-client package on Pypi: + - it is mandatory to take the package from a Jenkins build + - make sure you keep 'forever' that build and give it a significant name (eg: Release ​tvb-rest-client ​2.0.2) + - download on your local machine the package from Jenkins + - install it in a new environment and run the examples (eg: fire_simulation.py) to ensure it works correctly + - upload it on Pypi + + 2. Update the REST server docker image: + Currently, we have 2 images: + - thevirtualbrain/tvb-run:keycloak - it is built and uploaded by Jenkins. We have to mount the proper + Keycloak configuration files inside the container. + - thevirtualbrain/tvb-run:tvb-rest - it comes with a Keycloak client configuration. For deploy, we have + to COPY the Keycloak configuration files inside the image at build + time. Thus, the build is done locally. + + If there are changes in tvb-library that affect the tvb-rest-client, we need to release that, too. + Make sure the version number is kept in sync for all of tvb-library, tvb-rest-client and tvb-framework. \ No newline at end of file diff --git a/framework_tvb/README_rest_client.rst b/framework_tvb/README_rest_client.rst index a24f9378fd..4f46967365 100644 --- a/framework_tvb/README_rest_client.rst +++ b/framework_tvb/README_rest_client.rst @@ -10,6 +10,8 @@ All the logic necessary to prepare and send requests towards the REST server, is For the **POST** requests, a client has to attach a file with some input configuration. Such a file is usually an **H5** in TVB specific format. Thus, tvb-rest-client has all the logic for preparing those H5 files and sending requests. +Also, the REST server uses a Keycloak client at log in time, so this client will open a browser that allows the user to +log in, before attempting to make the requests. Usage ===== @@ -24,27 +26,34 @@ If the TVB REST server you want to access runs at another address, change the pa .. code-block:: python from tvb.interfaces.rest.client.tvb_client import TVBClient - main_client = TVBClient("http://localhost:9090") + tvb_client = TVBClient("http://localhost:9090") .. -Start using the client API to send requests, by calling different types of methods: +Attempt to login and start using the client API to send requests, by calling different types of methods: - methods that return a list of DTOs .. code-block:: python - list_of_users = main_client.get_users() - list_of_user_projects = main_client.get_project_list(list_of_users[0].username) - list_of_datatypes_in_project = main_client.get_data_in_project(list_of_user_projects[0].gid) - list_of_operations_for_datatype = main_client.get_operations_for_datatype(list_of_datatypes_in_project[0].gid) + tvb_client.browser_login() + list_of_user_projects = tvb_client.get_project_list() + list_of_datatypes_in_project = tvb_client.get_data_in_project(list_of_user_projects[0].gid) + list_of_operations_for_datatype = tvb_client.get_operations_for_datatype(list_of_datatypes_in_project[0].gid) .. -- methdos that download data files locally, under a folder chosen by the client +- method that download data files locally, under a folder chosen by the client .. code-block:: python - main_client.retrieve_datatype(list_of_datatypes_in_project[0].gid, download_folder) + datatype_path = tvb_client.retrieve_datatype(list_of_datatypes_in_project[0].gid, download_folder) +.. + +- method that loads in memory the datatype downloaded previously + +.. code-block:: python + + datatype = tvb_client.load_datatype_from_file(datatype_path) .. - methods that launch operations in the TVB server @@ -57,17 +66,17 @@ Start using the client API to send requests, by calling different types of metho .. code-block:: python + from tvb.adapters.analyzers.fourier_adapter import FFTAdapterModel, FourierAdapter + project_gid = list_of_user_projects[0].gid - operation_module = list_of_operations_for_datatype[0].module - operation_class = list_of_operations_for_datatype[0].classname model = FFTAdapterModel() # logic to fill the model with required attributes - operation_gid = main_client.launch_operation(project_gid, operation_module, operation_class, model) + operation_gid = tvb_client.launch_operation(project_gid, FourierAdapter, model) .. - method to monitor the status of an operation .. code-block:: python - status = main_client.get_operation_status(operation_gid) + monitor_operation(tvb_client, operation_gid) .. \ No newline at end of file diff --git a/framework_tvb/setup.py b/framework_tvb/setup.py index 87eb0e9fdc..36e4bc0484 100644 --- a/framework_tvb/setup.py +++ b/framework_tvb/setup.py @@ -40,7 +40,7 @@ import shutil import setuptools -VERSION = "2.0.2a3" +VERSION = "2.0.3a1" TVB_TEAM = "Mihai Andrei, Lia Domide, Stuart Knock, Bogdan Neacsa, Paula Popa, Paula Sansz Leon, Marmaduke Woodman" diff --git a/framework_tvb/setup_rest_client.py b/framework_tvb/setup_rest_client.py index f20070d3cc..ae4652279c 100644 --- a/framework_tvb/setup_rest_client.py +++ b/framework_tvb/setup_rest_client.py @@ -40,12 +40,11 @@ manifest_maker.template = 'MANIFEST_rest_client.in' -VERSION = "2.0.2a3" +VERSION = "2.0.3a1" TVB_TEAM = "Lia Domide, Paula Popa, Bogdan Valean, Robert Vincze" -TVB_INSTALL_REQUIREMENTS = ["allensdk", "h5py", "networkx", "nibabel", "numpy", "Pillow", "psutil", - "requests", "scipy", +TVB_INSTALL_REQUIREMENTS = ["allensdk", "h5py", "networkx", "nibabel", "numpy", "Pillow", "psutil", "requests", "scipy", "simplejson", "sqlalchemy", "sqlalchemy-migrate", "tvb-data", "tvb-gdist", "tvb-library"] # Packaging tvb-rest-client diff --git a/scientific_library/setup.py b/scientific_library/setup.py index e59b461dcc..7557628997 100644 --- a/scientific_library/setup.py +++ b/scientific_library/setup.py @@ -39,7 +39,7 @@ import shutil import setuptools -LIBRARY_VERSION = "2.0.2" +LIBRARY_VERSION = "2.0.3" LIBRARY_TEAM = "Marmaduke Woodman, Stuart Knock, Paula Sanz Leon, Viktor Jirsa"