PeerLogic Web Services

From Expertiza_Wiki
Revision as of 03:49, 10 May 2022 by Ggarrid (talk | contribs)
Jump to navigation Jump to search

Summary

The expertiza web services are a group of scripts and programs utilized by the expertiza website for performing various functions. These functions are hosted at peerlogic.csc.ncsu.edu and are externally called for the purposes of better performance, flexibility, and modularity.

This page is documenting all of these services, including where they are located, the code they utilize, and theoretical explanations of what they are performing.

The collection of the code for all of these web services can be found here.

Documentation Videos (Start Here!)

If you are just starting out accessing the PeerLogic Web Services, a series of videos have been created to explain the general premise of the web services, demonstrate some of the information expressed below, and more. This is a good way to get a general overview of how the Web Services work. To view these videos, click here.

Getting Started on Updating the Server

If for some reason, you need to modify, change, or update the code hosted at peerlogic.csc.ncsu.edu, you may follow these steps to do so.

  • Submit a request to CSC IT in order to be given access to the server. You can do this by emailing them at csc_help@ncsu.edu and cc'ing Dr. Gehringer so he may verify you have permission to do so.
  • Prepare the code you intend to add or modify in a GitHub repository. This will make it as simple as possible to transport your code to the web server.
  • Transfer that code over to the PeerLogic GitHub group (if you are not part of the group, join it!) This will ensure anyone in the future will be able to access and modify your code.
  • The server can only be accessed from within the internal NCState network. In order to gain this access, create a VCL reservation here, and SSH or remote desktop into the VCL. For the purposes of this explanation, I will assume you are doing this using Unix for your VCL.
  • Now that you are within the network, you can access the server via the SSH command, using your unityid. You will also be asked to provide your password upon connecting to the server. The command to ssh is given below:
ssh <unityid>@peerlogic.csc.ncsu.edu
  • Navigate to where the web services are located, using the following command:
cd /opt/webservices/
  • Located here are GitHub repos of all of the web services. If you intend to update an already-deployed service, simply enter the repository for that service and perform the following command to pull the changes:
git pull
  • Make sure the changes are working by running the new version locally and testing using API (see demonstration videos for more details)
  • Make sure the code still works the next day (after the server reset)

Adding a New Web Service

Template and Walkthrough

If you are just starting out and are willing to work in Python, a web service template has been created with explicit instructions, in both written and video form. It is recommended to use this as your approach unless you have something else specific in mind. To find these resources, click here: https://expertiza.csc.ncsu.edu/index.php/PeerLogic_Web_Services:_Python_Web_Service_Template.

General Instructions

  • First, clone your remote PeerLogic GitHub repository into the webservices directory under /opt/webservices. This will put the application code onto the server.
  • Next, you will need to edit one of the two startup scripts in /opt/webservices: runws_root.sh, and runws_user.sh.
  • runws_user.sh belongs to the "railsadmin" user and runs ruby 2.3.0p0. This file should be modified in order to start up any Ruby services.
  • runws_root.sh, meanwhile, is run by the root access user, and should be used for any Python scripts or anything needing root access.
  • Pick the appropriate script and add the code to start your application within (see the video demonstration for more details on this).
  • After doing all this, navigate to and edit /etc/nginx/nginx.conf (you will need sudo access to do this)
  • Within this config file, each service is assigned to a unique port on the machine. Your application must be configured to run on one of these ports, and on a port not already in use (please see the spreadsheet to see which ports are already in use).
  • To add your application to these url mappings, add this code to the config file, substituting the urls relevant to your service (this is very similar to the already existing mappings within the file):
location ^~ /[URL_PATH_TOBE_EXPOSED_EXTERNALLY] {
        	proxy_pass [YOUR_SERVICE_LOCAL_URL];
}
  • Reload nginx to update the changes to the config file and allow the new route to be properly redirected using the following:
sudo service nginx reload
  • After the next server restart, your service should be automatically started. You can test whether the new service is working immediately by running it yourself, and setting it to automatically run in the background. If you were running a python script, this may be something like the following:
sudo nohup python3 <your_application_name.py> &

NOTE: it is highly recommended to watch the demonstration video for setting up a new WebService, particularly if working in Python, which can be viewed at the page linked in the above section, as well as by clicking this link (while logged into your NCState account): https://drive.google.com/file/d/15Q5hBXU4umpJN8gStLryo5XdNiy1xZay/view?usp=sharing.

IntelligentAssignment

IntelligentAssignment is a Python application which has the stated purpose of forming project groups by performing k-means clustering on their topics of interest.

Please see the extended documentation here.

This project was last updated in March of 2018.

The code for this project can be accessed here: https://github.com/peerlogic/IntelligentAssignment.

RainbowGraphService

RainbowGraphService is a primarily JavaScript application that visualizes the results of peer review criticisms.

Please see the extended documentation here.

This project was last updated in March of 2018.

The code for this project can be accessed here: https://github.com/ferryxo/RainbowGraphService.

AutoSummaryV1

AutoSummaryV1 is a Javascript application about explaining and summarizing reviews made by students.

Please see the extended documentation here: here.

This project was last updated in February of 2016.

The code for this project can be accessed here: https://github.com/peerlogic/AutoSummaryV1.

reputation_web_service

reputation_web_service is a Javascript application with extensive documentation, detailing the web service's use for determining user reputation.

Please see the extended documentation for this project here: here.

This project was last updated in April of 2016.

The code for this project can be accessed here https://github.com/peerlogic/reputation_web_service.

Peer-reviews-NLP

Peer-reviews-NLP is a Python-based program which is used to tag student reviews. It does so by performing NLP and identifying features such as the presence of suggestions, problems, and more. Currently, 5 options are known to be functioning and useful: volume, suggestions, suggestions_confidence, problems, and problems_confidence. It is actively used by expertiza to do review tagging using ML.

Please see the extended documentation here.

This project was last updated in March of 2018.

The code for this project can be accessed here: [1].


autometareviews0.1

This project is a Ruby application for the purpose of natural language processing, including sentiment analysis, volume, tone, etc.

This project was last updated in April of 2016.

The code for this project can be accessed here https://github.com/peerlogic/autometareviews0.1.

Other Resources

The following are older resources with a bit more depth into specifics, left here for the sake of not losing any information.

Original PeerLogic web service set up: here.

NLP Web Service Setup: here.