From fae987c47d04bc1b5f2fdaf725b1700f195cd9a2 Mon Sep 17 00:00:00 2001 From: Xiechengqi Date: Mon, 16 Dec 2024 10:08:52 +0800 Subject: [PATCH] Create install-vllm.sh --- install/fitsonchips/install-vllm.sh | 53 +++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 install/fitsonchips/install-vllm.sh diff --git a/install/fitsonchips/install-vllm.sh b/install/fitsonchips/install-vllm.sh new file mode 100644 index 0000000..26361d5 --- /dev/null +++ b/install/fitsonchips/install-vllm.sh @@ -0,0 +1,53 @@ +#!/usr/bin/env bash + +source /etc/profile +BASEURL="https://gitee.com/Xiechengqi/scripts/raw/master" +source <(curl -SsL $BASEURL/tool/common.sh) + +main() { + +export installPath="/data/fitsonchips-vllm" +export IMAGE="squeezebits/fitsonchips-gpu-vllm:latest" +mkdir -p ${installPath} + +export DEVICE_KEY=$1 +[ ".${DEVICE_KEY}" = "." ] && ERROR "bash [DEVICE_KEY] [DEVICE]" + +INFO "docker pull ${IMAGE}" && docker pull ${IMAGE} || ERROR "Pull image fail ..." + +export DEVICE=$2 +if [ ".${DEVICE}" = "." ] +then +cat > ${installPath}/docker-run.sh << EOF +#!/usr/bin/env bash + +name="fitsonchips-vllm" +docker rm -f \${name} +docker run -itd \\ +--restart=unless-stopped \\ +--gpus all \\ +-e DEVICE_KEY=${DEVICE_KEY} \\ +--name \${name} \\ +${IMAGE} \\ +./start_worker.sh +EOF +eles +cat > ${installPath}/docker-run.sh << EOF +#!/usr/bin/env bash + +name="fitsonchips-vllm" +docker run -itd \\ +--restart=unless-stopped \\ +--gpus '"device=0"' \\ +-e DEVICE_KEY=${DEVICE_KEY} \\ +--name \${name} \\ +${IMAGE} \\ +./start_worker.sh +EOF +fi +EXEC "chmod +x ${installPath}/docker-run.sh" +INFO "bash ${installPath}/docker-run.sh" && bash ${installPath}/docker-run.sh || ERROR "Run fail ..." + +} + +main $@