@@ -4,6 +4,8 @@ ARG DAPPER_HOST_ARCH
4
4
ARG http_proxy
5
5
ARG https_proxy
6
6
ENV HOST_ARCH=${DAPPER_HOST_ARCH} ARCH=${DAPPER_HOST_ARCH}
7
+ ARG SRC_BRANCH=main
8
+ ARG SRC_TAG
7
9
8
10
# Setup environment
9
11
ENV PATH /go/bin:$PATH
@@ -12,25 +14,22 @@ ENV DAPPER_ENV TAG REPO DRONE_REPO DRONE_PULL_REQUEST DRONE_COMMIT_REF
12
14
ENV DAPPER_OUTPUT bin coverage.out
13
15
ENV DAPPER_RUN_ARGS --privileged -v /dev:/host/dev -v /proc:/host/proc -v /sys:/host/sys
14
16
ENV DAPPER_SOURCE /go/src/github.com/longhorn/go-spdk-helper
17
+ ENV SRC_BRANCH ${SRC_BRANCH}
18
+ ENV SRC_TAG ${SRC_TAG}
15
19
16
20
ENV GOLANGCI_LINT_VERSION="v1.60.3"
17
21
18
22
WORKDIR ${DAPPER_SOURCE}
19
23
20
- ENV SPDK_COMMIT_ID a7421a6e59f1d099294af6f65d73ebec4afebfc5
21
- ENV LIBJSONC_COMMIT_ID b4c371fa0cbc4dcbaccc359ce9e957a22988fb34
22
- # Build nvme-cli 2.10.2
23
- ENV NVME_CLI_COMMIT_ID eeaa08c9a0e9184f3889df0bff3d2a23db6d6294
24
-
25
24
RUN zypper -n addrepo --refresh https://download.opensuse.org/repositories/system:/snappy/SLE_15/system:snappy.repo && \
26
25
zypper -n addrepo --refresh https://download.opensuse.org/repositories/network:/utilities/SLE_15/network:utilities.repo && \
27
26
zypper -n addrepo --refresh https://download.opensuse.org/repositories/devel:libraries:c_c++/15.6/devel:libraries:c_c++.repo && \
28
27
zypper -n addrepo --refresh https://download.opensuse.org/repositories/devel:languages:python:Factory/15.6/devel:languages:python:Factory.repo && \
29
28
zypper -n addrepo --refresh https://download.opensuse.org/repositories/devel:languages:python:backports/SLE_15/devel:languages:python:backports.repo && \
30
29
zypper --gpg-auto-import-keys ref
31
30
32
- RUN zypper -n install cmake wget unzip xsltproc docbook-xsl-stylesheets python311 python311-pip fuse3 libfuse3-3 \
33
- e2fsprogs xfsprogs util-linux-systemd device-mapper
31
+ RUN zypper -n install cmake wget unzip xsltproc docbook-xsl-stylesheets python311 python311-pip fuse3-devel \
32
+ e2fsprogs xfsprogs util-linux-systemd device-mapper jq
34
33
35
34
# Install Go & tools
36
35
ENV GOLANG_ARCH_amd64=amd64 GOLANG_ARCH_arm64=arm64 GOLANG_ARCH=GOLANG_ARCH_${ARCH} \
@@ -40,48 +39,27 @@ RUN curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/i
40
39
RUN ln -sf /usr/bin/python3.11 /usr/bin/python3 & \
41
40
ln -sf /usr/bin/pip3.11 /usr/bin/pip3
42
41
43
- # Build SPDK
44
- ENV SPDK_DIR /usr/src/spdk
45
- RUN git clone https://github.com/longhorn/spdk.git ${SPDK_DIR} --recursive && \
46
- cd ${SPDK_DIR} && \
47
- git checkout ${SPDK_COMMIT_ID} && \
48
- git submodule update --init && \
49
- sed -i '/python3-pyelftools/d' ./scripts/pkgdep/sles.sh && \
50
- sed -i 's/python3-/python311-/g' ./scripts/pkgdep/sles.sh && \
51
- ./scripts/pkgdep.sh && \
52
- pip3 install -r ./scripts/pkgdep/requirements.txt && \
53
- if [ ${ARCH} = "amd64" ]; then \
54
- ./configure --target-arch=nehalem --disable-tests --disable-unit-tests --disable-examples --without-nvme-cuse && \
55
- make -j$(nproc) && \
56
- make install; \
57
- elif [ ${ARCH} = "arm64" ]; then \
58
- ./configure --target-arch=native --disable-tests --disable-unit-tests --disable-examples --without-nvme-cuse && \
59
- DPDKBUILD_FLAGS="-Dplatform=generic" make -j$(nproc) && \
60
- make install; \
61
- else \
62
- echo "Unsupported architecture: ${ARCH}"; \
63
- exit 1; \
42
+ RUN git clone https://github.com/longhorn/dep-versions.git -b ${SRC_BRANCH} /usr/src/dep-versions && \
43
+ cd /usr/src/dep-versions && \
44
+ if [ -n "${SRC_TAG}" ] && git show-ref --tags ${SRC_TAG} > /dev/null 2>&1; then \
45
+ echo "Checking out tag ${SRC_TAG}"; \
46
+ cd /usr/src/dep-versions && git checkout tags/${SRC_TAG}; \
64
47
fi
65
48
49
+ # Build spdk
50
+ RUN export REPO_OVERRIDE="" && \
51
+ export COMMIT_ID_OVERRIDE="" && \
52
+ bash /usr/src/dep-versions/scripts/build-spdk.sh "${REPO_OVERRIDE}" "${COMMIT_ID_OVERRIDE}" "${ARCH}"
53
+
66
54
# Build libjson-c-devel
67
- RUN cd /usr/src && \
68
- git clone https://github.com/json-c/json-c.git && \
69
- cd json-c && \
70
- git checkout ${LIBJSONC_COMMIT_ID} && \
71
- mkdir .build && \
72
- cd .build && \
73
- cmake ../ && \
74
- make && \
75
- make install
55
+ RUN export REPO_OVERRIDE="" && \
56
+ export COMMIT_ID_OVERRIDE="" && \
57
+ bash /usr/src/dep-versions/scripts/build-libjsonc.sh "${REPO_OVERRIDE}" "${COMMIT_ID_OVERRIDE}"
76
58
77
59
# Build nvme-cli
78
- ENV NVME_CLI_DIR /usr/src/nvme-cli
79
- RUN git clone https://github.com/linux-nvme/nvme-cli.git ${NVME_CLI_DIR} && \
80
- cd ${NVME_CLI_DIR} && \
81
- git checkout ${NVME_CLI_COMMIT_ID} && \
82
- meson setup --force-fallback-for=libnvme .build && \
83
- meson compile -C .build && \
84
- meson install -C .build
60
+ RUN export REPO_OVERRIDE="" && \
61
+ export COMMIT_ID_OVERRIDE="" && \
62
+ bash /usr/src/dep-versions/scripts/build-nvme-cli.sh "${REPO_OVERRIDE}" "${COMMIT_ID_OVERRIDE}"
85
63
86
64
RUN ldconfig
87
65
0 commit comments