Skip to content

Commit

Permalink
Merge pull request #83 from the-virtual-brain/prepare_release
Browse files Browse the repository at this point in the history
Prepare release 2.0.3
  • Loading branch information
popaula937 authored Mar 30, 2020
2 parents 47633a3 + 695d0f2 commit d01757f
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 18 deletions.
20 changes: 19 additions & 1 deletion dev_resources/docs/ReleaseProcedure
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,22 @@ When creating a new TVB set of release packages you should:




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.
33 changes: 21 additions & 12 deletions framework_tvb/README_rest_client.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
=====
Expand All @@ -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
Expand All @@ -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)
..
2 changes: 1 addition & 1 deletion framework_tvb/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
5 changes: 2 additions & 3 deletions framework_tvb/setup_rest_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion scientific_library/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down

0 comments on commit d01757f

Please sign in to comment.