From 497064c4924cddf6de86417a2cf1b4c2deab375a Mon Sep 17 00:00:00 2001 From: yumoqing Date: Thu, 22 May 2025 07:16:47 +0000 Subject: [PATCH] bugfix --- deploy.sh | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100755 deploy.sh diff --git a/deploy.sh b/deploy.sh new file mode 100755 index 0000000..43fecf8 --- /dev/null +++ b/deploy.sh @@ -0,0 +1,48 @@ +#!/bin/bash +# 变量 +# +# home +# user +# passwd +# modelpath +# modelname +# gpucnt +# port +# +# 开始要检查安装nvidia驱动 + +if [ "$#" -lt 3 ]; then + echo "用法: $0 " + exit 1 +fi +git_url=$1 +pkgname=$(basename $git_url) +port=$2 +usrname=$(id -un) +grpname=$(id -gn) +pkg_home=$(pwd)/pkgname +venvpath=$pkg_home/$pkgname.env +pip install git+$git_url +cd $pkg_home +python3 -m venv $envpath +source $envpath/bin/activate +pip install setuptools wheel +pip install git+https://git.kaiyuancloud.cn/yumoqing/apppublic +pip install git+https://git.kaiyuancloud.cn/yumoqing/sqlor +pip install git+https://git.kaiyuancloud.cn/yumoqing/ahserver +pip install -r requirements.txt +mkdir $pkg_home/script +cat <$pkg_home/script/$pkgname.service +[Unit] +Wants=systemd-networkd.service + +[Service] +User=$usrname +Group=$grpname +WorkingDirectory=$pkg_home +ExecStart=$envpath/bin/python app/$3 +[Install] +WantedBy=multi-user.target +EOF +sudo ln -s $pkg_home/script/$pkgname.service /etc/systemd/system +sudo systemctl start $pkgname.service