Page MenuHomePhabricator

D5458.id17869.diff
No OneTemporary

D5458.id17869.diff

diff --git a/services/docker-compose.yml b/services/docker-compose.yml
--- a/services/docker-compose.yml
+++ b/services/docker-compose.yml
@@ -20,7 +20,7 @@
- $HOME/.aws/config:/root/.aws/config:ro
- $HOME/.aws/credentials:/root/.aws/credentials:ro
- ./tunnelbroker/tunnelbroker.ini:/root/tunnelbroker/tunnelbroker.ini:ro
- - ./tunnelbroker/tunnelbroker-dev.ini:/root/tunnelbroker/tunnelbroker-dev.ini:ro
+ - ./tunnelbroker/tunnelbroker-sandbox.ini:/root/tunnelbroker/tunnelbroker-sandbox.ini:ro
# backup
backup-server:
depends_on:
diff --git a/services/tunnelbroker/Dockerfile b/services/tunnelbroker/Dockerfile
--- a/services/tunnelbroker/Dockerfile
+++ b/services/tunnelbroker/Dockerfile
@@ -1,27 +1,6 @@
FROM commapp/services-base:1.3.2
-ARG MAKE_JOBS=4
-ENV MAKEFLAGS="-j${MAKE_JOBS}"
-
-WORKDIR /transferred/scripts
-
-# Install Curl
-RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y curl
-
-# Install SDKs
-COPY services/tunnelbroker/docker/install_amqp_cpp.sh .
-RUN ./install_amqp_cpp.sh
-
-COPY services/tunnelbroker/docker/install_cryptopp.sh .
-RUN ./install_cryptopp.sh
-
-COPY services/tunnelbroker/docker/install_libuv.sh .
-RUN ./install_libuv.sh
-
-RUN curl https://sh.rustup.rs -sSf | sh -s -- -y
-
-COPY services/lib/docker/install_corrosion.sh .
-RUN ./install_corrosion.sh
+ENV PATH=/root/.cargo/bin:$PATH
ARG COMM_TEST_SERVICES
ARG COMM_SERVICES_SANDBOX
@@ -29,19 +8,37 @@
ENV COMM_TEST_SERVICES=${COMM_TEST_SERVICES}
ENV COMM_SERVICES_SANDBOX=${COMM_SERVICES_SANDBOX}
-WORKDIR /transferred
+# Install Curl
+RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y curl
-COPY services/lib/src/ lib/src/
-COPY shared/ shared/
+# Copying of the Tunnelbroker code
+WORKDIR /transferred/services/tunnelbroker
+COPY services/tunnelbroker/ .
-WORKDIR /transferred/tunnelbroker
+# Install SDKs
+RUN ./docker/install_amqp_cpp.sh
+RUN ./docker/install_cryptopp.sh
+RUN ./docker/install_libuv.sh
-ADD shared/protos grpc
-COPY services/lib/cmake-components cmake-components
-COPY services/lib/docker/ scripts/
-COPY services/tunnelbroker/docker/* docker/
-COPY services/tunnelbroker/ .
+RUN curl https://sh.rustup.rs -sSf | sh -s -- -y
-RUN scripts/build_service.sh
+# Copying of the shared code
+WORKDIR /transferred
+COPY services/lib/src/ services/lib/src/
+COPY shared/ shared/
-CMD if [ "$COMM_TEST_SERVICES" -eq 1 ]; then scripts/run_tests.sh; else scripts/run_service.sh; fi
+# Build C++ library gTests by CMake
+WORKDIR /transferred/services/tunnelbroker/src/libcpp/test
+RUN cmake -B build . && make -C build -j$(nproc)
+
+# Build Rust by Cargo
+WORKDIR /transferred/services/tunnelbroker
+RUN cargo build
+
+CMD if [ "$COMM_TEST_SERVICES" -eq 1 ];\
+ then\
+ src/libcpp/test/build/bin/runTests --gtest_filter='-AmqpManager*:DatabaseManager*'\
+ && cargo test;\
+ else\
+ cargo run;\
+ fi

File Metadata

Mime Type
text/plain
Expires
Mon, Nov 25, 3:57 PM (19 h, 19 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2580386
Default Alt Text
D5458.id17869.diff (2 KB)

Event Timeline