Skip to content

Installing MXCuBE WEB versions prior to 4.x

fabcor edited this page Jan 16, 2024 · 3 revisions

Warning

This page is now deprecated.

The up-to-date documentation can be found at:

https://mxcubecore.readthedocs.io/


This page describes the steps required to install and launch MXCuBE-WEB.

Automated install

There is a script for Debian package based systems, that downloads and installs the necessary dependencies automatically.

Simply run either of:

curl -o- https://raw.githubusercontent.com/mxcube/mxcube3/master/debian-install.sh | bash
wget -q0- https://raw.githubusercontent.com/mxcube/mxcube3/master/debian-install.sh | bash

This script should work for versions of Debian 7 and later, Ubuntu Trusty Tahr and later. Its been tested on Debain 7 and Ubuntu Xenial Xerus, and should work on distributions with similar package configurations.

Manual install (from source)

Before installing packages it might be useful to have a look at configuring a virtual environment, so you do not change your system. For example here.

Installing system packages:

Note that you need to install the pip tool, [see here] (https://pypi.python.org/pypi/pip); as well as Node > v 4.2.2 [here] (https://nodejs.org/en/), and the Node Package Manager (npm) > v2.14.x [here] (https://www.npmjs.com/package/npm). Be very carefull with the version numbers, otherwise the client interface might not work at all (the versions that come with ubuntu 16.04 are ok, the ones in 14.04 need to be updated, see below). These steps have been tested in Kubuntu 16.04 and Ubuntu 14.04, clean install and everything updated.

For Debian package based systems:

     sudo apt install git
     sudo apt install npm nodejs-legacy
     sudo apt install python-pip
     sudo apt install libldap2-dev
     sudo apt install libsasl2-dev python-dev libssl-dev
     sudo apt install libxml2-dev libxslt1-dev
     sudo apt install libjpeg-dev
     sudo apt install redis-server
     sudo apt install liblapack-dev gfortran

For Redhat & CentOS:

     yum install -y epel-release
     yum install -y git
     yum install -y python-pip
     yum install -y openldap-devel python-devel openssl-devel libpng-devel cairo-devel
     yum install -y redis
     yum install -y gcc gcc-c++
     yum install -y npm nodejs-legacy
     yum install -y giflib-devel

Note for Ubuntu 14.04: The default npm version is too old (v 1.3.10), please update it to newer version. First update node:

curl -sL https://deb.nodesource.com/setup_4.x | sudo -E bash -
sudo apt-get install -y nodejs

and then, update npm:

curl https://www.npmjs.com/install.sh > install.sh
chmod +x install.sh
sudo ./install.sh

Cloning:

$ git clone [email protected]:mxcube/mxcube3.git --recursive

If you have any publickey issue use:

git clone https://github.com/mxcube/mxcube3.git --recursive

Currently we are using the 2.2 branch of HardwareObjects for mockups, and the submodule already points to 2.2.

So, at this point your local copy should contain the latest version of the repo and all the required mxcube internals. But before launching the application some python packages must be installed.

Installing python requirements:

All the requirements are in requirements.txt file, which is a list of all the packages and their respective versions. So, just type the following;

$ pip install -r requirements.txt

and it will download and install all the missing python packages. Be carefull with the permissions if you are not using a virtual environment (add sudo).

Running the mxcube3 server:

The development environment requires three servers to be running:

  • Mxcube3 server: the python server that talks to the hardware objects
  • Redis: the server storing session information
  • webpack server: the server that provides the web interface and talks to the python server, started via npm

Assuming that previous steps were successful, now it's time to launch the server. First one needs to start the redis server by:

$ redis-server&

For mxcube server, the repository already contains a mockup folder for the configuration of the hardware objects (test/HardwareObjectsMockup.xml). Just type:

$ python mxcube3-server -r test/HardwareObjectsMockup.xml --log-file mxcube3.log
* Restarting with stat
2016-06-28 17:59:17,399 |INFO   | Module load, probably application start
 * Debugger is active!
 * Debugger pin code: 538-886-758
No handlers could be found for logger "root"
* [HWR] INFO 2016-06-28 17:59:17,518 initializing camera object
* [HWR] INFO 2016-06-28 17:59:17,520 going to poll images
* [HWR] WARNING 2016-06-28 17:59:17,538 MiniDiff: Grid direction is not defined. Using default.
* [HWR] WARNING 2016-06-28 17:59:17,538 Sample Changer is not defined.
.......

At this time the mxcube3 server should be running. You can change the port in mxcube3-server:L8, the 0.0.0.0 address means that the server is listening in all IP addresses on your local machine.

Running the web client:

The default repository does not contain the compiled javascript code so one needs to launch the npm server that will talk to the server. First you need to install the requirements for the web client, you can have a look at package.json if you are curious.

$ npm install

Note: run this when the previous one finishes: npm install fabric

Note for Ubuntu 14.04: It might happen that not all the packages in packages.json are installed (missing webpack-dev-server). Run npm install --dev

Point the npm client to the mxcube server, rename backend_server.js.example to backend_server.js (so that the npm server knows where is the backend server). By default it points to localhost:8081, if your server is running somewhere else change accordingly.

And then, run webpack in development mode:

$ npm start
....
   70:2   error  A function with a name starting with an uppercase letter should only be used as a constructor  new-cap
   73:2   error  A function with a name starting with an uppercase letter should only be used as a constructor  new-cap
   89:1   error  Line 89 exceeds the maximum line length of 100                                                 max-len
  110:1   error  Line 110 exceeds the maximum line length of 100                                                max-len
  110:92  error  Unexpected string concatenation
....

The error messages are related to the linting rules, they just say that the code does not fully follow the coding convention, the server is still ok.

Finally, open a web browser a go to http://localhost:8090. Username is idtest0 ; any password will be accepted, except the word wrong that is used to simulate a failed login attempt. At this point you should see the "sample grid" view, where you can add samples&tasks to the queue, you can check sample changer contents and the grid will be populated with some dummy samples to play with. Click, select, add tasks to samples, etc. In the top of this view you can switch between sample-changer and manual mode. Then go to the "DataCollection" page (see the left bar) and you should see an image of a sample, no much to do since it is a mockup but you get the idea. You can try to a 3 click centring, which will give a point after a single click (mockup issue), right click on the point and select save, and then you can add a task to the saved point.

Clone this wiki locally