Skip to content

Commit

Permalink
update CI docker images
Browse files Browse the repository at this point in the history
  • Loading branch information
sekelle committed Dec 29, 2024
1 parent 61a5aa9 commit bcea51f
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 299 deletions.
164 changes: 10 additions & 154 deletions .gitlab/Dockerfile_1
Original file line number Diff line number Diff line change
@@ -1,172 +1,28 @@
FROM docker.io/nvidia/cuda:11.8.0-base-ubuntu22.04
FROM docker.io/nvidia/cuda:12.3.0-devel-ubuntu22.04

# {{{ readme
# ubjg:
# cd /tmp2/JG/ascent/
# sudo docker build -f Dockerfile_1 -t deleteme:latest .
# push to jfrog (buildah):
# # check src dir
# # scp [email protected]:...
# salloc -N1 -C'gpu&contbuild' -A`id -gn` -t1:0:0
# ssh $SLURM_NODELIST
# module load daint-gpu Buildah/1.26.1
# buildah bud --format=docker --tag sph-exa_base:cuda -f Dockerfile_1 .
# # TODO stop using art.cscs.ch, use jfrog.svc.cscs.ch:
# buildah login -u $USER art.cscs.ch
# buildah push sph-exa_base:cuda docker://art.cscs.ch/contbuild/testing/jg/sph-exa_base:cuda
# #buildah pull art.cscs.ch/contbuild/testing/jg/sph-exa_base:cuda
# buildah login -u $USER jfrog.svc.cscs.ch
# buildah push sph-exa_base:cuda docker://jfrog.svc.cscs.ch/contbuild/testing/pasc/sphexa/sph-exa_base:cuda
# # --> test with: hpctools.git/reframechecks/containers/reframe_ci.py
# push to dockerhub:
# sudo docker login -u sphexa
# sudo docker tag deleteme:latest sphexa/ascent:latest
# sudo docker push sphexa/ascent:latest
# }}}

#{{{ variables:
ENV TZ Europe/Zurich
ENV DEPS_PATH 'ftp://ftp.cscs.ch/out/jgp/hpc/containers'
#}}}

#{{{ apt:
# clang-12 libomp-12-dev \
RUN sed -i '[email protected]@ubuntu.ethz.ch@' /etc/apt/sources.list \
&& apt update --quiet \
&& apt upgrade -y --quiet \
&& echo "## apt:" \
&& DEBIAN_FRONTEND=noninteractive \
apt install -y --no-install-recommends \
libtbb-dev zlib1g-dev git file wget vim-tiny \
git file wget vim-tiny pkg-config mpich libhdf5-mpich-dev cmake libgtest-dev \
python-is-python3 python3-pip libpython3-dev python3-numpy python3-matplotlib \
cuda-nvcc-11-8 libcublas-dev-11-8 pkg-config \
&& apt clean autoremove

#{{{ apt
# RUN apt-get update \
# && apt-get install -y sudo
# # add a new user
# RUN adduser docker-nemo --gecos "Docker Nemo,1,0000,0001" --disabled-password
# RUN echo "docker-nemo:password" | chpasswd \
# && usermod -aG sudo docker-nemo
# # update and install dependencies
# RUN apt-get install -y \
# software-properties-common \
# wget \
# locate \
# && add-apt-repository -y ppa:ubuntu-toolchain-r/test \
# && apt-get update \
# && apt-get install -y \
# make \
# git \
# curl \
# vim \
# && apt-get install -y cmake \
# && apt-get install -y \
# gcc \
# g++ \
# gfortran
#}}}
#}}}

#{{{ src:
# wget https://github.com/Kitware/CMake/releases/download/v3.24.0/cmake-3.24.0-linux-x86_64.tar.gz
# wget https://support.hdfgroup.org/ftp/HDF5/releases/hdf5-1.13/hdf5-1.13.2/src/hdf5-1.13.2.tar.bz2
# wget https://www.mpich.org/static/downloads/3.1.4/mpich-3.1.4.tar.gz
# wget https://github.com/google/googletest/archive/refs/tags/release-1.12.1.tar.gz
# COPY src/cmake-3.24.0-linux-x86_64.tar.gz /usr/local/games/
# COPY src/hdf5-1.13.2.tar.bz2 /usr/local/games/
# COPY src/mpich-3.1.4.tar.gz /usr/local/games/
# COPY src/release-1.12.1.tar.gz /usr/local/games/
# insitu:
# COPY src/ascent-v0.8.0-src-with-blt.tar.gz /usr/local/games/
# COPY src/conduit-v0.8.3-src-with-blt.tar.gz /usr/local/games/
# COPY src/v0.8.1.tar.gz /usr/local/games/
# COPY src/v1.7.1.tar.gz /usr/local/games/
# COPY src/v0.5.1.tar.gz /usr/local/games/
# = https://github.com/LLNL/blt/archive/refs/tags/v0.5.1.tar.gz
# TODO: glass.h5

RUN echo \
&& echo "## wget:" \
&& cd /usr/local/games \
&& wget --quiet $DEPS_PATH/c/CMake/cmake-3.24.0-linux-x86_64.tar.gz \
&& wget --quiet $DEPS_PATH/m/MPICH/mpich-3.1.4.tar.gz \
&& wget --quiet $DEPS_PATH/h/hdf5/hdf5-1.13.2.tar.bz2 \
&& wget --quiet $DEPS_PATH/g/googletest/release-1.12.1.tar.gz \
&& wget --quiet $DEPS_PATH/in/glass.h5
#}}}

#{{{ cmake:
RUN echo \
&& echo "## cmake:" \
&& export VV=3.24.0 VVshort=3.24 \
&& cd /usr/local/games \
&& tar xf cmake-$VV-linux-x86_64.tar.gz \
&& cp -a cmake-$VV-linux-x86_64/bin/* /usr/bin/ \
&& cp -a cmake-$VV-linux-x86_64/share/cmake-$VVshort /usr/share/cmake-$VVshort \
&& rm -fr cmake-$VV-linux-x86_64.tar.gz cmake-$VV-linux-x86_64/bin/cmake-gui
#}}}

#{{{ mpich:
RUN echo \
&& echo "## mpich:" \
&& cd /usr/local/games \
&& tar xf mpich-3.1.4.tar.gz \
&& cd mpich-3.1.4/ \
&& ./configure --prefix=/usr --enable-fortran=no > /dev/null \
&& make --quiet -j `grep processor /proc/cpuinfo | wc -l` install > /dev/null \
&& cd /usr/local/games \
&& rm -fr mpich-3.1.4 mpich-3.1.4.tar.gz \
&& ldconfig
#}}}

#{{{ hdf5:
RUN echo \
&& echo "## hdf5:" \
&& export VV=1.13.2 \
&& cd /usr/local/games \
&& tar xf hdf5-$VV.tar.bz2 \
&& cmake \
-DCMAKE_C_COMPILER:STRING=mpicc \
-DCMAKE_C_FLAGS:STRING=-w \
-DONLY_SHARED_LIBS:BOOL=ON \
-DHDF5_BUILD_HL_LIB:BOOL=ON \
-DHDF5_ENABLE_Z_LIB_SUPPORT:BOOL=ON \
-DBUILD_SHARED_LIBS:BOOL=ON \
-DHDF5_ENABLE_PARALLEL:BOOL=ON \
-DHDF5_BUILD_TOOLS:BOOL=OFF \
-DBUILD_STATIC_LIBS=OFF \
-DHDF5_BUILD_EXAMPLES:BOOL=OFF \
-DBUILD_TESTING:BOOL=OFF \
-DHDF5_ENABLE_SZIP_SUPPORT:BOOL=OFF \
-DHDF5_ENABLE_SZIP_ENCODING:BOOL=OFF \
-DHDF5_ENABLE_THREADSAFE:BOOL=OFF \
-DHDF5_BUILD_CPP_LIB:BOOL=OFF \
-DHDF5_BUILD_FORTRAN:BOOL=OFF \
-DHDF5_BUILD_JAVA:BOOL=OFF \
-S hdf5-$VV -B build-hdf5 > /dev/null \
&& cmake --build build-hdf5 -t install -j \
&& cd /usr/local/games \
&& rm -fr hdf5-$VV.tar.bz2 hdf5-$VV build-hdf5
#ln -fs /usr/lib/x86_64-linux-gnu/libdl.so.2 /usr/lib/x86_64-linux-gnu/libdl.so
#ln -fs /usr/lib/x86_64-linux-gnu/libpthread.so.0 /usr/lib/x86_64-linux-gnu/libpthread.so
#}}}
#RUN echo \
# && echo "## wget:" \
# && cd /usr/local/games \
# && wget --quiet $DEPS_PATH/c/CMake/cmake-3.24.0-linux-x86_64.tar.gz \
# && wget --quiet $DEPS_PATH/m/MPICH/mpich-3.1.4.tar.gz \
# && wget --quiet $DEPS_PATH/h/hdf5/hdf5-1.13.2.tar.bz2 \
# && wget --quiet $DEPS_PATH/g/googletest/release-1.12.1.tar.gz \
# && wget --quiet $DEPS_PATH/in/glass.h5

#{{{ googletest:
RUN echo \
&& echo "## googletest:" \
&& cd /usr/local/games \
&& export VV=1.12.1 \
&& tar xf release-$VV.tar.gz \
&& rm -f release-$VV.tar.gz
#}}}

#{{{ analytical_solutions:
RUN echo \
&& echo "## analytical_solutions + reframe:" \
&& pip install ReFrame-HPC h5py matplotlib
#}}}

#{{{ next step: Dockerfile_2
#}}}
145 changes: 1 addition & 144 deletions .gitlab/Dockerfile_2
Original file line number Diff line number Diff line change
@@ -1,88 +1,8 @@
ARG BASE_IMAGE
FROM $BASE_IMAGE
#{{{ readme
# sarus pull --login jfrog.svc.cscs.ch/docker-ci-ext/44692846847247/base/sph-exa_base-cuda:c527c05af50cc172
# --> /scratch/snx3000tds/piccinal/.sarus/images/jfrog.svc.cscs.ch/docker-ci-ext/44692846847247/base/sph-exa_base-cuda/c527c05af50cc172.meta

# buildah login -u piccinal jfrog.svc.cscs.ch
# buildah pull jfrog.svc.cscs.ch/docker-ci-ext/44692846847247/base/sph-exa_base-cuda:c527c05af50cc172
#
# rm -fr SPH-EXA.git ;cp -a SPH-EXA.git.ori SPH-EXA.git
# sudo docker build -f Dockerfile_2 -t deleteme:latest .
# sudo docker login -u piccinal jfrog.svc.cscs.ch
# Error response from daemon: Get "https://jfrog.svc.cscs.ch/v2/": net/http:
# request canceled while waiting for connection (Client.Timeout exceeded while
# awaiting headers)
#
#{{{ built on dom with:
# buildah bud --volume $PWD/SPH-EXA.git:/usr/local/games/SPH-EXA.git \
# --format=docker -f Dockerfile_install \
# --tag sph-exa_install:cuda_debug-gpud .
#
# CMAKE_BUILD_TYPE=Debug + GPU_DIRECT=OFF sph-exa_install:cuda_debug-gpud
# CMAKE_BUILD_TYPE=Release + GPU_DIRECT=OFF sph-exa_install:cuda_release-gpud
# CMAKE_BUILD_TYPE=Debug + GPU_DIRECT=ON sph-exa_install:cuda_debug_plus_gpud
# CMAKE_BUILD_TYPE=Release + GPU_DIRECT=ON sph-exa_install:cuda_release_plus_gpud
# buildah push sph-exa_install:cuda docker://art.cscs.ch/contbuild/testing/jg/sph-exa_install:cuda
#
# ART=docker://art.cscs.ch/contbuild/testing/jg/sph-exa_install
# buildah push localhost/sph-exa_install:cuda_release_plus_gpud $ART:cuda_release_plus_gpud
# buildah push localhost/sph-exa_install:cuda_debug_plus_gpud $ART:cuda_debug_plus_gpud
# buildah push localhost/sph-exa_install:cuda_release-gpud $ART:cuda_release-gpud
# buildah push localhost/sph-exa_install:cuda_debug-gpud $ART:cuda_debug-gpud
# -----------------
# mac:~/readme.containers
# FROM localhost/local:cuda
# base depends on: FROM nvidia/cuda:11.7.0-base-ubuntu20.04
#}}}
#{{{ sphexa:cuda
## debug with:
# buildah rm deleteme
# buildah from --name deleteme aa3d015969d4
# buildah run -t deleteme bash
# buildah tag 8a2921008544 local:cuda # -> FROM localhost/local:cuda
# buildah push localhost/local:cuda docker://art.cscs.ch/contbuild/testing/jg/sph-exa_base:cuda
#}}}
#}}}
#{{{ readme PR
# cd /scratch/snx3000tds/piccinal/reframe/stage/DEL/pr287
# git clone https://github.com/unibas-dmi-hpc/SPH-EXA SPH-EXA.git
# cd SPH-EXA.git ;gic hip-readiness;cd -
# salloc -N1 -C'gpu&contbuild' -A`id -gn` -t0:30:0
# ssh $SLURM_NODELIST
# module load daint-gpu Buildah/1.26.1
# ln -s /apps/common/UES/sandbox/jgp/hpctools.git/reframechecks/containers/Dockerfile_2
# uncomment "COPY SPH-EXA.git" below
# VV=sph-exa_build:pr287
# buildah bud --format=docker --tag $VV -f Dockerfile_2 .
# buildah images
# buildah login -u $USER jfrog.svc.cscs.ch
# buildah push $VV docker://jfrog.svc.cscs.ch/contbuild/testing/anfink/9590261141699040/pasc/sphexa/$VV
# echo VV=$VV
# logout/exit
# #then
# echo VV=$VV
# mll sarus/1.5.1 # sarus/1.4.2
# sarus pull --login jfrog.svc.cscs.ch/contbuild/testing/jg/$VV
# or
# sarus pull --login jfrog.svc.cscs.ch/contbuild/testing/anfink/9590261141699040/pasc/sphexa/$VV
# sarus images
# cd /apps/common/UES/sandbox/jgp/hpctools.git/reframechecks/containers/NEW
# source ~/myvenv_dom/bin/activate
# RFM_TRAP_JOB_ERRORS=1 ~/R -c reframe_ci.py \
# -S image='jfrog.svc.cscs.ch/contbuild/testing/jg/sph-exa_build' \
# -S build_type='pr289' -r
# #sarus run -t jfrog.svc.cscs.ch/contbuild/testing/jg/$VV
# # integration_mpi/exchange_halos_gpu
#}}}

ENV TZ Europe/Zurich
ENV PATH="${PATH}:/usr/local/cuda/bin"
ENV CMAKE_PREFIX_PATH="/usr/local/HDF_Group/HDF5/1.13.2/share/cmake:${CMAKE_PREFIX_PATH}"
# --mount type=bind,source=$PWD/SPH-EXA.git,target=/usr/local/games/SPH-EXA.git
# not needed in gitlab:
# COPY SPH-EXA.git /usr/local/games/SPH-EXA.git
# + TODO: ln -fs /sources/ SPH-EXA.git
COPY . /usr/local/games/SPH-EXA.git

#{{{ build
Expand All @@ -93,82 +13,19 @@ RUN echo \
&& nvcc --version \
&& cd /usr/local/games/SPH-EXA.git/ \
&& ls -la . \
&& export VV=/usr/local/games/googletest-release-1.12.1 \
&& sed -i "s@GIT_REPOSITORY@SOURCE_DIR $VV/\n#@" ./domain/cmake/setup_GTest.cmake \
&& sed -i "s@GIT_REPOSITORY@SOURCE_DIR $VV/\n#@" ./cmake/setup_GTest.cmake \
&& sed -i "s@GIT_REPOSITORY@SOURCE_DIR $VV/\n#@" ./ryoanji/cmake/setup_GTest.cmake \
&& sed -i "s@GIT_TAG@#GIT_TAG @" ./domain/cmake/setup_GTest.cmake \
&& sed -i "s@GIT_TAG@#GIT_TAG @" ./cmake/setup_GTest.cmake \
&& sed -i "s@GIT_TAG@#GIT_TAG @" ./ryoanji/cmake/setup_GTest.cmake \
&& cd /usr/local/games \
&& export CMAKE_PREFIX_PATH=/usr/local/HDF_Group/HDF5/1.13.2/cmake:$CMAKE_PREFIX_PATH \
&& cmake -S SPH-EXA.git -B build \
-DCMAKE_CXX_COMPILER=mpicxx \
-DCMAKE_C_COMPILER=mpicc \
-DBUILD_TESTING=ON \
-DBUILD_ANALYTICAL=ON \
-DSPH_EXA_WITH_H5PART=ON \
-DGPU_DIRECT=OFF \
-DCMAKE_CUDA_FLAGS='-arch=sm_60' \
-DCMAKE_CUDA_FLAGS='-arch=sm_60 -ccbin=mpicxx -std=c++20' \
-DCMAKE_BUILD_TYPE=Debug \
&& echo "## cmake --build + --install :" \
&& cmake --build build -j `grep processor /proc/cpuinfo | wc -l` \
&& cmake --install build \
&& cp SPH-EXA.git/.gitlab/rfm.py /usr/local/games/rfm.py \
&& ls /usr/local/sbin
# -DSPH_EXA_WITH_HIP=OFF \
# -DCMAKE_CXX_FLAGS_DEBUG="-g -w" \
# #
# -DGPU_DIRECT=OFF \
# -DCMAKE_BUILD_TYPE=Debug \
# #
# -DGPU_DIRECT=OFF \
# -DCMAKE_BUILD_TYPE=Release \
# #
# -DGPU_DIRECT=ON \
# -DCMAKE_BUILD_TYPE=Debug \
# #
# -DGPU_DIRECT=ON \
# -DCMAKE_BUILD_TYPE=Release \
#}}}

#del #{{{ test with:
#del #{{{ -> installed:
#del # -- Installing: /usr/local/sbin/coord_samples/coordinate_test
#del # -- Installing: /usr/local/sbin/integration_mpi/globaloctree
#del # -- Installing: /usr/local/sbin/integration_mpi/exchange_halos
#del # -- Installing: /usr/local/sbin/integration_mpi/box_mpi
#del # -- Installing: /usr/local/sbin/integration_mpi/exchange_focus
#del # -- Installing: /usr/local/sbin/integration_mpi/exchange_keys
#del # -- Installing: /usr/local/sbin/integration_mpi/focus_transfer
#del # -- Installing: /usr/local/sbin/integration_mpi/domain_2ranks
#del # -- Installing: /usr/local/sbin/integration_mpi/treedomain
#del # -- Installing: /usr/local/sbin/integration_mpi/exchange_general
#del # -- Installing: /usr/local/sbin/integration_mpi/exchange_domain
#del # -- Installing: /usr/local/sbin/integration_mpi/focus_tree
#del # -- Installing: /usr/local/sbin/integration_mpi/domain_nranks
#del # -- Installing: /usr/local/sbin/integration_mpi/exchange_halos_gpu
#del # -- Installing: /usr/local/sbin/performance/octree_perf
#del # -- Installing: /usr/local/sbin/performance/peers_perf
#del # -- Installing: /usr/local/sbin/performance/scan_perf
#del # -- Installing: /usr/local/sbin/performance/hilbert_perf
#del # -- Installing: /usr/local/sbin/performance/cudaNeighborsTest
#del # -- Installing: /usr/local/sbin/performance/octree_perf_gpu
#del # -- Installing: /usr/local/sbin/performance/hilbert_perf_gpu
#del # -- Installing: /usr/local/sbin/unit/component_units
#del # -- Installing: /usr/local/sbin/unit/component_units_omp
#del # -- Installing: /usr/local/sbin/unit_cuda/component_units_cuda
#del # -- Installing: /usr/local/sbin/ryoanji/ryoanji_demo/ryoanji_demo
#del # -- Installing: /usr/local/sbin/ryoanji/cpu_unit_tests/ryoanji_cpu_unit_tests
#del # -- Installing: /usr/local/sbin/ryoanji/unit_tests/ryoanji_unit_tests
#del # -- Installing: /usr/local/sbin/ryoanji/global_upsweep_cpu
#del # -- Installing: /usr/local/sbin/ryoanji/global_upsweep_gpu
#del # -- Installing: /usr/local/sbin/hydro/kernel_tests_std
#del # -- Installing: /usr/local/sbin/hydro/kernel_tests_ve
#del # -- Installing: /usr/local/bin/sphexa
#del # -- Installing: /usr/local/bin/sphexa-cuda
#del # -- Installing: /usr/local/bin/sedov_solution
#del # -- Installing: /usr/local/bin/compare_solutions.py
#del # -- Installing: /usr/local/bin/compare_noh.py
#del #}}}
#del #}}}
1 change: 0 additions & 1 deletion ryoanji/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ add_executable(${testname}
target_compile_options(${testname} PRIVATE -Wall -Wextra -Wno-unknown-pragmas)
target_include_directories(${testname} PRIVATE ${RYOANJI_TEST_INCLUDE_DIRS})
target_link_libraries(${testname} PRIVATE GTest::gtest_main OpenMP::OpenMP_CXX)
target_link_libraries(${testname} PRIVATE GTest::gmock_main OpenMP::OpenMP_CXX)
add_test(NAME ${testname} COMMAND ryoanji_cpu_unit_tests)
install(TARGETS ${testname} RUNTIME DESTINATION ${CMAKE_INSTALL_SBINDIR}/ryoanji/cpu_unit_tests)

Expand Down

0 comments on commit bcea51f

Please sign in to comment.