diff --git a/.gitmodules b/.gitmodules index 5c44019564397a2a554e435bbe222fc45358b94f..39d8dd173088fb66dd6cfb5bbe08f7bf2dcb0778 100644 --- a/.gitmodules +++ b/.gitmodules @@ -7,3 +7,6 @@ [submodule "python/pybind11"] path = python/pybind11 url = https://github.com/pybind/pybind11.git +[submodule "ci"] + path = ci + url = https://gitlab.com/cscs-ci/arbor-sim/arbor-ci.git diff --git a/README.md b/README.md index 58c79241565f6449c00f976974a6b7165e946d57..f626422887140d1e71651eb978176810576b92c2 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -[](https://gitpod.io/#https://github.com/arbor-sim/arbor) +[](https://gitlab.com/cscs-ci/arbor-sim/arbor/-/commits/master) [](https://gitpod.io/#https://github.com/arbor-sim/arbor) # Arbor Library diff --git a/bors.toml b/bors.toml new file mode 100644 index 0000000000000000000000000000000000000000..adceaa7a5accd3c9d5f69afa2cbf83328f02950a --- /dev/null +++ b/bors.toml @@ -0,0 +1,4 @@ +status = [ + "ci/gitlab/%", +] +delete_merged_branches = true diff --git a/ci b/ci new file mode 160000 index 0000000000000000000000000000000000000000..042c9ed94a681cbaf2b2d1fcae4b9942cdb2f720 --- /dev/null +++ b/ci @@ -0,0 +1 @@ +Subproject commit 042c9ed94a681cbaf2b2d1fcae4b9942cdb2f720 diff --git a/docker/build-env/Dockerfile b/docker/build-env/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..873f17686ea287f0217041dbf41a8b8a4b345d50 --- /dev/null +++ b/docker/build-env/Dockerfile @@ -0,0 +1,32 @@ +FROM nvidia/cuda:10.1-devel-ubuntu18.04 + +WORKDIR /root + +ARG MPICH_VERSION=3.1.4 + +ENV DEBIAN_FRONTEND noninteractive +ENV FORCE_UNSAFE_CONFIGURE 1 +ENV MPICH_VERSION ${MPICH_VERSION} + +# Install basic tools +RUN apt-get update -qq && apt-get install -qq -y --no-install-recommends \ + build-essential \ + python \ + git tar wget curl && \ + rm -rf /var/lib/apt/lists/* + +# Install cmake +RUN wget -qO- "https://cmake.org/files/v3.17/cmake-3.17.0-Linux-x86_64.tar.gz" | tar --strip-components=1 -xz -C /usr/local + +# Install MPICH ABI compatible with Cray's lib on Piz Daint +RUN wget -q https://www.mpich.org/static/downloads/${MPICH_VERSION}/mpich-${MPICH_VERSION}.tar.gz && \ + tar -xzf mpich-${MPICH_VERSION}.tar.gz && \ + cd mpich-${MPICH_VERSION} && \ + ./configure --disable-fortran && \ + make install -j$(nproc) && \ + rm -rf mpich-${MPICH_VERSION}.tar.gz mpich-${MPICH_VERSION} + +# Install bundle tooling for creating small Docker images +RUN wget -q https://github.com/haampie/libtree/releases/download/v1.0.3/libtree_x86_64.tar.gz && \ + tar -xzf libtree_x86_64.tar.gz && \ + rm libtree_x86_64.tar.gz diff --git a/docker/deploy/Dockerfile b/docker/deploy/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..6b1da7ee433c3efbc8a5ba7af70dec56f9b1608c --- /dev/null +++ b/docker/deploy/Dockerfile @@ -0,0 +1,48 @@ +# Multistage build: here we import the current source code +# into build environment image, build the project, bundle it +# and then extract it into a small image that just contains +# the binaries we need to run + +ARG BUILD_ENV + +FROM $BUILD_ENV as builder + +# Build arbor +COPY . /arbor + +# Build and bundle binaries +RUN mkdir /arbor/build && cd /arbor/build && \ + CC=mpicc CXX=mpicxx cmake .. \ + -DARB_VECTORIZE=ON \ + -DARB_ARCH=broadwell \ + -DARB_WITH_PYTHON=OFF \ + -DARB_WITH_MPI=ON \ + -DARB_WITH_GPU=ON \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_INSTALL_PREFIX=/usr && \ + make -j$(nproc) tests && \ + /root/libtree/libtree --chrpath --strip \ + -d /root/arbor.bundle \ + /arbor/build/bin/modcc \ + /arbor/build/bin/unit \ + /arbor/build/bin/unit-local \ + /arbor/build/bin/unit-modcc \ + /arbor/build/bin/unit-mpi && \ + rm -rf /arbor + +FROM ubuntu:18.04 + +# This is the only thing necessary really from nvidia/cuda's ubuntu18.04 runtime image +ENV NVIDIA_VISIBLE_DEVICES all +ENV NVIDIA_DRIVER_CAPABILITIES compute,utility +ENV NVIDIA_REQUIRE_CUDA "cuda>=10.1 brand=tesla,driver>=384,driver<385 brand=tesla,driver>=396,driver<397 brand=tesla,driver>=410,driver<411" + +COPY --from=builder /root/arbor.bundle /root/arbor.bundle + +# Make it easy to call our binaries. +ENV PATH="/root/arbor.bundle/usr/bin:$PATH" + +RUN echo "/root/arbor.bundle/usr/lib/" > /etc/ld.so.conf.d/arbor.conf && ldconfig + +WORKDIR /root/arbor.bundle/usr/bin +