forked from QMCPACK/qmcpack
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add docker tests for spack build centos image (QMCPACK#4404)
* add docker tests for spack build centos image * change os to ubuntu, githubrunners have a limited list of supported os's * debug output path * update path and lib path * syntax errror * update env variable mapping * forgot to update variable name in runs script * migrate version to gcc11, remove gcc-toolset * update job names, add missing PATH path * update build scripts to account for new cases of cmake * update actual job names, not just matrix * add /opt/view/lib to library path to access spack libraries * syntax error in runscript * added includes from spack * export fftw_home to help find fftw * try to add include folder through cxxflags * remove cxxflags, manually specify libxml vars * use libxml_root instead * add hdf5 root * add boost root * update binutils to version compatible with gcc11 * added rsync to image, apparently missing * * try running tests with +binutils build spack container * syntax error * syntax error * add back glib fix * Revert "add back glib fix" This reverts commit b61ed0b. * Revert "syntax error" This reverts commit 4794104. * Revert "syntax error" This reverts commit 493f2f6. * Revert "* try running tests with +binutils build spack container" This reverts commit 1390eeb.
- Loading branch information
Showing
3 changed files
with
166 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
# Build stage with Spack pre-installed and ready to be used | ||
FROM spack/centos-stream as builder | ||
|
||
|
||
# What we want to install and how we want to install it | ||
# is specified in a manifest file (spack.yaml) | ||
|
||
RUN which tar | ||
RUN tar -cf tarfilename.tar -T /dev/null | ||
|
||
RUN spack install [email protected] | ||
RUN spack load [email protected] | ||
RUN spack compiler add $(spack location -i [email protected]) | ||
RUN spack compilers | ||
|
||
RUN yum install texinfo -y | ||
|
||
RUN mkdir /opt/spack-environment \ | ||
&& export gcc_vnew=11.3.0\ | ||
&& export cmake_vnew=3.24.2 \ | ||
&& export libxml2_v=2.9.13 \ | ||
&& export boost_vnew=1.79.0 \ | ||
&& export hdf5_vnew=1.12.2 \ | ||
&& export fftw_vnew=3.3.10 \ | ||
&& (echo "spack:" \ | ||
&& echo " specs:" \ | ||
&& echo " - gcc@${gcc_vnew}%gcc@${gcc_vnew}" \ | ||
&& echo " - texinfo" \ | ||
&& echo " - binutils" \ | ||
&& echo " - git" \ | ||
&& echo " - ninja" \ | ||
&& echo " - cmake@${cmake_vnew}" \ | ||
&& echo " - libxml2@${libxml2_v}%gcc@${gcc_vnew}" \ | ||
&& echo " - boost@${boost_vnew}%gcc@${gcc_vnew}" \ | ||
&& echo " - util-linux-uuid%gcc@${gcc_vnew}" \ | ||
&& echo " - python%gcc@${gcc_vnew}" \ | ||
&& echo " - hdf5@${hdf5_vnew}%gcc@${gcc_vnew} +fortran +hl ~mpi" \ | ||
&& echo " - fftw@${fftw_vnew}%gcc@${gcc_vnew} -mpi" \ | ||
&& echo " - openblas%gcc@${gcc_vnew} threads=openmp" \ | ||
&& echo " - py-lxml" \ | ||
&& echo " - py-matplotlib" \ | ||
&& echo " - py-pandas" \ | ||
&& echo " - py-scipy" \ | ||
&& echo " - py-h5py ^hdf5@${hdf5_vnew}%gcc@${gcc_vnew} +fortran +hl ~mpi" \ | ||
&& echo " concretizer:" \ | ||
&& echo " unify: true" \ | ||
&& echo " config:" \ | ||
&& echo " install_tree: /opt/software" \ | ||
&& echo " build_stage:" \ | ||
&& echo " - $HOME" \ | ||
&& echo " view: /opt/view") > /opt/spack-environment/spack.yaml | ||
|
||
|
||
# Install the software, remove unnecessary deps | ||
RUN cd /opt/spack-environment && spack env activate . && spack install --fail-fast && spack gc -y | ||
|
||
# Strip all the binaries | ||
RUN find -L /opt/view/* -type f -exec readlink -f '{}' \; | \ | ||
xargs file -i | \ | ||
grep 'charset=binary' | \ | ||
grep 'x-executable\|x-archive\|x-sharedlib' | \ | ||
awk -F: '{print $1}' | xargs strip -s | ||
|
||
# Modifications to the environment that are necessary to run | ||
RUN cd /opt/spack-environment && \ | ||
spack env activate --sh -d . >> /etc/profile.d/z10_spack_environment.sh | ||
|
||
# Bare OS image to run the installed executables | ||
FROM quay.io/centos/centos:stream | ||
|
||
COPY --from=builder /opt/spack-environment /opt/spack-environment | ||
COPY --from=builder /opt/software /opt/software | ||
COPY --from=builder /opt/._view /opt/._view | ||
COPY --from=builder /opt/view /opt/view | ||
COPY --from=builder /etc/profile.d/z10_spack_environment.sh /etc/profile.d/z10_spack_environment.sh | ||
|
||
# building from source is missing ld (the linker) | ||
RUN yum install -y gcc-toolset-11-binutils | ||
RUN yum install -y rsync | ||
RUN export PATH=/opt/rh/gcc-toolset-11/root/bin/:$PATH | ||
RUN yum install -y libgcc.i686 glibc-devel.i686 libstdc++-devel.i686 | ||
RUN ranlib /opt/view/lib/gcc/x86_64-pc-linux-gnu/11.3.0/libgcc.a | ||
|
||
ENTRYPOINT ["/bin/bash", "--rcfile", "/etc/profile", "-l", "-c", "$*", "--" ] | ||
CMD [ "/bin/bash" ] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters