Skip to content

Commit

Permalink
Migrate ubuntu22.04 (#76)
Browse files Browse the repository at this point in the history
* Fix GLIBC 2.10 deprecation of sys_siglist
* Bump to latest casacore and python-casacore in 22.04 test, manually compiled until kern 9 release
  • Loading branch information
bennahugo authored Feb 7, 2024
1 parent 7e852f2 commit 5651b2a
Show file tree
Hide file tree
Showing 7 changed files with 136 additions and 3 deletions.
File renamed without changes.
122 changes: 122 additions & 0 deletions .ci/ubuntu22.04.docker
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
FROM ubuntu:22.04
ENV DEBIAN_FRONTEND noninteractive
ENV DEBIAN_PRIORITY critical

RUN apt update
RUN apt install -y libblitz0-dev python3-dev libblas-dev liblapack-dev libqdbm-dev wcslib-dev \
libfftw3-dev python3-numpy libcfitsio-dev libboost-all-dev libboost-system-dev cmake g++ wget gfortran \
libncurses5-dev bison libbison-dev flex libreadline6-dev python3-pip rsync \
python3-virtualenv libgsl-dev

#####################################################################
## casa data from NRAO
#####################################################################
RUN mkdir -p /usr/share/casacore/data/
WORKDIR /usr/share/casacore/data/
RUN rsync -avz rsync://casa-rsync.nrao.edu/casa-data .

#####################################################################
## CASAcore from source
#####################################################################
RUN cd /opt && \
wget https://github.com/casacore/casacore/archive/v3.5.0.tar.gz && \
tar xvf v3.5.0.tar.gz && \
rm v3.5.0.tar.gz && \
mkdir casacore-3.5.0/build && \
cd /opt/casacore-3.5.0/build && \
cmake -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release -DBUILD_DEPRECATED=OFF -DBUILD_PYTHON=OFF -DBUILD_PYTHON3=ON ../ && \
make -j 16 && \
make install && \
rm -r /opt/casacore-3.5.0 && \
ldconfig

#####################################################################
## CASArest from source
#####################################################################
RUN cd /opt && \
wget https://github.com/casacore/casarest/archive/v1.8.1.tar.gz && \
tar xvf v1.8.1.tar.gz && \
rm v1.8.1.tar.gz && \
cd /opt/casarest-1.8.1 && \
mkdir -p build && \
cd /opt/casarest-1.8.1/build && \
cmake -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release ../ && \
make -j 16 && \
make install && \
rm -r /opt/casarest-1.8.1 && \
ldconfig

#####################################################################
## BUILD MAKEMS FROM SOURCE AND TEST
#####################################################################
WORKDIR /opt
RUN wget https://github.com/ska-sa/makems/archive/v1.5.5.tar.gz && \
tar xvf v1.5.5.tar.gz && \
rm v1.5.5.tar.gz && \
mkdir -p /opt/makems-1.5.5/LOFAR/build/gnu_opt && \
cd /opt/makems-1.5.5/LOFAR/build/gnu_opt && \
cmake -DCMAKE_MODULE_PATH:PATH=/opt/makems-1.5.5/LOFAR/CMake \
-DUSE_LOG4CPLUS=OFF -DBUILD_TESTING=OFF -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/usr ../.. && \
make -j 16 && \
make install && \
cd /opt/makems-1.5.5/test && \
makems WSRT_makems.cfg && \
rm -r /opt/makems-1.5.5

#####################################################################
## BUILD MeqTrees from source
#####################################################################
WORKDIR /opt
RUN virtualenv venv -p python3.10 --system-site-packages
RUN . /opt/venv/bin/activate && pip install setuptools wheel pip -U
# Get MeqTrees universe python packages
RUN . /opt/venv/bin/activate && python3.10 -m pip install purr \
owlcat \
kittens \
'meqtrees-cattery>=1.7.6' \
astro-tigger-lsm \
# possible ABI issues if this is not pinned to system version \
python-casacore==3.5.2 \
# possible ABI issues if this is not pinned to system version \
numpy==1.21.5 \
--no-binary 'python-casacore'


ADD . /code
RUN mkdir /code/build && \
cd /code/build && \
cmake -DCMAKE_INSTALL_PREFIX=/usr \
-DCMAKE_BUILD_TYPE=Release \
-DENABLE_PYTHON_3=ON \
.. && \
make -j8 && \
make install && \
rm -r /code/build && \
ldconfig

#####################################################################
## Run tests
#####################################################################

# basic install tests
RUN . /opt/venv/bin/activate && flag-ms.py --help
RUN . /opt/venv/bin/activate && meqtree-pipeliner.py --help
RUN . /opt/venv/bin/activate && pyxis --help
RUN . /opt/venv/bin/activate && python3 -c 'from Timba import mequtils'

# run test when built
WORKDIR /src
RUN . /opt/venv/bin/activate && python3 -m pip install pynose
RUN wget https://github.com/ska-sa/pyxis/archive/v1.7.4.3.tar.gz && \
tar -xvf v1.7.4.3.tar.gz && \
rm v1.7.4.3.tar.gz && \
. /opt/venv/bin/activate && \
python3.10 -m pip install /src/pyxis-1.7.4.3 && \
cd /src/pyxis-1.7.4.3/Pyxis/recipes/meqtrees-batch-test && \
pynose && \
rm -r /src/pyxis-1.7.4.3

WORKDIR /
ENTRYPOINT ["meqtree-pipeliner.py"]
CMD ["--help"]
3 changes: 2 additions & 1 deletion Jenkinsfile.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,5 @@ cd $PROJECTS_DIR/meqtrees-timba
IMAGENAME="mttimbapr"

# build and test
docker build -f .ci/py3.docker -t "${IMAGENAME}36:$BUILD_NUMBER" --no-cache=true .
docker build -f .ci/ubuntu20.04.docker -t "${IMAGENAME}38:$BUILD_NUMBER" --no-cache=true .
docker build -f .ci/ubuntu22.04.docker -t "${IMAGENAME}310:$BUILD_NUMBER" --no-cache=true .
6 changes: 5 additions & 1 deletion OCTOPUSSY/src/Dispatcher.cc
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,11 @@ void Dispatcher::signalHandler (int signum,siginfo_t *,void *)
#ifdef USE_THREADS
if( DebugOctopussy::getDebugContext().check(2) )
{
printf("thread %ld: received signal %d (%s)\n",(long)Thread::self().id(),signum,sys_siglist[signum]);
#if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10)
printf("thread %ld: received signal %d (%s)\n",(long)Thread::self().id(),signum,strsignal(signum));
#else
printf("thread %ld: received signal %d (%s)\n",(long)Thread::self().id(),signum,sys_siglist[signum]);
#endif
}
#endif
sigaddset(&raisedSignals,signum);
Expand Down
1 change: 1 addition & 0 deletions OCTOPUSSY/src/Dispatcher.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
#include <OCTOPUSSY/WPInterface.h>
#include <OCTOPUSSY/Message.h>
#include <OCTOPUSSY/OctopussyDebugContext.h>
#include <string.h>

#pragma aid Argv

Expand Down
6 changes: 5 additions & 1 deletion OCTOPUSSY/src/WPInterface.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1076,7 +1076,11 @@ int WPInterface::input (int fd, int flags)
//##ModelId=3C7DFD240203
int WPInterface::signal (int signum)
{
dprintf(1)("unhandled signal(%s)\n",sys_siglist[signum]);
#if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10)
dprintf(1)("unhandled signal(%s)\n",strsignal(signum));
#else
dprintf(1)("unhandled signal(%s)\n",sys_siglist[signum]);
#endif
return Message::ACCEPT;
}

Expand Down
1 change: 1 addition & 0 deletions OCTOPUSSY/src/WPInterface.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
#include <list>
#include <set>
#include <queue>
#include <string.h>

namespace Octopussy
{
Expand Down

0 comments on commit 5651b2a

Please sign in to comment.