Repository navigation
Expand file tree
/
Copy pathDockerfile-debug
More file actions
88 lines (74 loc) · 3.24 KB
/
Copy pathDockerfile-debug
File metadata and controls
88 lines (74 loc) · 3.24 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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
FROM ubuntu:latest
ARG BUILD_JOBS
ARG POSTGRES_VERSION
ARG GRAPHBLAS_VERSION
ARG LAGRAPH_VERSION
# 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 \
libtap-parser-sourcehandler-pgtap-perl \
python3-psycopg2 libssl-dev gnuplot python3-graph-tool pkg-config ca-certificates \
liblz4-dev libzstd-dev libxml2-dev libxslt1-dev gcovr
RUN deluser --remove-home ubuntu
# Add a dedicated in-container postgres user. The mounted checkout is not built in place.
RUN groupadd -r postgres; \
useradd -r --gid postgres --no-log-init -m -s /bin/bash -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"
RUN set -eux; \
curl -fsSLO https://ftp.postgresql.org/pub/source/v${POSTGRES_VERSION}/postgresql-${POSTGRES_VERSION}.tar.bz2; \
tar -xjf postgresql-${POSTGRES_VERSION}.tar.bz2; \
cd postgresql-${POSTGRES_VERSION}; \
./configure --prefix=/usr --with-openssl --with-icu --with-lz4 --with-zstd \
--enable-debug \
--enable-depend --enable-cassert \
CFLAGS="-ggdb -Og -g3 -fno-omit-frame-pointer"; \
make -j"${BUILD_JOBS:-$(nproc)}"; \
sudo make install; \
cd ..; \
sudo rm -rf postgresql-${POSTGRES_VERSION} postgresql-${POSTGRES_VERSION}.tar.bz2 /var/lib/apt/lists/*
# pgTAP is installed only in the debug image used by the semantic test suite.
RUN git clone --depth 1 --branch v1.3.4 https://github.com/theory/pgtap.git && \
cd pgtap && \
test "$(git rev-parse HEAD)" = "968eb53a33114e83042b3bdb0c664b5b80cf8bdf" && \
make && \
sudo make install && \
cd .. && \
rm -rf pgtap
# get GraphBLAS, compile with debug symbols
RUN curl -s -L -J https://github.com/DrTimothyAldenDavis/GraphBLAS/archive/refs/tags/v${GRAPHBLAS_VERSION}.tar.gz | \
tar zxvf - && cd GraphBLAS-${GRAPHBLAS_VERSION} && \
make -j"${BUILD_JOBS:-$(nproc)}" debug \
# CMAKE_OPTIONS='-DGRAPHBLAS_COMPACT=1 ' \
&& sudo make install \
&& /bin/rm -Rf GraphBLAS-${GRAPHBLAS_VERSION}
RUN curl -s -L -J https://github.com/GraphBLAS/LAGraph/archive/refs/tags/v${LAGRAPH_VERSION}.tar.gz | \
tar zxvf - && cd LAGraph-${LAGRAPH_VERSION} && \
make -j"${BUILD_JOBS:-$(nproc)}" library \
&& sudo make install \
&& /bin/rm -Rf LAGraph-${LAGRAPH_VERSION}
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' \
-c onesparse.jit_control='on' \
--encoding UTF8
EXPOSE 5432
# Keep the test container running until the harness starts PostgreSQL.
CMD sleep infinity