Commit f1b4cccf authored by easybuild's avatar easybuild
Browse files

fix

parents 1435da3d 7ac1100e
*.img
*.swp
CentOS-7.5/
*.simg
CentOS-7.5
CentOS/7.5-intel
CentOS/7.5-VARROC
CentOS/7.5-DHI
CentOS/7.5-ESPRESO/CentOS-7.5-ESPRESO.simg.backup
OpenFOAM/
Ubuntu/16.04-OpenFOAM/
Bootstrap: docker
From: centos:6.9
IncludeCmd: yes
%setup
cp /apps/easybuild/sources/n/NVIDIA/NVIDIA-Linux-x86_64-390.30.run /tmp
%post
yum -y update && yum -y upgrade
yum -y install python gcc make wget vim mc procps tcl gcc-c++ gcc-gfortran pkg-config acl acpid alsa-lib alsa-lib-devel amtu apr aspell at atk atk-devel attr audit audit-libs audit-libs-python authconfig autoconf autofs automake avahi-glib avahi-libs basesystem bash bc bind-libs bind-utils binutils binutils-devel bison bison-devel bluez-libs bridge-utils busybox bzip2 bzip2-devel bzip2-libs ca-certificates cairo cairo-devel c-ares ccid cdparanoia-libs centos-indexhtml centos-release checkpolicy chkconfig cloog-ppl compat-libcap1 compat-libstdc++-33 compat-readline5 ConsoleKit ConsoleKit-libs coolkey coreutils coreutils-libs cpio cpp cppunit cpupowerutils cpuspeed cracklib cracklib-dicts crash crda cronie cronie-anacron crontabs cryptsetup-luks cryptsetup-luks-libs cups cups-libs curl cvs cyrus-sasl cyrus-sasl-devel cyrus-sasl-gssapi cyrus-sasl-lib cyrus-sasl-plain dash db4 db4-cxx db4-devel db4-utils dbus dbus-devel dbus-glib dbus-glib-devel dbus-libs dbus-python dejavu-fonts-common dejavu-lgc-sans-mono-fonts dejavu-sans-mono-fonts desktop-file-utils device-mapper device-mapper-event device-mapper-event-libs device-mapper-libs device-mapper-multipath device-mapper-multipath-libs device-mapper-persistent-data diffutils dmidecode dmraid dmraid-events dmz-cursor-themes docbook-dtds docbook-style-dsssl docbook-style-xsl docbook-utils dos2unix dosfstools dracut dracut-kernel dracut-network dump e2fsprogs e2fsprogs-devel e2fsprogs-libs ed eggdbus eject elfutils-libelf elfutils-libelf-devel elfutils-libs emacs emacs-common environment-modules ethtool expat expat-devel expect file file-devel file-libs filesystem findutils finger fipscheck fipscheck-lib flac fontconfig fontconfig-devel fontpackages-filesystem foomatic foomatic-db foomatic-db-filesystem foomatic-db-ppds freeglut freeglut-devel freetype freetype-devel ftp fuse fuse-libs gamin gamin-python gawk gcc gcc-c++ gcc-gfortran GConf2 GConf2-devel gd gdb gdbm gdbm-devel gdk-pixbuf2 gdk-pixbuf2-devel genisoimage gettext gettext-devel gettext-libs ghostscript ghostscript-fonts giflib git glib2 glib2-devel glibc glibc-common glibc-debuginfo glibc-debuginfo-common glibc-devel glibc-headers glx-utils gmp gmp-devel gnome-icon-theme gnome-keyring gnome-keyring-devel gnome-themes gnome-vfs2 gnome-vfs2-devel gnupg2 gnuplot gnuplot-common gnutls gnutls-devel gperf gpgme gpm gpm-libs grep groff grub grubby gstreamer gstreamer-plugins-base gstreamer-tools gtk2 gtk2-devel gtk2-engines gtk-doc gzip hal hal-devel hal-info hal-libs hdparm hesiod hicolor-icon-theme hunspell hwdata hwloc hwloc-devel ilmbase ImageMagick indent info initscripts iproute iptables iptables-ipv6 iptstate iputils irqbalance iscsi-initiator-utils iso-codes iw jasper-libs jwhois kbd kbd-misc kernel kernel kernel-devel kernel-firmware kernel-headers keyutils keyutils-libs keyutils-libs-devel kpartx krb5-devel krb5-libs krb5-workstation ksh lcms-libs less lftp libacl libacl-devel libaio libart_lgpl libart_lgpl-devel libasyncns libattr libattr-devel libbasicobjects libblkid libbonobo libbonobo-devel libbonoboui libbonoboui-devel libcanberra libcanberra-gtk2 libcap libcap-devel libcap-ng libcgroup libcollection libcom_err libcom_err-devel libcroco libcroco-devel libcxgb3 libcxgb4 libdaemon libdhash libdrm libdrm-devel libedit libedit-devel libevent libexif libffi libfontenc libgcc libgcj libgcrypt libgcrypt-devel libgfortran libglade2 libglade2-devel libgnome libgnomecanvas libgnomecanvas-devel libgnome-devel libgomp libgpg-error libgpg-error-devel libgsf libgsf-devel libgssglue libgudev1 libhugetlbfs libibcm libibcm-devel libibverbs libibverbs-devel libibverbs-devel-static libibverbs-utils libICE libICE-devel libicu libIDL libIDL-devel libidn libidn-devel libini_config libipa_hbac libjpeg-turbo libjpeg-turbo-devel libldb libmcpp libmlx4 libmlx5 libmng libmng-devel libmthca libmthca-static libnetfilter_conntrack libnfnetlink libnih libnl libnl-devel libnotify libogg liboil libotf libpath_utils libpcap libpciaccess libpciaccess-devel libpng libpng-devel libproxy libproxy-bin libproxy-python libref_array librsvg2 librsvg2-devel libselinux libselinux-devel libselinux-python libselinux-utils libsemanage libsepol libsepol-devel libSM libSM-devel libsndfile libss libssh2 libsss_idmap libstdc++ libstdc++-devel libsysfs libsysfs-devel libtalloc libtasn1 libtasn1-devel libtdb libtevent libthai libtheora libtiff libtiff-devel libtirpc libtool-ltdl libudev libudev-devel libunistring libusb libusb1 libusb-devel libuser libutempter libuuid libvisual libvorbis libwmf libwmf-lite libwnck libX11 libX11-common libX11-devel libXau libXau-devel libXaw libXaw-devel libxcb libxcb-devel libXcomposite libXcomposite-devel libXcursor libXcursor-devel libXdamage libXdamage-devel libXdmcp libXdmcp-devel libXext libXext-devel libXfixes libXfixes-devel libXfont libXft libXft-devel libXi libXi-devel libXinerama libXinerama-devel libxkbfile libxml2 libxml2-devel libxml2-python libXmu libXmu-devel libXp libXpm libXpm-devel libXrandr libXrandr-devel libXrender libXrender-devel libXres libXScrnSaver libXScrnSaver-devel libxslt libxslt-devel libXt libXt-devel libXtst libXtst-devel libXv libXv-devel libXxf86misc libXxf86misc-devel libXxf86vm libXxf86vm-devel lm_sensors-libs lockdev logrotate lsof lvm2 lvm2-libs lynx lzo m17n-db m17n-db-datafiles m17n-lib m2crypto m4 mailcap mailx make MAKEDEV man man-pages mc mcpp mcstrans mdadm mesa-dri1-drivers mesa-dri-drivers mesa-dri-filesystem mesa-libGL mesa-libGL-devel mesa-libGLU mesa-libGLU-devel mesa-private-llvm mgetty microcode_ctl mingetty mkbootdisk mlocate module-init-tools mpfr mtools mtr mysql-libs nano nc ncurses ncurses-base ncurses-devel ncurses-libs net-snmp net-snmp-libs net-tools newt newt-python nfs-utils nfs-utils-lib nmap notification-daemon nscd nspr nspr-devel nss nss_db nss-devel nss-softokn nss-softokn-debuginfo nss-softokn-devel nss-softokn-freebl nss-softokn-freebl-devel nss-sysinit nss-tools nss-util nss-util-devel ntp ntpdate ntsysv OpenEXR-libs OpenIPMI OpenIPMI-libs openjade openjpeg-libs openldap openldap-devel openmotif openmotif22 opensp openssh openssh-clients openssh-server ORBit2 ORBit2-devel p11-kit p11-kit-trust pam pam-devel pam_krb5 pam_passwdqc pam_pkcs11 pango pango-devel paps paps-libs parted passwd patch pax pciutils pciutils-devel pciutils-libs pcmciautils pcp pcp-conf pcp-libs pcre pcsc-lite pcsc-lite-libs perf perl perl-AppConfig perl-Authen-SASL perl-Bit-Vector perl-Carp-Clan perl-CGI perl-Class-Singleton perl-Compress-Raw-Zlib perl-Compress-Zlib perl-Convert-ASN1 perl-Crypt-PasswdMD5 perl-Date-Calc perl-Date-Manip perl-DateTime perl-DBD-Pg perl-DBI perl-devel perl-Digest-HMAC perl-Digest-SHA1 perl-Error perl-ExtUtils-MakeMaker perl-ExtUtils-ParseXS perl-File-Which perl-Git perl-GSSAPI perl-HTML-Parser perl-HTML-Tagset perl-IO-Compress-Base perl-IO-Compress-Zlib perl-IO-Socket-SSL perl-JSON perl-LDAP perl-libs perl-libwww-perl perl-List-MoreUtils perl-Module-Pluggable perl-Net-LibIDN perl-Net-SSLeay perl-Net-Telnet perl-Params-Validate perl-PCP-PMDA perl-Pod-Escapes perl-Pod-Simple perl-SGMLSpm perl-Socket6 perl-String-CRC32 perl-TermReadKey perl-Test-Harness perl-Test-Simple perl-Text-Iconv perl-Time-HiRes perl-URI perl-version perl-WWW-Curl perl-XML-Filter-BufferText perl-XML-LibXML perl-XML-NamespaceSupport perl-XML-Parser perl-XML-SAX perl-XML-SAX-Writer perl-XML-Simple perl-YAML-Syck pinentry pinfo pixman pixman-devel pkgconfig plymouth plymouth-core-libs plymouth-scripts pm-utils policycoreutils polkit poppler poppler-data poppler-utils popt popt-devel portreserve postfix postgresql postgresql-devel postgresql-libs postgresql-odbc ppl ppp prelink procmail procps psacct psmisc pth pulseaudio-libs pycairo pycairo-devel pygobject2 pygobject2-codegen pygobject2-devel pygobject2-doc pygpgme pygtk2 pygtk2-codegen pygtk2-devel pygtk2-doc pyOpenSSL pytalloc python python-argparse python-devel python-iniparse python-libs python-pcp python-pycurl python-setuptools python-sssdconfig python-urlgrabber qt qt3 qt-sqlite qt-x11 quota rarian rarian-compat rdate rdma readahead readline readline-devel redhat-logos redhat-lsb redhat-lsb-compat redhat-lsb-core redhat-lsb-graphics redhat-lsb-printing redhat-menus redhat-rpm-config rmt rootfiles rpcbind rpm rpm-devel rpm-libs rpm-python rp-pppoe rrdtool rsh rsync ruby ruby-libs samba samba4-libs samba-common samba-winbind samba-winbind-clients screen SDL SDL-devel sed selinux-policy setserial setup setuptool sgml-common sgpio shadow-utils shared-mime-info slang smartmontools snappy sos sound-theme-freedesktop sqlite sqlite-devel sssd sssd-ad sssd-client sssd-common sssd-common-pac sssd-ipa sssd-krb5 sssd-krb5-common sssd-ldap sssd-proxy startup-notification startup-notification-devel strace stunnel sudo swig symlinks sysfsutils syslinux syslinux-nonlinux sysstat system-gnome-theme system-icon-theme systemtap-devel sysvinit-tools t1lib talk tar tcl tcl-devel tcpdump tcp_wrappers tcp_wrappers-libs tcsh telnet time tk tmpwatch traceroute tree tunctl tzdata udev udftools unix2dos unixODBC unixODBC-devel unzip upstart urw-fonts usbutils usermode ustr util-linux-ng vconfig vim-common vim-enhanced vim-filesystem vim-minimal virt-what wget which wireless-tools words wpa_supplicant xcb-util xdg-utils xerces-c xerces-c-devel xinetd xkeyboard-config xml-common xmlrpc-c xmlrpc-c-client xorg-x11-fonts-100dpi xorg-x11-fonts-75dpi xorg-x11-font-utils xorg-x11-proto-devel xorg-x11-server-common xorg-x11-server-utils xorg-x11-xauth xorg-x11-xkb-utils xterm xz xz-libs xz-lzma-compat ypbind yp-tools yum yum-metadata-parser yum-plugin-auto-update-debug-info yum-plugin-fastestmirror yum-plugin-priorities yum-plugin-security yum-plugin-versionlock yum-utils zip zlib zlib-devel
yum -y groupinstall "Development Tools"
cd /tmp
# OpenMPI
wget https://www.open-mpi.org/software/ompi/v2.1/downloads/openmpi-2.1.1.tar.gz
tar xvf openmpi-2.1.1.tar.gz && cd openmpi-2.1.1
./configure --prefix=/usr/local
make -j 16
make install
# pip
curl -s -O https://bootstrap.pypa.io/get-pip.py
python get-pip.py
pip install setuptools --upgrade
# lua
yum -y install lua lua-devel
# lua posix and dependencies
wget https://github.com/luarocks/luarocks/archive/v2.4.2.tar.gz
tar xvf v2.4.2.tar.gz
cd luarocks-2.4.2
./configure
make build
make install
mkdir ~/.luarocks
echo "fs_use_modules = false" > ~/.luarocks/config.lua
luarocks install luaposix
luarocks install luafilesystem
LUAROCKS_PREFIX=/usr/local
export LUA_PATH="$LUAROCKS_PREFIX/share/lua/5.1/?.lua;$LUAROCKS_PREFIX/share/lua/5.1/?/init.lua;;"
export LUA_CPATH="$LUAROCKS_PREFIX/lib/lua/5.1/?.so;;"
# Lmod
wget https://github.com/TACC/Lmod/archive/7.7.7.tar.gz
tar xvf 7.7.7.tar.gz
cd Lmod-7.7.7
./configure --prefix=/opt/apps
make install
# GPU
driver_version=390.30
driver="/tmp/NVIDIA-Linux-x86_64-$driver_version.run"
sh $driver -x
mv NVIDIA-Linux-x86_64-$driver_version /usr/local/
dir=/usr/local/NVIDIA-Linux-x86_64-$driver_version
cd $dir
ln -s libcuda.so.$driver_version libcuda.so
ln -s libEGL.so.$driver_version libEGL.so
ln -s libGLESv1_CM.so.$driver_version libGLESv1_CM.so
ln -s libGLESv2.so.$driver_version libGLESv2.so
ln -s libGL.so.$driver_version libGL.so
ln -s libglx.so.$driver_version libglx.so
ln -s libnvcuvid.so.$driver_version libnvcuvid.so
ln -s libnvidia-cfg.so.$driver_version libnvidia-cfg.so
ln -s libnvidia-compiler.so.$driver_version libnvidia-compiler.so
ln -s libnvidia-eglcore.so.$driver_version libnvidia-eglcore.so
ln -s libnvidia-encode.so.$driver_version libnvidia-encode.so
ln -s libnvidia-fbc.so.$driver_version libnvidia-fbc.so
ln -s libnvidia-glcore.so.$driver_version libnvidia-glcore.so
ln -s libnvidia-glsi.so.$driver_version libnvidia-glsi.so
ln -s libnvidia-gtk2.so.$driver_version libnvidia-gtk2.so
ln -s libnvidia-gtk3.so.$driver_version libnvidia-gtk3.so
ln -s libnvidia-ifr.so.$driver_version libnvidia-ifr.so
ln -s libnvidia-ml.so.$driver_version libnvidia-ml.so
ln -s libnvidia-ml.so.$driver_version libnvidia-ml.so.1
ln -s libnvidia-opencl.so.$driver_version libnvidia-opencl.so
ln -s libnvidia-tls.so.$driver_version libnvidia-tls.so
ln -s libnvidia-wfb.so.$driver_version libnvidia-wfb.so
ln -s libvdpau_nvidia.so.$driver_version libvdpau_nvidia.so
ln -s libvdpau.so.$driver_version libvdpau.so
ln -s libvdpau_trace.so.$driver_version libvdpau_trace.so
ln -s libcuda.so.$driver_version libcuda.so.1
# APPS and SCRATCH
mkdir /apps
mkdir /scratch
%environment
source /opt/apps/lmod/7.7.7/init/profile
clearMT
export -f ml
export -f module
export -f clearMT
export LD_LIBRARY_PATH=/usr/local/cuda/lib64:/usr/local/cuda/extras/CUPTI/lib64:/usr/local/NVIDIA-Linux-x86_64-390.30:$LD_LIBRARY_PATH
export PATH=/usr/local/NVIDIA-Linux-x86_64-390.30:/usr/local/cuda/bin:$PATH
Bootstrap: docker
From: centos:latest
%setup
cp /apps/easybuild/sources/n/NVIDIA/NVIDIA-Linux-x86_64-390.30.run /tmp
%post
yum -y update && yum -y upgrade
# CentOS repo
yum -y install python gcc make wget vim mc procps tcl gcc-c++ gcc-gfortran pkg-config acl acpid alsa-lib alsa-lib-devel amtu apr aspell at atk atk-devel attr audit audit-libs audit-libs-python authconfig autoconf autofs automake avahi-glib avahi-libs basesystem bash bc bind-libs bind-utils binutils binutils-devel bison bison-devel bluez-libs bridge-utils busybox bzip2 bzip2-devel bzip2-libs ca-certificates cairo cairo-devel c-ares ccid cdparanoia-libs centos-indexhtml centos-release checkpolicy chkconfig cloog-ppl compat-libcap1 compat-libstdc++-33 compat-readline5 ConsoleKit ConsoleKit-libs coolkey coreutils coreutils-libs cpio cpp cppunit cpupowerutils cpuspeed cracklib cracklib-dicts crash crda cronie cronie-anacron crontabs cryptsetup-luks cryptsetup-luks-libs cups cups-libs curl cvs cyrus-sasl cyrus-sasl-devel cyrus-sasl-gssapi cyrus-sasl-lib cyrus-sasl-plain dash db4 db4-cxx db4-devel db4-utils dbus dbus-devel dbus-glib dbus-glib-devel dbus-libs dbus-python dejavu-fonts-common dejavu-lgc-sans-mono-fonts dejavu-sans-mono-fonts desktop-file-utils device-mapper device-mapper-event device-mapper-event-libs device-mapper-libs device-mapper-multipath device-mapper-multipath-libs device-mapper-persistent-data diffutils dmidecode dmraid dmraid-events dmz-cursor-themes docbook-dtds docbook-style-dsssl docbook-style-xsl docbook-utils dos2unix dosfstools dracut dracut-kernel dracut-network dump e2fsprogs e2fsprogs-devel e2fsprogs-libs ed eggdbus eject elfutils-libelf elfutils-libelf-devel elfutils-libs emacs emacs-common environment-modules ethtool expat expat-devel expect file file-devel file-libs filesystem findutils finger fipscheck fipscheck-lib flac fontconfig fontconfig-devel fontpackages-filesystem foomatic foomatic-db foomatic-db-filesystem foomatic-db-ppds freeglut freeglut-devel freetype freetype-devel ftp fuse fuse-libs gamin gamin-python gawk gcc gcc-c++ gcc-gfortran GConf2 GConf2-devel gd gdb gdbm gdbm-devel gdk-pixbuf2 gdk-pixbuf2-devel genisoimage gettext gettext-devel gettext-libs ghostscript ghostscript-fonts giflib git glib2 glib2-devel glibc glibc-common glibc-debuginfo glibc-debuginfo-common glibc-devel glibc-headers glx-utils gmp gmp-devel gnome-icon-theme gnome-keyring gnome-keyring-devel gnome-themes gnome-vfs2 gnome-vfs2-devel gnupg2 gnuplot gnuplot-common gnutls gnutls-devel gperf gpgme gpm gpm-libs grep groff grub grubby gstreamer gstreamer-plugins-base gstreamer-tools gtk2 gtk2-devel gtk2-engines gtk-doc gzip hal hal-devel hal-info hal-libs hdparm hesiod hicolor-icon-theme hunspell hwdata hwloc hwloc-devel ilmbase ImageMagick indent info initscripts iproute iptables iptables-ipv6 iptstate iputils irqbalance iscsi-initiator-utils iso-codes iw jasper-libs jwhois kbd kbd-misc kernel kernel kernel-devel kernel-firmware kernel-headers keyutils keyutils-libs keyutils-libs-devel kpartx krb5-devel krb5-libs krb5-workstation ksh lcms-libs less lftp libacl libacl-devel libaio libart_lgpl libart_lgpl-devel libasyncns libattr libattr-devel libbasicobjects libblkid libbonobo libbonobo-devel libbonoboui libbonoboui-devel libcanberra libcanberra-gtk2 libcap libcap-devel libcap-ng libcgroup libcollection libcom_err libcom_err-devel libcroco libcroco-devel libcxgb3 libcxgb4 libdaemon libdhash libdrm libdrm-devel libedit libedit-devel libevent libexif libffi libfontenc libgcc libgcj libgcrypt libgcrypt-devel libgfortran libglade2 libglade2-devel libgnome libgnomecanvas libgnomecanvas-devel libgnome-devel libgomp libgpg-error libgpg-error-devel libgsf libgsf-devel libgssglue libgudev1 libhugetlbfs libibcm libibcm-devel libibverbs libibverbs-devel libibverbs-devel-static libibverbs-utils libICE libICE-devel libicu libIDL libIDL-devel libidn libidn-devel libini_config libipa_hbac libjpeg-turbo libjpeg-turbo-devel libldb libmcpp libmlx4 libmlx5 libmng libmng-devel libmthca libmthca-static libnetfilter_conntrack libnfnetlink libnih libnl libnl-devel libnotify libogg liboil libotf libpath_utils libpcap libpciaccess libpciaccess-devel libpng libpng-devel libproxy libproxy-bin libproxy-python libref_array librsvg2 librsvg2-devel libselinux libselinux-devel libselinux-python libselinux-utils libsemanage libsepol libsepol-devel libSM libSM-devel libsndfile libss libssh2 libsss_idmap libstdc++ libstdc++-devel libsysfs libsysfs-devel libtalloc libtasn1 libtasn1-devel libtdb libtevent libthai libtheora libtiff libtiff-devel libtirpc libtool-ltdl libudev libudev-devel libunistring libusb libusb1 libusb-devel libuser libutempter libuuid libvisual libvorbis libwmf libwmf-lite libwnck libX11 libX11-common libX11-devel libXau libXau-devel libXaw libXaw-devel libxcb libxcb-devel libXcomposite libXcomposite-devel libXcursor libXcursor-devel libXdamage libXdamage-devel libXdmcp libXdmcp-devel libXext libXext-devel libXfixes libXfixes-devel libXfont libXft libXft-devel libXi libXi-devel libXinerama libXinerama-devel libxkbfile libxml2 libxml2-devel libxml2-python libXmu libXmu-devel libXp libXpm libXpm-devel libXrandr libXrandr-devel libXrender libXrender-devel libXres libXScrnSaver libXScrnSaver-devel libxslt libxslt-devel libXt libXt-devel libXtst libXtst-devel libXv libXv-devel libXxf86misc libXxf86misc-devel libXxf86vm libXxf86vm-devel lm_sensors-libs lockdev logrotate lsof lvm2 lvm2-libs lynx lzo m17n-db m17n-db-datafiles m17n-lib m2crypto m4 mailcap mailx make MAKEDEV man man-pages mc mcpp mcstrans mdadm mesa-dri1-drivers mesa-dri-drivers mesa-dri-filesystem mesa-libGL mesa-libGL-devel mesa-libGLU mesa-libGLU-devel mesa-private-llvm mgetty microcode_ctl mingetty mkbootdisk mlocate module-init-tools mpfr mtools mtr mysql-libs nano nc ncurses ncurses-base ncurses-devel ncurses-libs net-snmp net-snmp-libs net-tools newt newt-python nfs-utils nfs-utils-lib nmap notification-daemon nscd nspr nspr-devel nss nss_db nss-devel nss-softokn nss-softokn-debuginfo nss-softokn-devel nss-softokn-freebl nss-softokn-freebl-devel nss-sysinit nss-tools nss-util nss-util-devel ntp ntpdate ntsysv OpenEXR-libs OpenIPMI OpenIPMI-libs openjade openjpeg-libs openldap openldap-devel openmotif openmotif22 opensp openssh openssh-clients openssh-server ORBit2 ORBit2-devel p11-kit p11-kit-trust pam pam-devel pam_krb5 pam_passwdqc pam_pkcs11 pango pango-devel paps paps-libs parted passwd patch pax pciutils pciutils-devel pciutils-libs pcmciautils pcp pcp-conf pcp-libs pcre pcsc-lite pcsc-lite-libs perf perl perl-AppConfig perl-Authen-SASL perl-Bit-Vector perl-Carp-Clan perl-CGI perl-Class-Singleton perl-Compress-Raw-Zlib perl-Compress-Zlib perl-Convert-ASN1 perl-Crypt-PasswdMD5 perl-Date-Calc perl-Date-Manip perl-DateTime perl-DBD-Pg perl-DBI perl-devel perl-Digest-HMAC perl-Digest-SHA1 perl-Error perl-ExtUtils-MakeMaker perl-ExtUtils-ParseXS perl-File-Which perl-Git perl-GSSAPI perl-HTML-Parser perl-HTML-Tagset perl-IO-Compress-Base perl-IO-Compress-Zlib perl-IO-Socket-SSL perl-JSON perl-LDAP perl-libs perl-libwww-perl perl-List-MoreUtils perl-Module-Pluggable perl-Net-LibIDN perl-Net-SSLeay perl-Net-Telnet perl-Params-Validate perl-PCP-PMDA perl-Pod-Escapes perl-Pod-Simple perl-SGMLSpm perl-Socket6 perl-String-CRC32 perl-TermReadKey perl-Test-Harness perl-Test-Simple perl-Text-Iconv perl-Time-HiRes perl-URI perl-version perl-WWW-Curl perl-XML-Filter-BufferText perl-XML-LibXML perl-XML-NamespaceSupport perl-XML-Parser perl-XML-SAX perl-XML-SAX-Writer perl-XML-Simple perl-YAML-Syck pinentry pinfo pixman pixman-devel pkgconfig plymouth plymouth-core-libs plymouth-scripts pm-utils policycoreutils polkit poppler poppler-data poppler-utils popt popt-devel portreserve postfix postgresql postgresql-devel postgresql-libs postgresql-odbc ppl ppp prelink procmail procps psacct psmisc pth pulseaudio-libs pycairo pycairo-devel pygobject2 pygobject2-codegen pygobject2-devel pygobject2-doc pygpgme pygtk2 pygtk2-codegen pygtk2-devel pygtk2-doc pyOpenSSL pytalloc python python-argparse python-devel python-iniparse python-libs python-pcp python-pycurl python-setuptools python-sssdconfig python-urlgrabber qt qt3 qt-sqlite qt-x11 quota rarian rarian-compat rdate rdma readahead readline readline-devel redhat-logos redhat-lsb redhat-lsb-compat redhat-lsb-core redhat-lsb-graphics redhat-lsb-printing redhat-menus redhat-rpm-config rmt rootfiles rpcbind rpm rpm-devel rpm-libs rpm-python rp-pppoe rrdtool rsh rsync ruby ruby-libs samba samba4-libs samba-common samba-winbind samba-winbind-clients screen SDL SDL-devel sed selinux-policy setserial setup setuptool sgml-common sgpio shadow-utils shared-mime-info slang smartmontools snappy sos sound-theme-freedesktop sqlite sqlite-devel sssd sssd-ad sssd-client sssd-common sssd-common-pac sssd-ipa sssd-krb5 sssd-krb5-common sssd-ldap sssd-proxy startup-notification startup-notification-devel strace stunnel sudo swig symlinks sysfsutils syslinux syslinux-nonlinux sysstat system-gnome-theme system-icon-theme systemtap-devel sysvinit-tools t1lib talk tar tcl tcl-devel tcpdump tcp_wrappers tcp_wrappers-libs tcsh telnet time tk tmpwatch traceroute tree tunctl tzdata udev udftools unix2dos unixODBC unixODBC-devel unzip upstart urw-fonts usbutils usermode ustr util-linux-ng vconfig vim-common vim-enhanced vim-filesystem vim-minimal virt-what wget which wireless-tools words wpa_supplicant xcb-util xdg-utils xerces-c xerces-c-devel xinetd xkeyboard-config xml-common xmlrpc-c xmlrpc-c-client xorg-x11-fonts-100dpi xorg-x11-fonts-75dpi xorg-x11-font-utils xorg-x11-proto-devel xorg-x11-server-common xorg-x11-server-utils xorg-x11-xauth xorg-x11-xkb-utils xterm xz xz-libs xz-lzma-compat ypbind yp-tools yum yum-metadata-parser yum-plugin-auto-update-debug-info yum-plugin-fastestmirror yum-plugin-priorities yum-plugin-security yum-plugin-versionlock yum-utils zip zlib zlib-devel
# Fedora repo
yum -y install bash-completion pigz tmux
yum -y groupinstall "Development Tools"
cd /tmp
# OpenMPI
wget https://www.open-mpi.org/software/ompi/v2.1/downloads/openmpi-2.1.1.tar.gz
tar xvf openmpi-2.1.1.tar.gz && cd openmpi-2.1.1
./configure --prefix=/usr/local
make -j 16
make install
# pip
curl -s -O https://bootstrap.pypa.io/get-pip.py
python get-pip.py
pip install setuptools python-graph-core python-graph-dot tabulate numpy scipy pandas wheel --upgrade
# lua
wget http://dl.fedoraproject.org/pub/epel/7/x86_64/Packages/l/lua-posix-32-2.el7.x86_64.rpm
wget http://dl.fedoraproject.org/pub/epel/7/x86_64/Packages/l/lua-filesystem-1.6.2-2.el7.x86_64.rpm
wget http://mirror.centos.org/centos/7/os/x86_64/Packages/lua-devel-5.1.4-15.el7.x86_64.rpm
wget http://dl.fedoraproject.org/pub/epel/7/x86_64/Packages/l/lua-bitop-1.0.2-3.el7.x86_64.rpm
rpm -ihv lua-devel-5.1.4-15.el7.x86_64.rpm
rpm -ihv lua-filesystem-1.6.2-2.el7.x86_64.rpm
rpm -ihv lua-bitop-1.0.2-3.el7.x86_64.rpm
rpm -ihv lua-posix-32-2.el7.x86_64.rpm
# Lmod
wget https://github.com/TACC/Lmod/archive/7.7.7.tar.gz
tar xvf 7.7.7.tar.gz
cd Lmod-7.7.7
./configure --prefix=/opt/apps
make install
# GPU
driver_version=390.30
driver="/tmp/NVIDIA-Linux-x86_64-$driver_version.run"
sh $driver -x
mv NVIDIA-Linux-x86_64-$driver_version /usr/local/
dir=/usr/local/NVIDIA-Linux-x86_64-$driver_version
cd $dir
ln -s libcuda.so.$driver_version libcuda.so
ln -s libEGL.so.$driver_version libEGL.so
ln -s libGLESv1_CM.so.$driver_version libGLESv1_CM.so
ln -s libGLESv2.so.$driver_version libGLESv2.so
ln -s libGL.so.$driver_version libGL.so
ln -s libglx.so.$driver_version libglx.so
ln -s libnvcuvid.so.$driver_version libnvcuvid.so
ln -s libnvidia-cfg.so.$driver_version libnvidia-cfg.so
ln -s libnvidia-compiler.so.$driver_version libnvidia-compiler.so
ln -s libnvidia-eglcore.so.$driver_version libnvidia-eglcore.so
ln -s libnvidia-encode.so.$driver_version libnvidia-encode.so
ln -s libnvidia-fbc.so.$driver_version libnvidia-fbc.so
ln -s libnvidia-glcore.so.$driver_version libnvidia-glcore.so
ln -s libnvidia-glsi.so.$driver_version libnvidia-glsi.so
ln -s libnvidia-gtk2.so.$driver_version libnvidia-gtk2.so
ln -s libnvidia-gtk3.so.$driver_version libnvidia-gtk3.so
ln -s libnvidia-ifr.so.$driver_version libnvidia-ifr.so
ln -s libnvidia-ml.so.$driver_version libnvidia-ml.so
ln -s libnvidia-ml.so.$driver_version libnvidia-ml.so.1
ln -s libnvidia-opencl.so.$driver_version libnvidia-opencl.so
ln -s libnvidia-tls.so.$driver_version libnvidia-tls.so
ln -s libnvidia-wfb.so.$driver_version libnvidia-wfb.so
ln -s libvdpau_nvidia.so.$driver_version libvdpau_nvidia.so
ln -s libvdpau.so.$driver_version libvdpau.so
ln -s libvdpau_trace.so.$driver_version libvdpau_trace.so
ln -s libcuda.so.$driver_version libcuda.so.1
# APPS and SCRATCH
mkdir /apps
mkdir /scratch
%environment
source /opt/apps/lmod/7.7.7/init/profile
clearMT
export -f ml
export -f module
export -f clearMT
export LD_LIBRARY_PATH=/usr/local/cuda/lib64:/usr/local/cuda/extras/CUPTI/lib64:/usr/local/NVIDIA-Linux-x86_64-390.30:$LD_LIBRARY_PATH
export PATH=/usr/local/NVIDIA-Linux-x86_64-390.30:/usr/local/cuda/bin:$PATH
import sys
import time
import os
import json
import logging
import shutil
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger("Log crawler")
PROGRESS_HEAD = '''<html>
<head>
<title>HPC job progress</title>
<script type="text/javascript">
function abort() {
notify_running_job("ABORT");
}
</script>
</head>'''
PROGRESS_BODY='''<body style="margin: 20px; padding: 20px;">
<h1>HPC job progress</h1>
<div>
<h3>This is a waiter. It's waiting on the HPC cluster. It has waited {}/{} seconds.</h3>
<p>(Status from {}.)</p>
<p>Click the Abort button to stop the waiter early. Please click only once,
it will take a while until the request is processed. (The status might even
update once more before the job is aborted.)</p>
<input type="button" value="Abort" onclick="abort()">
</div>
</body>
</html>
'''
PROGRESS_BODY_UNKNOWN='''<body style="margin: 20px; padding: 20px;">
<h1>HPC job progress</h1>
<div>
<h3>This is a waiter. It's waiting on the HPC cluster. Its status is unknown.</h3>
<input type="button" value="Abort job" onclick="abort()">
</div>
</body>
</html>
'''
def main():
fn_log = sys.argv[1]
fn_status = sys.argv[2]
crawl_log(fn_log, fn_status)
def crawl_log(fn_log, fn_status):
"""Monitors a log file and creates html status pages from it
The log file is expected to grow only by one line at a time, with new lines
added to the end of the file. Each line is expected to be either a json
string containing the fields 'timestamp', 'elapsed_time', and 'total_time',
or the string 'FINISHED', which triggers the crawler to stop.
Note that this crawler is "memory-less", meaning that it cares only about
the last, newest line added to the log file while all prior lines are
disregarded.
Args:
fn_log (str): Filename of the log file to monitor
fn_status (str): Filename to write the status output to
"""
logger.info("Log crawler starting up")
cached_stamp = 0
should_stop = False
while not should_stop:
if not os.path.exists(fn_log):
logger.info("Log file doesn't exist")
else:
# Check if "last modified" time of the log file has changed
stamp = os.stat(fn_log).st_mtime
if not stamp != cached_stamp:
logger.info("Log file hasn't changed since last check")
else:
logger.info("Log file has changed")
cached_stamp = stamp
status = get_last_line(fn_log)
# We can stop crawling the logs if the main app is done
if status.strip() == "FINISHED":
should_stop = True
logger.info("Found FINISHED log, will stop now!")
# Otherwise, parse json and write status from it
else:
try:
log = json.loads(status)
write_status(log, fn_status)
except json.JSONDecodeError:
write_status_unknown(fn_status)
time.sleep(1)
logger.info("Log crawler terminating")
def get_last_line(fn):
"""Returns the last line of a file
Args:
fn (str): File name of the file to read from
"""
with open(fn, 'r') as fin:
for line in fin:
pass
return line
def write_status(log, fn_status):
"""Writes a status html page using the information in 'log'
Args:
log (dict): Log containing the field 'timestamp', 'elapsed_time', and
'total_time'
fn_status (str): Filename to write the status html to
"""
status = PROGRESS_HEAD + PROGRESS_BODY.format(
log["elapsed_time"],
log["total_time"],
log["timestamp"],
)
# First write to a temporary file, then copy to actual status file. That
# way, the status file won't be corrupt if the writing process takes a
# while.
fn_status_new = fn_status + '.new'
with open(fn_status_new, 'w') as fout:
fout.write(status)
shutil.copyfile(fn_status_new, fn_status)
logger.info("Wrote status file")
def write_status_unknown(fn_status):
"""Writes a status html page when no actual status is known
Args:
fn_status (str): Filename to write the status html to
"""
with open(fn_status, 'w') as fout:
fout.write(PROGRESS_HEAD + PROGRESS_BODY_UNKNOWN)
logger.info("Wrote unknown status")
if __name__ == "__main__":
main()
\ No newline at end of file
import os
import time
import sys
import logging
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger("Notifications monitor")
def main():
fn_notifications = sys.argv[1]
fn_abort = sys.argv[2]
monitor(fn_notifications, fn_abort)
def monitor(fn_notifications, fn_abort):
"""
"""
logger.info("Notifications monitor starting up")
cached_stamp = 0
while True:
if not os.path.exists(fn_notifications):
logger.info("Notifications file doesn't exist")
else:
# Check if "last modified" time of the file has changed
stamp = os.stat(fn_notifications).st_mtime
if not stamp != cached_stamp:
logger.info("Notifications file hasn't changed since last check")
else:
logger.info("Notifications file has changed")
cached_stamp = stamp
command = get_last_line(fn_notifications).strip()
if command == "ABORT":
logger.info("Received abort command")
# Abort the main app by creating a specific file
open(fn_abort, 'a').close()
else:
logger.info("Ignoring unknown command {}".format(command))
time.sleep(1)
def get_last_line(fn):
"""Returns the last line of a file
Returns an empty string if the file is empty.
Args:
fn (str): File name of the file to read from
"""
with open(fn, 'r') as fin:
i = -1
for i, line in enumerate(fin):
pass
if i >= 0:
return line
else:
return ''
if __name__ == "__main__":
main()
\ No newline at end of file
import subprocess
import sys
import os
import string
import random
import shutil
import logging
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger("Startup")
def main():
# Input arguments
seconds_to_wait = int(sys.argv[1])
app_folder = sys.argv[2]
# Pre-defined files for communication with the "outside world"
fn_status = '/service/status.html'
fn_result = '/service/result.txt'
fn_notifications = '/service/notifications.txt'
# Write dummy value into result file
logger.info("Writing dummy result")
with open(fn_result, 'w') as fout:
fout.write("UNSET")
# Define files for the main app in a unique folder
ID = generate_id('/home')
unique_folder = os.path.join('/home', ID)
os.mkdir(unique_folder)
fn_log = os.path.join(unique_folder, 'main_log.txt')
fn_abort = os.path.join(unique_folder, 'main_abort.txt')
logger.info("Created unique folder {}".format(unique_folder))
# 1: Start log crawler as a background process
# The log crawler monitors a single log file and creates status html pages
# from it
# The log crawler will automatically terminate when it reads the finishing
# log from the main application
logger.info("Starting log crawler")
log_crawler_script = os.path.join(app_folder, 'log_crawler.py')
command = ['python', log_crawler_script, fn_log, fn_status]
proc_log = subprocess.Popen(command)
# 2: Start the notifications monitor as a background process
# It monitors the notifications file (which is written to when messages are
# sent to the HPC service running this Singularity image) and translates
# messages into comands to the main application. Here, this is done simply
# by creating a specific file the main app looks for. Only a single command
# (abort) is supported.
# The notifications monitor does _not_ terminate by itself.
logger.info("Starting notifications monitor")
not_monitor_script = os.path.join(app_folder, 'notifications_monitor.py')
command = ['python', not_monitor_script, fn_notifications, fn_abort]
proc_not = subprocess.Popen(command)
# 3: Start the main application as a foreground process
# The main application will write to the log file monitored by the crawler,
# and it will write its final result into the result file.
# It will also check periodically for the existence of 'fn_abort' and quit
# if this file exists. (This is a cheap way of sending a command to the
# main app.)
logger.info("Starting waiter")
waiter_script = os.path.join(app_folder, 'wait_a_while.py')
command = ['python', waiter_script, str(seconds_to_wait), fn_log,
fn_result, fn_abort]
subprocess.run(command)
logger.info("Waiter finished, terminating processes")
# 4: Terminate notifications monitor and remove log folders
# As the main app is finished at this point, we can safely terminate the
# notifications monitor
proc_log.terminate()
proc_not.terminate()
shutil.rmtree(unique_folder)
# (Optional) 5: Process end result
# In case the final result of the main application (see step 3) is _not_
# just a simple file, we should call another script here which processes
# this end result and writes into the /service/result.txt file.
def generate_id(folder, size=16, chars=string.ascii_uppercase + string.digits):
"""Generates a random ID string which guaranteed not to exist in a folder"""
while True:
ID = ''.join(random.choice(chars) for _ in range(size))
if not os.path.exists(os.path.join(folder, ID)):
break
return ID
if __name__ == "__main__":
main()
\ No newline at end of file
import sys
import time
import datetime
import json
import os
import logging
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger("Waiter")
def main():
seconds_to_wait = int(sys.argv[1])
fn_log = sys.argv[2]
fn_result = sys.argv[3]
fn_abort = sys.argv[4]
logger.info("Waiter starting up, will wait {} seconds".format(seconds_to_wait))
for current_time in range(seconds_to_wait):
# Perform part of "complicated computation"
time.sleep(1)
# Write log
write_log(fn_log, current_time, seconds_to_wait)
# Check if we should abort
if os.path.exists(fn_abort):
write_final_log(fn_log)
write_result(fn_result, current_time, aborted=True)
return 0
write_final_log(fn_log)
write_result(fn_result, seconds_to_wait)
def write_log(fn_log, elapsed_time, total_time):
log = {
'timestamp': str(datetime.datetime.now()),
'elapsed_time': str(elapsed_time),
'total_time': str(total_time),
}
with open(fn_log, 'a') as fout:
json.dump(log, fout)
fout.write("\n")
logger.info("Log written: {}/{} seconds waited".format(elapsed_time, total_time))
def write_final_log(fn_log):
with open(fn_log, 'a') as fout:
fout.write("FINISHED\n")
logger.info("Final log written")
def write_result(fn, seconds_waited, aborted=False):
with open(fn, 'w') as f:
if aborted:
f.write('Done. My waiting was aborted after {} seconds.'.format(seconds_waited))
else:
f.write('Done. I have waited {} seconds.'.format(seconds_waited))
logger.info("Result written")
if __name__ == "__main__":
main()
# ESPRESO Configuration File
#BENCHMARK ARG0 [ TETRA4, TETRA10, PYRAMID5, PYRAMID13, PRISMA6, PRISMA15, HEXA8, HEXA20 ]
#BENCHMARK ARG10 [ TOTAL_FETI, HYBRID_FETI ]
DEFAULT_ARGS {
0 HEXA8;
1 1;
2 1;
3 1;
4 2;
5 2;
6 2;
7 5;