-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile.pro.test
60 lines (46 loc) · 2.78 KB
/
Dockerfile.pro.test
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
ARG BASE_IMAGE=ubuntu:24.04
### Test env phase
FROM ${BASE_IMAGE} AS test-setup
ENV LC_ALL="C.UTF-8"
ENV GTEST_ROOT=/usr/local
ENV DEBIAN_FRONTEND=noninteractive
RUN --mount=target=/var/lib/apt/lists,type=cache,sharing=locked \
--mount=target=/var/cache/apt,type=cache,sharing=locked \
apt-get update && \
apt-get install --yes \
lcov \
tini build-essential libblkid-dev libboost-filesystem-dev libboost-iostreams-dev libboost-program-options-dev libboost-system-dev libcrcutil-dev libdb-dev libfmt-dev libfuse3-dev libgoogle-perftools-dev libgtest-dev libisal-dev libjudy-dev libpam0g-dev libspdlog-dev libsystemd-dev libthrift-dev libtirpc-dev liburcu-dev libyaml-cpp-dev netcat-openbsd python3-venv uuid-dev zlib1g-dev docbook docbook-xml krb5-user libacl1-dev libcap-dev libcephfs-dev libdbus-1-dev libglusterfs-dev libgssapi-krb5-2 libjemalloc-dev libkrb5-dev libkrb5support0 libnfsidmap-dev libradospp-dev libradosstriper-dev librgw-dev libsqlite3-dev xfslibs-dev \
acl asciidoc attr automake bash-completion bc ccache cmake curl dbench debhelper devscripts fakeroot fio fuse3 gcc git gnupg2 kmod lcov make nfs4-acl-tools pkg-config pylint python3-pip python3-setuptools python3-wheel psmisc rsync rsyslog socat sudo tidy time valgrind wget bison byacc ceph dbus doxygen flex tree zonefs-tools
WORKDIR /saunafs
COPY ./saunafs/tests/setup_machine.sh ./tests/
# Run the setup-test-machine.sh script
RUN --mount=target=/var/lib/apt/lists,type=cache,sharing=locked \
--mount=target=/var/cache/apt,type=cache,sharing=locked \
rm -f /etc/apt/apt.conf.d/docker-clean && \
apt-get update && \
./tests/setup_machine.sh setup /mnt/hdd_0 /mnt/hdd_1 /mnt/hdd_2 /mnt/hdd_3 /mnt/hdd_4 /mnt/hdd_5 /mnt/hdd_6 /mnt/hdd_7 || true
RUN mkdir -p /mnt/hdd_0/ /mnt/hdd_1/ /mnt/hdd_2/ /mnt/hdd_3/ /mnt/hdd_4/ /mnt/hdd_5/ /mnt/hdd_6/ /mnt/hdd_7/
RUN chown saunafstest:saunafstest -R /mnt/hdd_*
### Build Phase
FROM test-setup AS test-build
# Enable additional basic tools
ENV PATH="/usr/lib/ccache:${PATH}"
COPY /saunafs/CMakeLists.txt .
COPY /saunafs/cmake ./cmake
COPY /saunafs/config.h.in .
COPY /saunafs/external ./external
COPY /saunafs/utils ./utils
COPY /saunafs/src ./src
COPY /saunafs/tests/ ./tests
# Copy ZoneFS related code/tests
COPY /zonefs_disk/zonefs_disk/ ./src/chunkserver/plugins/zonefs_disk
COPY /zonefs_disk/SMRTests/ ./tests/test_suites/SMRTests
COPY /saunafs/doc ./doc
COPY /saunafs/COPYING .
COPY /saunafs/README.md .
RUN --mount=type=cache,target=/saunafs/build/,sharing=locked --mount=type=cache,target=/root/.ccache \
mkdir -p /saunafs/build && ls /saunafs && \
cd /saunafs/build && cmake -DENABLE_TESTS=1 -DENABLE_DOCS=1 -DENABLE_NFS_GANESHA=1 -DENABLE_CLIENT_LIB=ON -DENABLE_URAFT=ON .. && make -j$(nproc) install
WORKDIR /
ENV TERM=xterm
ENTRYPOINT ["tini", "--"]