diff --git a/science-containers/Dockerfiles/casa/centos7/CentOS-Base.repo b/science-containers/Dockerfiles/casa/centos7/CentOS-Base.repo new file mode 100644 index 0000000..ff734ae --- /dev/null +++ b/science-containers/Dockerfiles/casa/centos7/CentOS-Base.repo @@ -0,0 +1,25 @@ +[base] +name=CentOS-$releasever - Base +# mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os&infra=$infra +# baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/ +baseurl=https://vault.centos.org/7.9.2009/os/$basearch/ +gpgcheck=1 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 + +# released updates +[updates] +name=CentOS-$releasever - Updates +# mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates&infra=$infra +# baseurl=http://mirror.centos.org/centos/$releasever/updates/$basearch/ +baseurl=https://vault.centos.org/7.9.2009/updates/$basearch/ +gpgcheck=1 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 + +# additional packages that may be useful +[extras] +name=CentOS-$releasever - Extras +# mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras&infra=$infra +# baseurl=http://mirror.centos.org/centos/$releasever/extras/$basearch/ +baseurl=https://vault.centos.org/7.9.2009/extras/$basearch/ +gpgcheck=1 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 diff --git a/science-containers/Dockerfiles/casa/centos7/Dockerfile b/science-containers/Dockerfiles/casa/centos7/Dockerfile index 707557f..442c4db 100644 --- a/science-containers/Dockerfiles/casa/centos7/Dockerfile +++ b/science-containers/Dockerfiles/casa/centos7/Dockerfile @@ -2,15 +2,21 @@ FROM centos:7 #This dockerfile makes a centos7 container with library dependencies needed # for casa versions -RUN yum clean all -y -RUN yum makecache -y -RUN yum update -y -RUN yum install -y freetype libSM libXi libXrender libXrandr \ +# Override old repo info with current urls +RUN rm /etc/yum.repos.d/CentOS-Base.repo +ADD CentOS-Base.repo /etc/yum.repos.d/ + +RUN yum clean all -y && \ + yum makecache -y && \ + yum update -y && \ + yum install -y freetype libSM libXi libXrender libXrandr \ libXfixes libXcursor libXinerama fontconfig \ libxslt xauth xorg-x11-server-Xvfb dbus-x11 \ - tkinter ImageMagick-c++ xterm perl autoconf python-sphinx graphviz xz - -RUN yum install -y firefox - -RUN yum install -y sssd-client acl + tkinter ImageMagick-c++ xterm perl autoconf python-sphinx graphviz xz && \ + yum install -y firefox && \ + yum install -y sssd-client acl && \ +#for admit: + yum install -y tcsh && \ +#for analysisUtils: + yum install -y wget diff --git a/science-containers/Dockerfiles/casa/ubuntu20.04/Dockerfile b/science-containers/Dockerfiles/casa/ubuntu20.04/Dockerfile index a08eeeb..9d96e9e 100644 --- a/science-containers/Dockerfiles/casa/ubuntu20.04/Dockerfile +++ b/science-containers/Dockerfiles/casa/ubuntu20.04/Dockerfile @@ -4,21 +4,20 @@ FROM ubuntu:20.04 # standard software/libraries that CASA versions need to run. This container # is stored on harbor for to assist with long term stability -RUN apt update -RUN apt upgrade -y - -RUN apt install -y libsm6 libxi6 libxrender1 libxrandr2 \ +RUN apt update && \ + apt upgrade -y && \ + apt install -y libsm6 libxi6 libxrender1 libxrandr2 \ libxfixes3 libxcursor1 libxinerama1 fontconfig \ - imagemagick xterm -RUN apt install -y perl autoconf autoconf graphviz xz-utils \ - gfortran libcanberra-gtk-module libsnl0 + imagemagick xterm && \ + apt install -y perl autoconf autoconf graphviz xz-utils \ + gfortran libcanberra-gtk-module libsnl0 && \ #NB: for 20.04, need libsnl0 not libsnl-dev -RUN apt install -y libxslt1.1 xauth xorg xvfb dbus - -RUN apt install -y libfuse2 - + apt install -y libxslt1.1 xauth xorg xvfb dbus && \ +# + apt install -y libfuse2 && \ #Add in firefox and library dependency -RUN apt install -y firefox libpci3 - -RUN apt install -y sssd acl - + apt install -y firefox libpci3 && \ + apt install -y sssd acl && \ + apt install -y wget && \ +#add in tcsh for admit installation + apt install -y tcsh diff --git a/science-containers/Dockerfiles/casa/version-6.1-6.4/init.sh b/science-containers/Dockerfiles/casa/version-6.1-6.4/init.sh deleted file mode 100755 index c7daebb..0000000 --- a/science-containers/Dockerfiles/casa/version-6.1-6.4/init.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/bash - -echo "INIT START" -echo "sourcing admit_start.sh" -source /opt/admit/admit_start.sh -echo "INIT DONE" diff --git a/science-containers/Dockerfiles/casa/version-6.1-6.4/Dockerfile b/science-containers/Dockerfiles/casa/version-6.1/Dockerfile similarity index 51% rename from science-containers/Dockerfiles/casa/version-6.1-6.4/Dockerfile rename to science-containers/Dockerfiles/casa/version-6.1/Dockerfile index 6148daa..c8827f8 100644 --- a/science-containers/Dockerfiles/casa/version-6.1-6.4/Dockerfile +++ b/science-containers/Dockerfiles/casa/version-6.1/Dockerfile @@ -1,8 +1,13 @@ FROM images.canfar.net/skaha/centos:7 +#NB: CASA 6.1.X needs glibc2.29 and does not work with ubuntu20.04 which +# has glibc2.31. +#xterm dependency is an extra to get the casa shell in the display +#perl was added for casa later than 5 -# xterm dependency is an extra to get the casa shell in the display -# perl was added for casa later than 5 +##additional packages for UVmultifit +#RUN yum install -y gcc gcc-c++ gsl-devel fftw-devel + # setup all required env variables ARG CASA_RELEASE ENV CASA_RELEASE=${CASA_RELEASE} @@ -11,39 +16,38 @@ ENV PATH /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/casa/ # unpack and move casa databundle to container ADD ${CASA_RELEASE}.tar.xz /opt/ -# ADD does not untar xz automatically -# RUN unxz /opt/${CASA_RELEASE}.tar.xz -# RUN tar -xf /opt/${CASA_RELEASE}.tar - # chown because the untarred casa has wrong owner/group +##NB: commands below revert back to the pre-CASA6.4 terminology, as the version of python is now specified everywhere in the full path. +##NB2: exception is pipeline6.5.3, which does not specify -py3.8 and thus has a different naming structure to that below. +## (the %%-py* string removes the -py3.X part of the CASA_RELEASE variable name for the directory structure) RUN chown -R root:root /opt/${CASA_RELEASE%%-py*} && ln -s /opt/${CASA_RELEASE%%-py*} /opt/casa - -# add the admit enhancement (issue #25) -RUN yum install -y tcsh +## add the admit enhancement (issue #25) RUN mkdir /opt/admit ADD admit /opt/admit RUN cd /opt/admit && \ - autoconf && ./configure --with-casa-root=/opt/${CASA_RELEASE%%-py*} + autoupdate && autoconf && \ + ./configure --with-casa-root=/opt/${CASA_RELEASE%%-py*} # Allow runtime symlink creation to the casa-data-repository # Create a dangling symlink to casa-data-repository so that after deployment # the symlink will link to the actual casa-data-repository in storage. -RUN mkdir -p /arc/projects/casa-data-repository -RUN rm -rf /opt/${CASA_RELEASE%%-py*}/data && \ - ln -s /arc/projects/casa-data-repository/ /opt/${CASA_RELEASE%%-py*}/data -RUN chmod 777 /opt/${CASA_RELEASE%%-py*} -RUN cd /opt/${CASA_RELEASE%%-py*} && \ +RUN mkdir -p /arc/projects/casa-data-repository && \ + rm -rf /opt/${CASA_RELEASE%%-py*}/data && \ + ln -s /arc/projects/casa-data-repository/ /opt/${CASA_RELEASE%%-py*}/data && \ + chmod 777 /opt/${CASA_RELEASE%%-py*} && \ + cd /opt/${CASA_RELEASE%%-py*} && \ REPLACED_DATA=`find lib -name __data__` && \ chmod 777 ${REPLACED_DATA}/.. && \ rm -rf ${REPLACED_DATA} && \ - ln -s /arc/projects/casa-data-repository/ /opt/${CASA_RELEASE%%-py*}/${REPLACED_DATA} -RUN rm -rf /arc + ln -s /arc/projects/casa-data-repository/ /opt/${CASA_RELEASE%%-py*}/${REPLACED_DATA} && \ + rm -rf /arc -#AnalysisUtils package -RUN mkdir /opt/casa/analysisUtils -RUN yum install -y wget -RUN cd /opt/casa/analysisUtils && wget ftp://ftp.cv.nrao.edu/pub/casaguides/analysis_scripts.tar && tar -xvf analysis_scripts.tar +#Add in analysisUtils package +RUN mkdir /opt/casa/analysisUtils && \ + cd /opt/casa/analysisUtils && \ + wget ftp://ftp.cv.nrao.edu/pub/casaguides/analysis_scripts.tar && \ + tar -xvf analysis_scripts.tar #(if above doesn't work, can manually download the package and add as below) #ADD ./analysis_scripts.tar /opt/casa/analysisUtils/ #NB: the analysisUtils path is added to the CASA startup file in the init.sh script @@ -57,8 +61,12 @@ ADD init.sh /skaha/ RUN dbus-uuidgen --ensure ADD nsswitch.conf /etc/ + WORKDIR /opt COPY extract-casaviewer.sh . +#below suggested by Seb to help with viewer script & variables, doesn't work +# here for some reason, and generally hasn't been effective +#ENV PYTHONPATH /opt/${CASA_RELEASE%%-py*}/lib/py/lib/python3.8/site-packages RUN bash extract-casaviewer.sh && rm extract-casaviewer.sh RUN chmod 777 -R /opt/squashfs-root /opt/squashfs-root/usr /opt/squashfs-root/usr/* diff --git a/science-containers/Dockerfiles/casa/version-6.1/Makefile b/science-containers/Dockerfiles/casa/version-6.1/Makefile new file mode 100644 index 0000000..e5136d8 --- /dev/null +++ b/science-containers/Dockerfiles/casa/version-6.1/Makefile @@ -0,0 +1,53 @@ +# NB: before using, uncomment the version to be built +# NB2: One manual edit is also required in the extract_casaviewer.sh script, +# about halfway down, to again select the command associated with setting up +# plotms for the desired version of CASA + +VERSIONS = \ + casa-6.1.0-118# \ + +VERSIONS_PIPELINE = \ +# casa-6.1.1-15-pipeline-2020.1.0.40 + +DOCKER_REPO_BASE=images.canfar.net/casa-6/casa + +.PHONY: build clean run + +all: build build-pipeline + +build: + @- $(foreach V,$(VERSIONS), \ + ./download.sh $(V) current ; \ + docker build --build-arg CASA_RELEASE=$(V) -t ${DOCKER_REPO_BASE}:$(V) .; \ + ) + +build-pipeline: + @- $(foreach V,$(VERSIONS_PIPELINE), \ + ./download.sh $(V) pipeline ; \ + docker build --build-arg CASA_RELEASE=$(V) -t ${DOCKER_REPO_BASE}:$(V) .; \ + ) + + +clean: + @- $(foreach V,$(VERSIONS), \ + docker rmi ${DOCKER_REPO_BASE}:$(V) ; \ + ) + +clean-pipeline: + @- $(foreach V,$(VERSIONS_PIPELINE), \ + docker rmi ${DOCKER_REPO_BASE}:$(V) ; \ + ) + +clean-all: clean clean-pipeline + +upload: build + @- $(foreach V,$(VERSIONS), \ + docker push ${DOCKER_REPO_BASE}:$(V) ; \ + ) + +upload-pipeline: build-pipeline + @- $(foreach V,$(VERSIONS_PIPELINE), \ + docker push ${DOCKER_REPO_BASE}:$(V) ; \ + ) + +upload-all: upload upload-pipeline diff --git a/science-containers/Dockerfiles/casa/version-6.1-6.4/admit b/science-containers/Dockerfiles/casa/version-6.1/admit similarity index 100% rename from science-containers/Dockerfiles/casa/version-6.1-6.4/admit rename to science-containers/Dockerfiles/casa/version-6.1/admit diff --git a/science-containers/Dockerfiles/casa/version-6.1-6.4/download.sh b/science-containers/Dockerfiles/casa/version-6.1/download.sh similarity index 100% rename from science-containers/Dockerfiles/casa/version-6.1-6.4/download.sh rename to science-containers/Dockerfiles/casa/version-6.1/download.sh diff --git a/science-containers/Dockerfiles/casa/version-6.1/extract-casaviewer.sh b/science-containers/Dockerfiles/casa/version-6.1/extract-casaviewer.sh new file mode 100644 index 0000000..8e7008f --- /dev/null +++ b/science-containers/Dockerfiles/casa/version-6.1/extract-casaviewer.sh @@ -0,0 +1,50 @@ +#!/bin/bash +#NB: needs to be edited for casa version in first coding line below +# AppImage fix applies now too casaviewer, casaplotms +# and new: casalogger, casaplotserver, casatablebrowser, casafeather + +casavers=casa-6.1.0-118 +#casavers=casa-6.1.1-15-pipeline-2020.1.0.40 + +pyvers=python3.6 + +pushd /opt +#below command was original way of structuring this, but not working anymore +#manually inputting casavers above to get around this +#casaviewer=$(python3 -m casaviewer --app-path 2> /dev/null | grep casaviewer) +#echo ${casaviewer} +casaviewer=/opt/${casavers}/lib/py/lib/${pyvers}/site-packages/casaviewer/__bin__/casaviewer-x86_64.AppImage +${casaviewer} --appimage-extract 2> /dev/null + +mv /opt/casa/bin/casaviewer /opt/casa/bin/casaviewer.old +ln -s /opt/squashfs-root/AppRun /opt/casa/bin/casaviewer + +#additional steps courtesy of CASA helpdesk +#NB: casa6.5 and higher use python3.8, only option +mv /opt/casa/lib/py/lib/${pyvers}/site-packages/casaviewer/__bin__/casaviewer-x86_64.AppImage /opt/casa/lib/py/lib/${pyvers}/site-packages/casaviewer/__bin__/casaviewer-x86_64.AppImage.orig +ln -s /opt/squashfs-root/usr/bin/casaviewer /opt/casa/lib/py/lib/${pyvers}/site-packages/casaviewer/__bin__/casaviewer-x86_64.AppImage + +#Apply similar process for other packages +#1) extract AppImage +/opt/${casavers}/lib/py/lib/${pyvers}/site-packages/casaplotms/__bin__/casaplotms-x86_64.AppImage --appimage-extract 2> /dev/null +/opt/${casavers}/lib/py/lib/${pyvers}/site-packages/casalogger/__bin__/casalogger-x86_64.AppImage --appimage-extract 2> /dev/null +/opt/${casavers}/lib/py/lib/${pyvers}/site-packages/casafeather/__bin__/casafeather-x86_64.AppImage --appimage-extract 2> /dev/null +/opt/${casavers}/lib/py/lib/${pyvers}/site-packages/casaplotserver/__bin__/casaplotserver-x86_64.AppImage --appimage-extract 2> /dev/null +/opt/${casavers}/lib/py/lib/${pyvers}/site-packages/casatablebrowser/__bin__/casatablebrowser-x86_64.AppImage --appimage-extract 2> /dev/null + +#2a) move old AppImage +mv /opt/casa/lib/py/lib/${pyvers}/site-packages/casaplotms/__bin__/casaplotms-x86_64.AppImage /opt/casa/lib/py/lib/${pyvers}/site-packages/casaplotms/__bin__/casaplotms-x86_64.AppImage.orig +mv /opt/casa/lib/py/lib/${pyvers}/site-packages/casalogger/__bin__/casalogger-x86_64.AppImage /opt/casa/lib/py/lib/${pyvers}/site-packages/casalogger/__bin__/casalogger-x86_64.AppImage.orig +mv /opt/casa/lib/py/lib/${pyvers}/site-packages/casafeather/__bin__/casafeather-x86_64.AppImage /opt/casa/lib/py/lib/${pyvers}/site-packages/casafeather/__bin__/casafeather-x86_64.AppImage.orig +mv /opt/casa/lib/py/lib/${pyvers}/site-packages/casaplotserver/__bin__/casaplotserver-x86_64.AppImage /opt/casa/lib/py/lib/${pyvers}/site-packages/casaplotserver/__bin__/casaplotserver-x86_64.AppImage.orig +mv /opt/casa/lib/py/lib/${pyvers}/site-packages/casatablebrowser/__bin__/casatablebrowser-x86_64.AppImage /opt/casa/lib/py/lib/${pyvers}/site-packages/casatablebrowser/__bin__/casatablebrowser-x86_64.AppImage.orig + +#2b) link to new one +ln -s /opt/squashfs-root/usr/bin/casaplotms /opt/casa/lib/py/lib/${pyvers}/site-packages/casaplotms/__bin__/casaplotms-x86_64.AppImage +ln -s /opt/squashfs-root/usr/bin/casalogger /opt/casa/lib/py/lib/${pyvers}/site-packages/casalogger/__bin__/casalogger-x86_64.AppImage +ln -s /opt/squashfs-root/usr/bin/casafeather /opt/casa/lib/py/lib/${pyvers}/site-packages/casafeather/__bin__/casafeather-x86_64.AppImage +ln -s /opt/squashfs-root/usr/bin/casaplotserver /opt/casa/lib/py/lib/${pyvers}/site-packages/casaplotserver/__bin__/casaplotserver-x86_64.AppImage +ln -s /opt/squashfs-root/usr/bin/casatablebrowser /opt/casa/lib/py/lib/${pyvers}/site-packages/casatablebrowser/__bin__/casatablebrowser-x86_64.AppImage + + +popd diff --git a/science-containers/Dockerfiles/casa/version-6.1/init.sh b/science-containers/Dockerfiles/casa/version-6.1/init.sh new file mode 100755 index 0000000..00f5ef1 --- /dev/null +++ b/science-containers/Dockerfiles/casa/version-6.1/init.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +echo "INIT START" +echo "sourcing admit_start.sh" +source /opt/admit/admit_start.sh +echo "setting up analysisUtils path" +echo 'import sys' > $HOME/.casa/startup.py +echo 'sys.path.append("/opt/casa/analysisUtils/analysis_scripts/")' >> $HOME/.casa/startup.py +echo 'import analysisUtils as au' >> $HOME/.casa/startup.py +echo 'import analysisUtils as AU' >> $HOME/.casa/startup.py +echo "INIT DONE" +echo "INIT DONE" diff --git a/science-containers/Dockerfiles/casa/version-6.1-6.4/nsswitch.conf b/science-containers/Dockerfiles/casa/version-6.1/nsswitch.conf similarity index 100% rename from science-containers/Dockerfiles/casa/version-6.1-6.4/nsswitch.conf rename to science-containers/Dockerfiles/casa/version-6.1/nsswitch.conf diff --git a/science-containers/Dockerfiles/casa/version-6.1-6.4/update-data.patch b/science-containers/Dockerfiles/casa/version-6.1/update-data.patch similarity index 100% rename from science-containers/Dockerfiles/casa/version-6.1-6.4/update-data.patch rename to science-containers/Dockerfiles/casa/version-6.1/update-data.patch diff --git a/science-containers/Dockerfiles/casa/version-6.2-6.4/Dockerfile b/science-containers/Dockerfiles/casa/version-6.2-6.4/Dockerfile new file mode 100644 index 0000000..0a2f749 --- /dev/null +++ b/science-containers/Dockerfiles/casa/version-6.2-6.4/Dockerfile @@ -0,0 +1,83 @@ +FROM images.canfar.net/skaha/ubuntu:20.04 + +# xterm dependency is an extra to get the casa shell in the display +# perl was added for casa later than 5 + +##additional packages for UVmultifit +#RUN yum install -y gcc gcc-c++ gsl-devel fftw-devel +# +# +# setup all required env variables +ARG CASA_RELEASE +ENV CASA_RELEASE=${CASA_RELEASE} +ENV PATH /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/casa/bin + +# unpack and move casa databundle to container +ADD ${CASA_RELEASE}.tar.xz /opt/ + +# chown because the untarred casa has wrong owner/group +##NB: commands below revert back to the pre-CASA6.4 terminology, as the version of python is now specified everywhere in the full path. +##NB2: exception is pipeline6.5.3, which does not specify -py3.8 and thus has a different naming structure to that below. +## (the %%-py* string removes the -py3.X part of the CASA_RELEASE variable name for the directory structure) +RUN chown -R root:root /opt/${CASA_RELEASE%%-py*} && ln -s /opt/${CASA_RELEASE%%-py*} /opt/casa + +## add the admit enhancement (issue #25) +RUN mkdir /opt/admit +ADD admit /opt/admit +RUN cd /opt/admit && \ + autoupdate && autoconf && \ + ./configure --with-casa-root=/opt/${CASA_RELEASE%%-py*} + +# Allow runtime symlink creation to the casa-data-repository +# Create a dangling symlink to casa-data-repository so that after deployment +# the symlink will link to the actual casa-data-repository in storage. +RUN mkdir -p /arc/projects/casa-data-repository && \ + rm -rf /opt/${CASA_RELEASE%%-py*}/data && \ + ln -s /arc/projects/casa-data-repository/ /opt/${CASA_RELEASE%%-py*}/data && \ + chmod 777 /opt/${CASA_RELEASE%%-py*} && \ + cd /opt/${CASA_RELEASE%%-py*} && \ + REPLACED_DATA=`find lib -name __data__` && \ + chmod 777 ${REPLACED_DATA}/.. && \ + rm -rf ${REPLACED_DATA} && \ + ln -s /arc/projects/casa-data-repository/ /opt/${CASA_RELEASE%%-py*}/${REPLACED_DATA} && \ + rm -rf /arc + +#Add in analysisUtils package +RUN mkdir /opt/casa/analysisUtils && \ + cd /opt/casa/analysisUtils && \ + wget ftp://ftp.cv.nrao.edu/pub/casaguides/analysis_scripts.tar && \ + tar -xvf analysis_scripts.tar +#(if above doesn't work, can manually download the package and add as below) +#ADD ./analysis_scripts.tar /opt/casa/analysisUtils/ +#NB: the analysisUtils path is added to the CASA startup file in the init.sh script +# (needs access to user's $HOME) + +#NB: astropy & astroquery do not seem compatible with py3.6 & ubuntu20.04 +# At least some of the casa versions in this directory (6.4) do work with +# py3.8 & ubuntu22.04, however, firefox does not currently work there, +# and is helpful for some pipeline tasks +###NEW for CASA6.*: explicitly add in astropy +###Instructions here: https://casadocs.readthedocs.io/en/latest/notebooks/frequently-asked-questions.html +#RUN /opt/casa/bin/python3 -m pip install --upgrade pip && \ +# /opt/casa/bin/pip3 install astropy && \ +##also add astroquery (astroquery.readthedocs.io/en/latest/) +# /opt/casa/bin/python3 -m pip install --pre astroquery[all] + +RUN mkdir /skaha +ADD init.sh /skaha/ + +# generate missing dbus uuid (issue #47) +RUN dbus-uuidgen --ensure + +ADD nsswitch.conf /etc/ + +WORKDIR /opt +COPY extract-casaviewer.sh . +#below suggested by Seb to help with viewer script & variables, doesn't work +# here for some reason, and generally hasn't been effective +#ENV PYTHONPATH /opt/${CASA_RELEASE%%-py*}/lib/py/lib/python3.8/site-packages +RUN bash extract-casaviewer.sh && rm extract-casaviewer.sh && \ +# + chmod 777 -R /opt/squashfs-root /opt/squashfs-root/usr /opt/squashfs-root/usr/* + +CMD [ "/skaha/init.sh" ] diff --git a/science-containers/Dockerfiles/casa/version-6.1-6.4/Makefile b/science-containers/Dockerfiles/casa/version-6.2-6.4/Makefile similarity index 96% rename from science-containers/Dockerfiles/casa/version-6.1-6.4/Makefile rename to science-containers/Dockerfiles/casa/version-6.2-6.4/Makefile index fdb81e1..49805db 100644 --- a/science-containers/Dockerfiles/casa/version-6.1-6.4/Makefile +++ b/science-containers/Dockerfiles/casa/version-6.2-6.4/Makefile @@ -4,19 +4,17 @@ # plotms for the desired version of CASA VERSIONS_OLD = \ -# casa-6.1.0-118# \ -# casa-6.2.0-124# \ + casa-6.2.0-124# \ # casa-6.3.0-48 #\ VERSIONS_PIPELINE = \ - casa-6.1.1-15-pipeline-2020.1.0.40 -# casa-6.4.1-12-pipeline-2022.2.0.64-py3.6 # casa-6.2.1-7-pipeline-2021.2.0.128 +# casa-6.4.1-12-pipeline-2022.2.0.64-py3.6 #!NB >casa6.4.3 versions have a different directory naming structure VERSIONS = \ -# casa-6.4.0-16-py3.6 # casa-6.4.3-27-py3.6 +# casa-6.4.0-16-py3.6 DOCKER_REPO_BASE=images.canfar.net/casa-6/casa diff --git a/science-containers/Dockerfiles/casa/version-6.2-6.4/admit b/science-containers/Dockerfiles/casa/version-6.2-6.4/admit new file mode 160000 index 0000000..bbf3d79 --- /dev/null +++ b/science-containers/Dockerfiles/casa/version-6.2-6.4/admit @@ -0,0 +1 @@ +Subproject commit bbf3d79bb6e1a6f7523553ed8ede0d358d106f2c diff --git a/science-containers/Dockerfiles/casa/version-6.2-6.4/download.sh b/science-containers/Dockerfiles/casa/version-6.2-6.4/download.sh new file mode 100755 index 0000000..3ed1518 --- /dev/null +++ b/science-containers/Dockerfiles/casa/version-6.2-6.4/download.sh @@ -0,0 +1,36 @@ +#!/usr/bin/env bash + +if [ $# -lt 2 ] +then + echo "usage: $0 <"old"|"current">" + exit 1 +fi + +RELEASE=$1 +FILE="${RELEASE}.tar.xz" + +if [ $2 == "old" ]; then + URL="https://casa.nrao.edu/download/distro/casa/release/rhel//${FILE}" +elif [ $2 == "pipeline" ]; then + URL="https://casa.nrao.edu/download/distro/casa-pipeline/release/linux/${FILE}" +else + URL="https://casa.nrao.edu/download/distro/casa/release/rhel/${FILE}" +fi + +# make sure we are in the source folder +HERE=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) +cd $HERE + +if [ ! -e "$FILE" ]; then + curl -O $URL +else + echo "$FILE already downloaded." +fi + +FILE="admit" +URL="https://github.com/astroumd/${FILE}" +if [ ! -e "$FILE" ]; then + git clone $URL +else + echo "$FILE already downloaded." +fi diff --git a/science-containers/Dockerfiles/casa/version-6.1-6.4/extract-casaviewer.sh b/science-containers/Dockerfiles/casa/version-6.2-6.4/extract-casaviewer.sh similarity index 95% rename from science-containers/Dockerfiles/casa/version-6.1-6.4/extract-casaviewer.sh rename to science-containers/Dockerfiles/casa/version-6.2-6.4/extract-casaviewer.sh index 65a935a..4223a79 100644 --- a/science-containers/Dockerfiles/casa/version-6.1-6.4/extract-casaviewer.sh +++ b/science-containers/Dockerfiles/casa/version-6.2-6.4/extract-casaviewer.sh @@ -3,14 +3,10 @@ # AppImage fix applies now too casaviewer, casaplotms # and new: casalogger, casaplotserver, casatablebrowser, casafeather -#casavers=casa-6.5.4-9-pipeline-2023.1.0.124 -#casavers=casa-6.5.3-28-pipeline-2023.0.0.36 -#casavers=casa-6.4.1-12-pipeline-2022.2.0.64 -#casavers=casa-6.2.1-7-pipeline-2021.2.0.128 -casavers=casa-6.1.1-15-pipeline-2020.1.0.40 +casavers=casa-6.2.0-124 #casavers=casa-6.3.0-48 -#casavers=casa-6.2.0-124 -#casavers=casa-6.1.0-118 +#casavers=casa-6.2.1-7-pipeline-2021.2.0.128 +#casavers=casa-6.4.1-12-pipeline-2022.2.0.64 #casavers=casa-6.4.0-16 #casavers=casa-6.4.3-27 diff --git a/science-containers/Dockerfiles/casa/version-6.2-6.4/init.sh b/science-containers/Dockerfiles/casa/version-6.2-6.4/init.sh new file mode 100755 index 0000000..00f5ef1 --- /dev/null +++ b/science-containers/Dockerfiles/casa/version-6.2-6.4/init.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +echo "INIT START" +echo "sourcing admit_start.sh" +source /opt/admit/admit_start.sh +echo "setting up analysisUtils path" +echo 'import sys' > $HOME/.casa/startup.py +echo 'sys.path.append("/opt/casa/analysisUtils/analysis_scripts/")' >> $HOME/.casa/startup.py +echo 'import analysisUtils as au' >> $HOME/.casa/startup.py +echo 'import analysisUtils as AU' >> $HOME/.casa/startup.py +echo "INIT DONE" +echo "INIT DONE" diff --git a/science-containers/Dockerfiles/casa/version-6.2-6.4/nsswitch.conf b/science-containers/Dockerfiles/casa/version-6.2-6.4/nsswitch.conf new file mode 100644 index 0000000..22d8d99 --- /dev/null +++ b/science-containers/Dockerfiles/casa/version-6.2-6.4/nsswitch.conf @@ -0,0 +1,62 @@ +# +# /etc/nsswitch.conf +# +# An example Name Service Switch config file. This file should be +# sorted with the most-used services at the beginning. +# +# The entry '[NOTFOUND=return]' means that the search for an +# entry should stop if the search in the previous entry turned +# up nothing. Note that if the search failed due to some other reason +# (like no NIS server responding) then the search continues with the +# next entry. +# +# Valid entries include: +# +# nisplus Use NIS+ (NIS version 3) +# nis Use NIS (NIS version 2), also called YP +# dns Use DNS (Domain Name Service) +# files Use the local files +# db Use the local database (.db) files +# compat Use NIS on compat mode +# hesiod Use Hesiod for user lookups +# [NOTFOUND=return] Stop searching if not found so far +# + +# To use db, put the "db" in front of "files" for entries you want to be +# looked up first in the databases +# +# Example: +#passwd: db files nisplus nis +#shadow: db files nisplus nis +#group: db files nisplus nis + +passwd: sss files +shadow: files sss +group: sss files + +#hosts: db files nisplus nis dns +hosts: files dns + +# Example - obey only what nisplus tells us... +#services: nisplus [NOTFOUND=return] files +#networks: nisplus [NOTFOUND=return] files +#protocols: nisplus [NOTFOUND=return] files +#rpc: nisplus [NOTFOUND=return] files +#ethers: nisplus [NOTFOUND=return] files +#netmasks: nisplus [NOTFOUND=return] files + +bootparams: nisplus [NOTFOUND=return] files + +ethers: files +netmasks: files +networks: files +protocols: files +rpc: files +services: files + +netgroup: nisplus + +publickey: nisplus + +automount: files nisplus +aliases: files nisplus diff --git a/science-containers/Dockerfiles/casa/version-6.2-6.4/update-data.patch b/science-containers/Dockerfiles/casa/version-6.2-6.4/update-data.patch new file mode 100755 index 0000000..3dc80c6 --- /dev/null +++ b/science-containers/Dockerfiles/casa/version-6.2-6.4/update-data.patch @@ -0,0 +1,27 @@ +#!/usr/bin/perl +## +## move rsync point from svn.cv.nrao.edu to casa.nrao.edu +## +use File::Find; + +if ( scalar(@ARGV) < 1 ) { die "$0 requires path to CASA installation to be patched..." } +if ( scalar(@ARGV) > 1 ) { die "$0 requires only one parameter which is the path to CASA installation to be patched..." } + +unless ( -d $ARGV[0] ) { die "$0 requires path to CASA installation (which should be a directory) to be patched..." } + +sub locate_script { + if ( -f $_ && $_ eq "update-data" ) { + print "substituting $File::Find::dir/$_\n"; + open( CONTENTS, "< $_" ); + my @contents = ; + close( CONTENTS ); + open( CONTENTS, "> $_" ); + foreach my $x ( @contents ) { + $x =~ s@(?:rsync://svn.cv.nrao.edu/casa-data|rsync://casa.nrao.edu/casa-data)@rsync://casa-rsync.nrao.edu/casa-data@g; + print CONTENTS "$x"; + } + close( CONTENTS ); + } +} + +find( { wanted => \&locate_script }, $ARGV[0] ); \ No newline at end of file