Skip to content
Snippets Groups Projects
Commit 9551fad7 authored by Stefano Di Frischia's avatar Stefano Di Frischia
Browse files

Merge branch 'master' into L2SS-375-archiving-load

parents 7802fcd2 2c9a1457
No related branches found
No related tags found
1 merge request!153Resolve L2SS-375 "Archiving load"
......@@ -33,7 +33,6 @@ bandit:
- tox -e bandit
shellcheck:
stage: static-analysis
allow_failure: true
before_script:
- sudo apt-get update
- sudo apt-get install -y shellcheck
......
#!/bin/bash
function help()
{
why="${1}"
echo -e "*** Cannot start the Python device server.\n${why}\n\n* The Python file for the device server must be the 1st parameter that is provided.\n* The instance of this device server must be the 2nd parameter that is provided."
echo -e "*** Cannot start the Python device server.\\n${why}\\n\\n* The Python file for the device server must be the 1st parameter that is provided.\\n* The instance of this device server must be the 2nd parameter that is provided."
exit -1
}
......@@ -29,14 +30,14 @@ esac
# ATTENTION
# This is assuming that the device server's Python file exists
# on the Docker's host in the user's ${HOME} directory.
runThis=$(basename ${deviceServer})
runThis=$(basename "${deviceServer}")
runThis=${runThis//.sh/.py}
if [ -f ${runThis} ]; then
if [ -f "${runThis}" ]; then
myDir=${PWD}
else
myDir=${PWD}/$(dirname ${deviceServer})
myDir=${PWD}/$(dirname "${deviceServer}")
fi
deviceServerPath=${myDir/${HOME}/\/hosthome}
# Tango log lines start with a UNIX timestamp. Replace them with the UTC time.
docker exec -it itango python3 ${deviceServerPath}/${runThis} ${instance} ${@} | perl -ne 'use Time::Piece; s/^([0-9]+)/gmtime($1)->strftime("%F %T")/e; print;'
docker exec -it itango python3 "${deviceServerPath}/${runThis}" "${instance}" "${@}" | perl -ne 'use Time::Piece; s/^([0-9]+)/gmtime($1)->strftime("%F %T")/e; print;'
#!/bin/bash
OS=$(uname)
case ${OS} in
Linux)
display=""
XTRA_OPTIONS="-u $(id -u ${USER}):$(id -g ${USER}) -v /etc/passwd:/etc/passwd:ro -v /etc/groups:/etc/groups:ro"
XTRA_OPTIONS="-u $(id -u "${USER}"):$(id -g "${USER}") -v /etc/passwd:/etc/passwd:ro -v /etc/groups:/etc/groups:ro"
;;
Darwin)
......@@ -28,10 +29,10 @@ else
fi
#docker run --rm -it --network host ${OPTIONS} nexus.engageska-portugal.pt/ska-docker/tango-java:latest ${command} ${@}
container_name=artefact.skatelescope.org/ska-tango-images/tango-java:9.3.3.2
container=$(docker ps | egrep ${container_name} | cut -d' ' -f1)
if [ ! -z ${container} ]; then
docker exec -it ${container} ${command} ${@}
container_name=artefact.skao.int/ska-tango-images-tango-java:9.3.4
container=$(docker ps | grep -E ${container_name} | cut -d' ' -f1)
if [ ! -z "${container}" ]; then
docker exec -it "${container}" ${command} "${@}"
else
echo "Container \"${container_name}\" is not running."
fi
......
#!/bin/bash -e
if [ -z "$LOFA20_DIR"]; then
if [ -z "$LOFAR20_DIR" ]; then
# We assume we aren't in the PATH, so we can derive our path.
# We need our parent directory.
LOFAR20_DIR_RELATIVE=`dirname "$0"`/..
LOFAR20_DIR_RELATIVE=$(dirname "$0")/..
# As an absolute path
LOFAR20_DIR=`readlink -f "${LOFAR20_DIR_RELATIVE}"`
LOFAR20_DIR=$(readlink -f "${LOFAR20_DIR_RELATIVE}")
fi
# Start and stop sequence
......@@ -18,7 +18,7 @@ make start databaseds dsconfig jupyter elk
sleep 15
# Update the dsconfig
${LOFAR20_DIR}/sbin/update_ConfigDb.sh ${LOFAR20_DIR}/CDB/integration_ConfigDb.json
"${LOFAR20_DIR}"/sbin/update_ConfigDb.sh "${LOFAR20_DIR}"/CDB/integration_ConfigDb.json
cd "$LOFAR20_DIR/docker-compose" || exit 1
make start sdptr-sim recv-sim unb2-sim
......
#! /usr/bin/env bash -e
#!/bin/bash -e
# Tag and push which image version?
DOCKER_TAG=latest
......@@ -10,16 +10,16 @@ SKA_REPO="nexus.engageska-portugal.pt/ska-docker"
LOFAR_REPO="git.astron.nl:5000/lofar2.0/tango"
# Compile a list of the SKA images
SKA_IMAGES=$(for i in $(docker images | egrep ${DOCKER_TAG} | egrep ${SKA_REPO} | cut -d' ' -f1); do printf "%s " ${i}; done)
SKA_IMAGES=$(for i in $(docker images | grep -E ${DOCKER_TAG} | grep -E ${SKA_REPO} | cut -d' ' -f1); do printf "%s " "${i}"; done)
# Compile a list of LOFAR2.0 images
LOFAR_IMAGES=$(for i in $(docker images | egrep ${DOCKER_TAG} | egrep -v "${SKA_REPO}|${LOFAR_REPO}" | cut -d' ' -f1); do printf "%s " ${i}; done)
LOFAR_IMAGES=$(for i in $(docker images | grep -E ${DOCKER_TAG} | grep -E -v "${SKA_REPO}|${LOFAR_REPO}" | cut -d' ' -f1); do printf "%s " "${i}"; done)
function tag_and_push()
{
(
docker tag ${1} ${2}
docker push ${2}
docker tag "${1}" "${2}"
docker push "${2}"
) &
}
......@@ -27,14 +27,14 @@ function tag_and_push()
# and push them to the LOFAR2.0 repo
for IMAGE in ${SKA_IMAGES}; do
PUSH_IMAGE=${IMAGE//${SKA_REPO}/${LOFAR_REPO}}:${VERSION}
tag_and_push ${IMAGE} ${PUSH_IMAGE}
tag_and_push "${IMAGE}" "${PUSH_IMAGE}"
done
# Rename the LOFAR2.0 images for the LOFAR2.0 repo
# and push them to the LOFAR2.0 repo
for IMAGE in ${LOFAR_IMAGES}; do
PUSH_IMAGES=${LOFAR_REPO}/${IMAGE}:${VERSIN}
tag_and_push ${IMAGE} ${PUSH_IMAGE}
PUSH_IMAGE=${LOFAR_REPO}/${IMAGE}:${VERSION}
tag_and_push "${IMAGE}" "${PUSH_IMAGE}"
done
wait
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment