diff --git a/.forgejo/workflows/build.yml b/.forgejo/workflows/build.yml index 2d40117..4d86212 100644 --- a/.forgejo/workflows/build.yml +++ b/.forgejo/workflows/build.yml @@ -329,3 +329,41 @@ jobs: file: Dockerfile.ml push: true tags: ${{ steps.tag.outputs.tags }} + + # The desktop GPU agent (#114) — published so the operator pulls + runs it on + # the GPU machine instead of building locally. Independent of web/ml (its own + # CUDA + onnxruntime-gpu image, context = agent/). Same tag cadence. + build-agent: + runs-on: python-ci + container: + image: git.fabledsword.com/bvandeusen/ci-python:3.14 + steps: + - uses: actions/checkout@v4 + + - name: Determine tag + id: tag + run: | + SHORT_SHA=$(printf '%s' "$GITHUB_SHA" | cut -c1-7) + if [ "${GITHUB_REF#refs/tags/}" != "${GITHUB_REF}" ]; then + TAG_NAME="${GITHUB_REF#refs/tags/}" + echo "tags=git.fabledsword.com/bvandeusen/fabledcurator-agent:${TAG_NAME}" >> "$GITHUB_OUTPUT" + elif [ "${GITHUB_REF##*/}" = "main" ]; then + echo "tags=git.fabledsword.com/bvandeusen/fabledcurator-agent:main,git.fabledsword.com/bvandeusen/fabledcurator-agent:latest,git.fabledsword.com/bvandeusen/fabledcurator-agent:c-${SHORT_SHA}" >> "$GITHUB_OUTPUT" + else + echo "tags=git.fabledsword.com/bvandeusen/fabledcurator-agent:dev" >> "$GITHUB_OUTPUT" + fi + + - name: Login to Forgejo registry + uses: docker/login-action@v3 + with: + registry: git.fabledsword.com + username: ${{ github.actor }} + password: ${{ secrets.RELEASE_TOKEN }} + + - name: Build and push agent image + uses: docker/build-push-action@v5 + with: + context: agent + file: agent/Dockerfile + push: true + tags: ${{ steps.tag.outputs.tags }} diff --git a/agent/README.md b/agent/README.md index a787ae6..da72f44 100644 --- a/agent/README.md +++ b/agent/README.md @@ -10,11 +10,11 @@ You run it when you want a burst and stop it to reclaim the card. ## 1. Get a token In FC: **Settings → Tagging → GPU agent → Generate token** (or Rotate). Copy it. -## 2. Build +## 2. Pull (CI publishes it alongside the web/ml images) ```sh -cd agent -docker build -t fc-gpu-agent . +docker pull git.fabledsword.com/bvandeusen/fabledcurator-agent:latest ``` +> Local build for development instead: `docker build -t fc-gpu-agent agent/` ## 3. Run (on the machine with the GPU) ```sh @@ -22,7 +22,7 @@ docker run --rm --gpus all -p 8770:8770 \ -e FC_URL=http://curator.traefik.internal \ -e FC_TOKEN= \ -v fc-agent-models:/models \ - fc-gpu-agent + git.fabledsword.com/bvandeusen/fabledcurator-agent:latest ``` Then open — the control page. Click **Start** to begin draining the queue; **Pause**/**Stop** to yield the GPU. The `-v fc-agent-models`