Project

General

Profile

Using Redux to serve images on myamiweb » History » Revision 15

Revision 14 (Jim Pulokas, 10/05/2012 02:19 PM) → Revision 15/64 (Jim Pulokas, 10/05/2012 02:32 PM)

h1. Using Redux to serve images on myamiweb 

 h2. Installation 

 # Follow [[Web_Server_Installation]] but ignore warning on not using php 5.3 
 # Install redux prerequisites as found in its README file 
 # Install myami-redux branch of myami on the webserver machine.    Redux needs write permission at its installation location to write fftw wisdom file. 

 <pre> 
 sudo easy_install fs 
 </pre> 

 h2. Configurations: 

 # Assign redux server in myamiweb 
 <pre> 
 define('SERVER_HOST',"your_hostname") 
 </pre> 

 # Using Redux cache 
 ** At myamiweb/config.php 
 <pre> 
 define('USE_REDUX_CACHE',true) 
 </pre> 
 ** Turn it on or off in redux/pipeline.py 
 ** Input the desired disk_cache_path, disk_cache_size, and mem_cache_size in the next few lines 
 ** Create the disk_cache_path before running redux if cache will be used 
 <pre> 
 mkdir /tmp/redux 
 chmod 777 /tmp/redux 
 </pre> 

 h2. Test Installation 

 # Using Redux to do simple input output (simple client with no reduxd server needed):<pre>redux output: 
 <pre> 
 cd /your_myami_download/redux/bin 
 redux --filename=test.jpg --oformat=PNG > test.png</pre>Make sure the resulting test.png is in fact an image and not an error message. 
 # Run the server:    run the following on a command line:<pre>reduxd</pre>leave it running for the following... 
 # Test command line client connecting to the server<pre>redux --server_host=localhost --filename=test.jpg --oformat=PNG > test.png</pre>Note: The input file name is from the perspective of the reduxd server, so be sure to give it an absolute path (unlike the first test, which was not accessing the server) </pre> 

 h2. Using redux server with myamiweb 

 # start reduxd server redux server. (reduxd is in executable path if not already running from the above test:<pre>reduxd</pre> installed) 
 <pre> 
 reduxd 
 </pre> 
 # click on "[test dataset]" on your main myamiweb home page, or go directly to the URL: myamiweb/viewerxml.php 
 # test by accessing your own images from Leginon an image in myamiweb/imageviewer.php 

 h2. starting reduxd run at boot 

 <pre> 
 sudo cp -v myami/redux/init.d/reduxd /etc/init.d/ 
 sudo service reduxd start 
 </pre> 

 h2. Test server 

 <pre> 
 redux --server_host=localhost \ 
  --filename=myami/redux/gst/example.png \ 
  --oformat=JPEG --shape=32,32 > test.jpg 

 identify test.jpg 
 </pre> 

 result 
 <pre> 
 test.jpg JPEG 32x32 32x32+0+0 8-bit DirectClass 1.03kb  
 </pre>