Cortex

From ISRWiki
Revision as of 16:57, 17 November 2010 by Giovanni Saponaro (talk | contribs) (move some stuff to VisLab network page)
Jump to navigation Jump to search

Cortex is a computation rack for VisLab humanoid robots. It contains 7 machines:

  • 1 server that manages startup, shutdown and the file system of the clients;
  • 6 clients (named cortex1...cortex6) that run user processes.

All clients numbered 1 to 5 mount the same file system. Therefore, performing changes in the file system of cortex[1-5] will reflect to all other four clients. The client cortex6 is separate for now, because it runs a 64 bit Linux.

Network setup

See the VisLab network page.

Additional setup

Server machine

The server has:

  • a boot folder for the clients at /tftpboot/pxelinux.cfg. It contains the files:
    • default - default boot file;
    • <mac_address> - specific for a machine with the given mac address.
  • startup scripts for each machine at /nfsroot/app

Client machines

The clients have:

  • A superuser account (compurack) to administer system-wide settings (configurations, libraries, etc.)
  • Normal user accounts. By default, the login script runs the contents of file $HOME/.bash_env, where users can set their environment variables, e.g., export ICUB_DIR=$HOME/iCub. This works for both interactive shell sessions and non-interactive ones (i.e., commands remotely invoked by yarprun).
  • A yarp account to update and install the YARP library. Variable YARP_DIR is set by default to /home/yarp/yarp2 for all users (in /etc/bash.bashrc).
  • An icub account with sudo privileges (created with sudo adduser icub admin on 2009-06-30).

System-wide libraries and repositories

YARP

As reported on the VisLab logbook, in September 2009 we installed the yarp2 SVN repository under user yarp, by downloading it and then performing cmake ., make, sudo make install.

We updated yarp on 13-July-2010.

iCub

As reported on the VisLab logbook, in September 2009 we installed the iCub SVN repository under user icub, by downloading it and then performing cmake ., make, sudo make install. There was a conflict with iKin, which could not find libipopt.so.0, but it is now fixed thanks to setting the environment variable

 LD_LIBRARY_PATH=/opt/Ipopt-3.5.5-linux-x86_32-gcc4.2.4/lib/

into /home/icub/.bash_env.

We updated iCub on 13-July-2010. One module has been disabled in the CMakeList.txt file, because it was not compiling properly: crawling.

Other libraries, manually installed

Please list here the system-wide libraries and applications that were installed by the superuser, especially the ones that do not have a clean 'make install' procedure but were manually installed into /opt:

  • ARToolKit
  • Ipopt-3.5.5-linux-x86_32-gcc4.2.4

CMake 2.6 does not come with the version of Ubuntu currently installed, but it is needed by the latest version of yarp, so we installed it via this archive.

  • cmake 2.6

Other libraries, cleanly installed

These packages were installed with apt-get install

 libncurses5-dev
 libace-dev
 libgsl0-dev
 libgtk2.0-dev libgtkmm-2.4-dev libglademm-2.4-dev
 glew-utils libglew1.5-dev
 libglut-dev

OpenCV:

  THE REPOSITORY IS NOW IN SVN FORM, WE NEED TO UPDATE THIS.
  cvs -z3 -d:pserver:anonymous@opencvlibrary.cvs.sourceforge.net:/cvsroot/opencvlibrary co -P opencv
  cd opencv
  ./configure
  make
  make install
  add /usr/local/lib to /etc/ld.so.conf

User repositories

RE-THINK THIS POLICY (plus, we installed iCub svn):

Each user should manage its own repositories, e.g. the iCub repository:

  cvs -d vislab@cvs.robotcub.org:/cvsroot/robotcub co iCub

then you should add <iCub>/bin to your PATH by editing your ~/.bashrc like this:

 PATH=$PATH:~/iCub/bin/
 ICUB_DIR=~/iCub/
 export ICUB_DIR
 ICUB_ROOT=$ICUB_DIR
 export ICUB_ROOT

You should also edit ~/.bash_env adding these lines:

 export ICUB_DIR=$HOME/iCub
 export ICUB_ROOT=$ICUB_DIR

this is needed when you connect non-interactively via ssh to a Cortex computer, for instance when execute a "yarp run ..." on a Cortex, from Chico2.

Be aware that Ubuntu 7.10 (the version currently installed on the cluster) has a conflict with iKin, specifically with iCub/conf/FindIPOPT.cmake (used by iKin): for now, in order to compile iKin, change the following line of FindIPOPT.cmake from

  SET(IPOPT_LIB   ${IPOPT_LIB} gfortranbegin gfortran)

to

  SET(IPOPT_LIB   ${IPOPT_LIB} gfortran)

Other configuration

Subversion

We have set the following parameter in /etc/subversion/config:

 store-passwords = no

This implies that SVN will ask you for your password every time you do a commit. (Don't worry about changing your personal ~/.subversion/config file: the parameter is not actually set there, so the global /etc setting is used.)

Network tuning

  sysctl -w net.core.rmem_max=8388608
  sysctl -w net.core.wmem_max=8388608
  sysctl -w net.core.rmem_default=65536
  sysctl -w net.core.wmem_default=65536
  sysctl -w net.ipv4.tcp_rmem='4096 87380 8388608'
  sysctl -w net.ipv4.tcp_wmem='4096 65536 8388608'
  sysctl -w net.ipv4.tcp_mem='8388608 8388608 8388608'
  sysctl -w net.ipv4.route.flush=1

Prompt ($PS1)

The prompt is set to "user@cortex?:pwd$" in /etc/bash.bashrc. With those settings, if you log in to Cortex1, the prompt will be "user@cortex1:~$". We chose to do so because sometimes it's convenient to have the number of the Cortex machine you're working on embedded in the prompt. By default, though, this configuration is overridden in the users' ~/.bashrc file, and the prompt is set to "user@source" regardless of the Cortex machine you log in to.
If you want to inhibit this behaviour in ~/.bashrc and thus have a prompt like "user@cortex?:pwd", just comment these lines in your ~/.bashrc:

  # set a fancy prompt (non-color, unless we know we "want" color)
  case "$TERM" in
  xterm-color)
      PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
      ;;
  *)
      PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
      ;;
  esac

However, for users created after 2009-05-07, the prompt is already set to "user@cortex?:pwd$" by default.

Helper commands

  • Check the kernel : uname -m
  • Check the file versions : file
  • Set bash shell in /etc/passwd
  • Check disk space: du –h –s /home
  • Check per user processes: ps -U <user>