Skip to content
Snippets Groups Projects
Commit cfaa2f7a authored by Jan David Mol's avatar Jan David Mol
Browse files

Merge branch 'add-ds-log-artifacts' into 'master'

L2SS-1646: Add our services logs as gitlab artifacts

See merge request !803
parents acaa29ef 7d279142
No related branches found
No related tags found
1 merge request!803L2SS-1646: Add our services logs as gitlab artifacts
...@@ -20,15 +20,20 @@ RUN --mount=type=cache,target=/var/cache/apt \ ...@@ -20,15 +20,20 @@ RUN --mount=type=cache,target=/var/cache/apt \
sudo apt-get install -y netcat sudo apt-get install -y netcat
COPY tmp/requirements.txt /tangostationcontrol-requirements.txt COPY tmp/requirements.txt /tangostationcontrol-requirements.txt
COPY tmp/*.whl /
RUN echo "TANGO_STATION_CONTROL: ${TANGO_STATION_CONTROL}" RUN echo "TANGO_STATION_CONTROL: ${TANGO_STATION_CONTROL}"
RUN if [ -z $TANGO_STATION_CONTROL ]; then \
echo "Installing requirements only"; \
sudo pip3 install -r /tangostationcontrol-requirements.txt; \
fi
# This COPY typically triggers a new build instead of pulling from cache.
# We thus perform it after installing the requirements.txt in case
# $TANGO_STATION_CONTROL is not defined.
COPY tmp/*.whl /
RUN if [ $TANGO_STATION_CONTROL ]; then \ RUN if [ $TANGO_STATION_CONTROL ]; then \
echo "Installing prebuild Station Control wheel"; \ echo "Installing prebuild Station Control wheel"; \
sudo pip3 install /*.whl; \ sudo pip3 install /*.whl; \
else \
echo "Installing requirements only"; \
sudo pip3 install -r /tangostationcontrol-requirements.txt; \
fi fi
# install and use ephimerides and geodetic ("measures") tables for casacore. # install and use ephimerides and geodetic ("measures") tables for casacore.
......
...@@ -121,6 +121,21 @@ function cleanup { ...@@ -121,6 +121,21 @@ function cleanup {
docker logs "${container}" >& "log/${container}.log" docker logs "${container}" >& "log/${container}.log"
done done
bash "${LOFAR20_DIR}"/sbin/dsconfig.sh --dump >& log/dump_ConfigDb.log bash "${LOFAR20_DIR}"/sbin/dsconfig.sh --dump >& log/dump_ConfigDb.log
mkdir -p log/allocations
# obtain the list of tasks, but only those that have actually started.
docker exec server.station.nomad.nomad-cluster.jumppad.dev nomad alloc status -json | jq --raw-output '.[] | (.ID + " " + .Name + " " + (.TaskStates | map_values(select(.StartedAt)) | keys[]) + " " + (.CreateTime/1e9 | todate))' | while read -r line
do
read -r -a parts <<< "${line}"
ALLOC_ID="${parts[0]}"
ALLOC_NAME="${parts[1]}"
TASK_NAME="${parts[2]}"
CREATE_TIME="${parts[3]}"
echo "Saving logs for job ${TASK_NAME} allocation ${ALLOC_ID}"
docker exec server.station.nomad.nomad-cluster.jumppad.dev nomad alloc logs -stderr "${ALLOC_ID}" "${TASK_NAME}" > "log/allocations/${ALLOC_NAME}-${TASK_NAME}-${CREATE_TIME}-${ALLOC_ID}.stderr.log"
docker exec server.station.nomad.nomad-cluster.jumppad.dev nomad alloc logs -stdout "${ALLOC_ID}" "${TASK_NAME}" > "log/allocations/${ALLOC_NAME}-${TASK_NAME}-${CREATE_TIME}-${ALLOC_ID}.stdout.log"
done
fi fi
if [ -z "${preserve}" ]; then if [ -z "${preserve}" ]; then
make stop > /dev/null 2>&1 make stop > /dev/null 2>&1
...@@ -155,7 +170,7 @@ function integration_test { ...@@ -155,7 +170,7 @@ function integration_test {
-v "$LOFAR20_DIR":/opt/lofar/tango:rw -v "$LOFAR20_DIR":/opt/lofar/tango:rw
-w="/opt/lofar/tango/tangostationcontrol" -w="/opt/lofar/tango/tangostationcontrol"
) )
echo "run integration ${1} ..." echo "run integration ${1} starting at $(date +'%F %T')..."
docker "${docker_args[@]}" -e "TEST_MODULE=${1}" "git.astron.nl:5000/lofar2.0/tango/ci-build-runner:$TAG" \ docker "${docker_args[@]}" -e "TEST_MODULE=${1}" "git.astron.nl:5000/lofar2.0/tango/ci-build-runner:$TAG" \
tox -e integration tox -e integration
} }
...@@ -169,7 +184,7 @@ function await { ...@@ -169,7 +184,7 @@ function await {
echo -n '.'; echo -n '.';
sleep 2; sleep 2;
current_time="$(date -u +%s)" current_time="$(date -u +%s)"
elapsed_seconds=$("$current_time"-"$start_time") elapsed_seconds=$(("$current_time" - "$start_time"))
if [ "${elapsed_seconds}" -gt "${timeout_sec}" ]; then if [ "${elapsed_seconds}" -gt "${timeout_sec}" ]; then
echo ". [timeout]"; echo ". [timeout]";
exit 1; exit 1;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment