Merge branch 'stage2' of github.com:gradido/gradido_login_server into stage2

This commit is contained in:
einhornimmond 2021-03-09 16:51:05 +01:00 committed by Ulf Gebhardt
commit a58622b3dc
No known key found for this signature in database
GPG Key ID: 81308EFE29ABFEBD
4 changed files with 133 additions and 136 deletions

1
.gitignore vendored
View File

@ -5,3 +5,4 @@ src/cpsp/*.h
src/cpsp/*.cpp
src/cpp/proto/
build*/
/skeema/gradido_login/insert/crypto_key.sql

View File

@ -1,132 +1,114 @@
#########################################################################################################
# Build protoc
#########################################################################################################
FROM gcc:7.5 as protoc_build
RUN git clone --recurse-submodules https://github.com/protocolbuffers/protobuf.git
WORKDIR /protobuf
RUN git checkout v3.9.1
RUN ./autogen.sh
RUN ./configure --enable-static=yes
RUN make -j$(grep processor /proc/cpuinfo | wc -l)
RUN make check
CMD ["./protobuf"]
#########################################################################################################
# debug build preparation
#########################################################################################################
From conanio/gcc7 as debug_preparation
ENV DOCKER_WORKDIR="/code"
USER root
COPY --from=protoc_build /protobuf/src/.libs/protoc /usr/bin/
COPY --from=protoc_build /protobuf/src/.libs/libprotobuf.so.20.0.1 /usr/lib/libprotobuf.so.20
COPY --from=protoc_build /protobuf/src/.libs/libprotoc.so.20.0.1 /usr/lib/libprotoc.so.20
COPY --from=protoc_build /protobuf/src/google/protobuf/*.proto /usr/include/google/protobuf/
COPY --from=protoc_build /protobuf/src/google/protobuf/*.h /usr/include/google/protobuf/
#VOLUME /root/.conan
RUN mkdir -p ${DOCKER_WORKDIR}
WORKDIR ${DOCKER_WORKDIR}
COPY ./dependencies ./dependencies
COPY ./conanfile.txt ./conanfile.txt
RUN ls -la
RUN cd dependencies/iroha-ed25519 && \
ls -la && \
mkdir build && \
cd build && \
cmake .. -DCMAKE_BUILD_TYPE=Debug -DEDIMPL=ref10 -DHASH=sha2_sphlib -DRANDOM=bcryptgen -DBUILD=STATIC && \
make -j$(grep processor /proc/cpuinfo | wc -l)
RUN cd dependencies/mariadb-connector-c && \
mkdir build && \
cd build && \
cmake -DCMAKE_BUILD_TYPE=Debug -DWITH_SSL=OFF ..
#RUN chmod +x compile_proto.sh
#RUN chmod +x compile_pot.sh
#RUN ls -la
#RUN ./compile_pot.sh
#RUN ./compile_proto.sh
RUN mkdir build && \
cd build && \
conan install .. --build=missing -s build_type=Debug
#########################################################################################################
# Build debug
#########################################################################################################
From debug_preparation as debug
ENV DOCKER_WORKDIR="/code"
USER root
#VOLUME /root/.conan
RUN apt-get update && \
apt-get install -y --no-install-recommends gdb && \
apt-get autoclean && \
apt-get autoremove && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
#COPY --from=protoc_build /protobuf/src/.libs/libprotobuf.so.20.0.1 /usr/lib/libprotobuf.so.20
#COPY --from=protoc_build /protobuf/src/google/protobuf/*.h /usr/include/google/protobuf/
#COPY --from=debug_preparation /code /code
#COPY --from=debug_preparation /home/conan /home/conan
#RUN ls -la /home/conan/.conan
COPY . .
WORKDIR ${DOCKER_WORKDIR}
#RUN ls -la
#RUN cat build/conanbuildinfo.cmake
RUN chmod +x compile_proto.sh
RUN chmod +x compile_pot.sh
#RUN ls -la
RUN ./compile_pot.sh
RUN ./compile_proto.sh
RUN cd build && \
cmake -DCMAKE_BUILD_TYPE=Debug .. && \
make -j$(grep processor /proc/cpuinfo | wc -l)
#########################################################################################################
# run debug
#########################################################################################################
FROM ubuntu:latest as login_server_debug
WORKDIR "/usr/bin"
#RUN apt-get update && \
# apt-get install -y --no-install-recommends gdb && \
# apt-get autoclean && \
# apt-get autoremove && \
# apt-get clean && \
# rm -rf /var/lib/apt/lists/*
VOLUME /var/log/grd_login
COPY --from=debug /code/build/bin/Gradido_LoginServer /usr/bin/
COPY --from=debug /code/build/lib/libmariadb.so.3 /usr/lib/
#COPY start_after_mysql.sh .
RUN chmod +x /usr/bin/Gradido_LoginServer
EXPOSE 1200
EXPOSE 1201
#ENTRYPOINT ["/usr/bin/Gradido_LoginServer"]
# Wait on mariadb to started
#CMD ["sleep 5", "/usr/bin/Gradido_LoginServer"]
#RUN chmod +x ./start_after_mysql.sh
#ENTRYPOINT ["/usr/bin/Gradido_LoginServer"]
#CMD gdb -ex=r Gradido_LoginServer
#########################################################################################################
# debug build preparation
#########################################################################################################
From conanio/gcc9 as build_debug_preparation
USER root
#RUN apt-get update && \
# apt-get install -y --no-install-recommends gcc g++ && \
# apt-get autoclean && \
# apt-get autoremove && \
# apt-get clean && \
# rm -rf /var/lib/apt/lists/*
ENV DOCKER_WORKDIR="/code"
#VOLUME /root/.conan
RUN mkdir -p ${DOCKER_WORKDIR}
WORKDIR ${DOCKER_WORKDIR}
COPY ./dependencies ./dependencies
COPY ./conanfile.txt ./conanfile.txt
RUN cd dependencies/mariadb-connector-c && \
mkdir build && \
cd build && \
cmake -DCMAKE_BUILD_TYPE=Debug -DWITH_SSL=OFF ..
RUN mkdir build && \
cd build && \
conan install .. --build=missing -s build_type=Debug
#########################################################################################################
# debug build proto and grpc
#########################################################################################################
From build_debug_preparation as proto_grpc
ENV DOCKER_WORKDIR="/code"
WORKDIR ${DOCKER_WORKDIR}
COPY ./CMakeLists.txt .
RUN cd build && \
cmake -DCMAKE_BUILD_TYPE=Debug .. && \
make -j${CPU_COUNT} protoc grpc_cpp_plugin
#########################################################################################################
# parse proto and gettext
#########################################################################################################
From proto_grpc as proto_parse
ENV DOCKER_WORKDIR="/code"
WORKDIR ${DOCKER_WORKDIR}
RUN mkdir src && \
cd src && \
mkdir cpp
COPY ./src/proto ./src/proto
COPY ./unix_parse_proto.sh .
RUN chmod +x unix_parse_proto.sh && \
./unix_parse_proto.sh
#########################################################################################################
# Build debug
#########################################################################################################
From proto_parse as build_debug
ENV DOCKER_WORKDIR="/code"
USER root
WORKDIR ${DOCKER_WORKDIR}
COPY ./src/cpp ./src/cpp
COPY ./src/LOCALE ./src/LOCALE
COPY ./compile_pot.sh .
COPY ./files_to_translate.txt .
RUN chmod +x compile_pot.sh && \
./compile_pot.sh
RUN cd build && \
cmake -DCMAKE_BUILD_TYPE=Debug .. && \
make -j$(nproc)
CMD bash
#########################################################################################################
# run debug
#########################################################################################################
FROM ubuntu:latest as login_server_debug
WORKDIR "/usr/bin"
#RUN apt-get update && \
# apt-get install -y --no-install-recommends gdb && \
# apt-get autoclean && \
# apt-get autoremove && \
# apt-get clean && \
# rm -rf /var/lib/apt/lists/*
VOLUME /var/log/grd_login
COPY --from=build_debug /code/build/bin/Gradido_LoginServer /usr/bin/
COPY --from=build_debug /code/build/lib/libmariadb.so.3 /usr/lib/
#COPY --from=build_debug /code/build/lib/libPocoNetSSLd.so.64 /usr/lib/libPocoNetSSLd.so.64
RUN chmod +x /usr/bin/Gradido_LoginServer
EXPOSE 1200
EXPOSE 1201
#CMD gdb -ex=r Gradido_LoginServer
CMD Gradido_LoginServer

View File

@ -8,11 +8,6 @@ gtest/1.8.1@bincrafters/stable
cmake
[options]
Poco:shared=True
Poco:enable_data_sqlite=False
Poco:enable_mongodb=False
Poco:enable_redis=False
boost:shared=True
[generators]
virtualrunenv

View File

@ -0,0 +1,19 @@
INSERT INTO `node_servers` (`id`, `url`, `port`, `group_id`, `server_type`, `node_hedera_id`, `last_live_sign`) VALUES
(1, 'http://0.testnet.hedera.com', 50211, 0, 4, 1, '2000-01-01 00:00:00');
INSERT INTO `hedera_ids` (`id`, `shardNum`, `realmNum`, `num`) VALUES
(1, 0, 0, 3),
(2, 0, 0, 3327),
(3, 0, 0, 413151);
INSERT INTO `hedera_accounts` (`id`, `user_id`, `account_hedera_id`, `account_key_id`, `balance`, `network_type`, `updated`) VALUES
(1, 1, 2, 1, 1000000000000, 1, '2021-01-07 10:22:52');
INSERT INTO `groups` (`id`, `alias`, `name`, `url`, `home`, `description`) VALUES
(1, 'docker_stage2', 'docker stage2 gradido group', 'localhost', '/', 'gradido test group for docker and stage2');
INSERT INTO `hedera_topics` (`id`, `topic_hedera_id`, `name`, `auto_renew_account_hedera_id`, `auto_renew_period`, `group_id`, `admin_key_id`, `submit_key_id`, `current_timeout`, `sequence_number`, `running_hash`, `running_hash_version`, `updated`) VALUES
(1, 2, 'docker_stage2', 2, 7890000, 1, 0, 0, '2021-06-08 23:17:19', 0, NULL, 0, '2021-03-09 16:42:34');