Skip to content

Commit

Permalink
[feat] Add Dockerfile and scripts to run writes and reads in containers
Browse files Browse the repository at this point in the history
  • Loading branch information
Toutou98 committed Jul 30, 2024
1 parent a0fd72d commit 9f6e7d2
Show file tree
Hide file tree
Showing 3 changed files with 145 additions and 0 deletions.
106 changes: 106 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
# Stage 1: God created the heavens and the earth
FROM ubuntu:22.04 AS builder

ENV eckit_ROOT=/usr/local
ENV CMAKE_PREFIX_PATH=/usr/local
ENV metkit_ROOT=/usr/local

RUN apt-get update && apt-get upgrade -y

RUN DEBIAN_FRONTEND=noninteractive TZ=Europe/Athens apt install -y wget git cmake g++ gfortran python3 python3-pip libnuma-dev libboost-all-dev bc
RUN apt install -y vim gdb

RUN pip3 install eccodes

# fdb dependecies
RUN wget https://gitlab.dkrz.de/k202009/libaec/-/archive/v1.1.1/libaec-v1.1.1.tar.gz && \
tar -xzf libaec-v1.1.1.tar.gz && \
cd libaec-v1.1.1 && \
mkdir build && \
cd build && \
cmake .. # -CMAKE_INSTALL_PREFIX=/usr/local

RUN cd libaec-v1.1.1/build && \
make install && \
cd /

RUN wget https://confluence.ecmwf.int/download/attachments/45757960/eccodes-2.35.0-Source.tar.gz?api=v2 && \
tar -xzf eccodes-2.35.0-Source.tar.gz?api=v2 && \
cd eccodes-2.35.0-Source && \
mkdir build && \
cd build && \
cmake .. -DCMAKE_INSTALL_PREFIX=/usr/local && \
make -j10 && \
ctest && \
make install && \
cd /

RUN git clone https://github.com/ecmwf/ecbuild && \
cd ecbuild && \
mkdir bootstrap && \
cd bootstrap && \
../bin/ecbuild --prefix=/usr/local .. && \
ctest && \
make install && \
cd /

RUN git clone https://github.com/ecmwf/eckit.git && \
cd eckit && \
mkdir build && \
cd build && \
ecbuild --prefix=/usr/local -- .. && \
make -j10 && \
make install && \
cd /

RUN git clone https://github.com/ecmwf/metkit.git && \
cd metkit && \
mkdir build && \
cd build && \
ecbuild --prefix=/usr/local -- -DECKIT_PATH=/usr/local ../$pwd && \
make -j10 && \
make install && \
cd /


COPY correct_date.grib /grib/o3_new.grib

RUN cp /grib/o3_new.grib /tmp/0.grib && \
cp /grib/o3_new.grib /tmp/1.grib && \
cp /grib/o3_new.grib /tmp/2.grib && \
cp /grib/o3_new.grib /tmp/3.grib && \
cp /grib/o3_new.grib /tmp/4.grib && \
cp /grib/o3_new.grib /tmp/5.grib && \
cp /grib/o3_new.grib /tmp/6.grib && \
cp /grib/o3_new.grib /tmp/7.grib && \
cp /grib/o3_new.grib /tmp/8.grib && \
cp /grib/o3_new.grib /tmp/9.grib && \
cp /grib/o3_new.grib /tmp/10.grib && \
cp /grib/o3_new.grib /tmp/11.grib && \
cp /grib/o3_new.grib /tmp/12.grib && \
cp /grib/o3_new.grib /tmp/13.grib && \
cp /grib/o3_new.grib /tmp/14.grib && \
cp /grib/o3_new.grib /tmp/15.grib

RUN git clone -b embed_bloom_filters_in_sst https://github.com/Toutou98/parallax.git && \
cd parallax && \
rm -rf build && \
mkdir build && \
cd build && \
cmake .. -DCMAKE_INSTALL_PREFIX=/usr/local -DBUILD_SHARED_LIBS=ON && \
make -j10 && \
make install

# fdb-kv
RUN apt install uuid-dev -y

RUN mkdir /tmp/parallax
COPY . /fdb-kv
RUN cd fdb-kv && \
rm -rf build && \
mkdir build && \
cd build && \
ecbuild --prefix=/usr/local -- -DCMAKE_BUILD_TYPE="Debug" -DCMAKE_INSTALL_PREFIX=/usr/local -DUSE_PARALLAX=ON -DCMAKE_FIND_LIBRARY_PREFIXES="lib" -DCMAKE_FIND_LIBRARY_SUFFIXES=".so;.a" .. && \
make -j10


23 changes: 23 additions & 0 deletions docker-hammer-fdb-kv.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/bin/bash

INPUT_FILE="/tmp/1.grib"

rm -rf /fdb-kv/build/tests/fdb/root/parallax
mkdir /fdb-kv/build/tests/fdb/root/parallax
cd /fdb-kv/build/tests/fdb/root/parallax
fallocate default -l 400G
cd /

cd /parallax/scripts
./mkfs.sh /fdb-kv/build/tests/fdb/root/parallax/default 128
cd /fdb-kv/build/bin
# Command to run fdb-hammer
PARH5_VOLUME=/fdb-kv/build/tests/fdb/root/parallax/default ./fdb-hammer \
--statistics \
--expver=xxxx \
--class=rd \
--nlevels="$NLEVELS" \
--nsteps="$NSTEPS" \
--nparams="$NPARAMS" \
--nensembles="$NENSEMBLES" \
"$INPUT_FILE"
16 changes: 16 additions & 0 deletions docker-read-hammer-fdb-kv.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/bash

INPUT_FILE="/tmp/1.grib"

cd /fdb-kv/build/bin
# Command to run fdb-hammer
PARH5_VOLUME=/fdb-kv/build/tests/fdb/root/parallax/default ./fdb-hammer \
--statistics \
--expver=xxxx \
--class=rd \
--nlevels="$NLEVELS" \
--nsteps="$NSTEPS" \
--nparams="$NPARAMS" \
--nensembles="$NENSEMBLES" \
--read \
"$INPUT_FILE"

0 comments on commit 9f6e7d2

Please sign in to comment.