25
Dec
fastapi-dls安装说明
0 COMMENTS
首先搞台服务器或者虚拟机装linux。以centos7为示例
装完系统修改源:
sudo sed -e 's|^mirrorlist=|#mirrorlist=|g' \ -e 's|^#baseurl=http://mirror.centos.org/centos|baseurl=https://mirrors.ustc.edu.cn/centos|g' \ -i.bak \ /etc/yum.repos.d/CentOS-Base.repo改完更新缓存
yum makecache更完update
yum update -y安装docker
yum install -y docker-ce将docker设为开机启动并启动docker
systemctl enable docker systemctl start docker拉取fastapi-dls
docker pull collinwebdesigns/fastapi-dls:latest建立证书目录
mkdir -p /opt/fastapi-dls/cert生成秘钥
openssl genrsa -out /opt/fastapi-dls/cert/instance.private.pem 2048 openssl rsa -in /opt/fastapi-dls/cert/instance.private.pem -outform PEM -pubout -out /opt/fastapi-dls/cert/instance.public.pem创建证书
openssl req -x509 -nodes -days 3650 -newkey rsa:2048 -keyout /opt/fastapi-dls/cert/webserver.key -out /opt/fastapi-dls/cert/webserver.crt建容器
docker volume create dls-db docker run -d --restart=always -e LEASE_EXPIRE_DAYS=<DAYS> -e DLS_URL=<ServerIP> -e DLS_PORT=443 -p 443:443 -v /opt/fastapi-dls/cert:/app/cert -v dls-db:/app/database collinwebdesigns/fastapi-dls:latest #<DAYS>为vgpu授权时长单位天;<ServerIP>为容器服务器IP地址。端口号443建议默认即可,需要修改的话三个443改前两个443为相同端口号,最后一个443不改。之后在windows虚拟机上拉取链接证书,以管理员打开PowerShell(开始菜单上右键打开)
curl.exe --insecure -L -X GET https://<ServerIP>/-/client-token -o "C:\Program Files\NVIDIA Corporation\vGPU Licensing\ClientConfigToken\client_configuration_token_$($(Get-Date).tostring('dd-MM-yy-hh-mm-ss')).tok"<serverIP>就是容器的IP地址,换过端口了就后面加英文冒号和端口号,默认的就不需要。如果成功拉取到了就可以了,重启电脑或者重启服务后可以看到授权有效期。
重启服务命令
Restart-Service NVDisplay.ContainerLocalSystem重启完成后等几秒再右键查看nvidia面板是否授权成功或者powershell里直接查看
& 'nvidia-smi' -q | Select-String "License"Linux下拉取命令
wget --no-check-certificate -O /etc/nvidia/ClientConfigToken/client_configuration_token_$(date '+%d-%m-%Y-%H-%M-%S').tok https://<ServerIP>/-/client-token
本文地址:http://cms.xisix.com:8880/post-139.html
添加新评论