Skip to content
Snippets Groups Projects
Select Git revision
  • 41fb9e5b9470970188181aba0e9bebce2f9c3b0b
  • master default protected
  • L2SS-2407-swap-iers-caltable-monitoring-port
  • L2SS-2357-fix-ruff
  • sync-up-with-meta-pypcc
  • control-single-hba-and-lba
  • stabilise-landing-page
  • all-stations-lofar2
  • 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
  • remove-snmp-client
  • v0.52.3 protected
  • v0.52.3dev0 protected
  • 0.53.1dev0
  • 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
41 results

test_device_temperature_manager.py

Blame
  • Code owners
    Assign users and groups as approvers for specific file changes. Learn more.
    setup.sh 2.11 KiB
    #! /usr/bin/env bash
    # Copyright (C) 2022 ASTRON (Netherlands Institute for Radio Astronomy)
    # SPDX-License-Identifier: Apache-2.0
    
    # 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:-${ABSOLUTE_PATH}}
    
    if [ ! -f "${LOFAR20_DIR}/.git/hooks/post-checkout" ]; then
      alias git="cp ${LOFAR20_DIR}/bin/update_submodules.sh ${LOFAR20_DIR}/.git/hooks/post-checkout; cp ${LOFAR20_DIR}/bin/update_submodules.sh ${LOFAR20_DIR}/.git/hooks/post-merge; unalias git; git"
    fi
    
    # 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