Skip to content
Snippets Groups Projects
Select Git revision
  • e9a3fa643da0ee30c292045d453ab2112b7e177f
  • master default protected
  • L2SS-1957-remove-pcon-control
  • control-single-hba-and-lba
  • stabilise-landing-page
  • all-stations-lofar2
  • L2SS-2357-fix-ruff
  • v0.39.7-backports
  • Move-sdptr-to-v1.5.0
  • fix-build-ubuntu
  • tokens-in-env-files
  • fix-build
  • L2SS-2214-deploy-cdb
  • fix-missing-init
  • add-power-hardware-apply
  • L2SS-2129-Add-Subrack-Routine
  • Also-listen-internal-to-rpc
  • fix-build-dind
  • L2SS-2153--Improve-Error-Handling
  • L2SS-2153-Add-Grpc-Gateway-support
  • L2SS-1970-apsct-lol
  • v0.52.2-rc3 protected
  • v0.52.2-rc2 protected
  • v0.52.2-rc1 protected
  • v0.52.1.1 protected
  • v0.52.1 protected
  • v0.52.1-rc1 protected
  • v0.51.9-6 protected
  • v0.51.9-5 protected
  • v0.51.9-4 protected
  • v0.51.9-3 protected
  • v0.51.9-2 protected
  • v0.51.9-1 protected
  • v0.51.9 protected
  • v0.51.8 protected
  • v0.39.15-wsrttwo protected
  • v0.39.15-wsrt protected
  • v0.39.14-wsrt protected
  • v0.51.6 protected
  • v0.51.5-1 protected
  • v0.51.5 protected
41 results

NOTICE

Blame
  • 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