• RE: Headless installation

    Corrected, this seems to work.However, you need parts of X11 to make the python API load, namely:

        fontconfig libX libXrender libGL

     

    Here is a provisioning script for a Centos/Redhat system. Not fully tested, because I built it up bit by bit, but I hoipe it helps someone:

    # Run from Vagrantfile the first time a VM is provisioned.
    # To run again, you must do vagrant destroy

    # operating system dependencies, needed for CSD Python API
    yum install -y fontconfig libX libXrender libGL

    # import the Python dependencies
    /root/anaconda3/bin/conda env create -f /vagrant/environment.yml -n addopt

    # allow vagrant user to traverse to ananconda folder
    chmod a+x /root
    echo 'export PATH=$PATH:/root/anaconda3/bin/' >> /home/vagrant/.bashrc
    echo 'source activate addopt' >> /home/vagrant/.bashrc

    # Could check python installation
    #python -c "import sys; print sys.maxunicode > 65536 and 'UCS-4' or 'UCS-2'" | (\
    # read; if [ "$REPLY" != "UCS-4" ]
    # then echo ERROR: Python must support UTF-4 for CCDC API, is $REPLY
    #fi)

    cd /vagrant/downloads

    # Install CSDS - slow
    if [ -e csds-2016-1-linux-x64.tar ]; then
    tar -xf csds-2016-1-linux-x64.tar
    ./csds-linux-x64.run <<HERE
    11
    y

    y
    /home/vagrant/CCDC
    y
    y
    y
    1
    y
    n
    n
    HERE
    fi

    # install CDS database
    if [ -e CSDSQLite-2016-linux-x64-installer.run ]
    then ./CSDSQLite-2016-linux-x64-installer.run <<HERE2


    y
    /home/vagrant/CCDC/CSD_2016/csd
    y
    HERE2
    fi
    # set environment variables
    export CSDHOME=/home/vagrant/CCDC/CSD_2016/csd
    echo export CSDHOME=/home/vagrant/CCDC/CSD_2016/csd >> /home/vagrant/.bashrc
    export CCDC_TOOLKIT_SQLITE_DATABASE=/home/vagrant/CCDC/CSD_2016/csd/as537be_ASER.sqlite
    echo export CCDC_TOOLKIT_SQLITE_DATABASE=/home/vagrant/CCDC/CSD_2016/csd/as537be_ASER.sqlite >> /home/vagrant/.bashrc

    # See https://downloads.ccdc.cam.ac.uk/documentation/API/installation_notes.html#installation
    # install CCDC api.
    # or pip install /vagrant/csd-python-api-1.0.0-linux-64-py2.7.tar.gz
    if [-e csd-python-api-1.0.0-linux-64-py2.7-conda.tar.bz2]
    then conda install --name addopt csd-python-api-1.0.0-linux-64-py2.7-conda.tar.bz2
    fi

     

    # test CCDC installation. TODO there are better tests.
    # source activate addopt; python -c 'from ccdc import io'

  • Headless installation

    Has anyone managed to install the Python API on a headless system? If so, it would be great to hear how.

    I want to add the CSD Python API to a virtual machine that already contains the other dependencies of our project.  We like to be able to check in our provisioning scripts so all team members can easily get the same development environment.

    So far, I have downloaded and run csds-linux-x64.run and CSDSQLite-2016-linux-x64-installer.run. This was more painful than it need be, since neither is well suited to unattended installation.

    Installing the python API does not seem to work - python -c 'import ccdc' fails.

    I think that this is because I must start one of the programs in order to accept the license. However, none of the programs start, because they can't find libX11 or libGL. 

    Do I really have to install XWindows in order to install get a license? This may be friendly to click-and-point users, but it is not friendly to the sort of people who want an API.

  • RE: Tests failing due to missing files.

    Which archive is this? I installed from csd-python-api-1.0.0-linux-64-py2.7-conda.tar.bz2. This does not seem to contain any tests:

    [vagrant@localhost ~]$ tar -tf /vagrant/csd-python-api-1.0.0-linux-64-py2.7-conda.tar.bz2 | grep gz

    [vagrant@localhost ~]