ci: Gitea Actions workflow to build sglang image on push to dsv41-pd
build-sglang-image / build (push) Failing after 27m21s
build-sglang-image / build (push) Failing after 27m21s
Overseas node: original docker.io base (lmsysorg/sglang:dev-dsv41) and default pypi. Tags follow the ymkymx convention <branch>-<sha9>-<datetime> plus a moving <branch>-latest. Registry defaults to the Gitea instance's container registry, override with the REGISTRY variable.
This commit is contained in:
@@ -0,0 +1,51 @@
|
|||||||
|
# Gitea Actions 自动构建 sglang 镜像(海外节点,原版源)
|
||||||
|
# 基底 lmsysorg/sglang:dev-dsv41(docker.io),依赖走 pypi.org 默认源。
|
||||||
|
# 触发:push 到 dsv41-pd 分支。
|
||||||
|
#
|
||||||
|
# 前置条件(一次性,在 Gitea 实例上配置):
|
||||||
|
# 1. 实例已注册 act_runner(Gitea Actions runner,标签含 ubuntu-latest)
|
||||||
|
# 2. 仓库 Settings → Secrets 添加:
|
||||||
|
# REGISTRY_USERNAME / REGISTRY_PASSWORD(推送镜像的账号,如 Gitea 访问令牌)
|
||||||
|
# 3. 可选:Settings → Actions → Variables 添加 REGISTRY(默认 git.agentwithu.com,
|
||||||
|
# 即 Gitea 自带容器 registry;也可填 docker.io 等)
|
||||||
|
name: build-sglang-image
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [dsv41-pd]
|
||||||
|
|
||||||
|
env:
|
||||||
|
REGISTRY: ${{ vars.REGISTRY != '' && vars.REGISTRY || 'git.agentwithu.com' }}
|
||||||
|
IMAGE_NAME: minke.yu/sglang
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Resolve tag
|
||||||
|
id: meta
|
||||||
|
run: |
|
||||||
|
SHA9=$(git rev-parse --short=9 HEAD)
|
||||||
|
echo "tag=${{ github.ref_name }}-${SHA9}-$(date +%Y%m%d-%H%M)" >> "$GITHUB_OUTPUT"
|
||||||
|
|
||||||
|
- uses: docker/setup-buildx-action@v3
|
||||||
|
|
||||||
|
- uses: docker/login-action@v3
|
||||||
|
with:
|
||||||
|
registry: ${{ env.REGISTRY }}
|
||||||
|
username: ${{ secrets.REGISTRY_USERNAME }}
|
||||||
|
password: ${{ secrets.REGISTRY_PASSWORD }}
|
||||||
|
|
||||||
|
- uses: docker/build-push-action@v6
|
||||||
|
with:
|
||||||
|
context: .
|
||||||
|
file: Dockerfile.gitea
|
||||||
|
push: true
|
||||||
|
tags: |
|
||||||
|
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.meta.outputs.tag }}
|
||||||
|
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.ref_name }}-latest
|
||||||
|
# 基底 20GB 不变层走 GHA 缓存,源码层增量构建
|
||||||
|
cache-from: type=gha
|
||||||
|
cache-to: type=gha,mode=max
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
# Gitea Actions 用(海外节点):原版 docker.io 基底 + 原版 pypi
|
||||||
|
# 与 b300 离线版(/data/ymk/build/Dockerfile)的区别:
|
||||||
|
# - 基底直用 docker.io 的 lmsysorg/sglang:dev-dsv41(不走 umirror/DaoCloud)
|
||||||
|
# - 不设 PIP_INDEX_URL,用默认 pypi.org
|
||||||
|
# - 源码由 CI checkout 后经 COPY 进镜像(不用 in-image clone)
|
||||||
|
FROM lmsysorg/sglang:dev-dsv41
|
||||||
|
|
||||||
|
# checkout 含 .git,setuptools-scm 可打戳(main 系分支 version 显示 dev 属正常)
|
||||||
|
COPY . /sgl-workspace/sglang
|
||||||
|
|
||||||
|
RUN pip install --no-cache-dir -e /sgl-workspace/sglang/python
|
||||||
Reference in New Issue
Block a user