diff --git a/dev/Ubuntu_qt5/Dockerfile b/dev/Ubuntu_qt5/Dockerfile new file mode 100755 index 0000000..02f7305 --- /dev/null +++ b/dev/Ubuntu_qt5/Dockerfile @@ -0,0 +1,44 @@ +FROM ubuntu:focal + +# Set terminal and time zone, to catch installer interactoin attempts +ENV TERM linux +ENV TZ Europe/London +RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone + +# Install system packages - from Marcus O mxcub3 +RUN apt-get update && apt-get -y upgrade && \ + apt-get install -y apt-utils curl git sudo wget python +RUN apt-get install -y build-essential + +# Install 'top-level' packages +RUN apt-get install -y python3-scipy +RUN apt-get install -y python3-pyqtgraph + +# NB numpy, matplotlib, Pillow, PyQt5, and sip +# are installed at this point + +# Get and update pip +RUN apt-get install python3-pip -y +RUN pip install --upgrade pip + +# From requirement list +#RUN pip install greenlet==0.4.16 +#RUN pip install gevent==1.3.7 +RUN pip install gevent +RUN pip install suds-py3 +RUN pip install jsonpickle +RUN pip install ruamel.yaml +RUN pip install PyDispatcher +RUN pip install pylint +RUN pip install lxml +RUN pip install jsonschema + +# Global Phasing requirements +# Python-Java bridge - needed for GPhL workflow: +# Install as root, otherwise not found in xml parsing +#RUN pip install py4j==0.10.6 +RUN pip install py4j +# Needed for GPhL simcal and stratcal +RUN pip install f90nml +# Needed for GPhL stratcal rotation matrices +RUN pip install mgen diff --git a/dev/gphl/Debian9_qt4/Dockerfile b/dev/gphl/Debian9_qt4/Dockerfile index da51a1d..7a33da4 100755 --- a/dev/gphl/Debian9_qt4/Dockerfile +++ b/dev/gphl/Debian9_qt4/Dockerfile @@ -1,10 +1,23 @@ -FROM mx3_deb9_qt4 +FROM mx3_deb9b_qt4 RUN apt-get update RUN apt-get install python-pip -y RUN pip install --upgrade pip +# To get rid of error, that the ps command cannot be found +RUN apt-get install procps -y + +# Additional requirements - temporarily put here +RUN apt-get install python-jsonschema -y +RUN apt-get install python-pyqtgraph -y + +# Needed for new configuration from July 2019 +RUN pip install ruamel.yaml + +# Not used by gphl in dockers, but avoids constant error message +RUN pip install redis + # Python-Java bridge - needed for GPhL workflow: # Install as root, otehrwise not found in xml parsing RUN pip install py4j @@ -18,10 +31,10 @@ RUN pip install mgen # Add user and group so files on main machine get to belong to user instead of root # NB this must be adjusted to the test user. TODO move to separate docker -RUN groupadd -g 3001 gphl +# RUN groupadd -g 3001 gphl #RUN useradd -g gphl -m -s /bin/tcsh -u 1158 rhfogh # No longer makes home directory - this must be mounted externally at startup -RUN useradd -g gphl -s /bin/tcsh -u 1158 rhfogh +# RUN useradd -g gphl -s /bin/tcsh -u 1158 rhfogh # Directories: # @@ -29,9 +42,10 @@ RUN useradd -g gphl -s /bin/tcsh -u 1158 rhfogh # # GPhL code locations. Name is should match external directory structure, # so that the same directory names work inside and outside the docker. -RUN mkdir -p /archive -RUN mkdir -p /scratch_fs1 -RUN mkdir -p /public/xtal +# RUN mkdir -p /archive +# RUN mkdir -p /scratch_fs1 +# RUN mkdir -p /public/xtal +RUN mkdir -p /mnt/scrstch # Used instead of Entrypoint to allow alternative commands to be run diff --git a/dev/gphl/Debian9_qt4/start_mxcube2 b/dev/gphl/Debian9_qt4/start_mxcube2 index 5ddc9f7..20ea61a 100755 --- a/dev/gphl/Debian9_qt4/start_mxcube2 +++ b/dev/gphl/Debian9_qt4/start_mxcube2 @@ -1,18 +1,21 @@ #!/usr/bin/env bash -CONTAINER=mx3_deb9_qt4_gphl2 +CONTAINER=mx3_deb9_qt4_gphl5 # The following variables should be checked and (re)set as needed # MXCuBE additional lookup directories # # Examples of alternative path settings: -HO_SERVER="/MXCuBE/mxcube/ExampleFiles/HardwareObjects.xml" -# HARDWARE_REPOSITORY_SERVER="/MXCuBE/mxcube/ExampleFiles/HardwareObjects.xml:/MXCuBE/mxcube/repo_test_1" +HO_SERVER="/MXCuBE/mxcube/HardwareRepository/" +HO_CONFIGURATION=${HO_SERVER}/configuration +# HO_CONFIGURATION="/MXCuBE/mxcube/ExampleFiles/HardwareObjects.xml" # CUSTOM_HARDWARE_OBJECTS_PATH="/MXCuBE/mxcube/extra_HO_test_1:/MXCuBE/mxcube/extra_HO_test_2" # CUSTOM_BRICKS_PATH="/MXCuBE/mxcube/extra_brick_test_1:/MXCuBE/mxcube/extra_brick_test_2" -HARDWARE_REPOSITORY_SERVER="${HO_SERVER}/gphl_mock:/${HO_SERVER}:/${HO_SERVER}/embl_hh_p14" -CUSTOM_HARDWARE_OBJECTS_PATH="" +HARDWARE_REPOSITORY_SERVER="${HO_CONFIGURATION}/gphl_mock:${HO_CONFIGURATION}/xml-qt:${HO_CONFIGURATION}/embl_hh_p14" +# HARDWARE_REPOSITORY_SERVER="${HO_CONFIGURATION}/gphl_mock:${HO_CONFIGURATION}:${HO_CONFIGURATION}/alba_xaloc13" +CUSTOM_HARDWARE_OBJECTS_PATH="/MXCuBE/mxcube/HardwareRepository/HardwareObjects/mockup" + CUSTOM_BRICKS_PATH="" # User and mac address @@ -21,8 +24,9 @@ CUSTOM_BRICKS_PATH="" MAC_ADDRESS="54:ee:75:b6:8e:d3" # # User for docker - for giving correct file ownership. -# DOCKER_USER_ID="1000:100" -DOCKER_USER_ID="1158:3001" +DOCKER_USER_ID="1000:100" +# DOCKER_USER_ID="1158:3001" +# CONSIDER SOMETHING LKE --user $(id -u):$(id -g) # User name - used only for file names etc. USER_NAME="test_user" @@ -38,11 +42,11 @@ OUTPUT_HOME="/home/rhfogh/dockerhome/" # GPHL-specific directories for mounting # Note: These are the same from insisde and outside the docker # and so must be either identical or used on only one side. -GPHL_RELEASE_ROOT="/public/xtal/" -GPHL_SETUP_ROOT="/archive/rhfogh/mxcube/" +GPHL_RELEASE_ROOT="/mnt/scratch/rhfogh/GPhL/" +GPHL_SETUP_ROOT="/mnt/scratch/rhfogh/GPhL/mxcube_setup/" # Location for output data - must be the same inside and outside docker -DATA_ROOT="/scratch_fs1/" +DATA_ROOT="/mnt/scratch/rhfogh/mxcube_data" # End of settable parameters. @@ -50,6 +54,8 @@ DATA_ROOT="/scratch_fs1/" xhost +local: # Command needed to run GPhL workflows +# Add in this for debug +# -p 8050:8050 \ exec docker run -it \ --mac-address $MAC_ADDRESS \ -p 25333:25333 \ diff --git a/dev/gphl/Ubuntu_focal_qt5/Dockerfile b/dev/gphl/Ubuntu_focal_qt5/Dockerfile new file mode 100755 index 0000000..0cfce08 --- /dev/null +++ b/dev/gphl/Ubuntu_focal_qt5/Dockerfile @@ -0,0 +1,25 @@ +FROM ubuntu_focal_qt5 + +RUN apt-get update + +RUN mkdir -p /MXCuBE +WORKDIR /MXCuBE + +# Add user and group so files on main machine get to belong to user instead of root +# NB this must be adjusted to the test user. TODO move to separate docker +# RUN groupadd -g 3001 gphl +#RUN useradd -g gphl -m -s /bin/tcsh -u 1158 rhfogh +# No longer makes home directory - this must be mounted externally at startup +# RUN useradd -g gphl -s /bin/tcsh -u 1158 rhfogh + +# Directories: +# +# GPhL code locations. Name is should match external directory structure, +# so that the same directory names work inside and outside the docker. +# RUN mkdir -p /archive +# RUN mkdir -p /scratch_fs1 +# RUN mkdir -p /public/xtal +RUN mkdir -p /mnt/scratch + +# Used instead of Entrypoint to allow alternative commands to be run +CMD ["python3", "/MXCuBE/mxcube/mxcubeqt/__main__.py", "--pyqt5", "--mockupMode"] diff --git a/dev/gphl/Ubuntu_focal_qt5/start_mxcube b/dev/gphl/Ubuntu_focal_qt5/start_mxcube new file mode 100755 index 0000000..e7ca88b --- /dev/null +++ b/dev/gphl/Ubuntu_focal_qt5/start_mxcube @@ -0,0 +1,75 @@ +#!/usr/bin/env bash + +CONTAINER=mxcube_ubuntu_focal_qt5 + +# The following variables should be checked and (re)set as needed +# +MXCUBE_BASE="/MXCuBE" +MXCUBE_CORE="${MXCUBE_BASE}/mxcubecore/mxcubecore" +CUSTOM_BRICKS_PATH="" +CUSTOM_HARDWARE_OBJECTS_PATH="${MXCUBE_CORE}/HardwareObjects/mockup" + +MOCKUP_XML_PATH="${MXCUBE_CORE}/configuration/mockup" +MXCUBE_CORE_CONFIG_PATH="${MOCKUP_XML_PATH}/gphl:${MOCKUP_XML_PATH}/qt:${MOCKUP_XML_PATH}" + +# SOLEIL: +MXCUBE_CORE_CONFIG_PATH="${MXCUBE_CORE_CONFIG_PATH}:${MXCUBE_CORE}/configuration/soleil/px2/mockups" + +# User and mac address +# +# Mac address for docker - nededed for GPhL license +MAC_ADDRESS="54:ee:75:b6:8e:d3" +# +# User for docker - for giving correct file ownership. +DOCKER_USER_ID="1000:100" +# DOCKER_USER_ID="1158:3001" +# CONSIDER SOMETHING LKE --user $(id -u):$(id -g) +# User name - used only for file names etc. +USER_NAME="test_user" + +# Directories set-up +# +# MXCuBE installation is in /MXCuBE/mxcube, as per standard +# +# Home directory, used for e.g. .config and .ssh. Externally mounted. +DOCKER_HOME="/home/rhfogh/" +OUTPUT_HOME="/home/rhfogh/dockerhome/" +# GPhL software. + +# GPHL-specific directories for mounting +# Note: These are the same from insisde and outside the docker +# and so must be either identical or used on only one side. +GPHL_RELEASE_ROOT="/mnt/scratch/rhfogh/GPhL/" +GPHL_SETUP_ROOT="/mnt/scratch/rhfogh/GPhL/mxcube_setup/" + +# Location for output data - must be the same inside and outside docker +DATA_ROOT="/mnt/scratch/rhfogh/mxcube_data" + +# End of settable parameters. + + +xhost +local: +# Command needed to run GPhL workflows +# Add in this for debug +# -p 8050:8050 \ +exec docker run -it \ +--mac-address $MAC_ADDRESS \ +-p 25333:25333 \ +-p 25334:25334 \ +-h=$CONTAINER \ +-u $DOCKER_USER_ID \ +-e HOME=$DOCKER_HOME \ +-e USER=$USER_NAME \ +-e DISPLAY=$DISPLAY \ +-e QT_X11_NO_MITSHM=1 \ +-e MXCUBE_CORE_CONFIG_PATH=$MXCUBE_CORE_CONFIG_PATH \ +-e CUSTOM_HARDWARE_OBJECTS_PATH=$CUSTOM_HARDWARE_OBJECTS_PATH \ +-e CUSTOM_BRICKS_PATH=$CUSTOM_BRICKS_PATH \ +-e PYTHONPATH=$MXCUBE_BASE/mxcube:$MXCUBE_BASE/mxcubecore \ +-v $MXCUBE_ROOT:/MXCuBE \ +-v $GPHL_RELEASE_ROOT:$GPHL_RELEASE_ROOT \ +-v $GPHL_SETUP_ROOT:$GPHL_SETUP_ROOT \ +-v $DATA_ROOT:$DATA_ROOT \ +-v $OUTPUT_HOME:$DOCKER_HOME \ +-v /tmp/.X11-unix:/tmp/.X11-unix \ +$CONTAINER