enh: update DockerfileTDgpt and run-shell
This commit is contained in:
parent
6648d2a502
commit
7a1191ef89
|
@ -1,25 +1,26 @@
|
||||||
FROM tdgpt_env:1.0
|
FROM tdgpt_env:1.0
|
||||||
WORKDIR /apps
|
WORKDIR /root
|
||||||
ENV DEBIAN_FRONTEND=noninteractive
|
ENV DEBIAN_FRONTEND=noninteractive
|
||||||
ARG pkgFile
|
ARG pkgFile
|
||||||
ARG dirName
|
ARG dirName
|
||||||
ARG nasIp
|
ARG modelDlUrl
|
||||||
ADD ${pkgFile} \
|
|
||||||
${dirName} \
|
# for timer-moe
|
||||||
http://${nasIp}/data/nas/TDengine/anode/taos.pth \
|
# ADD ${modelDlUrl}/timer-moe.tar.gz /root/
|
||||||
http://${nasIp}/data/nas/TDengine/anode/taos_ts_server.py \
|
# RUN tar -xzf timer-moe.tar.gz && rm -rf timer-moe.tar.gz
|
||||||
http://${nasIp}/data/nas/TDengine/anode/fc_australia.sql \
|
|
||||||
# http://${nasIp}/data/nas/TDengine/anode/timer-moe.tar.gz \
|
ADD ${pkgFile} \
|
||||||
/apps/
|
${modelDlUrl}/taos.pth \
|
||||||
|
${modelDlUrl}/taos_ts_server.py \
|
||||||
|
${modelDlUrl}/fc_australia.sql \
|
||||||
|
/root/
|
||||||
|
|
||||||
# RUN tar -xzf timer-moe.tar.gz && \
|
|
||||||
# rm -rf timer-moe.tar.gz && \
|
|
||||||
RUN cd ${dirName}/ && \
|
RUN cd ${dirName}/ && \
|
||||||
/bin/bash install.sh -e no && \
|
/bin/bash install.sh -e no && \
|
||||||
cd .. && \
|
cd .. && \
|
||||||
rm -rf ${dirName}
|
rm -rf ${dirName}
|
||||||
COPY entrypoint.sh /usr/local/bin/entrypoint.sh
|
COPY entrypoint.sh /usr/local/bin/entrypoint.sh
|
||||||
RUN chmod +x /usr/local/bin/entrypoint.sh /apps/taos_ts_server.py
|
RUN chmod +x /usr/local/bin/entrypoint.sh /root/taos_ts_server.py
|
||||||
EXPOSE 6090 8387 5000
|
EXPOSE 6090 8387 5000
|
||||||
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
|
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
set -e
|
set -e
|
||||||
#set -x
|
#set -x
|
||||||
|
|
||||||
# dockerbuild.sh
|
# dockerbuild.sh
|
||||||
# -c [aarch32 | aarch64 | amd64 | x86 | mips64 | loongarch64...]
|
# -c [aarch32 | aarch64 | amd64 | x86 | mips64 | loongarch64...]
|
||||||
# -n [version number]
|
# -n [version number]
|
||||||
# -p [password for docker hub]
|
# -p [password for docker hub]
|
||||||
|
@ -17,11 +17,13 @@ cpuTypeAlias=""
|
||||||
version=""
|
version=""
|
||||||
passWord=""
|
passWord=""
|
||||||
pkgFile=""
|
pkgFile=""
|
||||||
|
tdgptPkgFile=""
|
||||||
verType="stable"
|
verType="stable"
|
||||||
dockerLatest="n"
|
dockerLatest="n"
|
||||||
cloudBuild="n"
|
cloudBuild="n"
|
||||||
|
modelDlUrl=""
|
||||||
|
|
||||||
while getopts "hc:n:p:f:V:a:b:d:" arg
|
while getopts "hc:n:p:f:V:g:u:a:b:d:" arg
|
||||||
do
|
do
|
||||||
case $arg in
|
case $arg in
|
||||||
c)
|
c)
|
||||||
|
@ -48,6 +50,14 @@ do
|
||||||
#echo "verType=$OPTARG"
|
#echo "verType=$OPTARG"
|
||||||
verType=$(echo $OPTARG)
|
verType=$(echo $OPTARG)
|
||||||
;;
|
;;
|
||||||
|
g)
|
||||||
|
#echo "tdgptPkgFile=$OPTARG"
|
||||||
|
tdgptPkgFile=$(echo $OPTARG)
|
||||||
|
;;
|
||||||
|
u)
|
||||||
|
#echo "modelDlUrl=$OPTARG"
|
||||||
|
modelDlUrl=$(echo $OPTARG)
|
||||||
|
;;
|
||||||
d)
|
d)
|
||||||
#echo "cloudBuild=$OPTARG"
|
#echo "cloudBuild=$OPTARG"
|
||||||
cloudBuild=$(echo $OPTARG)
|
cloudBuild=$(echo $OPTARG)
|
||||||
|
@ -61,12 +71,14 @@ do
|
||||||
echo " -n [version number] "
|
echo " -n [version number] "
|
||||||
echo " -p [password for docker hub] "
|
echo " -p [password for docker hub] "
|
||||||
echo " -V [stable | beta] "
|
echo " -V [stable | beta] "
|
||||||
|
echo " -g [pkg name for tdgpt] "
|
||||||
|
echo " -u [model download url] "
|
||||||
echo " -f [pkg file] "
|
echo " -f [pkg file] "
|
||||||
echo " -a [y | n ] "
|
echo " -a [y | n ] "
|
||||||
echo " -d [cloud build ] "
|
echo " -d [cloud build ] "
|
||||||
exit 0
|
exit 0
|
||||||
;;
|
;;
|
||||||
?) #unknow option
|
?) #unknow option
|
||||||
echo "unkonw argument"
|
echo "unkonw argument"
|
||||||
exit 1
|
exit 1
|
||||||
;;
|
;;
|
||||||
|
@ -82,9 +94,15 @@ done
|
||||||
if [ "$verType" == "beta" ]; then
|
if [ "$verType" == "beta" ]; then
|
||||||
dockername=${cpuType}-${verType}
|
dockername=${cpuType}-${verType}
|
||||||
dirName=${pkgFile%-beta*}
|
dirName=${pkgFile%-beta*}
|
||||||
|
if [ -n "$tdgptPkgFile" ];then
|
||||||
|
tdgptDirName=${tdgptPkgFile%-beta*}
|
||||||
|
fi
|
||||||
elif [ "$verType" == "stable" ]; then
|
elif [ "$verType" == "stable" ]; then
|
||||||
dockername=${cpuType}
|
dockername=${cpuType}
|
||||||
dirName=${pkgFile%-Linux*}
|
dirName=${pkgFile%-Linux*}
|
||||||
|
if [ -n "$tdgptPkgFile" ];then
|
||||||
|
tdgptDirName=${tdgptPkgFile%-Linux*}
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
echo "unknow verType, nor stabel or beta"
|
echo "unknow verType, nor stabel or beta"
|
||||||
exit 1
|
exit 1
|
||||||
|
@ -103,7 +121,11 @@ communityDir=${scriptDir}/../../../community
|
||||||
DockerfilePath=${communityDir}/packaging/docker/
|
DockerfilePath=${communityDir}/packaging/docker/
|
||||||
if [ "$cloudBuild" == "y" ]; then
|
if [ "$cloudBuild" == "y" ]; then
|
||||||
communityArchiveDir=/nas/TDengine/v$version/cloud
|
communityArchiveDir=/nas/TDengine/v$version/cloud
|
||||||
Dockerfile=${communityDir}/packaging/docker/DockerfileCloud
|
if [ -n "$tdgptPkgFile" ];then
|
||||||
|
Dockerfile=${communityDir}/packaging/docker/DockerfileCloudTDgpt
|
||||||
|
else
|
||||||
|
Dockerfile=${communityDir}/packaging/docker/DockerfileCloud
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
communityArchiveDir=/nas/TDengine/v$version/community
|
communityArchiveDir=/nas/TDengine/v$version/community
|
||||||
Dockerfile=${communityDir}/packaging/docker/Dockerfile
|
Dockerfile=${communityDir}/packaging/docker/Dockerfile
|
||||||
|
@ -125,22 +147,36 @@ else
|
||||||
fi
|
fi
|
||||||
# check the tdengine cloud base image existed or not
|
# check the tdengine cloud base image existed or not
|
||||||
if [ "$cloudBuild" == "y" ]; then
|
if [ "$cloudBuild" == "y" ]; then
|
||||||
CloudBase=$(docker images | grep tdengine/tdengine-cloud-base ||:)
|
if [ -n "$tdgptPkgFile" ];then
|
||||||
if [[ "$CloudBase" == "" ]]; then
|
CloudBase=$(docker images | grep tdengine/tdengine-cloud-tdgpt-base ||:)
|
||||||
echo "Rebuild tdengine cloud base image..."
|
if [[ "$CloudBase" == "" ]]; then
|
||||||
docker build --rm -f "${communityDir}/packaging/docker/DockerfileCloud.base" -t tdengine/tdengine-cloud-base "." --build-arg cpuType=${cpuTypeAlias}
|
echo "Rebuild tdengine cloud tdgpt base image..."
|
||||||
|
docker build --rm -f "${communityDir}/packaging/docker/DockerfileCloudTDgpt.base" -t tdengine/tdengine-cloud-tdgpt-base "." --build-arg cpuType=${cpuTypeAlias}
|
||||||
|
else
|
||||||
|
echo "Already found tdengine cloud tdgpt base image"
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
echo "Already found tdengine cloud base image"
|
CloudBase=$(docker images | grep tdengine/tdengine-cloud-base ||:)
|
||||||
|
if [[ "$CloudBase" == "" ]]; then
|
||||||
|
echo "Rebuild tdengine cloud base image..."
|
||||||
|
docker build --rm -f "${communityDir}/packaging/docker/DockerfileCloud.base" -t tdengine/tdengine-cloud-base "." --build-arg cpuType=${cpuTypeAlias}
|
||||||
|
else
|
||||||
|
echo "Already found tdengine cloud base image"
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
docker build --rm -f "${Dockerfile}" --network=host -t tdengine/tdengine-${dockername}:${version} "." --build-arg pkgFile=${pkgFile} --build-arg dirName=${dirName} --build-arg cpuType=${cpuTypeAlias}
|
if [ -n "$tdgptPkgFile" ];then
|
||||||
|
docker build --rm -f "${Dockerfile}" --network=host -t tdengine/tdengine-${dockername}:${version} "." --build-arg pkgFile=${pkgFile} --build-arg dirName=${dirName} --build-arg tdgptPkgFile=${tdgptPkgFile} --build-arg tdgptDirName=${tdgptDirName} --build-arg cpuType=${cpuTypeAlias} --build-arg modelDlUrl=${modelDlUrl}
|
||||||
|
else
|
||||||
|
docker build --rm -f "${Dockerfile}" --network=host -t tdengine/tdengine-${dockername}:${version} "." --build-arg pkgFile=${pkgFile} --build-arg dirName=${dirName} --build-arg cpuType=${cpuTypeAlias}
|
||||||
|
fi
|
||||||
if [ "$cloudBuild" != "y" ]; then
|
if [ "$cloudBuild" != "y" ]; then
|
||||||
docker login -u tdengine -p ${passWord} #replace the docker registry username and password
|
docker login -u tdengine -p ${passWord} #replace the docker registry username and password
|
||||||
docker push tdengine/tdengine-${dockername}:${version}
|
docker push tdengine/tdengine-${dockername}:${version}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# set this version to latest version
|
# set this version to latest version
|
||||||
if [ "$cloudBuild" != "y" ] && [ ${dockerLatest} == 'y' ] ;then
|
if [ "$cloudBuild" != "y" ] && [ ${dockerLatest} == 'y' ] ;then
|
||||||
docker tag tdengine/tdengine-${dockername}:${version} tdengine/tdengine-${dockername}:latest
|
docker tag tdengine/tdengine-${dockername}:${version} tdengine/tdengine-${dockername}:latest
|
||||||
docker push tdengine/tdengine-${dockername}:latest
|
docker push tdengine/tdengine-${dockername}:latest
|
||||||
|
|
|
@ -6,32 +6,36 @@ export LC_CTYPE=en_US.UTF-8
|
||||||
export LC_ALL=en_US.UTF-8
|
export LC_ALL=en_US.UTF-8
|
||||||
|
|
||||||
CONFIG_FILE="/usr/local/taos/taosanode/cfg/taosanode.ini"
|
CONFIG_FILE="/usr/local/taos/taosanode/cfg/taosanode.ini"
|
||||||
TS_SERVER_FILE="/apps/taos_ts_server.py"
|
TS_SERVER_FILE="/root/taos_ts_server.py"
|
||||||
TIMER_POE_FILE="/apps/timer-moe/timer-moe_server.py"
|
TIMER_POE_FILE="/root/timer-moe/timer-moe_server.py"
|
||||||
|
|
||||||
if [ ! -f "$CONFIG_FILE" ]; then
|
if [ ! -f "$CONFIG_FILE" ]; then
|
||||||
echo "Error: Configuration file $CONFIG_FILE not found!"
|
echo "Error: Configuration file $CONFIG_FILE not found!"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Starting tdtsfm server..."
|
|
||||||
python3 $TS_SERVER_FILE --action server &
|
|
||||||
TAOS_TS_PID=$!
|
|
||||||
|
|
||||||
if ! ps -p $TAOS_TS_PID > /dev/null; then
|
if [ -f $TS_SERVER_FILE ];then
|
||||||
echo "Error: tdtsfm server failed to start!"
|
echo "Starting tdtsfm server..."
|
||||||
exit 1
|
python3 $TS_SERVER_FILE --action server &
|
||||||
|
TAOS_TS_PID=$!
|
||||||
|
|
||||||
|
if ! ps -p $TAOS_TS_PID > /dev/null; then
|
||||||
|
echo "Error: tdtsfm server failed to start!"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
if [ -f $TIMER_POE_FILE ];then
|
||||||
|
echo "Starting timer-moe server..."
|
||||||
|
cd $(dirname "$TIMER_POE_FILE")
|
||||||
|
python3 $TIMER_POE_FILE --action server &
|
||||||
|
TIMER_MOE_PID=$!
|
||||||
|
|
||||||
# echo "Starting timer-moe server..."
|
if ! ps -p $TIMER_MOE_PID > /dev/null; then
|
||||||
# cd /apps/timer-moe
|
echo "Error: timer-moe server failed to start!"
|
||||||
# python3 $TIMER_POE_FILE --action server &
|
exit 1
|
||||||
# TIMER_MOE_PID=$!
|
fi
|
||||||
|
fi
|
||||||
# if ! ps -p $TIMER_MOE_PID > /dev/null; then
|
|
||||||
# echo "Error: timer-moe server failed to start!"
|
|
||||||
# exit 1
|
|
||||||
# fi
|
|
||||||
|
|
||||||
echo "Starting uWSGI with config: $CONFIG_FILE"
|
echo "Starting uWSGI with config: $CONFIG_FILE"
|
||||||
exec /usr/local/taos/taosanode/venv/bin/uwsgi --ini "$CONFIG_FILE"
|
exec /usr/local/taos/taosanode/venv/bin/uwsgi --ini "$CONFIG_FILE"
|
||||||
|
|
Loading…
Reference in New Issue