Skip to content

Commit

Permalink
Create install-vllm.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
Xiechengqi authored Dec 16, 2024
1 parent ecd49af commit fae987c
Showing 1 changed file with 53 additions and 0 deletions.
53 changes: 53 additions & 0 deletions install/fitsonchips/install-vllm.sh
Original file line number Diff line number Diff line change
@@ -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 $@

0 comments on commit fae987c

Please sign in to comment.