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

L2SS-1646: Add our services logs as gitlab artifacts

parent acaa29ef
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 \
sudo apt-get install -y netcat
COPY tmp/requirements.txt /tangostationcontrol-requirements.txt
COPY tmp/*.whl /
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 \
echo "Installing prebuild Station Control wheel"; \
sudo pip3 install /*.whl; \
else \
echo "Installing requirements only"; \
sudo pip3 install -r /tangostationcontrol-requirements.txt; \
fi
# install and use ephimerides and geodetic ("measures") tables for casacore.
......
......@@ -121,6 +121,21 @@ function cleanup {
docker logs "${container}" >& "log/${container}.log"
done
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
if [ -z "${preserve}" ]; then
make stop > /dev/null 2>&1
......@@ -155,7 +170,7 @@ function integration_test {
-v "$LOFAR20_DIR":/opt/lofar/tango:rw
-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" \
tox -e integration
}
......@@ -169,7 +184,7 @@ function await {
echo -n '.';
sleep 2;
current_time="$(date -u +%s)"
elapsed_seconds=$("$current_time"-"$start_time")
elapsed_seconds=$(("$current_time" - "$start_time"))
if [ "${elapsed_seconds}" -gt "${timeout_sec}" ]; then
echo ". [timeout]";
exit 1;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment