Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade the containers to the correct new setup. #361

Merged
merged 1 commit into from
Oct 12, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 19 additions & 10 deletions dev_tools/containers/build_all_containers.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,22 @@
#!/bin/bash

hpccm --recipe ginkgo-nocuda-base.py --userarg gnu=8 llvm=6.0 papi=True > gko-nocuda-gnu8-llvm70.baseimage
hpccm --recipe ginkgo-cuda-base.py --userarg cuda=10.0 gnu=7 llvm=6.0 > gko-cuda100-gnu7-llvm60.baseimage
hpccm --recipe ginkgo-cuda-base.py --userarg cuda=9.2 gnu=7 llvm=5.0 > gko-cuda92-gnu7-llvm50.baseimage
hpccm --recipe ginkgo-cuda-base.py --userarg cuda=9.1 gnu=6 llvm=4.0 > gko-cuda91-gnu6-llvm40.baseimage
hpccm --recipe ginkgo-cuda-base.py --userarg cuda=9.0 gnu=5 llvm=3.9 > gko-cuda90-gnu5-llvm39.baseimage
for i in $(ls *.baseimage)


hpccm --recipe ginkgo-nocuda-base.py --userarg gnu=8 llvm=7 papi=True > gko-nocuda-gnu8-llvm70.baseimage
list=('gko-nocuda-gnu8-llvm70.baseimage')
if [ "$HOSTNAME" = "amdci" ]; then
list+=('gko-amd-gnu7-llvm60.baseimage')
else
hpccm --recipe ginkgo-cuda-base.py --userarg cuda=10.1 gnu=8 llvm=7 > gko-cuda101-gnu8-llvm70.baseimage
hpccm --recipe ginkgo-cuda-base.py --userarg cuda=10.0 gnu=7 llvm=6.0 > gko-cuda100-gnu7-llvm60.baseimage
hpccm --recipe ginkgo-cuda-base.py --userarg cuda=9.2 gnu=7 llvm=5.0 > gko-cuda92-gnu7-llvm50.baseimage
hpccm --recipe ginkgo-cuda-base.py --userarg cuda=9.1 gnu=6 llvm=4.0 > gko-cuda91-gnu6-llvm40.baseimage
hpccm --recipe ginkgo-cuda-base.py --userarg cuda=9.0 gnu=5 llvm=3.9 > gko-cuda90-gnu5-llvm39.baseimage
list+=(gko-cuda*.baseimage)
fi

for i in "${list[@]}"
do
name=$(echo $i | cut -d"." -f1)
docker build -t localhost:5000/$name -f $i .
docker push localhost:5000/$name
name=$(echo $i | cut -d"." -f1)
docker build -t localhost:5000/$name -f $i .
docker push localhost:5000/$name
done
59 changes: 45 additions & 14 deletions dev_tools/containers/ginkgo-cuda-base.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,16 @@
git, openssh, doxygen, curl, valgrind, graphviz, jq latest apt version
build-essential, automake, pkg-config, libtool, latest apt version
iwyu precompiled version 6.0
libthrust-dev latest apt version
gnupg-agent: latest apt version, for adding custom keys
"""
# pylint: disable=invalid-name, undefined-variable, used-before-assignment

import os

cuda_version = USERARG.get('cuda', '10.0')

release_name = 'xenial'
image = 'nvidia/cuda:{}-devel-ubuntu16.04'.format(cuda_version)
Stage0.baseimage(image)

Expand All @@ -39,20 +42,29 @@

# Setup extra tools
Stage0 += python()
Stage0 += cmake(eula=True)
Stage0 += cmake(eula=True, version='3.14.5')
Stage0 += apt_get(ospackages=['git', 'openssh-client', 'doxygen', 'curl', 'valgrind', 'graphviz'])
Stage0 += apt_get(ospackages=['jq', 'iwyu'])
Stage0 += apt_get(ospackages=['build-essential', 'automake', 'pkg-config', 'libtool'])

Stage0 += apt_get(ospackages=['libthrust-dev'])
Stage0 += apt_get(ospackages=['gnupg-agent'])
Stage0 += apt_get(ospackages=['ca-certificates']) # weird github certificates problem

# GNU compilers
gnu_version = USERARG.get('gnu', '7')
Stage0 += gnu(version=gnu_version, extra_repository=True)
gcov_update = ['update-alternatives --install /usr/bin/gcov gcov /usr/bin/gcov-{} 90'.format(gnu_version)]
Stage0 += shell(commands=gcov_update)

# Clang compilers
llvm_version = USERARG.get('llvm', '6.0')
Stage0 += llvm(version=llvm_version, extra_repository=True)
Stage0 += apt_get(ospackages=['libomp-dev']) #required for openmp+clang
llvm_version = USERARG.get('llvm', '7')
clang_ver = 'clang-{}'.format(llvm_version)
repo_ver = ['deb http://apt.llvm.org/{}/ llvm-toolchain-{}-{} main'.format(release_name, release_name, llvm_version)]
Stage0 += apt_get(ospackages=[clang_ver, 'libomp-dev'], repositories=repo_ver, keys=['https://apt.llvm.org/llvm-snapshot.gpg.key'])
clang_update = 'update-alternatives --install /usr/bin/clang clang /usr/bin/clang-{} 90'.format(llvm_version)
clangpp_update = 'update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang-{} 90'.format(llvm_version)
Stage0 += shell(commands=[clang_update, clangpp_update])


# clang-tidy
clangtidy = ['clang-tidy-{}'.format(llvm_version)]
Expand All @@ -64,7 +76,7 @@
if os.path.isdir('bin/'):
Stage0 += copy(src='bin/*', dest='/usr/bin/')

if os.path.isdir('sonar-scanner/'):
if os.path.isdir('sonar-scanner/') and float(cuda_version) >= float(10.0):
Stage0 += copy(src='sonar-scanner/', dest='/')

# hwloc
Expand All @@ -73,6 +85,7 @@
'git clone https://github.com/open-mpi/hwloc.git hwloc'])
Stage0 += shell(commands=['cd /var/tmp/hwloc', './autogen.sh',
'./configure --prefix=/usr --disable-nvml', 'make -j10', 'make install'])
Stage0 += shell(commands=['rm -rf /var/tmp/hwloc'])

# upload valid FineCI topology and set it for hwloc
if os.path.isfile('topology/fineci.xml'):
Expand All @@ -85,11 +98,29 @@
intel_versions = {'9.0' : '2017', '9.1' : '2017', '9.2' : '2017', '10.0' : '2018'}
intel_path = 'intel/parallel_studio_xe_{}/compilers_and_libraries/linux/'.format(intel_versions.get(cuda_version))
if os.path.isdir(intel_path):
Stage0 += copy(src=intel_path+'bin/intel64/', dest='/opt/intel/bin/')
Stage0 += copy(src=intel_path+'lib/intel64/', dest='/opt/intel/lib/')
Stage0 += copy(src=intel_path+'include/', dest='/opt/intel/include/')
Stage0 += environment(variables={'INTEL_LICENSE_FILE': '28518@scclic1.scc.kit.edu'})
Stage0 += environment(variables={'PATH': '$PATH:/opt/intel/bin'})
Stage0 += environment(variables={'LIBRARY_PATH': '$LIBRARY_PATH:/opt/intel/lib'})
Stage0 += environment(variables={'LD_LIBRARY_PATH': '$LD_LIBRARY_PATH:/opt/intel/lib'})
Stage0 += environment(variables={'LD_RUN_PATH': '$LD_RUN_PATH:/opt/intel/lib'})
Stage0 += copy(src=intel_path+'bin/intel64/', dest='/opt/intel/bin/')
Stage0 += copy(src=intel_path+'lib/intel64/', dest='/opt/intel/lib/')
Stage0 += copy(src=intel_path+'include/', dest='/opt/intel/include/')
Stage0 += environment(variables={'INTEL_LICENSE_FILE': '28518@scclic1.scc.kit.edu'})
Stage0 += environment(variables={'PATH': '$PATH:/opt/intel/bin'})
Stage0 += environment(variables={'LIBRARY_PATH': '$LIBRARY_PATH:/opt/intel/lib'})
Stage0 += environment(variables={'LD_LIBRARY_PATH': '$LD_LIBRARY_PATH:/opt/intel/lib'})
Stage0 += environment(variables={'LD_RUN_PATH': '$LD_RUN_PATH:/opt/intel/lib'})


# HIP
Stage0 += shell(commands=['cd /var/tmp',
'git clone https://github.com/ROCm-Developer-Tools/HIP.git'])
Stage0 += shell(commands=['cd /var/tmp/HIP', 'mkdir build', 'cd build',
'cmake ..', 'make install'])
Stage0 += shell(commands=['rm -rf /var/tmp/HIP'])
Stage0 += shell(commands=['cd /var/tmp',
'git clone https://github.com/tcojean/hipBLAS.git'])
Stage0 += shell(commands=['cd /var/tmp/hipBLAS', 'mkdir build', 'cd build',
'cmake ..', 'make install'])
Stage0 += shell(commands=['rm -rf /var/tmp/hipBLAS'])
Stage0 += shell(commands=['cd /var/tmp',
'git clone https://github.com/tcojean/hipSPARSE.git'])
Stage0 += shell(commands=['cd /var/tmp/hipSPARSE', 'mkdir build', 'cd build',
'cmake -DBUILD_CUDA=on ..', 'make install'])
Stage0 += shell(commands=['rm -rf /var/tmp/hipSPARSE'])
48 changes: 39 additions & 9 deletions dev_tools/containers/ginkgo-nocuda-base.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,38 +7,68 @@
OpenMP latest apt version for Clang+OpenMP
Python 2 and 3 (upstream)
cmake (upstream)
build-essential, git, openssh, doxygen, curl, valgrind latest apt version
jq, graphviz, ghostscript, texlive, texlive-latex-extra, latest apt version
texlive-science, texlive-fonts-extra, texlive-publishers latest apt version
build-essential, git, openssh, curl, valgrind latest apt version
jq, graphviz, ghostscript, latest apt version
bison, flex latest apt version, required for doxygen compilation
doxygen: install the latest release
texlive: install the latest release
clang-tidy, iwyu: latest apt version
hwloc, libhwloc-dev, pkg-config latest apt version
papi: adds package libpfm4, and copy precompiled papi headers and files
from a directory called 'papi'
gpg-agent: latest apt version, for adding custom keys
"""
# pylint: disable=invalid-name, undefined-variable, used-before-assignment

import os

Stage0.baseimage('ubuntu:18.04')

release_name = 'bionic'

# Setup extra tools
Stage0 += python()
Stage0 += cmake(eula=True)
Stage0 += apt_get(ospackages=['build-essential', 'git', 'openssh-client', 'doxygen', 'curl', 'valgrind'])
Stage0 += apt_get(ospackages=['jq', 'graphviz', 'ghostscript', 'texlive', 'texlive-latex-extra'])
Stage0 += apt_get(ospackages=['texlive-science', 'texlive-fonts-extra', 'texlive-publishers'])
Stage0 += apt_get(ospackages=['build-essential', 'git', 'openssh-client', 'curl', 'valgrind'])
Stage0 += apt_get(ospackages=['jq', 'graphviz', 'ghostscript'])
Stage0 += apt_get(ospackages=['clang-tidy', 'iwyu'])
Stage0 += apt_get(ospackages=['hwloc', 'libhwloc-dev', 'pkg-config'])
Stage0 += apt_get(ospackages=['gpg-agent'])
Stage0 += apt_get(ospackages=['ca-certificates']) # weird github certificates problem
Stage0 += apt_get(ospackages=['bison', 'flex'])

# GNU compilers
gnu_version = USERARG.get('gnu', '8')
Stage0 += gnu(version=gnu_version, extra_repository=True)

# Clang compilers
llvm_version = USERARG.get('llvm', '7')
Stage0 += llvm(version=llvm_version, extra_repository=True)
Stage0 += apt_get(ospackages=['libomp-dev']) #required for openmp+clang
clang_ver = 'clang-{}'.format(llvm_version)
repo_ver = ['deb http://apt.llvm.org/{}/ llvm-toolchain-{}-{} main'.format(release_name, release_name, llvm_version)]
Stage0 += apt_get(ospackages=[clang_ver, 'libomp-dev'], repositories=repo_ver, keys=['https://apt.llvm.org/llvm-snapshot.gpg.key'])
clang_update = 'update-alternatives --install /usr/bin/clang clang /usr/bin/clang-{} 90'.format(llvm_version)
clangpp_update = 'update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang-{} 90'.format(llvm_version)
Stage0 += shell(commands=[clang_update, clangpp_update])

# Doxygen
Stage0 += shell(commands=['cd /var/tmp', 'git clone https://github.com/doxygen/doxygen'])
Stage0 += shell(commands=['cd /var/tmp/doxygen', 'git checkout Release_1_8_16',
'mkdir build', 'cd build',
'cmake ..', 'make -j10', 'make install'])
Stage0 += shell(commands=['cd /var/tmp', 'rm -rf doxygen'])

# Texlive
if os.path.isdir('texlive/'):
Stage0 += copy(src='texlive/texlive.profile', dest='/var/tmp')
Stage0 += shell(commands=['cd /var/tmp', 'wget '
'http://mirror.ctan.org/systems/texlive/tlnet/install-tl-unx.tar.gz',
'tar -xvf install-tl-unx.tar.gz', 'cd install-tl-2*',
'./install-tl --profile=../texlive.profile'])
Stage0 += shell(commands=['cd /var/tmp', 'rm -rf install-tl*'])
Stage0 += shell(commands=['tlmgr install mathtools float xcolor varwidth '
'fancyvrb multirow hanging adjustbox xkeyval '
'collectbox stackengine etoolbox listofitems ulem '
'wasysym sectsty tocloft newunicodechar caption etoc '
'pgf ec helvetic courier wasy'])

# Copy PAPI libs
add_papi = USERARG.get('papi', 'False')
Expand Down
75 changes: 75 additions & 0 deletions dev_tools/containers/gko-amd-gnu7-llvm60.baseimage
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
FROM ubuntu:16.04
MAINTAINER Terry Cojean <terry.cojean@kit.edu>

# Initialize the image
# Modify to pre-install dev tools and ROCm packages
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends curl && \
curl -sL http://repo.radeon.com/rocm/apt/debian/rocm.gpg.key | apt-key add - && \
sh -c 'echo deb [arch=amd64] http://repo.radeon.com/rocm/apt/debian/ xenial main > /etc/apt/sources.list.d/rocm.list' && \
apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
libelf1 \
libnuma-dev \
build-essential \
git \
vim-nox \
cmake-curses-gui \
kmod \
rocm-dev \
hipsparse hipblas rocthrust && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*


RUN apt-get update -y && \
apt-get install -y --no-install-recommends \
wget && \
rm -rf /var/lib/apt/lists/*
RUN mkdir -p /var/tmp && wget -q -nc --no-check-certificate -P /var/tmp https://cmake.org/files/v3.11/cmake-3.11.1-Linux-x86_64.sh && \
/bin/sh /var/tmp/cmake-3.11.1-Linux-x86_64.sh --prefix=/usr/local --skip-license && \
rm -rf /var/tmp/cmake-3.11.1-Linux-x86_64.sh


# GNU compiler
RUN apt-get update -y && \
apt-get install -y --no-install-recommends software-properties-common && \
apt-add-repository ppa:ubuntu-toolchain-r/test -y && \
apt-get update -y && \
apt-get install -y --no-install-recommends \
gcc-7 \
g++-7 \
gfortran-7 && \
rm -rf /var/lib/apt/lists/*

RUN update-alternatives --install /usr/bin/gcc gcc $(which gcc-7) 30 && \
update-alternatives --install /usr/bin/g++ g++ $(which g++-7) 30 && \
update-alternatives --install /usr/bin/gfortran gfortran $(which gfortran-7) 30

# LLVM compiler
RUN apt-get update -y && \
apt-get install -y --no-install-recommends \
clang-6.0 && \
rm -rf /var/lib/apt/lists/*
RUN update-alternatives --install /usr/bin/clang clang $(which clang-6.0) 30 && \
update-alternatives --install /usr/bin/clang++ clang++ $(which clang++-6.0) 30

RUN apt-get update -y && \
apt-get install -y --no-install-recommends \
libomp-dev && \
rm -rf /var/lib/apt/lists/*


# sed --in-place=.rocm-backup 's|^\(PATH=.*\)"$|\1:/opt/rocm/bin"|' /etc/environment

USER root
WORKDIR /root
ENV PATH "${PATH}:/opt/rocm/bin"

# The following are optional enhancements for the command-line experience
# Uncomment the following to install a pre-configured vim environment based on http://vim.spf13.com/
# 1. Sets up an enhanced command line dev environment within VIM
# 2. Aliases GDB to enable TUI mode by default
#RUN curl -sL https://j.mp/spf13-vim3 | bash && \
# echo "alias gdb='gdb --tui'\n" >> ~/.bashrc

# Default to a login shell
CMD ["bash", "-l"]
Loading