Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit51a4c4a

Browse files
committed
incremental build of docker containers
1 parent35e1163 commit51a4c4a

File tree

4 files changed

+66
-61
lines changed

4 files changed

+66
-61
lines changed

‎Dockerfile

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# vim:set ft=dockerfile:
2+
FROM debian:jessie
3+
4+
# explicitly set user/group IDs
5+
RUN groupadd -r postgres --gid=999 && useradd -r -g postgres --uid=999 postgres
6+
7+
# make the "en_US.UTF-8" locale so postgres will be utf-8 enabled by default
8+
RUN apt-get update && apt-get install -y locales && rm -rf /var/lib/apt/lists/* \
9+
&& localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8
10+
ENV LANG en_US.utf8
11+
12+
# postgres build deps
13+
RUN apt-get update && apt-get install -y \
14+
git \
15+
make \
16+
gcc \
17+
gdb \
18+
libreadline-dev \
19+
bison \
20+
flex \
21+
zlib1g-dev\
22+
&& rm -rf /var/lib/apt/lists/*
23+
24+
RUN mkdir /pg && chown postgres:postgres /pg
25+
USER postgres
26+
ENV CFLAGS -O0
27+
WORKDIR /pg
28+
29+
RUN cd /pg && \
30+
git clone https://github.com/postgrespro/postgres_cluster.git --depth 1 && \
31+
cd /pg/postgres_cluster && \
32+
./configure --enable-cassert --enable-debug --prefix=/pg/install && \
33+
make -j 4 install
34+
35+
RUN mkdir /pg/data
36+
ENV PATH /pg/install/bin:$PATH
37+
ENV PGDATA /pg/data
38+
39+
# Here we can insert some ENV var to invalidate subsequent layers
40+
41+
RUN cd /pg/postgres_cluster/contrib/raftable && make install
42+
43+
RUN mkdir /pg/mmts
44+
COPY ./ /pg/mmts/
45+
RUN cd /pg/mmts && USE_PGXS=1 RAFTABLE_PATH=/pg/postgres_cluster/contrib/raftable make install
46+
47+
ENTRYPOINT ["/pg/mmts/tests2/docker-entrypoint.sh"]
48+
49+
EXPOSE 5432
50+
CMD ["postgres"]
51+

‎Makefile

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
MODULE_big = multimaster
22
OBJS = multimaster.o raftable.o arbiter.o bytebuf.o bgwpool.o pglogical_output.o pglogical_proto.o pglogical_receiver.o pglogical_apply.o pglogical_hooks.o pglogical_config.o pglogical_relid_map.o ddd.o bkb.o spill.o
33

4-
overrideCPPFLAGS += -I../raftable
4+
ifndefRAFTABLE_PATH
5+
RAFTABLE_PATH = ../raftable
6+
endif
7+
8+
overrideCPPFLAGS += -I$(RAFTABLE_PATH)
59

610
EXTRA_INSTALL = contrib/raftable contrib/mmts
711

@@ -33,3 +37,11 @@ check:
3337
env DESTDIR='$(abs_top_builddir)'/tmp_install make install
3438
$(prove_check)
3539

40+
xcheck:
41+
#pip install -r tests2/requirements.txt
42+
docker build -t pgmmts.
43+
cd tests2&& blockade up
44+
sleep 10# wait for mmts init
45+
cd tests2&& python test_recovery.py||true
46+
cd tests2&& blockade destroy
47+

‎tests2/Dockerfile

Lines changed: 0 additions & 60 deletions
This file was deleted.

‎tests2/Vagrantfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ Vagrant.configure(2) do |config|
2727
vb.memory=2048
2828
end
2929

30+
config.vm.synced_folder"../../..","/postgres_sources"
31+
3032
# there are obviously vagrant versions with a
3133
# broken 'docker' provisioner that can be fixed
3234
# by invoking an 'apt-get update' *before* docker itself

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp