From 9248f4173b11c849269b0a3440fa5cb751730c88 Mon Sep 17 00:00:00 2001 From: Hongze Cheng Date: Fri, 2 Aug 2019 09:12:01 +0800 Subject: [PATCH] remove useless files --- packaging/docker/Dockerfile.tbase | 27 --------- packaging/docker/Dockerfile.tbased | 37 ------------ packaging/docker/README.md | 25 -------- packaging/docker/docker-compose.yml | 78 ------------------------ packaging/docker/install.sh | 93 ----------------------------- packaging/docker/release_docker.sh | 87 --------------------------- packaging/docker/remove.sh | 45 -------------- packaging/docker/run_dnode.sh | 10 ---- packaging/docker/run_mnode.sh | 10 ---- packaging/docker/run_taos.sh | 8 --- 10 files changed, 420 deletions(-) delete mode 100644 packaging/docker/Dockerfile.tbase delete mode 100644 packaging/docker/Dockerfile.tbased delete mode 100644 packaging/docker/README.md delete mode 100755 packaging/docker/docker-compose.yml delete mode 100755 packaging/docker/install.sh delete mode 100755 packaging/docker/release_docker.sh delete mode 100755 packaging/docker/remove.sh delete mode 100755 packaging/docker/run_dnode.sh delete mode 100755 packaging/docker/run_mnode.sh delete mode 100755 packaging/docker/run_taos.sh diff --git a/packaging/docker/Dockerfile.tbase b/packaging/docker/Dockerfile.tbase deleted file mode 100644 index 1c93b91ece..0000000000 --- a/packaging/docker/Dockerfile.tbase +++ /dev/null @@ -1,27 +0,0 @@ -# Parent image -FROM ubuntu - -# Set work directory -WORKDIR /app - -# Copy executable file to work directory -COPY ./bin/tdengine . - -# Copy configuration file to /etc/taos -COPY ./cfg/tdengine.cfg /etc/tdengine/ - -# Volume to communicate with host machine -# config file history file -VOLUME ["/etc/tdengine/", "/root"] - -# Command to run -ENTRYPOINT ["/app/tdengine"] - -# To build the image -# docker build -t taos_img -f Dockerfile.taos . - -# To run the image -# docker run -it --rm \ -# --mount type=bind,source=/etc/taos/,target=/etc/taos/ \ -# --mount type=bind,source="$HOME",target=/root \ -# taos_img -p diff --git a/packaging/docker/Dockerfile.tbased b/packaging/docker/Dockerfile.tbased deleted file mode 100644 index 6b8d9c4216..0000000000 --- a/packaging/docker/Dockerfile.tbased +++ /dev/null @@ -1,37 +0,0 @@ -# Parent image -FROM ubuntu - -# Install required libraries -RUN apt-get update && apt-get install -y libssl-dev - -# Set work directory -WORKDIR /app - -# COPY executable file to work directory -COPY ./bin/tdengined . - -# Copy configuration file to /etc/taos -COPY ./cfg/tdengine.cfg /etc/tdengine/ - -# Volume to communicate with host machine -# data file log file config file -VOLUME ["/var/lib/tdengine/", "/var/log/tdengine/", "/etc/tdengine/"] - -# Port to expose to outside of the world. -EXPOSE 6100 6120 6140 6160 6180 6200 6220 6240 6260 6280 6290 6300 8080 - -# Command to run -ENTRYPOINT ["/app/tdengined"] - -# To build the image -# docker build -t mnode_img -f Dockerfile.mnode . - -# To run mnode -# docker run --rm -it --name mnode \ -# -p 6100:6100 -p 6120:6120 -p 6220:6220 -p 6260:6260 -p 6280:6280 \ -# --mount source=taos_data,target=/var/lib/taos/ \ -# --mount source=taos_log,target=/var/log/taos/ \ -# --mount type=bind,source=/home/hzcheng/Documents/TAOS/taosdata/cfg/,target=/etc/taos/ \ -# --network isolated_nw --ip 172.25.0.10 \ -# mnode_img -# diff --git a/packaging/docker/README.md b/packaging/docker/README.md deleted file mode 100644 index 94f95fa1a3..0000000000 --- a/packaging/docker/README.md +++ /dev/null @@ -1,25 +0,0 @@ -# TAOS DATABASE Docker version - -# Realse docker version install package -To release a docker version install package, change directory to -_taosdata/tools/docker_ and run: -```shell -bash release_docker.sh -``` -Then it will generate a tar file in _release_ file. - -# Install TAOS DATA -To install taosdata, uncompress the _tar_ file in release directory and -run _install.sh_ -```shell -./install.sh # Install mnode and dnode -./install.sh all # Install mnode and dnode -./install.sh mnode # Install mnode -./install.sh dnode # Install dnode -``` - -# Check the services -To check if taosdata run correctly, use _docker_ commands. -```shell -docker container ls -``` diff --git a/packaging/docker/docker-compose.yml b/packaging/docker/docker-compose.yml deleted file mode 100755 index aa70d55427..0000000000 --- a/packaging/docker/docker-compose.yml +++ /dev/null @@ -1,78 +0,0 @@ -version: '3.2' - -services: - mnode: - # Build properties - build: - context: . - dockerfile: Dockerfile.mnode - image: mnode_img - # Deploy properties - deploy: - mode: replicated - replicas: 1 - restart_policy: - condition: on-failure - delay: 5s - max_attempts: 3 - window: 120s - ports: - - "6100:6100" - - "6120:6120" - - "6220:6220" - - "6260:6260" - - "6280:6280" - volumes: - - type: volume - source: taos_data - target: /var/lib/taos/ - - type: volume - source: taos_log - target: /var/log/taos/ - # And also configuration files. - network_mode: bridge - - dnode: - # Build properties - build: - context: . - dockerfile: Dockerfile.dnode - image: dnode_img - # Deploy properties - deploy: - mode: replicated - replicas: 1 - restart_policy: - condition: on-failure - delay: 5s - max_attempts: 3 - window: 120s - ports: - - "6140:6140" - - "6160:6160" - - "6180:6180" - - "6200:6200" - - "6240:6240" - volumes: - - type: volume - source: taos_data - target: /var/lib/taos/ - - type: volume - source: taos_log - target: /var/log/taos/ - # And also configuration files. - network_mode: bridge - - taos: - # Build properties - build: - context: . - dockerfile: Dockerfile.taos - image: taos_img - # Deploy properties - -volumes: - taos_data: - taos_log: - -# To build the images: docker-compose build diff --git a/packaging/docker/install.sh b/packaging/docker/install.sh deleted file mode 100755 index ef08289b4f..0000000000 --- a/packaging/docker/install.sh +++ /dev/null @@ -1,93 +0,0 @@ -#!/bin/bash - -# ******************************************************** -# Script to install docker-version TAOSDATA on computer -# ******************************************************** - -set -e - -# Global variables -tarFile="tdengine.tar.gz" - -headerDir="/usr/local/include/tdengine" -cfgDir="/etc/tdengine" -binDir="/usr/local/bin/tdengine" -libDir="/usr/local/lib/tdengine" -linkDir="/usr/bin" - -javaAppDir="connector" - - -# TODO: Function to install different parts. -make_directory() { - sudo mkdir -p ${cfgDir} ${headerDir} ${binDir} ${libDir} ${binDir}/connector - # Copy global configure file - sudo cp -n cfg/tdengine.cfg ${cfgDir} -} - -installTDengine() { - # TODO: check if program is installed - make_directory - # Build tdengined image - sudo docker container rm -f tdengined_img || true - sudo docker image rm tdengined_img || true - sudo docker build -t tdengined_img -f Dockerfile.tdengined . - # Deploy the service - sudo docker run -d --name tdengined --network="host" \ - --mount source=taos_data,target=/var/lib/tdengine/ \ - --mount source=taos_log,target=/var/log/tdengine/ \ - --mount type=bind,source=/etc/tdengine/,target=/etc/tdengine/ \ - --restart=always \ - tdengined_img -} - - -installOthers() { - # Update header file - sudo rm -f ${headerDir}/*.h && sudo cp inc/*.h ${headerDir} - - # Update lib file - sudo rm -f /usr/lib/libtaos.so /usr/lib/libtaos.a - sudo rm -f ${libDir}/* && sudo cp lib/* ${libDir} - sudo ln -s ${libDir}/libtaos.so /usr/lib/libtaos.so - sudo ln -s ${libDir}/libtaos.a /usr/lib/libtaos.a - - # Update JDBC - sudo rm -rf ${binDir}/connector/* - sudo cp JDBCDriver*-dist.* ${binDir}/connector 2> /dev/null || : - - # TODO: Install taos - sudo rm -f ${linkDir}/taos ${binDir}/taos.sh - sudo docker image rm taos_img || true - sudo docker build --no-cache -t taos_img -f Dockerfile.tdengine . - sudo echo '#!/bin/bash' > taos.sh - sudo echo >> taos.sh - sudo echo 'docker run -it --rm --network="host" \' >> taos.sh - sudo echo '--mount type=bind,source=/etc/tdengine/,target=/etc/tdengine/ \' >> taos.sh - sudo echo '--mount type=bind,source="$HOME",target=/root \' >> taos.sh - sudo echo 'taos_img $@' >> taos.sh - sudo mv taos.sh ${binDir} - sudo chmod a+x ${binDir}/taos.sh - sudo ln -s ${binDir}/taos.sh ${linkDir}/taos - - # Install remove.sh - sudo rm -f ${linkDir}/rmtaos ${binDir}/remove.sh - sudo cp bin/remove.sh ${binDir} - sudo chmod a+x ${binDir}/remove.sh - sudo ln -s ${binDir}/remove.sh ${linkDir}/rmtaos -} - -printInstallGuide() { - echo - echo "Type 'bash install.sh' to install management and data service" - echo "Type 'bash install.sh dnode' to install data service only" - echo "Type 'bash install.sh mgmt' to install management service only" -} - -# ----------------------- Main program ----------------------- -tar -zxf ${tarFile} - -installTDengine -installOthers - -rm -rf $(tar -tf ${tarFile}) diff --git a/packaging/docker/release_docker.sh b/packaging/docker/release_docker.sh deleted file mode 100755 index 3748b78bde..0000000000 --- a/packaging/docker/release_docker.sh +++ /dev/null @@ -1,87 +0,0 @@ -#!/bin/bash - -# ************************************************************** -# Script to release TAOS install package. -# ************************************************************** - -set -e - -currDir=$(pwd) -codeDir=$(readlink -m ${currDir}/../..) -rootDir=$(readlink -m ${codeDir}/..) -buildDir=$(readlink -m ${rootDir}/build) -releaseDir=$(readlink -m ${rootDir}/release) - - -# # --------------------Get version information -versionInfo="${codeDir}/util/src/version.c" -version=$(cat ${versionInfo} | grep version | cut -d '"' -f2) - -if [ "$1" != "test" ]; then - while true; do - read -p "Do you want to release a new version? [y/N]: " isVersionChange - - if [[ ( "${isVersionChange}" == "y") || ( "${isVersionChange}" == "Y") ]]; then - # TODO: Add version format check here. - read -p "Please enter the new version: " version - break - elif [[ ( "${isVersionChange}" == "n") || ( "${isVersionChange}" == "N") ]]; then - echo "Use old version ${version}" - break - else - continue - fi - done -fi - -buildTime=$(date +"%F %R") -echo "char version[64] = \"${version}\";" > ${versionInfo} -echo "char buildinfo[512] = \"Built by ${USER} at ${buildTime}\";" >> ${versionInfo} - -# --------------------------Make executable file. -cd ${codeDir} -make clean -make -cd ${currDir} - -# --------------------------Group files -# create compressed install file. -installDir="tdengine-docker-${version}-$(echo ${buildTime}| tr ': ' -)-${USER}" - -# directories and files. -binDir="bin" -libDir="lib" -headerDir="inc" -cfgDir="cfg" - -binFiles="${buildDir}/bin/tdengine ${buildDir}/bin/tdengined ${currDir}/remove.sh" -libFiles="${buildDir}/lib/libtaos.so ${buildDir}/lib/libtaos.a" -headerFiles="${codeDir}/inc/taos.h" -cfgFiles="${codeDir}/cfg/*" - -dockerFiles="${currDir}/Dockerfile.tdengined ${currDir}/Dockerfile.tdengine" -installFiles="${currDir}/install.sh" - -# make directories. -mkdir -p ${installDir} -mkdir -p ${installDir}/${binDir} && cp ${binFiles} ${installDir}/${binDir} -mkdir -p ${installDir}/${libDir} && cp ${libFiles} ${installDir}/${libDir} -mkdir -p ${installDir}/${headerDir} && cp ${headerFiles} ${installDir}/${headerDir} -mkdir -p ${installDir}/${cfgDir} && cp ${cfgFiles} ${installDir}/${cfgDir} -cp ${dockerFiles} ${installDir} - -cp ${rootDir}/build/lib/JDBCDriver*-dist.* ${installDir} 2> /dev/null || : - -cd ${installDir} -tar -zcf tdengine.tar.gz * --remove-files -cd ${currDir} - -cp ${installFiles} ${installDir} - -# Copy example code -cp -r ${codeDir}/examples ${installDir} - -tar -zcf "${installDir}.tar.gz" ${installDir} --remove-files - -mkdir -p ${releaseDir} -mv "${installDir}.tar.gz" ${releaseDir} diff --git a/packaging/docker/remove.sh b/packaging/docker/remove.sh deleted file mode 100755 index 3b99bbf3aa..0000000000 --- a/packaging/docker/remove.sh +++ /dev/null @@ -1,45 +0,0 @@ -#!/bin/bash - -# ******************************************************** -# Script to uninstall docker-version TAOSDATA on computer -# ******************************************************** - -headerDir="/usr/local/include/tdengine" -cfgDir="/etc/tdengine" -binDir="/usr/local/bin/tdengine" -libDir="/usr/local/lib/tdengine" -linkDir="/usr/bin" -# 1. Stop continer and remove image -# TODO : Check information -sudo docker container stop tdengined || true -sudo docker container rm tdengined || true -sudo docker image rm tdengined_img || true - -sudo docker image rm taos_img || true - -# 2. Remove others -## remove binary files -sudo rm -rf {linkDir}/taos {linkDir}/rmtaos ${binDir} - -## remove header files -sudo rm -rf ${headerDir} - -## remove lib file -sudo rm -rf /usr/lib/libtaos* ${libDir} - -## remove configuration file -sudo rm -rf ${cfgDir} - -# 3. Remove data -while true; do - read -p "Do you want to delete data file? [y/N]: " isDeleteData - - if [[ ( "${isDeleteData}" == "y") || ( "${isDeleteData}" == "Y") ]]; then - sudo docker volume rm -f taos_data taos_log - break - elif [[ ( "${isDeleteData}" == "n") || ( "${isDeleteData}" == "N") ]]; then - break - else - continue - fi -done diff --git a/packaging/docker/run_dnode.sh b/packaging/docker/run_dnode.sh deleted file mode 100755 index 1c48b8e5b2..0000000000 --- a/packaging/docker/run_dnode.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/bash - -# run dnode -docker run --rm -it --name dnode \ - -p 6140:6140 -p 6160:6160 -p 6180:6180 -p 6200:6200 -p 6240:6240\ - --mount source=taos_data,target=/var/lib/taos/ \ - --mount source=taos_log,target=/var/log/taos/ \ - --mount type=bind,source=/home/hzcheng/Documents/TAOS/taosdata/cfg/,target=/etc/taos/ \ - --network isolated_nw --ip 172.25.0.11 \ - dnode_img diff --git a/packaging/docker/run_mnode.sh b/packaging/docker/run_mnode.sh deleted file mode 100755 index 0f002e7c3c..0000000000 --- a/packaging/docker/run_mnode.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/bash - -# run mnode -docker run --rm -it --name mnode \ - -p 6100:6100 -p 6120:6120 -p 6220:6220 -p 6260:6260 -p 6280:6280 \ - --mount source=taos_data,target=/var/lib/taos/ \ - --mount source=taos_log,target=/var/log/taos/ \ - --mount type=bind,source=/home/hzcheng/Documents/TAOS/taosdata/cfg/,target=/etc/taos/ \ - --network isolated_nw --ip 172.25.0.10 \ - mnode_img diff --git a/packaging/docker/run_taos.sh b/packaging/docker/run_taos.sh deleted file mode 100755 index 346ff293be..0000000000 --- a/packaging/docker/run_taos.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash - -# run taos -docker run --rm -it --name taos \ - --mount type=bind,source=/home/hzcheng/.taos_history,target=/root/.taos_history \ - --mount type=bind,source=/home/hzcheng/Documents/TAOS/taosdata/cfg/,target=/etc/taos/ \ - --network isolated_nw --ip 172.25.0.12 \ - taos_img -p -- GitLab