Skip to content

Gunicorn, reverse proxy, sql index, enhanced frontend, unit tests with coverage

Compare
Choose a tag to compare
@jeff1evesque jeff1evesque released this 20 Jan 06:41
· 3654 commits to master since this release

This release encompasses issues pertaining to milestone 0.5.

The flask application has integrated gunicorn processes, with nginx serving as a reverse proxy server. This new feature has significantly enhanced performance. For example, identical unit tests now run about 2x faster than the previous default flask microframework (i.e. without uwsgi). This can be seen by comparing the unit test benchmark, located on our new pytest.rst page, with the 0.4 release statement.

To tie together enhanced performance, various additional pytests have been added (or configured), along with the integration of coveralls. This particular tool is useful, since it indicates the degree, or percentage of lines of python code actually unit tested, within the entire application. A small visual representation has been added, to the main README.md, in the form of a badge, labelled as coverage.

Additionally, necessary database tables were given indexes, to help improve query performances. Also, the previous tbl_feature_value was split into two database tables, to better organize the storing of the supplied dataset(s):

  • tbl_svm_data
  • tbl_svr_data

On a similar topic of databases, necessary backend constructs were created in conjunction with the frontend react-redux, to store the userid of logged-in users, via the browsers internal sessionStorage. This allows the application the capability to validate a login attempt, and upon success, store the userid on the frontend, for a duration of a browser session. However, the login feature introduced scrypt (on the backend), a resource intensive algorithm, used to generate, and validate passwords. Because the implementation is resource expensive, we ensured our Vagrantfile allocated more than enough memory in the virtual machine.

Note: the login feature lays the foundation of many issues assigned to milestone 0.6.

With the integration of the login feature, the frontend required some adjustments, along with minor cosmetic touches. This involved the implementation of react-router, which generally enhances the user experience, by ensuring fixed urls, are associated with particular reactjs components.

Of course we attempted to enhance the general build, and security for our overall application. So, a new custom ubuntu 14.04 vagrant box was created, on the atlas repository. By creating our own vagrant base box, we were able to generate a corresponding MD5 checksum, which is validated against, on each vagrant build. If the vagrant box changes the slightest amount, the corresponding checksum would change, and the build would not succeed, since there would be a mismatch on the MD5 checksum.

Lastly, we decoupled some background information, from the main README.md into it's own dedicated project documentation/. In the future, this documentation/ will be generated into it's own dedicated website (possibly via sphinx), and serve as a primary hub, for visitors requiring particular how-to's.