-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathDockerfile
More file actions
198 lines (179 loc) · 8.74 KB
/
Dockerfile
File metadata and controls
198 lines (179 loc) · 8.74 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
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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
#################################################################
# #
# Copyright (c) 2021-2026 YottaDB LLC and/or its subsidiaries. #
# All rights reserved. #
# #
# This source code contains the intellectual property #
# of its copyright holder(s), and is made available #
# under a license. If you do not know the terms of #
# the license, please stop and do not read further. #
# #
#################################################################
# Instructions
# - docker build -f docker/Dockerfile -t ydbtest .
# - docker run --init -it -v <local directory>:/testarea1/ --cap-add PERFMON --rm ydbtest -t r132
#
# Other options:
# Pass a YDBTest Volume to use
# - docker run --init -it -v <local directory>:/testarea1/ -v <full path to YDBTest>:/YDBTest --cap-add PERFMON --rm ydbtest -t r132
# Run a shell as the gtmtest user
# - docker run --init -it -v <local directory>:/testarea1/ --cap-add PERFMON --rm ydbtest -shell
# Run a shell as root
# - docker run --init -it -v <local directory>:/testarea1/ --cap-add PERFMON --rm ydbtest -rootshell
# When the following line changes, remove the lines installing a custom version of gawk below
ARG OS_VSN=trixie
FROM debian:${OS_VSN}
VOLUME /testarea1
VOLUME /testarea2
VOLUME /testarea3
VOLUME /YDBTest
ARG DEBIAN_FRONTEND=noninteractive
# psmisc for fuser
RUN apt-get update && \
apt-get install -y --no-install-recommends \
file \
less \
cmake \
make \
gcc \
pkg-config \
git \
tcsh \
libconfig-dev \
libelf-dev \
libgcrypt-dev \
libgpg-error-dev \
libgpgme11-dev \
libicu-dev \
libncurses-dev \
libssl-dev \
libreadline-dev \
zlib1g-dev \
lsof \
bc \
unzip \
wget \
ca-certificates \
gawk \
psmisc \
ksh \
vim \
rsyslog \
locales \
strace \
expect \
elfutils \
net-tools \
netcat-traditional \
gdb \
valgrind \
python3 \
python3-venv \
python3-dev \
python3-setuptools \
libffi-dev \
curl \
iproute2 \
openjdk-25-jdk \
screen \
sudo \
bison \
flex \
libsodium-dev \
lsb-release \
rsync \
linux-perf \
libcurl4-openssl-dev \
libjansson4 \
libjansson-dev \
netbase \
clang \
openssh-server \
jq \
libjansson-dev \
rustc \
cargo \
gcovr \
&& \
apt-get clean
RUN rm -rf /usr/local/go && wget -O - https://go.dev/dl/go1.25.4.linux-amd64.tar.gz | tar -C /usr/local -xz
RUN echo "set auto-load safe-path /" >> /etc/gdb/gdbinit # enable loading of gdb debugging symbols for Go
# path to Go is added to PATH in cshrc file
RUN sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen && \
dpkg-reconfigure --frontend=noninteractive locales && \
update-locale LANG=en_US.UTF-8
# openssh-server installs systemd, which provides /usr/bin/journalctl, but this
# makes the test system think we have systemd jorunaling. We use rsyslog.
RUN mv /usr/bin/journalctl /usr/bin/journalctl-dontuse
# gtmtest1 is the ssh user
RUN ln -s /usr/bin/tcsh /usr/local/bin/tcsh && \
groupadd gtc && \
useradd gtmtest -g gtc -G adm,sudo -m -s /usr/local/bin/tcsh && \
useradd gtmtest1 -g gtc -G adm,sudo -m -s /usr/local/bin/tcsh
# Allow gtmtest as a member of the sudo group to use sudo with no password for the sudo tests
RUN echo "%sudo\tALL=(ALL:ALL) NOPASSWD: ALL" > /etc/sudoers.d/gtmtest-sudo
# Install Gawk 5.2.2, as 5.2.1 has a bug: https://lists.gnu.org/archive/html/bug-gawk/2023-02/msg00015.html
RUN wget https://ftp.gnu.org/gnu/gawk/gawk-5.2.2.tar.gz && \
tar xvf gawk-5.2.2.tar.gz && \
rm gawk-5.2.2.tar.gz && \
cd gawk-5.2.2/ && \
./configure && \
make && \
make install && \
cd .. && \
rm -r gawk-5.2.2/
# Get the source code for YottaDB and Plugins
RUN git clone https://gitlab.com/YottaDB/DB/YDB.git /Distrib/YottaDB
RUN git clone --depth 1 https://gitlab.com/YottaDB/Util/YDBPosix.git /Distrib/YDBPosix
RUN git clone --depth 1 https://gitlab.com/YottaDB/Util/YDBEncrypt.git /Distrib/YDBEncrypt
RUN mkdir -p /Distrib/ji_plugin && \
wget https://sourceforge.net/projects/fis-gtm/files/Plugins/GTMJI/1.0.4/ji_plugin_1.0.4.tar.gz && \
tar xzf ji_plugin_1.0.4.tar.gz -C /Distrib/ji_plugin && rm ji_plugin_1.0.4.tar.gz
RUN mkdir -p /Distrib/posix_plugin_r2 && \
wget https://sourceforge.net/projects/fis-gtm/files/Plugins/posix/r2/posix_plugin_r2.tar.gz && \
tar xzf posix_plugin_r2.tar.gz -C /Distrib/posix_plugin_r2 && \
rm ../posix_plugin_r2.tar.gz
COPY com/set_java_paths.csh /usr/library/gtm_test/set_java_paths.csh
# serverconf.txt file is needed for installing GTMJI Plugin so we need to copy it into the conatainer first.
# Otherwise build_and_install_yottadb.csh script will fail.
COPY docker/serverconf.txt /usr/library/gtm_test/T999/docker/serverconf.txt
COPY docker/build_and_install_yottadb.csh /usr/library/gtm_test/build_and_install_yottadb.csh
# build_and_install_yottadb.csh <folder in /usr/library> <git tag in YDB> <dbg/pro>
# GT.M version we are currently developing against
# Commented out for now as no users are using GT.M versions to develop against in Docker
# Can be re-enabled in the future as needed
#RUN /usr/library/gtm_test/build_and_install_yottadb.csh V71005 V7.1-005 pro
# v6 DB
RUN /usr/library/gtm_test/build_and_install_yottadb.csh V63014_R138 r1.38 pro
RUN /usr/library/gtm_test/build_and_install_yottadb.csh V63014_R138 r1.38 dbg
# gtm_curpro: bump up (when r2.06 is released) by changing the next 4 lines
ENV gtm_curpro=V71002_R206
RUN /usr/library/gtm_test/build_and_install_yottadb.csh V71002_R206 r2.06 pro
RUN /usr/library/gtm_test/build_and_install_yottadb.csh V71002_R206 r2.06 dbg
RUN ln -s /usr/library/R206 /usr/library/V71002_R206
# Needs to be the last one to enable the lastest source tree to be available for sudo tests
RUN /usr/library/gtm_test/build_and_install_yottadb.csh V999_R999 master dbg
COPY --chown=gtmtest:gtc . /usr/library/gtm_test/T999/
RUN ln -s /usr/library/gtm_test/T999/docker/cshrc ~/.cshrc && \
ln -s /usr/library/gtm_test/T999/docker/version.csh ~/version.csh && \
ln -s /usr/library/gtm_test/T999/docker/cshrc ~gtmtest/.cshrc && \
ln -s /usr/library/gtm_test/T999/docker/version.csh ~gtmtest/version.csh && \
ln -s /usr/library/gtm_test/T999/docker/cshrc ~gtmtest1/.cshrc && \
ln -s /usr/library/gtm_test/T999/docker/version.csh ~gtmtest1/version.csh
RUN ln -s /usr/library/gtm_test/T999/docker/serverconf.txt /usr/library/gtm_test/serverconf.txt
RUN ln -s /usr/library/gtm_test/T999/docker/tstdirs.csh /usr/library/gtm_test/tstdirs.csh
RUN /usr/library/gtm_test/T999/docker/setup_gpg.csh
# Set-up $ggdata
RUN mkdir /usr/library/gtm_test/ggdata && chown gtmtest:gtc /usr/library/gtm_test/ggdata
# https://stackoverflow.com/questions/56609182/openthread-environment-docker-rsyslogd-imklog-cannot-open-kernel-log-proc-km
RUN sed -i '/imklog/s/^/#/' /etc/rsyslog.conf
# SSH gtmuser -> gtmuser1 set-up
# gtmuser -> gtmuser set-up (for replication tests)
RUN su - gtmtest -c 'mkdir ~/.ssh/' && su - gtmtest1 -c 'mkdir ~/.ssh/' && \
su - gtmtest -c 'ssh-keygen -q -t rsa -N "" -f ~/.ssh/id_rsa' && \
cp ~gtmtest/.ssh/id_rsa.pub ~gtmtest1/.ssh/authorized_keys && \
chmod 600 ~gtmtest1/.ssh/authorized_keys && chown gtmtest1:gtc ~gtmtest1/.ssh/authorized_keys && \
cp ~gtmtest/.ssh/id_rsa.pub ~gtmtest/.ssh/authorized_keys && \
chmod 600 ~gtmtest/.ssh/authorized_keys && chown gtmtest:gtc ~gtmtest/.ssh/authorized_keys
WORKDIR /home/gtmtest
ENTRYPOINT ["/usr/library/gtm_test/T999/docker/run.csh"]