feat: .gitignore & deploy file

This commit is contained in:
zzw
2026-08-18 17:31:17 +08:00
parent 399d6042ff
commit 49df2ec952
6 changed files with 59 additions and 11 deletions
+31
View File
@@ -0,0 +1,31 @@
name: CI
on:
push:
branches:
- develop
workflow_dispatch:
jobs:
docker:
runs-on: runner
env:
NAME: lone/xunlian
steps:
- name: Checkout
uses: https://git.ailuowan.com/deploy/checkout@v4
- name: Login Registry
run: |
echo "${{ secrets.REGISTRY_PASSWORD }}" | docker login ${{ vars.REGISTRY }} -u "${{ vars.REGISTRY_USERNAME }}" --password-stdin
- name: Docker build
run: |
docker buildx build --load \
-f Dockerfile \
-t ${{ vars.REGISTRY }}/$NAME:latest \
.
- name: Docker push
run: |
docker push ${{ vars.REGISTRY }}/$NAME:latest
+4
View File
@@ -0,0 +1,4 @@
*.pt
__pycache__/
runs/
+5 -8
View File
@@ -1,8 +1,7 @@
# YOLOv8 training environment (NVIDIA GPU) # YOLOv8 training image (NVIDIA GPU)
# #
# The image contains Python, PyTorch and Ultralytics only. The project # Image contains Python / PyTorch / Ultralytics + train script.
# directory (including data.yaml, train/valid/test and *.pt files) is mounted # Dataset (*.pt weights, /data/facepp, runs/) are mounted at runtime.
# at /workspace when the container is started; this keeps the image small.
FROM nvidia/cuda:12.4.1-cudnn-runtime-ubuntu22.04 FROM nvidia/cuda:12.4.1-cudnn-runtime-ubuntu22.04
@@ -22,11 +21,10 @@ RUN apt-get update \
libxext6 \ libxext6 \
libxrender1 \ libxrender1 \
python3 \ python3 \
python3-dev \
python3-pip \ python3-pip \
&& rm -rf /var/lib/apt/lists/* && rm -rf /var/lib/apt/lists/*
# PyTorch 2.5.1 is paired with torchvision 0.20.1 and CUDA 12.4. # PyTorch 2.5.1 + torchvision 0.20.1 (CUDA 12.4)
RUN python3 -m pip install --upgrade pip \ RUN python3 -m pip install --upgrade pip \
&& python3 -m pip install \ && python3 -m pip install \
torch==2.5.1 \ torch==2.5.1 \
@@ -36,8 +34,7 @@ RUN python3 -m pip install --upgrade pip \
WORKDIR /workspace WORKDIR /workspace
# These files make the image usable for a quick smoke test. The normal run
# command mounts the whole project over /workspace.
COPY train_yolov8.py data.yaml ./ COPY train_yolov8.py data.yaml ./
ENTRYPOINT ["python3", "train_yolov8.py"] ENTRYPOINT ["python3", "train_yolov8.py"]
CMD ["--model", "yolov8n.pt", "--device", "0"]
Binary file not shown.
+3 -3
View File
@@ -1,7 +1,7 @@
path: . path: .
train: train/images train: /data/facepp/train/images
val: valid/images val: /data/facepp/valid/images
test: test/images test: /data/facepp/test/images
nc: 11 nc: 11
names: ['0', '1', '10', '2', '3', '4', '5', '6', '7', '8', '9'] names: ['0', '1', '10', '2', '3', '4', '5', '6', '7', '8', '9']
+16
View File
@@ -0,0 +1,16 @@
services:
xunlian:
image: git.ailuowan.com/lone/xunlian:latest
gpus: all
volumes:
- ./yolov8n.pt:/workspace/yolov8n.pt:ro
- ./yolov8m.pt:/workspace/yolov8m.pt:ro
- ./yolo26n.pt:/workspace/yolo26n.pt:ro
- /data/facepp:/data/facepp:ro
- ./runs:/workspace/runs
environment:
TZ: Asia/Shanghai
NVIDIA_VISIBLE_DEVICES: all
NVIDIA_DRIVER_CAPABILITIES: compute,utility
restart: "no"