Skip to content

Commit

Permalink
build for ubuntu22.04 backend and libraries needed for CASA, to impro…
Browse files Browse the repository at this point in the history
…ve re-build stability of casa containers in the future
  • Loading branch information
helenkirk committed Jun 21, 2024
1 parent fc9e5a9 commit 8a0bdfd
Show file tree
Hide file tree
Showing 5 changed files with 157 additions and 0 deletions.
29 changes: 29 additions & 0 deletions science-containers/Dockerfiles/casa/ubuntu22.04/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
FROM ubuntu:22.04

#This Dockerfile creates a local version of the Ubuntu 22.04 OS, along with
# 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 \
libxfixes3 libxcursor1 libxinerama1 fontconfig \
imagemagick xterm
RUN apt install -y perl autoconf autoconf graphviz xz-utils \
gfortran libcanberra-gtk-module libsnl-dev
RUN apt install -y libxslt1.1 xauth xorg xvfb dbus

RUN apt install -y libfuse2

RUN apt install -y gcc libgsl-dev libfftw3-dev

RUN apt install -y sssd acl

RUN apt install -y tcsh

RUN apt install -y wget



28 changes: 28 additions & 0 deletions science-containers/Dockerfiles/casa/ubuntu22.04/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@

VERSIONS = \
22.04


DOCKER_REPO_BASE=images.canfar.net/skaha/ubuntu

.PHONY: build clean run

all: build

build:
@- $(foreach V,$(VERSIONS), \
docker build -t ${DOCKER_REPO_BASE}:$(V) .; \
)

clean:
@- $(foreach V,$(VERSIONS), \
docker rmi ${DOCKER_REPO_BASE}:$(V) ; \
)


upload: build
@- $(foreach V,$(VERSIONS), \
docker push ${DOCKER_REPO_BASE}:$(V) ; \
)
clean_all: clean
upload_all: upload
11 changes: 11 additions & 0 deletions science-containers/Dockerfiles/casa/ubuntu22.04/init.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/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/init.py
echo 'sys.path.append("/opt/casa/analysisUtils/analysis_scripts/")' >> $HOME/.casa/init.py
echo 'import analysisUtils as au' >> $HOME/.casa/init.py
echo 'import analysisUtils as AU' >> $HOME/.casa/init.py
echo "INIT DONE"
62 changes: 62 additions & 0 deletions science-containers/Dockerfiles/casa/ubuntu22.04/nsswitch.conf
Original file line number Diff line number Diff line change
@@ -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
27 changes: 27 additions & 0 deletions science-containers/Dockerfiles/casa/ubuntu22.04/update-data.patch
Original file line number Diff line number Diff line change
@@ -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 = <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] );

0 comments on commit 8a0bdfd

Please sign in to comment.