mirror of
https://github.com/bytedance/deer-flow.git
synced 2026-08-01 19:06:01 +00:00
* ci(lark): publish lark-cli-init/broker images (#4532) Add .github/workflows/lark-cli-images.yaml to build and push the two optional Lark sandbox runtime images (Pattern A init container and Pattern B broker sidecar) to GHCR. These track the upstream larksuite/cli version, not the DeerFlow v* release, so the workflow is decoupled from container.yaml / the verify-versions gate: - Trigger via workflow_dispatch (lark_cli_version input) or a lark-cli-v* tag (version read from after the prefix). - Multi-arch linux/amd64,linux/arm64 (the images stage a real arch-dispatched lark-cli binary), via QEMU + Buildx. - Per-component build context: lark-cli-init builds from its own dir (relative COPY), lark-cli-broker from the repo root (it copies the shared build-runtime.sh + the harness lark_broker.py). - Tagged by lark-cli version; no latest; gated on the upstream repo. Docs: document the independent publishing in RELEASING.md and both image READMEs, replacing the "publishing is a fast-follow" notes. Closes #4532 * fix(ci): scope broker build context past root .dockerignore The repo-root .dockerignore excludes the whole `docker/` tree, but the lark-cli-broker image builds from a repo-root context and must COPY `docker/lark-cli-init/build-runtime.sh` and `docker/lark-cli-broker/entrypoint.sh` (plus the harness lark_broker.py). Under root .dockerignore those COPYs fail (excluded from context). Add docker/lark-cli-broker/Dockerfile.dockerignore: BuildKit uses this per-Dockerfile ignore-file instead of the root one for `-f docker/lark-cli-broker/Dockerfile` builds, keeping `docker/` and `backend/` in context while still dropping .git/venv/frontend/docs noise. lark-cli-init is unaffected (it builds from its own dir context). * fix(ci): harden lark-cli version input against shell injection Address PR #4558 review: pass the workflow_dispatch input through an env var instead of interpolating ${{ inputs.lark_cli_version }} directly into the run: script, so a dispatched value can't be expression-injected into the runner shell if the repo gate ever widens. Also fix the multi-arch comment verb (stage -> ships).
103 lines
4.1 KiB
YAML
103 lines
4.1 KiB
YAML
name: Publish lark-cli Images
|
|
|
|
# Publishes the two Lark sandbox runtime images (Pattern A init container and
|
|
# Pattern B broker sidecar). These track the upstream `larksuite/cli` release,
|
|
# not the DeerFlow `v*` release, so they publish on their own trigger and are
|
|
# tagged by the lark-cli version rather than being wired into container.yaml.
|
|
on:
|
|
workflow_dispatch:
|
|
inputs:
|
|
lark_cli_version:
|
|
description: "larksuite/cli release to build (e.g. v1.0.65)"
|
|
required: true
|
|
default: v1.0.65
|
|
push:
|
|
tags:
|
|
- "lark-cli-v*"
|
|
|
|
env:
|
|
REGISTRY: ghcr.io
|
|
|
|
jobs:
|
|
build-images:
|
|
# Only publish from the upstream repo; a fork dispatch/tag skips the job.
|
|
if: github.repository == 'bytedance/deer-flow'
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: read
|
|
packages: write
|
|
attestations: write
|
|
id-token: write
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
include:
|
|
# Pattern A init image: relative `COPY build-runtime.sh entrypoint.sh`,
|
|
# so the build context is its own dir.
|
|
- component: lark-cli-init
|
|
context: docker/lark-cli-init
|
|
file: docker/lark-cli-init/Dockerfile
|
|
# Pattern B broker image: copies the shared build-runtime.sh and the
|
|
# harness module, so the build context is the repo root.
|
|
- component: lark-cli-broker
|
|
context: .
|
|
file: docker/lark-cli-broker/Dockerfile
|
|
env:
|
|
IMAGE_NAME: ${{ github.repository }}-${{ matrix.component }}
|
|
steps:
|
|
- name: Resolve lark-cli version
|
|
id: version
|
|
# workflow_dispatch supplies it as an input; a `lark-cli-v*` tag encodes
|
|
# it after the prefix (lark-cli-v1.0.65 -> v1.0.65). The input is passed
|
|
# via env (not interpolated into the script) to avoid shell expression
|
|
# injection if the repo gate on dispatch ever widens.
|
|
env:
|
|
LARK_CLI_VERSION_INPUT: ${{ inputs.lark_cli_version }}
|
|
run: |
|
|
if [ -n "$LARK_CLI_VERSION_INPUT" ]; then
|
|
version="$LARK_CLI_VERSION_INPUT"
|
|
else
|
|
version="${GITHUB_REF_NAME#lark-cli-}"
|
|
fi
|
|
echo "value=${version}" >> "$GITHUB_OUTPUT"
|
|
- name: Checkout repository
|
|
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 #v6.0.3
|
|
- name: Set up QEMU
|
|
uses: docker/setup-qemu-action@29109295f81e9208d7d86ff1c6c12d2833863392 #v3.6.0
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 #v3.11.1
|
|
- name: Log in to the Container registry
|
|
uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 #v3.4.0
|
|
with:
|
|
registry: ${{ env.REGISTRY }}
|
|
username: ${{ github.actor }}
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
|
- name: Extract metadata (tags, labels) for Docker
|
|
id: meta
|
|
uses: docker/metadata-action@902fa8ec7d6ecbf8d84d538b9b233a880e428804 #v5.7.0
|
|
with:
|
|
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
|
|
# Tag by the lark-cli version (not the DeerFlow release). No `latest`.
|
|
tags: |
|
|
type=raw,value=${{ steps.version.outputs.value }}
|
|
- name: Build and push Docker image
|
|
id: push
|
|
uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 #v6.18.0
|
|
with:
|
|
context: ${{ matrix.context }}
|
|
file: ${{ matrix.file }}
|
|
push: true
|
|
# The sidecar/init image ships a real arch-dispatched lark-cli binary,
|
|
# so publish both arches the sandbox may run on.
|
|
platforms: linux/amd64,linux/arm64
|
|
tags: ${{ steps.meta.outputs.tags }}
|
|
labels: ${{ steps.meta.outputs.labels }}
|
|
build-args: |
|
|
LARK_CLI_VERSION=${{ steps.version.outputs.value }}
|
|
- name: Generate artifact attestation
|
|
uses: actions/attest-build-provenance@e8998f949152b193b063cb0ec769d69d929409be #v2.4.0
|
|
with:
|
|
subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
|
|
subject-digest: ${{ steps.push.outputs.digest }}
|
|
push-to-registry: true
|