Select Git revision
lofar20rc.sh
-
Jan David Mol authored
L2SS-394: Remove need for TANGO_LOFAR_CONTAINER_* as relative paths in docker compose paths are well defined (they are relative to the compose file).
Jan David Mol authoredL2SS-394: Remove need for TANGO_LOFAR_CONTAINER_* as relative paths in docker compose paths are well defined (they are relative to the compose file).
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
lofar20rc.sh 1.77 KiB
#! /usr/bin/env bash -e
# Set up the LOFAR2.0 environment.
# For the time being it is assumend that the LOFAR2.0 environment has to
# co-exist with a LOFAR1 environment.
# Set these for the host where you run SKA's Tango Docker images.
# And export those directories for LOFAR in Tango Docker images.
# Pass a directory as first parameter to this script. This will
# then be used as LOFAR20_DIR. Otherwise this file's directory
# be used to determine the tango directory location.
ABSOLUTE_PATH=$(realpath $(dirname ${BASH_SOURCE}))
export LOFAR20_DIR=${1:-$(realpath ${ABSOLUTE_PATH}/../..)}
# This needs to be modified for a development environment.
# In case you run multiple Docker networks on the same host in parallel, you need to specify a unique
# network name for each of them.
export NETWORK_MODE=tangonet
# It is assumed that the Tango host, the computer that runs the TangoDB, is this host.
# If this is not true, then modify to the Tango host's FQDN and port.
# Example: export TANGO_HOST=station-xk25.astron.nl:10000
export TANGO_HOST=$(hostname):10000
#
# NO MODIFICATION BEYOND THIS POINT!
#
# Remove all LOFAR1 related environment modifications
function remove_lofar()
{
tmp=${1//:/ }
echo "$(for new in $(for i in ${tmp}; do printf "%s\n" ${i}; done | egrep -v '/opt/lofar/|/opt/WinCC|/opt/stationtest|/opt/operations'); do printf "%s:" ${new}; done)"
}
unset LOFARROOT
export PATH=$(remove_lofar ${PATH})
export LD_LIBRARY_PATH=$(remove_lofar ${LD_LIBRARY_PATH})
export PYTHON_PATH=$(remove_lofar ${PYTHON_PATH})
# Allow read access for everybody to allow Docker the forwarding of X11.
chmod a+r ~/.Xauthority
# Source the LOFAR2.0 Python3 venv if it exists.
[ -z ${VIRTUAL_ENV} ] && [ -d ${LOFAR20_DIR}/lofar2.0_venv ] && source ${LOFAR20_DIR}/lofar2.0_venv/bin/activate