@@ -15,7 +15,18 @@ RUN yum install -y \
1515 ca-certificates \
1616 curl \
1717 python3 \
18- zlib-devel
18+ zlib-devel \
19+ # Additional spack dependencies
20+ python3-pip \
21+ pkgconfig \
22+ # xz \
23+ unzip \
24+ bzip2 \
25+ && pip3 install virtualenv
26+
27+ # Install clingo for Spack
28+ RUN python3 -m pip install --upgrade pip && \
29+ python3 -m pip install clingo
1930
2031RUN --mount=src=.,dst=$SRC_DIR $SRC_DIR/docker/install-cmake.sh
2132
@@ -29,19 +40,50 @@ RUN yum install -y \
2940 file \
3041 bison \
3142 flex \
32- patch
43+ patch \
44+ # `ca-certificates` needed by `git` to download GEOS repo.
45+ ca-certificates \
46+ autoconf \
47+ automake \
48+ git
3349
34- ARG HOST_CONFIG
50+ # Clone branch with spack configs
51+ # TODO decide landing place of spack recipes
52+ RUN git clone --branch feature/han12/wip_docker_spack_recipes \
53+ --depth 1 \
54+ --single-branch \
55+ https://github.com/GEOS-DEV/GEOS.git
3556
36- RUN --mount=src=.,dst=$SRC_DIR $SRC_DIR/docker/configure-tpl.sh
37- WORKDIR $BLD_DIR
38- RUN --mount=src=.,dst=$SRC_DIR make
57+ # Run uberenv
58+ # Have to create install directory first for uberenv
59+ # -k flag is to ignore SSL errors
60+ # Remove generated host-config for lvarray
61+ RUN --mount=src=.,dst=$SRC_DIR cd GEOS && \
62+ mkdir -p ${GEOSX_TPL_DIR} && \
63+ git submodule init scripts/uberenv && \
64+ git submodule update && \
65+ ./scripts/uberenv/uberenv.py \
66+ --spec "%gcc@8.3.0~pygeosx" \
67+ --spack-env-file=${SRC_DIR}/docker/total-spack.yaml \
68+ --project-json=.uberenv_config.json \
69+ --prefix ${GEOSX_TPL_DIR} \
70+ -k && \
71+ # Remove host-config generated for LvArray
72+ rm lvarray* && \
73+ # Rename and copy spack-generated host-config to root directory
74+ cp *.cmake /spack-generated.cmake && \
75+ # Remove extraneous spack files
76+ cd ${GEOSX_TPL_DIR} && \
77+ rm -rf bin/ build_stage/ misc_cache/ spack/ spack-env/ .spack-db/
3978
4079FROM tpl_toolchain_intersect_geosx_toolchain AS geosx_toolchain
4180ARG SRC_DIR
4281
4382COPY --from=tpl_toolchain $GEOSX_TPL_DIR $GEOSX_TPL_DIR
4483
84+ # Extract the generated host-config
85+ COPY --from=tpl_toolchain /spack-generated.cmake /
86+
4587RUN yum -y install \
4688 openssh-clients \
4789 ca-certificates \
0 commit comments