|
| 1 | +FROM ubuntu:22.04 |
| 2 | + |
| 3 | +LABEL author="Maja Franz <maja.franz@othr.de>" |
| 4 | + |
| 5 | +ENV DEBIAN_FRONTEND=noninteractive |
| 6 | +ENV LANG="C.UTF-8" |
| 7 | +ENV LC_ALL="C.UTF-8" |
| 8 | + |
| 9 | +# Install required packages |
| 10 | +RUN apt-get update |
| 11 | +RUN apt-get install -y software-properties-common |
| 12 | +RUN add-apt-repository ppa:deadsnakes/ppa # For Python 3.9 |
| 13 | +RUN apt-get install -y \ |
| 14 | + python3.9 \ |
| 15 | + python3-pip \ |
| 16 | + python3.9-distutils \ |
| 17 | + python3.9-dev \ |
| 18 | + wget \ |
| 19 | + git \ |
| 20 | + r-base \ |
| 21 | + libv8-dev \ |
| 22 | + libreadline-dev \ |
| 23 | + zlib1g-dev \ |
| 24 | + texlive-latex-base \ |
| 25 | + texlive-science \ |
| 26 | + texlive-fonts-recommended \ |
| 27 | + texlive-fonts-extra \ |
| 28 | + texlive-publishers \ |
| 29 | + texlive-bibtex-extra \ |
| 30 | + texlive-luatex \ |
| 31 | + biber |
| 32 | + |
| 33 | +# Install R packages for plotting |
| 34 | +RUN R -e "install.packages('tidyverse',dependencies=TRUE, repos='http://cran.rstudio.com/')" |
| 35 | +RUN R -e "install.packages('ggh4x',dependencies=TRUE, repos='http://cran.rstudio.com/')" |
| 36 | +RUN R -e "install.packages('patchwork',dependencies=TRUE, repos='http://cran.rstudio.com/')" |
| 37 | +RUN R -e "install.packages('tikzDevice',dependencies=TRUE, repos='http://cran.rstudio.com/')" |
| 38 | +RUN R -e "install.packages('scales',dependencies=TRUE, repos='http://cran.rstudio.com/')" |
| 39 | + |
| 40 | +# Let Python 3.9 be global python version |
| 41 | +RUN ln -s /usr/bin/python3.9 /usr/bin/python |
| 42 | + |
| 43 | +# Add user |
| 44 | +RUN useradd -m -G sudo -s /bin/bash repro && echo "repro:repro" | chpasswd |
| 45 | +USER repro |
| 46 | + |
| 47 | +WORKDIR /home/repro/postgres |
| 48 | + |
| 49 | +# setup PostgreSQL |
| 50 | +ENV RLJO_PSQL_BASE=/home/repro/postgres |
| 51 | + |
| 52 | +## PostgreSQL |
| 53 | +ENV RLJO_PSQL_DATA_DIRECTORY=$RLJO_PSQL_BASE/database |
| 54 | +ENV RLJO_PSQL_SRC_DIRECTORY="$RLJO_PSQL_BASE/postgresql-16.0" |
| 55 | +ENV RLJO_PSQL_INSTALL_DIRECTORY="$RLJO_PSQL_BASE/install" |
| 56 | +ENV RLJO_PG_HINT_PLAN_BASE="$RLJO_PSQL_BASE/pg_hint_plan" |
| 57 | +ENV RLJO_PG_HINT_PLAN_SRC_DIRECTORY="$RLJO_PG_HINT_PLAN_BASE/pg_hint_plan-REL16_1_6_0" |
| 58 | + |
| 59 | +WORKDIR $RLJO_PSQL_BASE |
| 60 | +RUN wget https://ftp.postgresql.org/pub/source/v16.0/postgresql-16.0.tar.gz |
| 61 | +RUN tar xvfz postgresql-16.0.tar.gz |
| 62 | +RUN mkdir $RLJO_PSQL_INSTALL_DIRECTORY |
| 63 | +RUN mkdir $RLJO_PSQL_DATA_DIRECTORY |
| 64 | +WORKDIR $RLJO_PSQL_SRC_DIRECTORY |
| 65 | +RUN ./configure --prefix=$RLJO_PSQL_INSTALL_DIRECTORY --enable-debug |
| 66 | +RUN make -j $(nproc) |
| 67 | +RUN make install |
| 68 | +WORKDIR $RLJO_PSQL_BASE |
| 69 | + |
| 70 | +ENV PATH=$RLJO_PSQL_BASE/install/bin:$PATH |
| 71 | +ENV LD_LIBRARY_PATH=$RLJO_PSQL_BASE/install/lib/ |
| 72 | + |
| 73 | +RUN initdb -D $RLJO_PSQL_DATA_DIRECTORY --user=postgres |
| 74 | +RUN pg_ctl -D $RLJO_PSQL_DATA_DIRECTORY -l $RLJO_PSQL_BASE/logfile start |
| 75 | + |
| 76 | +## PG hint plugin |
| 77 | +RUN mkdir $RLJO_PG_HINT_PLAN_BASE |
| 78 | +WORKDIR $RLJO_PG_HINT_PLAN_BASE |
| 79 | +RUN wget https://github.com/ossc-db/pg_hint_plan/archive/refs/tags/REL16_1_6_0.tar.gz |
| 80 | +RUN tar xvfz REL16_1_6_0.tar.gz |
| 81 | +WORKDIR $RLJO_PG_HINT_PLAN_SRC_DIRECTORY |
| 82 | +RUN make -j $(nproc) |
| 83 | +RUN make install |
| 84 | + |
| 85 | +ENV PATH=$PATH:/home/repro/postgres/install/bin |
| 86 | + |
| 87 | + |
| 88 | +# setup join order benchmark |
| 89 | +WORKDIR /home/repro |
| 90 | + |
| 91 | +ENV RLJO_JOB_BASE=/home/repro/JOB |
| 92 | + |
| 93 | +RUN mkdir $RLJO_JOB_BASE |
| 94 | +RUN git clone -n https://github.com/danolivo/jo-bench $RLJO_JOB_BASE/jo-bench |
| 95 | + |
| 96 | +WORKDIR $RLJO_JOB_BASE/jo-bench |
| 97 | +RUN git checkout a2019f9 |
| 98 | + |
| 99 | +# Add artifacts (from host) to home directory |
| 100 | +ADD --chown=repro:repro . /home/repro/qce24_repro |
| 101 | + |
| 102 | +WORKDIR /home/repro/qce24_repro |
| 103 | + |
| 104 | +# install python packages |
| 105 | +ENV PATH=$PATH:/home/repro/.local/bin |
| 106 | +# set default python version to 3.9 |
| 107 | +RUN echo 'alias python="python3.9"' >> /home/repro/.bashrc |
| 108 | + |
| 109 | +RUN python3.9 -m pip install -r experimental_analysis/requirements.txt |
| 110 | + |
| 111 | +# Experiments can be run, plots can be generated or paper can be built when |
| 112 | +# container is started, see options in README or run script |
| 113 | +ENTRYPOINT ["./scripts/run.sh"] |
| 114 | +CMD ["bash"] |
0 commit comments