Jump to: navigation, search

Difference between revisions of "Recommenders/Attic/TeamServer"

(Prerequisites)
(Removing all content from page)
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
=Outdated=
 
As of 0.5.2 a maven-like model repository is used. As of this change, the team server is not functional anymore. There will be a "Recommenders Developer Kit" that allows you to build and manage a local repository some time after Juno.
 
  
= Prerequisites  =
 
 
*Decent Linux/Win/Mac box with 2GHz, 2G RAM and Java 6 or better.
 
*Apache CouchDB 2.0 or higher (not officially released)
 
*Code Recommenders Team Server 0.4 or higher
 
 
= Installation  =
 
 
== Apache CouchDB  ==
 
 
*Download CouchDB developer preview from [http://files.couchbase.com/developer-previews/couchbase-single-server-2.0.0-dev-preview/ couchbase.com].
 
*Install CouchDB.
 
*Start CouchDB.
 
*Ensure that CouchDB's [http://localhost:5984/_utils welcome page] comes up.
 
*Change [http://localhost:5984/_utils/config.html os_process_timeout config parameter] from '5000' to '10000' or higher. The exact value depends on the power of your machine and the data you process.
 
 
== Code Recommenders Team Server  ==
 
 
*Download Code Recommenders latest team server (org.eclipse.recommenders.server-linux.gtk.x86_64.zip) from [http://vandyk.st.informatik.tu-darmstadt.de/updates/server/ here]. Note, the server platform is build-independent although the name suggests something different.
 
*Unzip ''org.eclipse.recommenders.server-linux.gtk.x86_64.zip'' to any directory on your local disc. This directory is referred to as $SERVER_HOME from here on.
 
*Start the server by executing $SERVER_HOME/start.sh (you may set the x-flag to execute the script). The server now starts with a OSGI console.
 
*In the console enter "initCouchdb". This creates and initializes all databases on the local Apache CouchDB instance.
 
 
You are done. The base system is up and running for/on localhost. To gracefully stop the server you should enter "close" in the OSGi console.
 
 
If you want to run the server as a background daemon, starting and stopping is a bit trickier. To start the server enter:
 
 
nohup ./start.sh &
 
 
To stop it enter:
 
 
kill <pid of system process>
 
 
To find the correct pid you can look at all processes or use some shell magic to filter the list
 
 
ps a | grep java | grep eclipse.osgi | cut -d\  -f1
 
 
= Server Configuration  =
 
 
== Extdoc Platform  ==
 
 
Database needs to be filled. Next, the generators have to be executed on the server's osgi console.
 
 
== Calls Code Completion  ==
 
 
Database needs to be filled. Next, the generators have to be executed on the server's osgi console.
 
 
== Code Search  ==
 
 
In $SERVER_HOME/configuration/config.ini, the code search server url has to be modified to point to your actual service that offers the source code files.
 
<pre>org.eclipse.recommenders.server.codesearch.baseUrl=http\://recommenders1.st.informatik.tu-darmstadt.de\:29750/codesearch
 
</pre>
 
Next, a search index has to be created, summaries need to be published in CouchDB, and a source zip file has to be pushed on the server. '''This is yet not automated.'''
 
 
'''NOTE:''' baseurl MUST be fully qualified including the port number. Apache HTTPD proxy rewrites all incoming URLs and unescapes all slashes used for type names and thus results in 404 when using code search. (codesearch/source%2FLorg%2FMyclass --&gt; codesearch/source/Lorg/Myclass --&gt; 404 since this url identifies a non-existant reosurce).
 
 
TODO: this should be simplified. Every installation needs to change the baseurl. Is there a simple way to figure out under which IP/name the JAX-RS webservice was queried?
 
 
TODO: create an upload interface for code search to ease creating a code search database.
 
 
= Client Configuration  =
 
 
Update your clients to use the new server instead of Code Recommenders' default server by changing the following urls in ''Preferences&gt;&gt;Code Recommenders'':
 
 
*Code Search: http://your-team-server:29750/codesearch
 
*Extdoc: http://your-team-server-name:29750/extdoc
 
*UDC: http://your-team-server:29750/udc
 
 
See [[Recommenders/TeamServer#User_Friendly_URLs]] to see how to get rid of the port numbers.
 
 
= Building Models  =
 
 
All data is stored in CouchDB or on local disk in $SERVER_HOME/recommenders/ (actually we use the working directory, i.e. $WORKING_DIR/recommenders, which should be the same in most cases).
 
 
To generate new models, enter the OSGI console of your server and enter "generateModels". That's it. After generation passed, your clients will automatically download the latest models.
 
 
TODO: Point to a crowd-sourcing page and explain that data needs to be uploaded by the clients into the team server.
 
 
TODO: explain how to set up a cron-job to generate new extdoc and calls models on a nightly basis.
 
 
= Optional Configuration  =
 
 
== User Friendly URLs  ==
 
 
Code Recommenders server is per default started on port 29750. You may override this by editing $SERVER_HOME/configuration/configuration.ini or by using an existing Apache HTTPD server as proxy. How to use an existing Apache HTTPD as proxy is shown below:
 
 
In ''/etc/apache2/mods-enabled/proxy.conf'' add:
 
 
&lt;IfModule mod_proxy.c&gt;
 
      [...]
 
 
      ProxyPass /udc http://localhost:29750/udc
 
      ProxyPassReverse /udc http://localhost:29750/udc
 
 
      ProxyPass /extdoc http://localhost:29750/extdoc
 
      ProxyPassReverse /extdoc http://localhost:29750/extdoc
 
 
      # it is important to use the keyword "nocanon" otherwise&nbsp;%2F from the URL
 
      # are unescaped and incorrectly interpreted as a path by the webservice
 
      ProxyPass /codesearch http://localhost:29750/codesearch nocanon
 
      ProxyPassReverse /codesearch http://localhost:29750/codesearch
 
&lt;/IfModule&gt;
 
 
Additionally it is important, that ''AllowEncodedSlashes'' is enabled in your virtual host:
 
 
&lt;VirtualHost *:80&gt;
 
      ServerAdmin webmaster@localhost
 
      DocumentRoot /var/www
 
 
      # to allow&nbsp;%2F in urls
 
      AllowEncodedSlashes On
 
      ...
 
&lt;/VirtualHost&gt;
 
 
The location of this virtual host directive depends on your apache configuration. On a fresh ubuntu install it is typically found in ''/etc/apache2/sites-enabled/000-default''.
 
 
Next, enable the required modules and restart the server:
 
 
root@host:# a2enmod proxy
 
root@host:# a2enmod proxy_http
 
root@host:# service apache2 restart
 
 
<br>
 
 
== Useful unix commands  ==
 
 
{| width="100%" cellspacing="1" cellpadding="1" border="1"
 
|-
 
| find ./ -regex .*ous.zip -exec printf '.' \; &#124; wc -c<br>
 
| Count the number of generated files matching the regular expression .*ous.zip<br>
 
|-
 
| free -mt<br>
 
| Show the memory consumption <br>
 
|}
 
 
[[Category:Recommenders]]
 

Latest revision as of 01:30, 26 September 2013