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