Repository navigation
Expand file tree
/
Copy pathDockerfile-tests
More file actions
74 lines (60 loc) · 2.56 KB
/
Copy pathDockerfile-tests
File metadata and controls
74 lines (60 loc) · 2.56 KB
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
FROM ubuntu:latest
# install base dependences
RUN apt-get update && \
apt-get install -y make cmake git curl build-essential m4 sudo gdbserver python3-pip \
gdb libreadline-dev bison flex zlib1g-dev libicu-dev icu-devtools tmux zile zip \
gawk wget python3-full python3-virtualenv graphviz python3-dev libpq-dev python3-psycopg2 libssl-dev
RUN deluser --remove-home ubuntu
# add postgres user and make data dir
RUN groupadd -r postgres && useradd --no-log-init -r -m -s /bin/bash -g postgres -G sudo postgres
# make postgres a sudoer
RUN echo "postgres ALL=(root) NOPASSWD:ALL" > /etc/sudoers.d/user && \
chmod 0440 /etc/sudoers.d/user
USER postgres
ENV PGDATA /home/postgres/data
RUN /bin/rm -Rf "$PGDATA" && mkdir "$PGDATA"
WORKDIR "/home/postgres"
# get postgres source and compile with debug and no optimization
RUN git clone https://github.com/michelp/postgres-upstream.git --depth=1 && \
cd postgres-upstream && CFLAGS="-DTOAST_MAX_CHUNK_SIZE=8192" ./configure \
--prefix=/usr/ \
--without-icu \
--enable-debug \
--enable-depend --enable-cassert --enable-profiling \
CFLAGS="-ggdb -Og -g3 -fno-omit-frame-pointer" \
# CFLAGS="-O3" \
&& make -j 4 && sudo make install
# COPY --chown=postgres:postgres postgres-upstream postgres-upstream
# RUN cd postgres-upstream && ./configure \
# --prefix=/usr/ \
# --with-python \
# --with-openssl \
# --without-icu \
# --enable-debug \
# # --enable-depend --enable-cassert --enable-profiling \
# # CFLAGS="-ggdb -Og -g3 -fno-omit-frame-pointer" \
# CFLAGS="-O3" \
# && make -j 4 && sudo make install \
# && cd contrib/postgres_fdw && make && sudo make install \
# && cd .. && /bin/rm -Rf postgres-upstream
# get GraphBLAS, compile with debug symbols
RUN curl -s -L -J https://github.com/DrTimothyAldenDavis/GraphBLAS/archive/refs/tags/v10.0.2.tar.gz | \
tar zxvf - && cd GraphBLAS-10.0.2 && \
make library \
# CMAKE_OPTIONS='-DCMAKE_BUILD_TYPE=Debug -DGRAPHBLAS_COMPACT=1' \
&& sudo make install \
&& /bin/rm -Rf GraphBLAS-10.0.2
RUN sudo ldconfig
# put test stuff into pg home
RUN mkdir "/home/postgres/onesparse"
WORKDIR "/home/postgres/onesparse"
COPY . .
ENV EDITOR zile
# make the extension
#RUN .virt/bin/python3 generate.py onesparse/onesparse--0.1.0.sql
RUN sudo make && sudo make install && sudo make clean
# start the database
RUN initdb -D "$PGDATA" -c shared_preload_libraries='onesparse' -c search_path='public,onesparse' --encoding UTF8
EXPOSE 5432
# wait forever
CMD tail -f /dev/null