-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use Sarus for containerized tests of Dawn.
- Loading branch information
Showing
15 changed files
with
312 additions
and
440 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,45 +1,16 @@ | ||
version: 2 | ||
jobs: | ||
dawn: | ||
docker: | ||
- image: jdahm/dawn-gcc9-env | ||
steps: | ||
- checkout: | ||
path: /usr/src/dawn | ||
- run: | ||
name: Dawn configure | ||
command: | | ||
cmake -S /usr/src/dawn/dawn -B /usr/src/dawn/dawn/build \ | ||
-DBUILD_TESTING=ON \ | ||
-DCMAKE_PREFIX_PATH=/usr/lib/llvm-9 \ | ||
-DCMAKE_INSTALL_PREFIX=/usr/local \ | ||
-GNinja | ||
# Compile and install needs to be one step because generated proto files | ||
# in the build directory are otherwise not installed. | ||
- run: | ||
name: Dawn compile and install | ||
command: cmake --build /usr/src/dawn/dawn/build -j $(nproc) --target install | ||
- run: | ||
name: Dawn python module | ||
command: python -m pip install -e /usr/src/dawn/dawn | ||
- run: | ||
name: Dawn tests | ||
working_directory: /usr/src/dawn/dawn/build | ||
command: ctest -j$(nproc) --progress --output-on-failure | ||
- run: | ||
name: GTClang configure | ||
command: | | ||
cmake -S /usr/src/dawn/gtclang -B /usr/src/dawn/gtclang/build \ | ||
-DBUILD_TESTING=ON \ | ||
-DDawn_DIR=/usr/local/lib/cmake/Dawn \ | ||
-DGridTools_DIR=/usr/local/lib/cmake \ | ||
-DCMAKE_PREFIX_PATH=/usr/lib/llvm-9 \ | ||
-DCMAKE_INSTALL_PREFIX=/usr/local \ | ||
-GNinja | ||
- run: | ||
name: GTClang compile and install | ||
command: cmake --build /usr/src/dawn/gtclang/build -j $(nproc) --target install | ||
- run: | ||
name: GTClang tests | ||
working_directory: /usr/src/dawn/dawn/build | ||
command: ctest -j$(nproc) --progress | ||
dawn: | ||
docker: | ||
- image: gtclang/dawn-env-ubuntu19.10 | ||
steps: | ||
- checkout: | ||
path: /usr/src/dawn | ||
- run: | ||
name: Dawn configure | ||
command: | | ||
/usr/src/dawn/scripts/build-and-test \ | ||
--dawn-install-dir /usr/local/dawn \ | ||
--parallel $(nproc) \ | ||
--docker-env \ | ||
-DCMAKE_BUILD_TYPE=Debug |
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 |
---|---|---|
@@ -1,54 +1,11 @@ | ||
FROM ubuntu:eoan AS dawn-gcc9-base-env | ||
RUN apt update && apt install -y \ | ||
build-essential ninja-build cmake \ | ||
llvm-9-dev libclang-9-dev \ | ||
python3 python3-pip libpython-dev \ | ||
python3-setuptools python3-wheel \ | ||
libboost-dev git curl && apt clean | ||
RUN python3 -m pip install --upgrade pip | ||
RUN update-alternatives --install /usr/bin/python python /usr/bin/python3 10 | ||
|
||
FROM dawn-gcc9-base-env AS dawn-gcc9-env | ||
RUN curl -L https://github.com/protocolbuffers/protobuf/releases/download/v3.10.1/protobuf-all-3.10.1.tar.gz | \ | ||
tar -xz -C /usr/src | ||
RUN mkdir -p /usr/src/protobuf-3.10.1/build | ||
RUN cmake -S /usr/src/protobuf-3.10.1/cmake -B /usr/src/protobuf-3.10.1/build \ | ||
-Dprotobuf_BUILD_EXAMPLES=OFF \ | ||
-Dprotobuf_BUILD_TESTS=OFF \ | ||
-Dprotobuf_INSTALL_EXAMPLES=OFF \ | ||
-Dprotobuf_BUILD_PROTOC_BINARIES=ON \ | ||
-DCMAKE_BUILD_TYPE=Release \ | ||
-DCMAKE_INSTALL_PREFIX=/usr/local \ | ||
-DBUILD_SHARED_LIBS=ON \ | ||
-GNinja | ||
RUN cmake --build /usr/src/protobuf-3.10.1/build --target install -j $(nproc) | ||
RUN rm -rf /usr/src/protobuf-3.10.1/build | ||
RUN cd /usr/src/protobuf-3.10.1/python && python setup.py build | ||
RUN mv /usr/src/protobuf-3.10.1/python/build/lib/google /usr/local/lib/google | ||
RUN curl -L https://github.com/GridTools/gridtools/archive/v1.0.4.tar.gz | \ | ||
tar -xz -C /usr/src | ||
RUN mkdir -p /usr/src/gridtools-1.0.4/build | ||
RUN cmake -S /usr/src/gridtools-1.0.4 -B /usr/src/gridtools-1.0.4/build \ | ||
-DBUILD_TESTING=OFF \ | ||
-DINSTALL_TOOLS=OFF \ | ||
-DGT_INSTALL_EXAMPLES=OFF \ | ||
-DCMAKE_BUILD_TYPE=Release \ | ||
-DCMAKE_INSTALL_PREFIX=/usr/local \ | ||
-GNinja | ||
RUN cmake --build /usr/src/gridtools-1.0.4/build -j $(nproc) --target install | ||
RUN rm -rf /usr/src/gridtools-1.0.4/build | ||
|
||
FROM dawn-gcc9-env AS dawn-gcc9 | ||
# IMAGE needs be be set to one of the docker/dawn-env.dockerfile images | ||
ARG IMAGE=gtclang/dawn-env-ubuntu19.10 | ||
FROM $IMAGE | ||
ARG BUILD_TYPE=Release | ||
COPY . /usr/src/dawn | ||
RUN mkdir -p /usr/src/dawn/build | ||
RUN cmake -S /usr/src/dawn -B /usr/src/dawn/build \ | ||
-DBUILD_TESTING=ON \ | ||
-DCMAKE_PREFIX_PATH=/usr/lib/llvm-9 \ | ||
-DCMAKE_INSTALL_PREFIX=/usr/local \ | ||
-DGridTools_DIR=/usr/local/lib/cmake \ | ||
-DPROTOBUF_PYTHON_DIR=/usr/local/lib/python3.7/dist-packages \ | ||
-GNinja | ||
RUN cmake --build /usr/src/dawn/build -j $(nproc) --target install | ||
RUN python -m pip install -e /usr/src/dawn/dawn | ||
RUN cd /usr/src/dawn/build && ctest -j$(nproc) --progress --output-on-failure | ||
RUN rm -rf /usr/src/dawn/build | ||
RUN /usr/src/dawn/scripts/build-and-test \ | ||
--dawn-install-dir /usr/local/dawn \ | ||
--parallel $(nproc) \ | ||
--docker-env \ | ||
-DCMAKE_BUILD_TYPE=$BUILD_TYPE | ||
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
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,25 @@ | ||
FROM nvcr.io/nvidia/cuda:10.1-devel-ubuntu18.04 | ||
RUN apt update && apt install -y --no-install-recommends \ | ||
apt-transport-https ca-certificates \ | ||
gnupg software-properties-common curl && apt clean | ||
# Add CMake repo | ||
RUN curl -L https://apt.kitware.com/keys/kitware-archive-latest.asc | apt-key add - | ||
RUN apt-add-repository 'deb https://apt.kitware.com/ubuntu/ bionic main' | ||
RUN apt-add-repository 'deb https://apt.kitware.com/ubuntu/ bionic-rc main' | ||
RUN apt-key --keyring /etc/apt/trusted.gpg del C1F34CDD40CD72DA | ||
# Add new toolchain repo | ||
RUN add-apt-repository ppa:ubuntu-toolchain-r/test | ||
# Install dependencies | ||
RUN apt update && apt install -y --no-install-recommends \ | ||
build-essential openssh-client git \ | ||
kitware-archive-keyring cmake ninja-build \ | ||
gcc-8 g++-8 \ | ||
llvm-9-dev libclang-9-dev \ | ||
python3 libpython3-dev python3-pip python3-setuptools python3-wheel \ | ||
libboost-dev && apt clean | ||
RUN python3 -m pip install --upgrade pip | ||
# Set defaults | ||
RUN update-alternatives --install /usr/bin/python python /usr/bin/python3 10 | ||
RUN update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-8 90 \ | ||
--slave /usr/bin/g++ g++ /usr/bin/g++-8 \ | ||
--slave /usr/bin/gcov gcov /usr/bin/gcov-8 |
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,65 @@ | ||
# IMAGE needs to be an image that already has the following dependencies: | ||
# - cmake & ninja | ||
# - llvm & clang | ||
# - python3: pip, setuptools, wheel | ||
# - boost | ||
ARG IMAGE | ||
FROM $IMAGE | ||
# ---------------------- ECBuild ---------------------- | ||
RUN curl -L https://github.com/ecmwf/ecbuild/archive/3.3.0.tar.gz | \ | ||
tar -xz -C /usr/src | ||
ENV ECBUILD_BIN /usr/src/ecbuild-3.3.0/bin/ecbuild | ||
# ---------------------- ECKit ---------------------- | ||
RUN curl -L https://github.com/ecmwf/eckit/archive/1.4.7.tar.gz | \ | ||
tar -xz -C /usr/src | ||
RUN mkdir -p /usr/src/eckit-1.4.7/build && cd /usr/src/eckit-1.4.7/build && \ | ||
${ECBUILD_BIN} \ | ||
-DCMAKE_INSTALL_PREFIX=/usr/local/eckit \ | ||
-DCMAKE_BUILD_TYPE=Release \ | ||
-GNinja -- ../ && \ | ||
cmake --build . -j $(nproc) --target install && rm -rf /usr/src/eckit-1.4.7/build | ||
# ---------------------- Atlas ---------------------- | ||
RUN curl -L https://github.com/ecmwf/atlas/archive/0.19.0.tar.gz | \ | ||
tar -xz -C /usr/src | ||
RUN mkdir -p /usr/src/atlas-0.19.0/build && cd /usr/src/atlas-0.19.0/build && \ | ||
${ECBUILD_BIN} \ | ||
-DCMAKE_INSTALL_PREFIX=/usr/local/atlas \ | ||
-DCMAKE_BUILD_TYPE=Release \ | ||
-DENABLE_ATLAS_RUN=OFF \ | ||
-DECKIT_PATH=/usr/local/eckit \ | ||
-GNinja -- ../ && \ | ||
cmake --build . -j $(nproc) --target install && rm -rf /usr/src/atlas-0.19.0/build | ||
# ---------------------- Protobuf ---------------------- | ||
RUN curl -L https://github.com/protocolbuffers/protobuf/releases/download/v3.10.1/protobuf-all-3.10.1.tar.gz | \ | ||
tar -xz -C /usr/src | ||
# These files seem to have a high UID/GID by default, so update this | ||
RUN chown root:root /usr/src/protobuf-3.10.1 -R | ||
RUN cmake -S /usr/src/protobuf-3.10.1/cmake -B /usr/src/protobuf-3.10.1/build \ | ||
-Dprotobuf_BUILD_EXAMPLES=OFF \ | ||
-Dprotobuf_BUILD_TESTS=OFF \ | ||
-Dprotobuf_INSTALL_EXAMPLES=OFF \ | ||
-Dprotobuf_BUILD_PROTOC_BINARIES=ON \ | ||
-DCMAKE_BUILD_TYPE=Release \ | ||
-DCMAKE_INSTALL_PREFIX=/usr/local/protobuf \ | ||
-DBUILD_SHARED_LIBS=ON \ | ||
-GNinja && \ | ||
cmake --build /usr/src/protobuf-3.10.1/build --target install -j $(nproc) && \ | ||
rm -rf /usr/src/protobuf-3.10.1/build | ||
RUN cd /usr/src/protobuf-3.10.1/python && \ | ||
PROTOC=/usr/local/protobuf/bin/protoc python setup.py build && \ | ||
mkdir -p /usr/local/protobuf/lib/python && \ | ||
mv /usr/src/protobuf-3.10.1/python/build/lib/google /usr/local/protobuf/lib/python/google | ||
# ---------------------- GridTools ---------------------- | ||
RUN curl -L https://github.com/GridTools/gridtools/archive/v1.0.4.tar.gz | \ | ||
tar -xz -C /usr/src | ||
RUN cmake -S /usr/src/gridtools-1.0.4 -B /usr/src/gridtools-1.0.4/build \ | ||
-DBUILD_TESTING=OFF \ | ||
-DINSTALL_TOOLS=OFF \ | ||
-DGT_INSTALL_EXAMPLES=OFF \ | ||
-DCMAKE_BUILD_TYPE=Release \ | ||
-DCMAKE_INSTALL_PREFIX=/usr/local/gridtools \ | ||
-GNinja && \ | ||
cmake --build /usr/src/gridtools-1.0.4/build -j $(nproc) --target install && \ | ||
rm -rf /usr/src/gridtools-1.0.4/build | ||
# Other python dependencies for using and testing dawn | ||
RUN python -m pip install pytest |
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,9 @@ | ||
FROM ubuntu:eoan | ||
RUN apt update && apt install -y --no-install-recommends \ | ||
build-essential ninja-build cmake git openssh-client curl \ | ||
llvm-9-dev libclang-9-dev \ | ||
python3 python3-pip libpython3-dev \ | ||
python3-setuptools python3-wheel \ | ||
libboost-dev && apt clean | ||
RUN python3 -m pip install --upgrade pip | ||
RUN update-alternatives --install /usr/bin/python python /usr/bin/python3 10 |
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,48 @@ | ||
#!/bin/sh | ||
|
||
set -e | ||
|
||
usage() { | ||
echo "USAGE: docker/update-images [-s] [cpu] [gpu]" | ||
exit 1 | ||
} | ||
|
||
if [ $# -eq 0 ]; then | ||
usage | ||
fi | ||
|
||
if [ "$1" = "-s" ]; then | ||
cmd_prefix="sudo" | ||
shift | ||
else | ||
cmd_prefix="" | ||
fi | ||
|
||
while [ "$1" != "" ]; do | ||
case $1 in | ||
c | cpu) | ||
image_name=gtclang/dawn-env-ubuntu19.10 | ||
$cmd_prefix docker build --rm \ | ||
--tag $image_name-base \ | ||
--file docker/ubuntu19.10.dockerfile . | ||
$cmd_prefix docker build --rm \ | ||
--tag $image_name --build-arg IMAGE=$image_name-base \ | ||
--file docker/dawn-env.dockerfile . | ||
echo "Now run:\n\t$cmd_prefix docker push $image_name" | ||
;; | ||
g | gpu) | ||
image_name=gtclang/dawn-env-cuda10.1-ubuntu18.04 | ||
$cmd_prefix docker build --rm \ | ||
--tag $image_name-base \ | ||
--file docker/cuda10.1-ubuntu18.04.dockerfile . | ||
$cmd_prefix docker build --rm \ | ||
--tag $image_name --build-arg IMAGE=$image_name-base \ | ||
--file docker/dawn-env.dockerfile . | ||
echo "Now run:\n\t$cmd_prefix docker push $image_name" | ||
;; | ||
*) | ||
usage | ||
;; | ||
esac | ||
shift | ||
done |
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
Oops, something went wrong.