From 9c421191c09db9e8ec0e25cb4501926d5ba67ad7 Mon Sep 17 00:00:00 2001 From: Tobias Anker Date: Sat, 4 Feb 2023 18:50:33 +0100 Subject: [PATCH] Change (#31): update docker-build process --- build.sh | 18 +--------- build/docker/Dockerfile | 6 ++-- build/docker/files/Dockerfile_base | 2 +- build/docker/files/build.sh | 53 ------------------------------ 4 files changed, 5 insertions(+), 74 deletions(-) delete mode 100755 build/docker/files/build.sh diff --git a/build.sh b/build.sh index cc848485..db326135 100755 --- a/build.sh +++ b/build.sh @@ -3,25 +3,9 @@ # get current directory-path and the path of the parent-directory DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" PARENT_DIR="$(dirname "$DIR")" -CURRENT_BRANCH=$(git rev-parse --abbrev-ref HEAD) - -# create build-directory -BUILD_DIR="$PARENT_DIR/build" -mkdir -p $BUILD_DIR - -# create directory for the final result -RESULT_DIR="$PARENT_DIR/result" -mkdir -p $RESULT_DIR - -#----------------------------------------------------------------------------------------------------------------- - -# create build directory for Hanami-AI and go into this directory -LIB_HANAMI_DIR="$BUILD_DIR/Hanami-AI" -mkdir -p $LIB_HANAMI_DIR -cd $LIB_KITSUNE_HANAMI_DIR # build Hanami-AI library with qmake -/usr/lib/x86_64-linux-gnu/qt5/bin/qmake "$PARENT_DIR/Hanami-AI/Hanami-AI.pro" -spec linux-g++ "CONFIG += optimize_full" +/usr/lib/x86_64-linux-gnu/qt5/bin/qmake "$PARENT_DIR/Hanami-AI/Hanami-AI.pro" -spec linux-g++ "CONFIG += optimize_full staticlib" # IMPORTNANT: at the moment it has to be build with only 1 thread, because the parser-generation with bison and flex # has problems in a parallel build-process (see issue #30) diff --git a/build/docker/Dockerfile b/build/docker/Dockerfile index 1d98d8b3..d272c296 100644 --- a/build/docker/Dockerfile +++ b/build/docker/Dockerfile @@ -1,7 +1,7 @@ FROM ubuntu:22.04 -RUN apt-get update && apt-get upgrade -y && apt-get update -RUN apt-get install -y gcc g++ make qt5-qmake bison flex xxd git ssh libssl-dev libcrypto++-dev libboost1.74-dev uuid-dev libsqlite3-dev protobuf-compiler protobuf-compiler nano +RUN apt-get update +RUN apt-get install -y gcc g++ make qt5-qmake bison flex xxd git ssh libssl-dev libcrypto++-dev libboost1.74-dev uuid-dev libsqlite3-dev protobuf-compiler protobuf-compiler nano ocl-icd-opencl-dev opencl-headers RUN apt-get install -y apt-transport-https ca-certificates curl software-properties-common && \ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg && \ echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | tee /etc/apt/sources.list.d/docker.list > /dev/null && \ @@ -9,7 +9,7 @@ RUN apt-get install -y apt-transport-https ca-certificates curl software-propert apt-get install -y docker-ce RUN mkdir /dockerbuilder -COPY files/build.sh /dockerbuilder +COPY files/build_components.sh /dockerbuilder COPY files/Dockerfile_base /dockerbuilder COPY files/Dockerfile_kyouko /dockerbuilder COPY files/Dockerfile_misaki /dockerbuilder diff --git a/build/docker/files/Dockerfile_base b/build/docker/files/Dockerfile_base index d13ccf45..ed88bb82 100644 --- a/build/docker/files/Dockerfile_base +++ b/build/docker/files/Dockerfile_base @@ -2,5 +2,5 @@ FROM ubuntu:22.04 ARG DEBIAN_FRONTEND=noninteractive RUN apt-get update; \ - apt-get install -y openssl libuuid1 libcrypto++8 libsqlite3-0 libprotobuf23 libboost1.74 rst2pdf; + apt-get install -y openssl libuuid1 libcrypto++8 libsqlite3-0 libprotobuf23 libboost1.74 rst2pdf opencl-headers ocl-icd-libopencl1; diff --git a/build/docker/files/build.sh b/build/docker/files/build.sh deleted file mode 100755 index 2d236897..00000000 --- a/build/docker/files/build.sh +++ /dev/null @@ -1,53 +0,0 @@ -REGISTRY=kitsudaiki -TAG=develop - - -# base -cd /dockerbuilder -docker build -t $REGISTRY/hanami_ai_base:$TAG -f Dockerfile_base . - - -# kyouko -git clone https://github.com/kitsudaiki/KyoukoMind.git /dockerbuilder/KyoukoMind -cd /dockerbuilder/KyoukoMind -./build.sh -cd /dockerbuilder -docker build -t $REGISTRY/kyouko_mind:$TAG -f Dockerfile_kyouko . - -# misaki -git clone https://github.com/kitsudaiki/MisakiGuard.git /dockerbuilder/MisakiGuard -cd /dockerbuilder/MisakiGuard -./build.sh -cd /dockerbuilder -docker build -t $REGISTRY/misaki_guard:$TAG -f Dockerfile_misaki . - -# azuki -git clone https://github.com/kitsudaiki/AzukiHeart.git /dockerbuilder/AzukiHeart -cd /dockerbuilder/AzukiHeart -./build.sh -cd /dockerbuilder -docker build -t $REGISTRY/azuki_heart:$TAG -f Dockerfile_azuki . - -# shiori -git clone https://github.com/kitsudaiki/ShioriArchive.git /dockerbuilder/ShioriArchive -cd /dockerbuilder/ShioriArchive -./build.sh -cd /dockerbuilder -docker build -t $REGISTRY/shiori_archive:$TAG -f Dockerfile_shiori . - -# torii -git clone https://github.com/kitsudaiki/ToriiGateway.git /dockerbuilder/ToriiGateway -cd /dockerbuilder/ToriiGateway -./build.sh -cd /dockerbuilder -docker build -t $REGISTRY/torii_gateway:$TAG -f Dockerfile_torii . - -# dashboard -cd /dockerbuilder -git clone https://github.com/kitsudaiki/Hanami-AI-Dashboard.git /dockerbuilder/Hanami-AI-Dashboard -cd /dockerbuilder/Hanami-AI-Dashboard/src -git clone https://github.com/kitsudaiki/libHanamiAiSdk.git -git clone https://github.com/kitsudaiki/libKitsunemimiHanamiMessages.git -git clone https://github.com/kitsudaiki/Hanami-AI-Dashboard-Dependencies.git -cd /dockerbuilder -docker build -t $REGISTRY/hanami_ai_dashboard:$TAG -f Dockerfile_dashboard .