fix: add vscode-server dir to Dockerfile, use vscode event for SSH

This commit is contained in:
shuiyu1123 committed 2026-06-18 20:18:20 +00:00
1 parent c6ff7be55a
commit 7b47faac50
2 files changed
+28 -17

No files matched your search

+21 -14
View File
@@ -1,14 +1,21 @@
version: "3" $:
tasks: vscode:
- name: "训练小狸AI-Epoch100" - docker:
image: build: .ide/Dockerfile
dockerfile: .ide/Dockerfile runner:
resources: cpus: 8
cpu: 8 tags: cnb:arch:amd64:gpu
memory: 32G services:
gpu: 1 - vscode
env: - docker
CUDA_VISIBLE_DEVICES: "0" env:
PYTHONUNBUFFERED: "1" CUDA_VISIBLE_DEVICES: "0"
commands: PYTHONUNBUFFERED: "1"
- cd /workspace && nvidia-smi && echo "=== GPU就绪 ===" && python3 scripts/train_cnb.py --epochs 100 --batch_size 16 stages:
- name: 开始训练
script: |
cd /workspace
nvidia-smi
echo "=== GPU就绪,开始训练 ==="
python3 scripts/train_cnb.py --epochs 100 --batch_size 16
echo "=== 训练完成 ==="
+7 -3
View File
@@ -1,11 +1,15 @@
FROM pytorch/pytorch:2.1.0-cuda12.1-cudnn8-runtime FROM pytorch/pytorch:2.1.0-cuda12.1-cudnn8-runtime
# 基础工具 # 安装必要工具
RUN apt-get update && apt-get install -y git curl wget nano && rm -rf /var/lib/apt/lists/* RUN apt-get update && apt-get install -y git curl wget nano openssh-server \
&& rm -rf /var/lib/apt/lists/*
# tqdm用于进度条 # pip依赖
RUN pip install --no-cache-dir tqdm numpy requests RUN pip install --no-cache-dir tqdm numpy requests
# 创建 vscode-server 需要的目录
RUN mkdir -p /root/.vscode-server /root/.vscode-server/data/Machine
# 设置工作目录 # 设置工作目录
WORKDIR /workspace WORKDIR /workspace