Skip to content

Orchestration in VDMS with Kubernetes #261

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 54 commits into from
Apr 9, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
e452959
srck8s
100rish Jan 2, 2025
b43c133
k8sfolder
100rish Jan 2, 2025
02bc09f
minor changes
rv355 Jan 2, 2025
19faa03
latest
100rish Jan 2, 2025
47ad765
latest
100rish Jan 2, 2025
581c4ce
latest
100rish Jan 3, 2025
c48047f
latest
100rish Jan 3, 2025
f1c0da9
latest
100rish Jan 3, 2025
f27cf56
readmeupdate
100rish Jan 9, 2025
f6c7804
localContainerCheckOK
100rish Jan 27, 2025
fe5fefa
dependency
100rish Jan 27, 2025
632192f
makeFix
100rish Jan 27, 2025
9de0ea6
dcokerfileupdate
100rish Jan 30, 2025
bec3bdf
dockerfileupdate
100rish Jan 30, 2025
b8b6c6a
readme updates and config fixes
rv355 Feb 5, 2025
28625b5
readme updates and config fixes
rv355 Feb 5, 2025
a3a0b59
Merge remote-tracking branch 'origin/develop' into kubernetes_support
rv355 Feb 5, 2025
ec641ff
Dockerfile update for kube client install
rv355 Feb 5, 2025
9e7aa2e
Dockerfile mods for kube client install
rv355 Feb 5, 2025
b565132
checkin docker file update
rv355 Feb 5, 2025
628ebec
checkin docker file update bazel
rv355 Feb 5, 2025
95c9027
readme and docker file updates
rv355 Feb 6, 2025
da88779
dockerfile updates
rv355 Feb 19, 2025
41641e7
Merge remote-tracking branch 'origin/develop' into kubernetes_support
rv355 Feb 20, 2025
88591ab
test case updates
rv355 Feb 20, 2025
aef0d62
kubehelper test
rv355 Feb 20, 2025
93f1fd7
adding missing file
rv355 Feb 20, 2025
0ea81b0
Merge remote-tracking branch 'origin/develop' into kubernetes_support
rv355 Feb 24, 2025
b92ad4d
[pre-commit.ci lite] apply automatic fixes
pre-commit-ci-lite[bot] Feb 24, 2025
471df9e
Merge branch 'develop' into kubernetes_support
cwlacewe Mar 5, 2025
7b15e1e
optional kubernetes install
rv355 Mar 6, 2025
11eb817
optional kubernetes install
rv355 Mar 6, 2025
2a028f1
[pre-commit.ci lite] apply automatic fixes
pre-commit-ci-lite[bot] Mar 6, 2025
4e129a3
Merge remote-tracking branch 'origin/develop' into kubernetes_support
rv355 Mar 6, 2025
82170db
Merge branch 'kubernetes_support' of https://github.com/IntelLabs/vdm…
rv355 Mar 6, 2025
bcbaf0f
Automated coverage update
github-actions[bot] Mar 6, 2025
a129f88
addressed review comments
rv355 Mar 13, 2025
1360d9f
Merge branch 'kubernetes_support' of https://github.com/IntelLabs/vdm…
rv355 Mar 13, 2025
4510ea1
Automated coverage update
github-actions[bot] Mar 13, 2025
3ed0190
checkin dockerfile condition update
rv355 Mar 14, 2025
a2536d2
Automated coverage update
github-actions[bot] Mar 14, 2025
8c00f7a
Format Dockerfiles, convert wget to curl, remove duplicate 'option' i…
cwlacewe Apr 2, 2025
bcceaca
minor fix for CMakeLists
rv355 Apr 4, 2025
83f2277
Merge remote-tracking branch origin/develop into kubernetes_support
rv355 Apr 4, 2025
ebf5d7d
added K8s test files to python test script
rv355 Apr 8, 2025
c173f5b
[pre-commit.ci lite] apply automatic fixes
pre-commit-ci-lite[bot] Apr 8, 2025
9a738a7
path fix
rv355 Apr 8, 2025
a06b4a1
path fix
rv355 Apr 8, 2025
e7da43b
Merge remote-tracking branch 'origin/develop' into kubernetes_support
rv355 Apr 8, 2025
65bc19d
Merge remote-tracking branch origin/develop into kubernetes_support
rv355 Apr 9, 2025
888d4dd
removed stray text in test file
rv355 Apr 9, 2025
8355467
[pre-commit.ci lite] apply automatic fixes
pre-commit-ci-lite[bot] Apr 9, 2025
44d41af
updates to cleandb
rv355 Apr 9, 2025
a79eb33
Merge branch 'kubernetes_support' of https://github.com/IntelLabs/vdm…
rv355 Apr 9, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .github/coverage/cpp.develop.coverage_report.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ src/CommunicationManager.cc 46 0 0% 42-43,46-47,49
src/DescriptorsCommand.cc 735 455 61% 95,101,114,167-169,173,187-191,243-254,258-259,263-268,278,286-289,303-305,309,324-333,335,355-358,365-369,402,405-408,414,416-417,420-422,424-425,427-428,431-432,434-436,459-461,465-469,476,482,484,486-487,490,524,563-565,575,585-590,596,598,600-601,603-604,644,672,692,696,698,701,703-706,709-714,716-720,722,725,727,729,732,735-736,738,740,742-747,750,752-754,757-758,760,762,764-765,767,769,771-773,775,777-782,787-788,791,793,795,820-822,841-842,845-846,859-862,877,879,882-883,886,916-918,935-937,965-967,973-974,1004-1007,1023-1024,1026-1027,1029,1031-1032,1034,1049,1052,1060,1065,1086-1088,1092-1095,1104,1106,1108-1112,1115-1116,1119-1122,1124,1126-1133,1158-1162,1167-1171,1181-1184,1198-1201,1213-1214,1255-1258,1288,1291,1311-1315,1331-1332
src/DescriptorsManager.cc 25 23 92% 49-50
src/ExceptionsCommand.cc 6 0 0% 35-40
src/ImageCommand.cc 309 139 45% 55,58-59,62-69,71-76,78,80-81,83,90,93,95-96,98-99,101-102,104-105,108,135,146-147,158-159,161,166-169,179-180,182,187-190,197-199,205-213,215-217,230-231,241-251,253-254,256-257,262,270,281,288,292,295,297,299,321,323-324,327-332,334,336,358-360,363-365,369-372,378,380,387-390,404,411,417-420,424-425,436-439,442-447,452-454,465-468,473-477,482-483,485-486,488-492,495,497-501,504-507,510-511,514,516,521
src/ImageCommand.cc 323 157 48% 65,69,73,75,77-79,81,83-86,101-102,107,112,114-115,123,125,132,135,137-138,140-141,143-144,146-147,150,177,188-189,200-201,203,208-211,221-222,224,229-232,247-255,257-259,272-273,283-293,295-296,298-299,304,312,323,330,334,337,339,341,363,365-366,369-374,376,378,400-402,405-407,411-414,420,422,429-432,446,453,459-462,466-467,478-481,484-489,494-496,507-510,515-519,524-525,527-528,530-534,537,539-543,546-549,552-553,556,558,563
src/ImageLoop.cc 253 232 91% 63,130,182-185,215,221,265,285,288,297-298,300,307-308,322-323,330,334,338
src/Neo4jBaseCommands.cc 36 23 63% 17,21,23-24,26,33,53,57-59,66-68
src/Neo4JDescriptorCommands.cc 551 405 73% 90,96-99,101-102,104-105,107,110-111,113,116-117,135-136,138-139,141,143-144,146,151,154-155,158-161,163-164,168,170-173,175-178,231,234,313-324,329-331,355-357,361-362,376-385,387,404-408,510,513-516,539-541,545-550,556-557,614-616,628-633,693,738-740,745-746,749-750,765-768,815-817,847-849,856-857,876-879,904-906,910-913,975-976,1028-1029,1032-1033,1054-1058
Expand Down Expand Up @@ -44,10 +44,10 @@ src/vcl/TDBDescriptorSet.cc 51 46 90% 127,148,150,15
src/vcl/TDBImage.cc 471 370 78% 164,186,209,255-257,268-271,276,300-302,305-306,308,325,341-344,346-350,352-354,364,366,386,406-411,414-417,421-424,428-431,433-435,437-439,523-524,551,553-556,558-559,561-562,564-567,578,580,583,585,644,664-668,750-754,756-758,760,762-767,770-772,785
src/vcl/TDBObject.cc 326 271 83% 112-114,116,118,120,219,221-222,258,321-322,386-388,398,432-433,462-463,493-494,496,500-501,503,621-632,638-651,661-663
src/vcl/TDBSparseDescriptorSet.cc 245 230 93% 163,190-191,230-232,252,294-296,308-309,380-381,441
src/vcl/utils.cc 73 65 89% 55-56,66,72,80,92,94,122
src/vcl/Video.cc 776 584 75% 67,128,134,139,161,167-168,190,192-196,199-202,219-224,232,234-240,242-246,249-251,255-256,261-262,264-265,267,269,272-273,275-276,279-280,297,315-328,345,347,349-351,380,413-415,457,466,489,495,505,528,649,651,662,673,679-682,691,710,713,715-716,719-720,749-750,771-773,776-777,779-780,783-784,803-806,834-836,839,842-844,859-862,870,872,874-879,891-894,928,950,965,988,992,1022,1024-1026,1028-1029,1048-1049,1070,1107,1115,1132,1147,1151,1158,1162,1181,1184,1189-1190,1193-1194,1196,1207,1211,1216,1234-1237,1290,1296-1298,1309,1311,1315,1319,1325-1337
src/vdms.cc 118 0 0% 40,42-43,45-48,50-51,53-56,58-59,62-64,66-67,69,71,74-76,79,84,86-89,91,93-99,101-104,106-107,109-112,114-116,118-121,123-125,127-130,132-133,135-138,140-141,143-144,148-150,153-156,159,162-164,167,169,172,175-181,188,190,193-194,198,201,207-208,211,217-220,223-232,235
src/VDMSConfig.cc 225 210 93% 109-110,137-139,214,216,219-220,226-227,231-232,343-344
src/vcl/utils.cc 71 63 88% 54-55,65,71,79,91,93,121
src/vcl/Video.cc 746 565 75% 66,127,133,138,160,166-167,189,191-195,198-201,218-223,231,233-239,241-245,248-250,254-255,260-261,263-264,266,268,271-272,274-275,278-279,296,314-327,344,346,348-350,379,412-414,456,465,488,494,517,637,639,650,656,660-661,670,689,692,694-695,698-699,728-729,750-752,755-756,758-759,762-763,782-785,813-815,818,821-823,838-841,849,851,853-858,870-873,907,929,944,967,971,1000-1001,1020-1021,1042,1079,1087,1104,1119,1123,1130,1134,1151,1154,1159-1160,1163-1164,1166,1177,1181,1186,1204-1207,1260,1264,1266-1267,1269-1270,1272,1274,1277-1278,1281-1282,1288-1292
src/vdms.cc 108 0 0% 39,41-42,44-47,49-50,52-55,57-58,61-63,65-66,68,70,73-75,78,82,84-87,89,91-97,99-102,104-105,107-110,112-114,116-119,121-122,124-127,129-130,132-135,137-138,140-141,145-147,150-153,156,158-160,163,165,168,171-177,183,185,188-189,193,196,202-203,206,212-215,218,220
src/VDMSConfig.cc 226 213 94% 131-133,209,211,214-215,221-222,226-227,338-339
src/VideoCommand.cc 474 117 24% 50,53-54,56-58,60,62,65-66,68-69,72,74-76,78-80,82,84-87,89-90,92-93,95,97-99,102,109,111,116,121-124,130,132,158-161,167-168,170,181,184,201,213,217-220,227-229,231-233,239,241-247,249-250,253-255,257-259,261-262,264,266-278,280-282,284-285,296,300,325,329,331,333,335,337,340-341,343,346,350,352,357-358,380-381,383-384,387-392,394,396,398-399,405,407,429-431,436,442-445,449-454,456-463,467-473,475,480-485,488,490-491,494-496,504,509,527-532,535-539,555,558,560-562,565-567,569-570,572-576,579-580,583-585,587,589-591,594-597,601-606,611-612,614-615,617-621,624-626,628,630-632,634-637,640-641,644,646,651,664,666-673,677,680,683,688-689,691-695,698-699,701,703,705,708,712,714,716-719,721-723,726,728,730,732-733,735-736,740,745,748-749,751-753,755,757,759-761,763-764,767-769,773-776,780-786,790-794,798,801,803,805,807,809-813,817-821,824-825,827-830,833-836,841-842,846-851,855-856,859-860
src/VideoLoop.cc 250 217 86% 33,81,98-101,103-109,180,188,197,201,207,211,217,220,290,312,315,320-321,324-325,327,334-335,354,370
utils/src/comm/ConnClient.cc 69 57 82% 49,55,59-60,98,103,108,114,120,127,130,149
Expand Down
14 changes: 8 additions & 6 deletions .github/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,23 @@ blinker==1.9.0
cffi==1.17.1
click==8.1.8
colorlog==6.9.0
coverage==7.6.12
cryptography==44.0.1
coverage==7.7.0
cryptography==44.0.2
Flask==3.1.0
gcovr==8.3
imutils==0.5.4
itsdangerous==2.2.0
Jinja2==3.1.5
Jinja2==3.1.6
lxml==5.3.1
MarkupSafe==3.0.2
numpy==1.26.4
opencv-python-headless==4.9.0.80
opencv-python-headless==4.11.0.86
pillow==11.1.0
protobuf==4.24.2
pycparser==2.22
Pygments==2.19.1
pyzmq==26.0.3
pyzmq==26.3.0
scipy==1.15.2
sk-video==1.1.10
Werkzeug==3.1.3
Werkzeug==3.1.3
zmq==0.0.0
65 changes: 53 additions & 12 deletions .github/scripts/Dockerfile.checkin
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ ARG NEO4J_PASS=""
ARG NEO4J_ENDPOINT=""
ARG AWS_API_PORT=9000
ARG AWS_CONSOLE_PORT=9001
ARG USE_K8S="OFF"

ENV DEBIAN_FRONTEND=noninteractive
ENV DEBCONF_NOWARNINGS="yes"
Expand All @@ -32,6 +33,11 @@ ENV NEO4J_ENDPOINT="${NEO4J_ENDPOINT}"
ENV AWS_API_PORT="${AWS_API_PORT}"
ENV AWS_CONSOLE_PORT="${AWS_CONSOLE_PORT}"

# Convert ARG value to uppercase and set ENV
RUN export USE_K8S=$(echo "${USE_K8S^^}") && \
echo "export USE_K8S=${USE_K8S}" >> /etc/profile.d/envvars.sh
ENV USE_K8S="${USE_K8S}"

############################################################
# BUILD DEPENDENCIES
FROM base AS build
Expand All @@ -42,14 +48,14 @@ RUN apt-get update -y && apt-get upgrade -y && \
apt-get install -o 'Acquire::Retries=3' -y --no-install-suggests \
--no-install-recommends --fix-broken --fix-missing \
apt-transport-https automake bison build-essential bzip2 ca-certificates \
cppzmq-dev curl ed flex g++ gcc git gnupg-agent javacc libarchive-tools libatlas-base-dev \
libavcodec-dev libavformat-dev libavutil-dev libboost-all-dev libbz2-dev libc-ares-dev \
cppzmq-dev curl ed flex g++ bazel-bootstrap gcc git gnupg-agent javacc libarchive-tools libatlas-base-dev \
libavcodec-dev libavformat-dev libavutil-dev libbison-dev libboost-all-dev libbz2-dev libc-ares-dev \
libcurl4-openssl-dev libdc1394-dev libgflags-dev libgoogle-glog-dev \
libgtk-3-dev libgtk2.0-dev libhdf5-dev libjpeg-dev libjpeg62-turbo-dev libjsoncpp-dev \
libleveldb-dev liblmdb-dev liblz4-dev libncurses5-dev libopenblas-dev libopenmpi-dev \
libpng-dev librdkafka-dev libsnappy-dev libssl-dev libswscale-dev libtbb-dev libtbbmalloc2 \
libtiff-dev libtiff5-dev libtool linux-libc-dev mpich openjdk-17-jdk-headless \
pkg-config procps software-properties-common swig unzip uuid-dev && \
libtiff-dev libtiff5-dev libtool libwebsockets-dev linux-libc-dev mpich openjdk-17-jdk-headless \
pkg-config procps software-properties-common swig uncrustify unzip uuid-dev && \
apt-get --purge remove -y python3.11 && apt-get autoremove -y && \
apt-get clean && rm -rf /var/lib/apt/lists/*

Expand Down Expand Up @@ -163,6 +169,29 @@ RUN curl -L -O https://github.com/gpakosz/peg/releases/download/${PEG_VERSION}/p
./configure --disable-werror --prefix=/opt/dist/usr && \
make clean check && make install -w --debug

RUN if [ "${USE_K8S}" = "ON" ]; then \
git clone --depth 1 https://github.com/yaml/libyaml.git /dependencies/libyaml && \
cd /dependencies/libyaml && \
mkdir build && \
cd build && \
cmake -DCMAKE_INSTALL_PREFIX=/usr/local -DBUILD_TESTING=OFF -DBUILD_SHARED_LIBS=ON .. && \
make ${BUILD_THREADS} && \
make install; \
fi

#Kubernetes
RUN if [ "${USE_K8S}" = "ON" ]; then \
git clone https://github.com/kubernetes-client/c.git /dependencies/k8s && \
ls /dependencies/k8s && \
CLIENT_REPO_ROOT=/dependencies/k8s && \
cd ${CLIENT_REPO_ROOT}/kubernetes && \
mkdir build && \
cd build && \
cmake -DCMAKE_PREFIX_PATH=/usr/local -DCMAKE_INSTALL_PREFIX=/usr/local .. && \
make ${BUILD_THREADS} && \
make install; \
fi

# CLEANUP
RUN rm -rf /dependencies /usr/local/share/doc /usr/local/share/man && \
mkdir -p /opt/dist/usr/include/x86_64-linux-gnu && \
Expand All @@ -172,7 +201,11 @@ RUN rm -rf /dependencies /usr/local/share/doc /usr/local/share/man && \
############################################################
# FINAL IMAGE
FROM base
ARG BUILD_COVERAGE="on"
ARG BUILD_COVERAGE="ON"

# Convert ARG value to uppercase and set ENV
RUN export BUILD_COVERAGE=$(echo "${BUILD_COVERAGE^^}") && \
echo "export BUILD_COVERAGE=${BUILD_COVERAGE}" >> /etc/profile.d/envvars.sh
ENV BUILD_COVERAGE="${BUILD_COVERAGE}"

# COPY FILES
Expand All @@ -190,22 +223,29 @@ COPY user_defined_operations /vdms/user_defined_operations
COPY utils /vdms/utils
COPY CMakeLists.txt /vdms/CMakeLists.txt
COPY config-vdms.json /vdms/config-vdms.json
COPY kubernetes/global_vdms_setup_script.sh /vdms/kubernetes/global_vdms_setup_script.sh
COPY kubernetes/kubeConfig.json /vdms/kubernetes/kubeConfig.json
COPY docker/override_default_config.py /vdms/override_default_config.py
COPY --from=build /opt/dist /
COPY --from=build /usr/local/bin/python${PYTHON_BASE} /usr/local/bin/python${PYTHON_BASE}
COPY --from=build /usr/local/lib/python${PYTHON_BASE} /usr/local/lib/python${PYTHON_BASE}
COPY --from=build ${VIRTUAL_ENV} ${VIRTUAL_ENV}
COPY --from=build /usr/local/include/kubernete[s] /usr/local/include/kubernetes
COPY --from=build /usr/include/libwebsocket[s] /usr/include/libwebsockets
COPY --from=build /usr/local/lib/libkubernetes.s[o] /usr/local/lib/libkubernetes.so
COPY --from=build /usr/local/lib/libyaml.s[o] /usr/local/lib/libyaml.so
COPY --from=build /usr/lib/x86_64-linux-gnu/libwebsockets.s[o] /usr/lib/x86_64-linux-gnu/libwebsockets.so
ENV PATH="$VIRTUAL_ENV/bin:$PATH"

# hadolint ignore=DL3008,SC2086
RUN apt-get update -y && apt-get upgrade -y && \
apt-get install -o 'Acquire::Retries=3' -y --no-install-suggests \
--no-install-recommends --fix-broken --fix-missing \
build-essential bzip2 cppzmq-dev curl g++ gcc git javacc libarchive-tools libavcodec-dev \
build-essential bzip2 cppzmq-dev curl g++ gcc git javacc libarchive-tools libavcodec-dev bazel-bootstrap \
libavformat-dev libcurl4-openssl-dev libdc1394-dev libgoogle-glog-dev libgtk-3-dev \
libhdf5-dev libjpeg62-turbo-dev libjsoncpp-dev libopenblas-dev libpng-dev librdkafka-dev \
libssl-dev libswscale-dev libtbb-dev libtbbmalloc2 libtiff5-dev libzip-dev openjdk-17-jdk-headless \
procps && \
libssl-dev libswscale-dev libtbb-dev libtbbmalloc2 libtiff5-dev libwebsockets-dev libzip-dev \
openjdk-17-jdk-headless procps uncrustify && \
apt-get --purge remove -y python3.11 && apt-get autoremove -y && \
apt-get clean && rm -rf /var/lib/apt/lists/* && \
echo "/usr/local/lib" >> /etc/ld.so.conf.d/all-libs.conf && ldconfig && \
Expand All @@ -215,7 +255,7 @@ RUN apt-get update -y && apt-get upgrade -y && \
# COVERAGE TESTING
WORKDIR /vdms
# hadolint ignore=DL3008,SC2086
RUN if [ "${BUILD_COVERAGE}" = "on" ]; then \
RUN if [ "${BUILD_COVERAGE}" = "ON" ]; then \
apt-get update -y ; \
apt-get install -y --no-install-suggests --no-install-recommends gdb ; \
apt-get clean ; \
Expand All @@ -240,11 +280,12 @@ RUN git submodule update --init --recursive && \
sed -i "s|#include <stdio.h>|#include <stdio.h>\n#include <stdexcept>|" /vdms/src/pmgd/test/neighbortest.cc && \
sed -i "s|#include <stdio.h>|#include <stdio.h>\n#include <stdexcept>|" /vdms/src/pmgd/tools/mkgraph.cc && \
mkdir -p /vdms/build && cd /vdms/build && \
cmake -DCODE_COVERAGE="${BUILD_COVERAGE}" .. && make ${BUILD_THREADS} && \
cmake -DUSE_K8S="${USE_K8S}" -DCODE_COVERAGE="${BUILD_COVERAGE}" .. && make ${BUILD_THREADS} VERBOSE=1 && \
echo '#!/bin/bash' > /start.sh && echo 'cd /vdms/build' >> /start.sh && \
echo 'python /vdms/override_default_config.py -i /vdms/config-vdms.json -o /vdms/build/config-vdms.json' >> /start.sh && \
echo 'python3 /vdms/override_default_config.py -i /vdms/config-vdms.json -o /vdms/build/config-vdms.json' >> /start.sh && \
echo './vdms' >> /start.sh && chmod 755 /start.sh

ENV PYTHONPATH=/vdms/client/python:${PYTHONPATH}
ENV PYTHONPATH=/vdms/client/python

HEALTHCHECK CMD echo "This is a healthcheck test." || exit 1
CMD ["/start.sh"]
3 changes: 2 additions & 1 deletion .github/scripts/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ services:
dockerfile: .github/scripts/Dockerfile.checkin
context: ../..
args:
- BUILD_COVERAGE=on
- BUILD_COVERAGE=ON
- USE_K8S=ON
image: vdms:${SOURCE_CONTAINER_NAME}
container_name: ${SOURCE_CONTAINER_NAME}
networks: [backend, frontend]
Expand Down
27 changes: 22 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,16 @@ cmake_minimum_required (VERSION 3.17)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall")
set(CMAKE_CXX_STANDARD 17)

option(USE_K8S "Enable kubernetes client libraries" OFF)
string(TOUPPER ${USE_K8S} USE_K8S)

option(CLIENT "Built client library." OFF)

IF(CODE_COVERAGE)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -O0 -Wall -coverage -fprofile-abs-path")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -O0 -Wall -coverage -fprofile-abs-path")
enable_testing()
string(TOUPPER ${CODE_COVERAGE} CODE_COVERAGE)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -O0 -Wall -coverage -fprofile-abs-path")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -O0 -Wall -coverage -fprofile-abs-path")
enable_testing()
ENDIF()

project(vdms_application)
Expand Down Expand Up @@ -41,7 +46,6 @@ protobuf_generate(
PROTOC_OUT_DIR "${PROTO_BINARY_DIR}"
)

option(CLIENT "Built client library." OFF)
if (CLIENT)
add_definitions("-D CLIENT")

Expand All @@ -59,7 +63,14 @@ else()
add_subdirectory(distributed)

link_directories(/usr/local/lib /usr/lib/x86_64-linux-gnu/)
include_directories(/usr/include/jsoncpp utils/include/ src/pmgd/include src/pmgd/util include/ src/vcl /usr/include ${CMAKE_CURRENT_BINARY_DIR}/utils/src/protobuf)

if(USE_K8S)
include_directories(/usr/include/jsoncpp utils/include/ src/pmgd/include src/pmgd/util include/ src/vcl /usr/include ${CMAKE_CURRENT_BINARY_DIR}/utils/src/protobuf /usr/local/include/kubernetes /usr/include/libwebsockets)
add_definitions("-D HAS_KUBERNETES_CLIENT")
else()
include_directories(/usr/include/jsoncpp utils/include/ src/pmgd/include src/pmgd/util include/ src/vcl /usr/include ${CMAKE_CURRENT_BINARY_DIR}/utils/src/protobuf)
endif()

add_library(dms SHARED
src/BackendNeo4j.cc
src/BoundingBoxCommand.cc
Expand Down Expand Up @@ -90,7 +101,13 @@ else()
src/ImageLoop.cc
src/VideoLoop.cc
)

target_link_libraries(dms vcl pmgd pmgd-util protobuf tbb tiledb vdms-utils pthread -lcurl -lzmq -lzip ${AWSSDK_LINK_LIBRARIES} neo4j-client)

add_executable(vdms src/vdms.cc)

target_link_libraries(vdms dms vdms_protobuf vcl tiledb faiss flinng jsoncpp ${OpenCV_LIBS} ${AWSSDK_LINK_LIBRARIES})
endif ()

message("Coverage:" ${CODE_COVERAGE})
message("USE_K8S:" ${USE_K8S})
31 changes: 30 additions & 1 deletion INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -275,8 +275,29 @@ cd $VDMS_DEP_DIR/libomni
make clean check
sudo make install -w --debug
```

<br>

#### **Kubernetes Client**
Installation required only if you plan to use the kubernetes environment
Follow [[Kubernetes README](kubernetes/README.md)] for how to set up the environment.
```bash
git clone --depth 1 https://github.com/yaml/libyaml.git /dependencies/libyaml
cd $VDMS_DEP_DIR/libyaml
mkdir build && cd build
cmake -DCMAKE_INSTALL_PREFIX=/usr/local/ -DBUILD_TESTING=OFF -DBUILD_SHARED_LIBS=ON ..
make
sudo make install

CLIENT_REPO_ROOT=$VDMS_DEP_DIR/k8s
git clone https://github.com/kubernetes-client/c.git ${CLIENT_REPO_ROOT}
cd ${CLIENT_REPO_ROOT}/kubernetes
mkdir build && cd build
cmake ..
make
sudo make install
```

## Install VDMS
This version of VDMS treats PMGD as a submodule so both libraries are compiled at one time. After entering the vdms directory, the command `git submodule update --init --recursive` will pull pmgd into the appropriate directory. Furthermore, Cmake is used to compile all directories.
```bash
Expand All @@ -297,7 +318,7 @@ sed -i "s|#include <libavcodec/avcodec.h>||" include/vcl/KeyFrame.h
sed -i "s|#include <libavcodec/bsf.h>||" include/vcl/KeyFrame.h
```

When compiling on a target without Optane persistent memory, use the following:
When compiling on a target without Optane persistent memory and without Kubernetes, use the following:
```bash
mkdir build && cd build
cmake ..
Expand All @@ -313,6 +334,14 @@ make ${BUILD_THREADS}
cp ../config-vdms.json .
```

If you plan on setting up the Kubernetes environment with VDMS and remote operations (experimental), use the following:
```bash
mkdir build && cd build
cmake -DUSE_K8S=ON ..
make ${BUILD_THREADS}
cp ../config-vdms.json .
```

***NOTE:*** If error similar to `cannot open shared object file: No such file or directory` obtained during loading shared libraries, such as `libpmgd.so` or `libvcl.so`, add the correct directories to `LD_LIBRARY_PATH`. This may occur for non-root users. To find the correct directory, run `find` command for missing object file. An example solution for missing `libpmgd.so` and `libvcl.so` is:
```bash
find / -name "libpmgd*so*" # <Path_to_VDMS_directory>/build/src/pmgd/src
Expand Down
1 change: 1 addition & 0 deletions config-vdms.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,6 @@
// use_endpoint: [true|false] in case of "storage_type" is equals to "aws", this key is used to specify whether it is going to use a "mocked" AWS connection
"use_endpoint": false,
"bucket_name": "minio-bucket",
"k8s_container": false,
"more-info": "github.com/IntelLabs/vdms"
}
Loading
Loading